This function computes the number of phases for R134a depending on the inputs for absolute pressure and specific enthalpy. It makes use of cubic spline functions for liquid and vapor specific enthalpy.
function getPhase_ph
extends Modelica.Icons.Function;
input AbsolutePressure p "pressure";
input SpecificEnthalpy h "specific enthalpy";
output Integer phase "number of phases";
end getPhase_ph;