Relative humidity of air for given pressure, temperature and water vapor mass fraction.
Note that the water vapor mass fraction must be in kg/kg total air, and not dry air.
function phi_pTX extends Modelica.Icons.Function; input Modelica.SIunits.Pressure p "Absolute pressure of the medium"; input Modelica.SIunits.Temperature T "Dry bulb temperature"; input Modelica.SIunits.MassFraction X_w "Water vapor mass fraction per unit mass total air"; output Real phi(unit = "1") "Relative humidity"; end phi_pTX;
p
.
I do not see any numerical problems without this test.