IEA EBC Annex 60 EBC logo

Annex60.Media.Specialized.Air.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 Annex60.Media.Specialized.Air.

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

Package Content

Name Description
Annex60.Media.Specialized.Air.Examples.PerfectGasDerivativeCheck PerfectGasDerivativeCheck  
Annex60.Media.Specialized.Air.Examples.PerfectGasTemperatureEnthalpyInversion PerfectGasTemperatureEnthalpyInversion Model to check computation of h(T) and its inverse
Annex60.Media.Specialized.Air.Examples.PerfectGasTestImplementation PerfectGasTestImplementation  

Annex60.Media.Specialized.Air.Examples.PerfectGasDerivativeCheck Annex60.Media.Specialized.Air.Examples.PerfectGasDerivativeCheck

Information

This example checks whether the function derivative is implemented correctly. If the derivative implementation is not correct, the model will stop with an assert statement.

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

Modelica definition

model PerfectGasDerivativeCheck extends Modelica.Icons.Example; package Medium = Annex60.Media.Specialized.Air.PerfectGas; Modelica.SIunits.Temperature T "Temperature"; Modelica.SIunits.SpecificEnthalpy hLiqSym "Liquid phase enthalpy"; Modelica.SIunits.SpecificEnthalpy hLiqCod "Liquid phase enthalpy"; Modelica.SIunits.SpecificEnthalpy hSteSym "Water vapor enthalpy"; Modelica.SIunits.SpecificEnthalpy hSteCod "Water vapor enthalpy"; Modelica.SIunits.SpecificEnthalpy hAirSym "Dry air enthalpy"; Modelica.SIunits.SpecificEnthalpy hAirCod "Dry air enthalpy"; constant Real convT(unit="K/s3") = 270 "Conversion factor to satisfy unit check"; initial equation hLiqSym = hLiqCod; hSteSym = hSteCod; hAirSym = hAirCod; equation T = 273.15+convT*time^3; hLiqCod=Medium.enthalpyOfLiquid(T); der(hLiqCod)=der(hLiqSym); assert(abs(hLiqCod-hLiqSym) < 1E-2, "Model has an error"); hSteCod=Medium.enthalpyOfCondensingGas(T); der(hSteCod)=der(hSteSym); assert(abs(hSteCod-hSteSym) < 1E-2, "Model has an error"); hAirCod=Medium.enthalpyOfDryAir(T); der(hAirCod)=der(hAirSym); assert(abs(hAirCod-hAirSym) < 1E-2, "Model has an error"); end PerfectGasDerivativeCheck;

Annex60.Media.Specialized.Air.Examples.PerfectGasTemperatureEnthalpyInversion Annex60.Media.Specialized.Air.Examples.PerfectGasTemperatureEnthalpyInversion

Model to check computation of h(T) and its inverse

Information

This model tests whether the inversion of temperature and enthalpy is implemented correctly. If T ≠ T(h(T)), the model stops with an error.

Extends from Modelica.Icons.Example (Icon for runnable examples), Annex60.Media.Examples.BaseClasses.TestTemperatureEnthalpyInversion (Model to check computation of h(T) and its inverse).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMedium 
TemperatureT0273.15 + 20Temperature [K]

Connectors

TypeNameDescription
replaceable package Medium 

Modelica definition

model PerfectGasTemperatureEnthalpyInversion "Model to check computation of h(T) and its inverse" extends Modelica.Icons.Example; extends Annex60.Media.Examples.BaseClasses.TestTemperatureEnthalpyInversion( redeclare package Medium = Annex60.Media.Specialized.Air.PerfectGas); end PerfectGasTemperatureEnthalpyInversion;

Annex60.Media.Specialized.Air.Examples.PerfectGasTestImplementation Annex60.Media.Specialized.Air.Examples.PerfectGasTestImplementation


Annex60.Media.Specialized.Air.Examples.PerfectGasTestImplementation

Information

This is a simple test for the medium model. It uses the test model described in Modelica.Media.UsersGuide.MediumDefinition.TestOfMedium.

Extends from Modelica.Icons.Example (Icon for runnable examples), Modelica.Media.Examples.Tests.Components.PartialTestModel (Basic test model to test a medium).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium model
AbsolutePressurep_startMedium.p_defaultInitial value of pressure [Pa]
TemperatureT_startMedium.T_defaultInitial value of temperature [K]
SpecificEnthalpyh_startMedium.h_defaultInitial value of specific enthalpy [J/kg]
RealX_start[Medium.nX]Medium.X_defaultInitial value of mass fractions

Connectors

TypeNameDescription
replaceable package MediumMedium model

Modelica definition

model PerfectGasTestImplementation extends Modelica.Icons.Example; extends Modelica.Media.Examples.Tests.Components.PartialTestModel( redeclare package Medium = Annex60.Media.Specialized.Air.PerfectGas); end PerfectGasTestImplementation;

http://iea-annex60.org