Function to calculate temperature from steamtable look up in Julia

I have been using a dynamic mathematical model, where I assume to replace some nonlinear functions corresponding to finding temperature (as a function of pressure and enthalpy) by substituting them with functions inbuild in Julia for this purpose, that is by looking up Julia implementation of steamtable.

I refered SteamTables.jl Package, for such a function but could not find any, such that it would render temperature as output, for given pressure and enthalpy as inputs.

Is there any function for the same ? Or any other package recommendations?
Thanks in advance.

It seems to have a function Tsat(P), is that what you want?

Or do you want to invert the function SpecificH(P, T) to get a function T(P, H)? Assuming it’s invertible, presumably you can do build up the desired inverse function by interpolation (just do root-finding at a sequence of H values and then interpolate).

It’s not obvious to me that this is the case, because there is a discontinuity in enthalpy SpecificH(P, T) across the phase transition…?

See also https://github.com/braamvandyk/SteamTables.jl/issues/13

In the IAPWS-IF97 reference, five regions are defined:

and backward equations are provided in the forms of T(p,h) and T(p,s) for regions 1 and 2, and Ts(p) for region 4.

1 Like

What I need is exactly the second case you suggested, to get a function T(P,H). Have to check if building inverse function using interpolation would help. Thanks for your reply…