This function calculates the density and temperature of R134a from absolute pressure and specific enthalpy in one-phase region. The function calls the fundamental helmholtz equation of Tillner-Roth (1994) which is requiring density and temperature for input. Thus, a newton iteration is performed to determine density and temperature. The newton iteration stops if the inputs for pressure difference delp and specific enthalpy difference delh are larger than the actual differences derived from the newton iteration.
function dtofphOnePhase extends Modelica.Icons.Function; input AbsolutePressure p "pressure"; input SpecificEnthalpy h "enthalpy"; input AbsolutePressure delp "absolute error in p in iteration"; input SpecificEnthalpy delh "absolute error in h in iteration"; output Density d "density"; output Temperature T "temperature"; output Integer error "1 if did not converged"; end dtofphOnePhase;