LBL logo

Buildings.Utilities.Psychrometrics.Functions

Package with psychrometric functions

Information

This package contains functions for psychrometric calculations.

The nomenclature used in this package is described at Buildings.UsersGuide.Conventions.

Extends from Modelica.Icons.Package (Icon for standard packages).

Package Content

NameDescription
Buildings.Utilities.Psychrometrics.Functions.pW_X pW_X Water vapor pressure for given humidity ratio
Buildings.Utilities.Psychrometrics.Functions.pW_TDewPoi pW_TDewPoi Function to compute the water vapor partial pressure for a given dew point temperature of moist air
Buildings.Utilities.Psychrometrics.Functions.pW_TDewPoi_amb pW_TDewPoi_amb Function to compute the water vapor partial pressure for a given dew point temperature of moist air
Buildings.Utilities.Psychrometrics.Functions.TDewPoi_pW TDewPoi_pW Function to compute the water vapor partial pressure for a given dew point temperature of moist air
Buildings.Utilities.Psychrometrics.Functions.TDewPoi_pW_amb TDewPoi_pW_amb Function to compute the dew point temperature of moist air for a given water vapor partial pressure
Buildings.Utilities.Psychrometrics.Functions.X_pW X_pW Humidity ratio for given water vapor pressure
Buildings.Utilities.Psychrometrics.Functions.Examples Examples Collection of models that illustrate model use and test models
Buildings.Utilities.Psychrometrics.Functions.Internal Internal Solve f(x, data) for x with given f
Buildings.Utilities.Psychrometrics.Functions.BaseClasses BaseClasses Package with base classes for Buildings.Utilities.Psychrometrics.Functions


Buildings.Utilities.Psychrometrics.Functions.pW_X

Water vapor pressure for given humidity ratio

Information

Function to compute the water vapor partial pressure for a given humidity ratio.

Inputs

TypeNameDefaultDescription
MassFractionX_w Species concentration at dry bulb temperature [1]
Pressurep101325Total pressure [Pa]

Outputs

TypeNameDescription
Pressurep_wWater vapor pressure [Pa]

Modelica definition

function pW_X "Water vapor pressure for given humidity ratio"
  annotation(derivative=BaseClasses.der_pW_X);

  input Modelica.SIunits.MassFraction X_w(
    min=0,
    max=1,
    nominal=0.01) "Species concentration at dry bulb temperature";
  input Modelica.SIunits.Pressure p=101325 "Total pressure";
  output Modelica.SIunits.Pressure p_w "Water vapor pressure";

protected 
  Modelica.SIunits.MassFraction x_w(nominal=0.01) 
    "Water mass fraction per mass of dry air";
algorithm 
  x_w := X_w/(1 - X_w);
  p_w := p*x_w/(0.62198 + x_w);
end pW_X;

Buildings.Utilities.Psychrometrics.Functions.pW_TDewPoi

Function to compute the water vapor partial pressure for a given dew point temperature of moist air

Information

Dew point temperature calculation for moist air above freezing temperature.

The correlation used in this model is valid for dew point temperatures between 0 degC and 200 degC. It is the correlation from 2005 ASHRAE Handbook, p. 6.2. In an earlier version of this model, the equation from Peppers has been used, but this equation yielded about 15 Kelvin lower dew point temperatures.

Inputs

TypeNameDefaultDescription
TemperatureT Dew point temperature [K]

Outputs

TypeNameDescription
Pressurep_wWater vapor partial pressure [Pa]

Modelica definition

function pW_TDewPoi 
  "Function to compute the water vapor partial pressure for a given dew point temperature of moist air"
  annotation(derivative=BaseClasses.der_pW_TDewPoi);

  input Modelica.SIunits.Temperature T "Dew point temperature";
  output Modelica.SIunits.Pressure p_w "Water vapor partial pressure";
protected 
  constant Real C8=-5.800226E3;
  constant Real C9=1.3914993E0;
  constant Real C10=-4.8640239E-2;
  constant Real C11=4.1764768E-5;
  constant Real C12=-1.4452093E-8;
  constant Real C13=6.5459673E0;

algorithm 
  p_w := Modelica.Math.exp(C8/T + C9 + T*(C10 + T*(C11 + T*C12)) + C13*
    Modelica.Math.log(T));
end pW_TDewPoi;

Buildings.Utilities.Psychrometrics.Functions.pW_TDewPoi_amb

Function to compute the water vapor partial pressure for a given dew point temperature of moist air

Information

Dew point temperature calculation for moist air between 0 degC and 30 degC.

The correlation used in this model is valid for dew point temperatures between 0 degC and 30 degC. It is an approximation to the correlation from 2005 ASHRAE Handbook, p. 6.2, which is valid in a wider range of temperatures and implemented in Buildings.Utilities.Psychrometrics.Functions.pW_TDewPoi. The approximation error of this simplified function is below 5% for a temperature of 0 degC to 30 degC. The benefit of this simpler function is that it can be inverted analytically, whereas the other function requires a numerical solution.

Extends from Buildings.Utilities.Psychrometrics.Functions.BaseClasses.pW_TDewPoi_amb (Partial function to compute the water vapor partial pressure for a given dew point temperature of moist air and its inverse).

Inputs

TypeNameDefaultDescription
TemperatureT Dew point temperature [K]

Outputs

TypeNameDescription
Pressurep_wWater vapor partial pressure [Pa]

Modelica definition

function pW_TDewPoi_amb 
  "Function to compute the water vapor partial pressure for a given dew point temperature of moist air"
  annotation(derivative=BaseClasses.der_pW_TDewPoi_amb);
  extends Buildings.Utilities.Psychrometrics.Functions.BaseClasses.pW_TDewPoi_amb;

  input Modelica.SIunits.Temperature T "Dew point temperature";
  output Modelica.SIunits.Pressure p_w "Water vapor partial pressure";

algorithm 
  p_w := Modelica.Math.exp(a1 + a2*T);
end pW_TDewPoi_amb;

Buildings.Utilities.Psychrometrics.Functions.TDewPoi_pW

Function to compute the water vapor partial pressure for a given dew point temperature of moist air

Information

Dew point temperature calculation for moist air above freezing temperature.

The correlation used in this model is valid for dew point temperatures between 0 degC and 200 degC. It is the correlation from 2005 ASHRAE Handbook, p. 6.2. In an earlier version of this model, the equation from Peppers has been used, but this equation yielded about 15 Kelvin lower dew point temperatures.

Inputs

TypeNameDefaultDescription
Pressurep_w Water vapor partial pressure [Pa]

Outputs

TypeNameDescription
TemperatureTDew point temperature [K]

Modelica definition

function TDewPoi_pW 
  "Function to compute the water vapor partial pressure for a given dew point temperature of moist air"

  input Modelica.SIunits.Pressure p_w "Water vapor partial pressure";
  output Modelica.SIunits.Temperature T "Dew point temperature";

algorithm 
  T := Internal.solve(
    y_zero=p_w,
    x_min=200,
    x_max=400);
end TDewPoi_pW;

Buildings.Utilities.Psychrometrics.Functions.TDewPoi_pW_amb

Function to compute the dew point temperature of moist air for a given water vapor partial pressure

Information

Dew point temperature calculation for moist air between 0 degC and 30 degC with partial pressure of water vapor as an input.

The correlation used in this model is valid for dew point temperatures between 0 degC and 30 degC. It is an approximation to the correlation from 2005 ASHRAE Handbook, p. 6.2, which is valid in a wider range of temperatures and implemented in Buildings.Utilities.Psychrometrics.Functions.pW_TDewPoi. The approximation error of this simplified function is below 5% for a temperature of 0 degC to 30 degC. The benefit of this simpler function is that it can be inverted analytically, whereas the other function requires a numerical solution.

Extends from Buildings.Utilities.Psychrometrics.Functions.BaseClasses.pW_TDewPoi_amb (Partial function to compute the water vapor partial pressure for a given dew point temperature of moist air and its inverse).

Inputs

TypeNameDefaultDescription
Pressurep_w Water vapor partial pressure [Pa]

Outputs

TypeNameDescription
TemperatureTDew point temperature [K]

Modelica definition

function TDewPoi_pW_amb 
  "Function to compute the dew point temperature of moist air for a given water vapor partial pressure"
  annotation(derivative=BaseClasses.der_TDewPoi_pW_amb);
  extends Buildings.Utilities.Psychrometrics.Functions.BaseClasses.pW_TDewPoi_amb;

  input Modelica.SIunits.Pressure p_w "Water vapor partial pressure";
  output Modelica.SIunits.Temperature T "Dew point temperature";

algorithm 
  T := (Modelica.Math.log(p_w) - a1)/a2;
end TDewPoi_pW_amb;

Buildings.Utilities.Psychrometrics.Functions.X_pW

Humidity ratio for given water vapor pressure

Information

Function to compute the humidity ratio for a given water vapor partial pressure.

Inputs

TypeNameDefaultDescription
Pressurep_w Water vapor pressure [Pa]
Pressurep101325Total pressure [Pa]

Outputs

TypeNameDescription
MassFractionX_wSpecies concentration at dry bulb temperature [1]

Modelica definition

function X_pW "Humidity ratio for given water vapor pressure"

  input Modelica.SIunits.Pressure p_w "Water vapor pressure";
  input Modelica.SIunits.Pressure p=101325 "Total pressure";
  output Modelica.SIunits.MassFraction X_w(
    min=0,
    max=1,
    nominal=0.01) "Species concentration at dry bulb temperature";

protected 
  Modelica.SIunits.MassFraction x_w(nominal=0.01) 
    "Water mass fraction per mass of dry air";
algorithm 
  x_w := 0.62198*p_w/(p - p_w);
  X_w := x_w/(1 + x_w);
end X_pW;

Automatically generated Wed Feb 22 15:24:42 2012.