Buildings.Media.SimpleAirPTDecoupled

Package with 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.SimpleAirPTDecoupled.BaseProperties BaseProperties Basic medium properties
Buildings.Media.SimpleAirPTDecoupled.setState_dTX setState_dTX Return thermodynamic state from d, T, and X or Xi
Buildings.Media.SimpleAirPTDecoupled.density density return density of ideal gas
Buildings.Media.SimpleAirPTDecoupled.specificEntropy specificEntropy Return specific entropy


Buildings.Media.SimpleAirPTDecoupled.BaseProperties Buildings.Media.SimpleAirPTDecoupled.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";
   SI.Conversions.NonSIunits.Temperature_degC T_degC=
       Modelica.SIunits.Conversions.to_degC(T) 
    "Temperature of medium in [degC]";
   SI.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*pStp = p*dStp;
   MM = MM_const;
   state.T = T;
   state.p = p;
end BaseProperties;

Buildings.Media.SimpleAirPTDecoupled.setState_dTX Buildings.Media.SimpleAirPTDecoupled.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.SimpleAirPTDecoupled.density Buildings.Media.SimpleAirPTDecoupled.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.SimpleAirPTDecoupled.specificEntropy Buildings.Media.SimpleAirPTDecoupled.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 Fri Jun 20 09:58:41 2008.