This package contains examples for the use of models that can be found in Buildings.Utilities.Psychrometrics.Functions.
Extends from Modelica.Icons.ExamplesPackage (Icon for packages containing runnable examples).Name | Description |
---|---|
pW_X | Model to test pW_X and its inverse function |
pW_TDewPoi | Model to test pW_TDewPoi and its inverse function |
pW_TDewPoi_comparison | Model to test the approximation for pW_TDewPoi and its inverse function |
X_pSatpphi | Model to test X_pSatpphi function |
model pW_X "Model to test pW_X and its inverse function" extends Modelica.Icons.Example; Modelica.SIunits.MassFraction X "Mass fraction"; Modelica.SIunits.MassFraction XInv "Mass fraction"; Modelica.SIunits.MassFraction dX "Difference between mass fraction"; Modelica.SIunits.Pressure p_w "Water vapor partial pressure"; constant Real conv(unit="1/s") = 0.999 "Conversion factor"; equation X = conv*time; p_w = Buildings.Utilities.Psychrometrics.Functions.pW_X(X); XInv = Buildings.Utilities.Psychrometrics.Functions.X_pW(p_w); dX = X - XInv; assert(abs(dX) < 10E-12, "Error in function implementation.");end pW_X;
model pW_TDewPoi "Model to test pW_TDewPoi and its inverse function" extends Modelica.Icons.Example; Modelica.SIunits.Temperature T "Dew point temperature"; Modelica.SIunits.Temperature TInv "Dew point temperature"; Modelica.SIunits.TemperatureDifference dT "Difference between temperatures"; Modelica.SIunits.Pressure p_w "Water vapor partial pressure"; constant Real conv(unit="K/s") = 100 "Conversion factor"; equation T = conv*time + 273.15; p_w = Buildings.Utilities.Psychrometrics.Functions.pW_TDewPoi(T); TInv = Buildings.Utilities.Psychrometrics.Functions.TDewPoi_pW(p_w); dT = T - TInv; assert(abs(dT) < 10E-12, "Error in function implementation.");end pW_TDewPoi;
model pW_TDewPoi_comparison "Model to test the approximation for pW_TDewPoi and its inverse function" extends Modelica.Icons.Example; Modelica.SIunits.Temperature T "Dew point temperature"; Modelica.SIunits.Temperature TInv "Dew point temperature"; Modelica.SIunits.TemperatureDifference dT "Difference between temperatures"; Modelica.SIunits.Pressure p_w_ashrae "Water vapor partial pressure according to the ASHRAE handbook"; Modelica.SIunits.Pressure p_w "Water vapor partial pressure"; constant Real conv(unit="K/s") = 30 "Conversion factor"; Real r_p "Ratio of the two approximations"; equation T = conv*time + 273.15; p_w_ashrae = Buildings.Utilities.Psychrometrics.Functions.pW_TDewPoi(T); p_w = Buildings.Utilities.Psychrometrics.Functions.pW_TDewPoi_amb(T); r_p = p_w_ashrae/p_w; p_w = Buildings.Utilities.Psychrometrics.Functions.pW_TDewPoi_amb(TInv); dT = T - TInv; assert(abs(dT) < 10E-12, "Error in function implementation.");end pW_TDewPoi_comparison;
This example computes the water content of air for a relative humidity between 0 and 100%, a temperature of 20ˆC and atmospheric pressure.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Type | Name | Default | Description |
---|---|---|---|
Temperature | T | 293.15 | Temperature [K] |
Pressure | p | 101325 | Pressure of the fluid [Pa] |
model X_pSatpphi "Model to test X_pSatpphi function" extends Modelica.Icons.Example; package Medium = Buildings.Media.PerfectGases.MoistAir "Medium model"; parameter Modelica.SIunits.Temperature T = 293.15 "Temperature"; Modelica.SIunits.AbsolutePressure pSat "Saturation pressure"; parameter Modelica.SIunits.Pressure p = 101325 "Pressure of the fluid"; Real phi(min=0, max=1) "Relative humidity"; Modelica.SIunits.MassFraction X_w( min=0, max=1, nominal=0.01) "Water vapor concentration per total mass of air"; constant Real conv(unit="1/s") = 1 "Conversion factor"; equation phi = time; pSat = Medium.saturationPressure(T); X_w = Buildings.Utilities.Psychrometrics.Functions.X_pSatpphi(pSat=pSat, p=p, phi=phi);end X_pSatpphi;