Temperature is computed from pressure, specific enthalpy and composition. Loop over the saturation temperature is performed for the fog region and for dry mixture, the temperature is computed from analytic inversion of the enthalpy relation with respect to the temperature.
function T_phX input AbsolutePressure p "Pressure"; input SpecificEnthalpy h "Specific enthalpy"; input MassFraction[:] X "Mass fractions of composition"; output Temperature T "Temperature"; end T_phX;