Closed stevengj closed 2 years ago
I shall dig into this. Thanks for logging the issue.
From the first example, the code is looking for a root of f(ρ) = Region3_ρ(:Pressure, ρ, T) - P, but in the range 0..500 for ρ, there are no roots. Looks like a region identification error. Will have to dig a little deeper.
julia> SpecificH(30, 628) 1640.4031042944146
julia> SpecificH(60, 636) 1002.5901301042508
I am admittedly embarrased to report on the source of the error ... In a (no doubt late night) fit of laziness, I initiated the function using the ideal gas law, then did root finding for the actual density. Starting from ideal gas at 30MPa. is where the problem originated, with some help from a density curve that "wobbles" near the region boundary, which is where my search started. Silliness!
I'll update.
Fix (I hope) included in v1.3.0 which is now available.
I tried plotting
SpecificH
for a grid of pressure and temperature points, and noticed that it throws seemingly spurious exceptions at a bunch of points in the domain. In the plot below, the points where it threw errors are colored white:Sample errors: