Open tkoenig1 opened 6 months ago
Here's a short script to identify dubious regions, plus its output.
Recognized two-phase flow is black. There are several areas which are white (indicating missing values), but also some areas which go into the two-phase region, which they should not.
using Plots,Colors
using SteamTables
using FlexiMaps
function my_H_ps(p,s)
tmp = missing
try
tmp = SpecificH_Ps(p,s)
catch
# Set residual two-phase region to -1000, so it is visible
if (p > Pc)
return missing
end
end
if !ismissing(tmp)
return tmp
end
T_sat = Tsat(p)
S_L = SatSL(T_sat)
S_V = SatSV(T_sat)
if (s < S_L || s > S_V)
# println("p = ",p, " Pc = ", Pc, " T_sat = ",T_sat)
return missing
end
return -4000.0
return tmp
end
n_pix = 512
p_low = P3*1.1
p_high = 50.0
s_low = 0.01
s_high = 12.0
pv = maprange(log,p_low,p_high,n_pix)
sv = range(s_low,s_high,n_pix)
H = [my_H_ps(p,s) for p in pv, s in sv]
p = contourf(sv,pv,H,yscale=:log10)
savefig(p,"gaps.png")
Carried over from a comment in #24 .