LBL logo

Buildings.Utilities.Psychrometrics.Examples

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 Buildings.Utilities.Psychrometrics.

Extends from Modelica.Icons.ExamplesPackage (Icon for packages containing runnable examples).

Package Content

NameDescription
Buildings.Utilities.Psychrometrics.Examples.DewPointTemperature DewPointTemperature Unit test for dew point temperature calculation
Buildings.Utilities.Psychrometrics.Examples.HumidityRatioPressure HumidityRatioPressure Unit test for humidity ratio model
Buildings.Utilities.Psychrometrics.Examples.MassFraction_pTphi MassFraction_pTphi Unit test for dew point temperature calculation
Buildings.Utilities.Psychrometrics.Examples.TotalAirDryAir TotalAirDryAir Unit test for conversion of humidity per total air and dry air mass
Buildings.Utilities.Psychrometrics.Examples.TWetBul_TDryBulPhi TWetBul_TDryBulPhi Model to test the wet bulb temperature computation
Buildings.Utilities.Psychrometrics.Examples.TWetBul_TDryBulXi TWetBul_TDryBulXi  
Buildings.Utilities.Psychrometrics.Examples.WetBul_pTX WetBul_pTX Model to test the wet bulb temperature computation


Buildings.Utilities.Psychrometrics.Examples.DewPointTemperature Buildings.Utilities.Psychrometrics.Examples.DewPointTemperature

Unit test for dew point temperature calculation

Buildings.Utilities.Psychrometrics.Examples.DewPointTemperature

Information

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model DewPointTemperature 
  "Unit test for dew point temperature calculation"
  extends Modelica.Icons.Example;
   package Medium = Buildings.Media.PerfectGases.MoistAir "Medium model";
  Buildings.Utilities.Psychrometrics.pW_TDewPoi watVapPre;
    Modelica.Blocks.Sources.Ramp XHum(
    duration=1,
    height=(0.01 - 0.1),
    offset=0.1) "Humidity concentration";
  Buildings.Utilities.Psychrometrics.pW_X humRat(
                         use_p_in=false);
  Buildings.Utilities.Psychrometrics.TDewPoi_pW TDewPoi;
equation 
  connect(XHum.y, humRat.X_w);
  connect(humRat.p_w, TDewPoi.p_w);
  connect(TDewPoi.T, watVapPre.T);
end DewPointTemperature;

Buildings.Utilities.Psychrometrics.Examples.HumidityRatioPressure Buildings.Utilities.Psychrometrics.Examples.HumidityRatioPressure

Unit test for humidity ratio model

Buildings.Utilities.Psychrometrics.Examples.HumidityRatioPressure

Information

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model HumidityRatioPressure "Unit test for humidity ratio model"
  extends Modelica.Icons.Example;
 package Medium = Buildings.Media.PerfectGases.MoistAir "Medium model";
  Buildings.Utilities.Psychrometrics.pW_X vapPre(
                         use_p_in=true) "Model for humidity ratio";
    Modelica.Blocks.Sources.Ramp XHumDryAir(
    duration=1,
    height=(0.0133 - 0.2),
    offset=0.2) "Humidity concentration in [kg/kg dry air]";
  Modelica.Blocks.Sources.Constant p(k=101325) "Pressure";
  Buildings.Utilities.Psychrometrics.X_pW humRat(
                            use_p_in=true);
  Diagnostics.AssertEquality assertEquality(threShold=1E-5) 
    "Checks that model and its inverse implementation are correct";
  ToTotalAir toTotalAir;
equation 
  connect(vapPre.p_w, humRat.p_w);
  connect(humRat.X_w, assertEquality.u1);
  connect(p.y, humRat.p_in);
  connect(p.y, vapPre.p_in);
  connect(XHumDryAir.y, toTotalAir.XiDry);
  connect(toTotalAir.XiTotalAir, vapPre.X_w);
  connect(toTotalAir.XiTotalAir, assertEquality.u2);
end HumidityRatioPressure;

Buildings.Utilities.Psychrometrics.Examples.MassFraction_pTphi Buildings.Utilities.Psychrometrics.Examples.MassFraction_pTphi

Unit test for dew point temperature calculation

Buildings.Utilities.Psychrometrics.Examples.MassFraction_pTphi

Information

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model MassFraction_pTphi 
  "Unit test for dew point temperature calculation"
  extends Modelica.Icons.Example;

   package Medium1 = Buildings.Media.PerfectGases.MoistAir "Medium model";
   package Medium2 = Buildings.Media.GasesPTDecoupled.MoistAir "Medium model";
    Modelica.Blocks.Sources.Ramp Phi(
    offset=0,
    duration=0.5,
    height=1) "Relative humidity";
  Buildings.Utilities.Psychrometrics.X_pTphi masFra1 
    "Mass fraction computation";
    Modelica.Blocks.Sources.Ramp T(
    height=10,
    offset=283.15,
    duration=0.5,
    startTime=0.5) "Temperature";
    Modelica.Blocks.Sources.Constant P(k=101325) "Pressure";
  Buildings.Utilities.Psychrometrics.X_pTphi masFra2(use_p_in=false) 
    "Mass fraction computation";
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;

Buildings.Utilities.Psychrometrics.Examples.TotalAirDryAir Buildings.Utilities.Psychrometrics.Examples.TotalAirDryAir

Unit test for conversion of humidity per total air and dry air mass

Buildings.Utilities.Psychrometrics.Examples.TotalAirDryAir

Information

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model TotalAirDryAir 
  "Unit test for conversion of humidity per total air and dry air mass"
  extends Modelica.Icons.Example;
   package Medium = Buildings.Media.PerfectGases.MoistAir "Medium model";
    Modelica.Blocks.Sources.Ramp XHum(
    duration=1,
    height=(0.01 - 0.1),
    offset=0.1) "Humidity concentration";
  ToTotalAir toTotalAir;
  ToDryAir toDryAir;
  Diagnostics.AssertEquality assertEquality(threShold=1E-5) 
    "Checks that model and its inverse implementation are correct";
equation 
  connect(toTotalAir.XiDry, XHum.y);
  connect(toTotalAir.XiTotalAir, toDryAir.XiTotalAir);
  connect(toDryAir.XiDry, assertEquality.u1);
  connect(assertEquality.u2, XHum.y);
end TotalAirDryAir;

Buildings.Utilities.Psychrometrics.Examples.TWetBul_TDryBulPhi Buildings.Utilities.Psychrometrics.Examples.TWetBul_TDryBulPhi

Model to test the wet bulb temperature computation

Buildings.Utilities.Psychrometrics.Examples.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_TDryBulPhi 
  "Model to test the wet bulb temperature computation"
  import Buildings;
  extends Modelica.Icons.Example;

 package Medium = Buildings.Media.PerfectGases.MoistAirUnsaturated 
    "Medium model";

  Buildings.Utilities.Psychrometrics.TWetBul_TDryBulPhi wetBulPhi(redeclare 
      package Medium = Medium) "Model for wet bulb temperature";
  Modelica.Blocks.Sources.Constant p(k=101325) "Pressure";
    Modelica.Blocks.Sources.Ramp phi(
    duration=1,
    height=0.98,
    offset=0.01) "Relative humidity";
  Modelica.Blocks.Sources.Constant TDryBul(k=283.15) "Dry bulb temperature";
  Buildings.Utilities.Psychrometrics.TWetBul_TDryBulPhi wetBulPhiApp(redeclare 
      package Medium = Medium, approximateWetBulb=true) 
    "Model for wet bulb temperature";
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);
end TWetBul_TDryBulPhi;

Buildings.Utilities.Psychrometrics.Examples.TWetBul_TDryBulXi Buildings.Utilities.Psychrometrics.Examples.TWetBul_TDryBulXi

Buildings.Utilities.Psychrometrics.Examples.TWetBul_TDryBulXi

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 = Buildings.Media.PerfectGases.MoistAir "Medium model";

    Modelica.Blocks.Sources.Ramp TDryBul(
    height=10,
    duration=1,
    offset=273.15 + 30) "Dry bulb temperature";
  Buildings.Utilities.Psychrometrics.TWetBul_TDryBulXi wetBul(         redeclare 
      package Medium = Medium) "Model for wet bulb temperature";
  Modelica.Blocks.Sources.Constant p(k=101325) "Pressure";
    Modelica.Blocks.Sources.Ramp XHum(
    duration=1,
    height=(0.0133 - 0.0175),
    offset=0.0175) "Humidity concentration";
  Buildings.Utilities.Psychrometrics.TWetBul_TDryBulXi wetBulApp(redeclare 
      package Medium = Medium, approximateWetBulb=true) 
    "Model for wet bulb temperature";
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;

Buildings.Utilities.Psychrometrics.Examples.WetBul_pTX Buildings.Utilities.Psychrometrics.Examples.WetBul_pTX

Model to test the wet bulb temperature computation

Buildings.Utilities.Psychrometrics.Examples.WetBul_pTX

Information

This examples is a unit test for the wet bulb computation.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model WetBul_pTX "Model to test the wet bulb temperature computation"
  import Buildings;
  extends Modelica.Icons.Example;

 package Medium = Buildings.Media.PerfectGases.MoistAirUnsaturated 
    "Medium model";

  Modelica.Blocks.Sources.Constant p(k=101325) "Pressure";
    Modelica.Blocks.Sources.Ramp XDryBul(
    duration=1,
    height=0.014,
    offset=0) "Dry bulb water vapor mass fraction";
  Modelica.Blocks.Sources.Constant TDryBul(k=293.15) "Dry bulb temperature";
  Buildings.Utilities.Psychrometrics.WetBul_pTX      wetBul_TDryBulX(redeclare 
      package Medium = Medium);
equation 
  connect(TDryBul.y, wetBul_TDryBulX.TDryBul);
  connect(XDryBul.y, wetBul_TDryBulX.XDryBul);
  connect(p.y, wetBul_TDryBulX.p);
end WetBul_pTX;

Automatically generated Wed May 15 11:58:34 2013.