Buildings.Media.GasesPTDecoupled.SimpleAir

Package with dry air model that decouples pressure and temperature

Information


This medium model is identical to Modelica.Media.Air.SimpleAir, except the equation d = p/(R*T) has been replaced with d/dStp = p/pStp where pStd and dStp are constants for a reference temperature and density.

This new formulation often leads to smaller systems of nonlinear equations because pressure and temperature are decoupled, at the expense of accuracy.

As in Modelica.Media.Air.SimpleAir, the specific enthalpy h and specific internal energy u are only a function of temperature T and all other provided medium quantities are constant.

Package Content

NameDescription
Buildings.Media.GasesPTDecoupled.SimpleAir.BaseProperties BaseProperties Basic medium properties
Buildings.Media.GasesPTDecoupled.SimpleAir.setState_dTX setState_dTX Return thermodynamic state from d, T, and X or Xi
Buildings.Media.GasesPTDecoupled.SimpleAir.density density return density of ideal gas
Buildings.Media.GasesPTDecoupled.SimpleAir.specificEntropy specificEntropy Return specific entropy


Buildings.Media.GasesPTDecoupled.SimpleAir.BaseProperties Buildings.Media.GasesPTDecoupled.SimpleAir.BaseProperties

Basic medium properties

Parameters

TypeNameDefaultDescription
BooleanpreferredMediumStatesfalse= true if StateSelect.prefer shall be used for the independent property variables of the medium

Modelica definition

redeclare model BaseProperties "Basic medium properties" 
   extends BasePropertiesRecord;
  
   ThermodynamicState state 
    "thermodynamic state variables for optional functions";
   parameter Boolean preferredMediumStates=false 
    "= true if StateSelect.prefer shall be used for the independent property variables of the medium";
   Modelica.SIunits.Conversions.NonSIunits.Temperature_degC T_degC=
       Modelica.SIunits.Conversions.to_degC(T) 
    "Temperature of medium in [degC]";
   Modelica.SIunits.Conversions.NonSIunits.Pressure_bar p_bar=
       Modelica.SIunits.Conversions.to_bar(p) 
    "Absolute pressure of medium in [bar]";
  constant AbsolutePressure pStp = 101325 "Pressure for which dStp is defined";
  constant Density dStp = 1.2 "Fluid density at pressure pStp";
  
equation 
   h = specificEnthalpy_pTX(p,T,X);
   u = h-R*T;
   R = R_gas;
   //    d = p/(R*T);
   d/dStp = p/pStp;
   MM = MM_const;
   state.T = T;
   state.p = p;
end BaseProperties;

Buildings.Media.GasesPTDecoupled.SimpleAir.setState_dTX Buildings.Media.GasesPTDecoupled.SimpleAir.setState_dTX

Return thermodynamic state from d, T, and X or Xi

Inputs

TypeNameDefaultDescription
Densityd density [kg/m3]
TemperatureT Temperature [K]
MassFractionX[:]fill(0, 0)Mass fractions [kg/kg]

Outputs

TypeNameDescription
ThermodynamicStatestate 

Modelica definition

redeclare replaceable function setState_dTX 
  "Return thermodynamic state from d, T, and X or Xi" 
   extends Modelica.Icons.Function;
   input Density d "density";
   input Temperature T "Temperature";
   input MassFraction X[:] = fill(0,0) "Mass fractions";
   output ThermodynamicState state;
algorithm 
   state := ThermodynamicState(p=d/dStp*pStd,T=T);
end setState_dTX;

Buildings.Media.GasesPTDecoupled.SimpleAir.density Buildings.Media.GasesPTDecoupled.SimpleAir.density

return density of ideal gas

Inputs

TypeNameDefaultDescription
ThermodynamicStatestate  

Outputs

TypeNameDescription
DensitydDensity [kg/m3]

Modelica definition

redeclare replaceable function extends density 
  "return density of ideal gas" 
algorithm 
   d := dStp*state.p/pStp;
end density;

Buildings.Media.GasesPTDecoupled.SimpleAir.specificEntropy Buildings.Media.GasesPTDecoupled.SimpleAir.specificEntropy

Return specific entropy

Inputs

TypeNameDefaultDescription
ThermodynamicStatestate  

Outputs

TypeNameDescription
SpecificEntropysSpecific entropy [J/(kg.K)]

Modelica definition

redeclare replaceable function extends specificEntropy 
  "Return specific entropy" 
     extends Modelica.Icons.Function;
algorithm 
   s := cp_const*Modelica.Math.log(state.T/T0);// - R_gas*Modelica.Math.log(state.p/reference_p);
end specificEntropy;

HTML-documentation generated by Dymola Tue Sep 30 14:24:46 2008.