Collection of models that illustrate model use and test models
Information
This package contains examples for the use of models that can be found in
Annex60.Utilities.Psychrometrics.
Extends from Modelica.Icons.ExamplesPackage (Icon for packages containing runnable examples).
Package Content
Name |
Description |
Density_pTX
|
Model to test the density computation |
DewPointTemperature
|
Unit test for dew point temperature calculation |
HumidityRatioPressure
|
Unit test for humidity ratio model |
MassFraction_pTphi
|
Unit test for dew point temperature calculation |
Phi_pTX
|
Model to test the relative humidity computation |
SaturationPressure
|
Model to test the wet bulb temperature computation |
SaturationPressureLiquid
|
Model to test the wet bulb temperature computation |
SublimationPressureIce
|
Model to test the wet bulb temperature computation |
TWetBul_TDryBulPhi
|
Model to test the wet bulb temperature computation |
TWetBul_TDryBulXi
|
|
TotalAirDryAir
|
Unit test for conversion of humidity per total air and dry air mass |
Model to test the density computation
Information
This examples is a unit test for the density computation.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Modelica definition
Unit test for dew point temperature calculation
Information
Extends from Modelica.Icons.Example (Icon for runnable examples).
Modelica definition
Unit test for humidity ratio model
Information
Extends from Modelica.Icons.Example (Icon for runnable examples).
Modelica definition
Unit test for dew point temperature calculation
Information
Extends from Modelica.Icons.Example (Icon for runnable examples).
Modelica definition
model MassFraction_pTphi
extends Modelica.Icons.Example;
package Medium1 =
Annex60.Media.Air ;
package Medium2 =
Annex60.Media.Air ;
Modelica.Blocks.Sources.Ramp Phi(
offset=0,
duration=0.5,
height=1) ;
Annex60.Utilities.Psychrometrics.X_pTphi masFra1
;
Modelica.Blocks.Sources.Ramp T(
height=10,
offset=283.15,
duration=0.5,
startTime=0.5) ;
Modelica.Blocks.Sources.Constant P(k=101325) ;
Annex60.Utilities.Psychrometrics.X_pTphi masFra2(use_p_in=false)
;
equation
connect(T.y, masFra1.T);
connect(Phi.y, masFra1.phi);
connect(T.y, masFra2.T);
connect(Phi.y, masFra2.phi);
connect(P.y, masFra1.p_in);
end MassFraction_pTphi;
Model to test the relative humidity computation
Information
This examples is a unit test for the relative humidity computation.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Modelica definition
Model to test the wet bulb temperature computation
Information
This examples is a unit test for the saturation pressure computation.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Modelica definition
Model to test the wet bulb temperature computation
Information
This examples is a unit test for the saturation pressure computation of liquid water.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Modelica definition
Model to test the wet bulb temperature computation
Information
This examples is a unit test for the sublimation pressure computation of ice.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Modelica definition
Model to test the wet bulb temperature computation
Information
This examples is a unit test for the wet bulb computation.
The model on the top uses the accurate computation of the
wet bulb temperature, whereas the model below uses the approximate
computation of the wet bulb temperature.
The model contains an assert that validates the model based on a single operating point from Example 17.1 in
Ananthanarayanan (2013).
References
Ananthanarayanan, P. N. Basic refrigeration and air conditioning. Tata McGraw-Hill Education, 2013.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Modelica definition
model TWetBul_TDryBulPhi
extends Modelica.Icons.Example;
package Medium =
Annex60.Media.Air ;
Annex60.Utilities.Psychrometrics.TWetBul_TDryBulPhi wetBulPhi(
redeclare package Medium = Medium) ;
Modelica.Blocks.Sources.Constant p(k=101325) ;
Modelica.Blocks.Sources.Ramp phi(
duration=1,
height=1,
offset=0) ;
Modelica.Blocks.Sources.Constant TDryBul(k=273.15 + 29.4)
;
Annex60.Utilities.Psychrometrics.TWetBul_TDryBulPhi wetBulPhiApp(
redeclare package Medium = Medium,
approximateWetBulb=true) ;
Annex60.Utilities.Psychrometrics.TWetBul_TDryBulXi wetBulXi(
redeclare package Medium = Medium)
;
Annex60.Utilities.Psychrometrics.X_pTphi x_pTphi ;
protected
block Assertions
extends Modelica.Blocks.Icons.Block;
constant Modelica.SIunits.Temperature dT_max=0.1
;
Modelica.Blocks.Interfaces.RealInput phi ;
Modelica.Blocks.Interfaces.RealInput wetBulPhi_TWetBul
;
Modelica.Blocks.Interfaces.RealInput wetBulXi_TWetBul
;
equation
if abs(phi-0.48)<0.001
then
assert(
abs(wetBulPhi_TWetBul - 21.1-273.15) < dT_max,
"Error in computation of wet bulb temperature, deviation with reference result is larger than "
+
String(dT_max) + " K since the wet bulb temperature equals " +
String(wetBulPhi_TWetBul));
end if;
assert(
abs(wetBulPhi_TWetBul-wetBulXi_TWetBul)<1e-2, "Inconsistent implementation of wetBulPhi and wetBulXi.");
end Assertions;
Assertions assertions ;
equation
connect(p.y, wetBulPhi.p);
connect(TDryBul.y, wetBulPhi.TDryBul);
connect(phi.y, wetBulPhi.phi);
connect(p.y, wetBulPhiApp.p);
connect(TDryBul.y, wetBulPhiApp.TDryBul);
connect(phi.y, wetBulPhiApp.phi);
connect(wetBulXi.TDryBul, TDryBul.y);
connect(wetBulXi.p, p.y);
connect(x_pTphi.p_in, p.y);
connect(x_pTphi.T, TDryBul.y);
connect(x_pTphi.phi, phi.y);
connect(x_pTphi.X[1], wetBulXi.Xi[1]);
connect(wetBulPhi.TWetBul, assertions.wetBulPhi_TWetBul);
connect(wetBulXi.TWetBul, assertions.wetBulXi_TWetBul);
connect(assertions.phi, phi.y);
end TWetBul_TDryBulPhi;
Information
This examples is a unit test for the wet bulb computation.
The model on the top uses the accurate computation of the
wet bulb temperature, whereas the model below uses the approximate
computation of the wet bulb temperature.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Modelica definition
model TWetBul_TDryBulXi
extends Modelica.Icons.Example;
package Medium =
Annex60.Media.Air ;
Modelica.Blocks.Sources.Ramp TDryBul(
height=10,
duration=1,
offset=273.15 + 30) ;
Annex60.Utilities.Psychrometrics.TWetBul_TDryBulXi wetBul(
redeclare
package Medium = Medium) ;
Modelica.Blocks.Sources.Constant p(k=101325) ;
Modelica.Blocks.Sources.Ramp XHum(
duration=1,
height=(0.0133 - 0.0175),
offset=0.0175) ;
Annex60.Utilities.Psychrometrics.TWetBul_TDryBulXi wetBulApp(
redeclare
package Medium = Medium, approximateWetBulb=true)
;
equation
connect(p.y, wetBul.p);
connect(XHum.y, wetBul.Xi[1]);
connect(TDryBul.y, wetBul.TDryBul);
connect(p.y, wetBulApp.p);
connect(XHum.y, wetBulApp.Xi[1]);
connect(TDryBul.y, wetBulApp.TDryBul);
end TWetBul_TDryBulXi;
Unit test for conversion of humidity per total air and dry air mass
Information
Extends from Modelica.Icons.Example (Icon for runnable examples).
Modelica definition
Information
Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).
Connectors
Type | Name | Description |
input RealInput | phi | Relative humidity |
input RealInput | wetBulPhi_TWetBul | Wet bulb temperature from wetBulPhi_phi |
input RealInput | wetBulXi_TWetBul | Wet bulb temperature from wetBulXi_phi |
Modelica definition
http://iea-annex60.org