LBL logo

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

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

Package Content

NameDescription
Buildings.Utilities.Psychrometrics.Functions.Examples.pW_X pW_X Model to test pW_X and its inverse function
Buildings.Utilities.Psychrometrics.Functions.Examples.pW_TDewPoi pW_TDewPoi Model to test pW_TDewPoi and its inverse function
Buildings.Utilities.Psychrometrics.Functions.Examples.pW_TDewPoi_comparison pW_TDewPoi_comparison Model to test the approximation for pW_TDewPoi and its inverse function


Buildings.Utilities.Psychrometrics.Functions.Examples.pW_X Buildings.Utilities.Psychrometrics.Functions.Examples.pW_X

Model to test pW_X and its inverse function

Information

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

Modelica definition

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;

Buildings.Utilities.Psychrometrics.Functions.Examples.pW_TDewPoi Buildings.Utilities.Psychrometrics.Functions.Examples.pW_TDewPoi

Model to test pW_TDewPoi and its inverse function

Information

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

Modelica definition

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;

Buildings.Utilities.Psychrometrics.Functions.Examples.pW_TDewPoi_comparison Buildings.Utilities.Psychrometrics.Functions.Examples.pW_TDewPoi_comparison

Model to test the approximation for pW_TDewPoi and its inverse function

Information

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

Modelica definition

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;

Automatically generated Wed Feb 29 16:55:18 2012.