Buildings.Media.Examples
Collection of models that test the media models
Information
This package contains examples that test the media packages in Buildings.Media.
Extends from Modelica.Icons.ExamplesPackage (Icon for packages containing runnable examples).
Package Content
| Name | Description | 
|---|---|
|  AirDerivativeCheck | Model that tests the derivative implementation | 
|  AirProperties | Model that tests the implementation of the fluid properties | 
|  AirTemperatureEnthalpyInversion | Model to check computation of h(T) and its inverse | 
|  PropyleneGlycolWaterDerivativeCheck | Model that tests the derivative implementation | 
|  PropyleneGlycolWaterProperties | Model that tests the implementation of the fluid properties | 
|  PropyleneGlycolWaterTemperatureEnthalpyInversion | Model to check computation of h(T) and its inverse | 
|  SteamDerivativeCheck | Model that tests the derivative implementation | 
|  SteamProperties | Model that tests the implementation of the steam superheated properties | 
|  SteamSaturationConsistencyCheck | Model that checks the consistency of saturated property functions | 
|  SteamTemperatureEnthalpyInversion | Model to check computation of h(T) and its inverse | 
|  WaterDerivativeCheck | Model that tests the derivative implementation | 
|  WaterProperties | Model that tests the implementation of the fluid properties | 
|  WaterTemperatureEnthalpyInversion | Model to check computation of h(T) and its inverse | 
|  BaseClasses | Package with base classes for Buildings.Media.Examples | 
 Buildings.Media.Examples.AirDerivativeCheck
Buildings.Media.Examples.AirDerivativeCheck
Model that tests the derivative implementation
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
 Buildings.Media.Examples.AirProperties
Buildings.Media.Examples.AirProperties
Model that tests the implementation of the fluid properties
Information
This example checks thermophysical properties of the medium.
Extends from Modelica.Icons.Example (Icon for runnable examples), Buildings.Media.Examples.BaseClasses.FluidProperties (Model that tests the implementation of the fluid properties).
Parameters
| Type | Name | Default | Description | 
|---|---|---|---|
| replaceable package Medium | PartialMedium | ||
| Temperature | TMin | 273.15 - 30 | Minimum temperature for the simulation [K] | 
| Temperature | TMax | 273.15 + 60 | Maximum temperature for the simulation [K] | 
| Pressure | p | Medium.p_default | Pressure [Pa] | 
| MassFraction | X[Medium.nX] | Medium.X_default | Mass fraction [1] | 
| Real | errAbs | 1E-8 | Absolute error used in the check of the state calculations | 
Connectors
| Type | Name | Description | 
|---|---|---|
| replaceable package Medium | ||
Modelica definition
 Buildings.Media.Examples.AirTemperatureEnthalpyInversion
Buildings.Media.Examples.AirTemperatureEnthalpyInversion
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), Buildings.Media.Examples.BaseClasses.TestTemperatureEnthalpyInversion (Model to check computation of h(T) and its inverse with a controlleable tolerance).
Parameters
| Type | Name | Default | Description | 
|---|---|---|---|
| replaceable package Medium | PartialMedium | ||
| Temperature | T0 | 273.15 + 20 | Temperature [K] | 
| Real | tol | 1E-8 | Numerical tolerance | 
Connectors
| Type | Name | Description | 
|---|---|---|
| replaceable package Medium | ||
Modelica definition
 Buildings.Media.Examples.PropyleneGlycolWaterDerivativeCheck
Buildings.Media.Examples.PropyleneGlycolWaterDerivativeCheck
Model that tests the derivative implementation
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
 Buildings.Media.Examples.PropyleneGlycolWaterProperties
Buildings.Media.Examples.PropyleneGlycolWaterProperties
Model that tests the implementation of the fluid properties
Information
This example checks thermophysical properties of the medium.
Extends from Modelica.Icons.Example (Icon for runnable examples), Buildings.Media.Examples.BaseClasses.FluidProperties (Model that tests the implementation of the fluid properties).
Parameters
| Type | Name | Default | Description | 
|---|---|---|---|
| replaceable package Medium | PartialMedium | ||
| Temperature | TMin | 273.15 | Minimum temperature for the simulation [K] | 
| Temperature | TMax | 373.15 | Maximum temperature for the simulation [K] | 
| Pressure | p | Medium.p_default | Pressure [Pa] | 
| MassFraction | X[Medium.nX] | Medium.X_default | Mass fraction [1] | 
| Real | errAbs | 1E-8 | Absolute error used in the check of the state calculations | 
Connectors
| Type | Name | Description | 
|---|---|---|
| replaceable package Medium | ||
Modelica definition
 Buildings.Media.Examples.PropyleneGlycolWaterTemperatureEnthalpyInversion
Buildings.Media.Examples.PropyleneGlycolWaterTemperatureEnthalpyInversion
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), Buildings.Media.Examples.BaseClasses.TestTemperatureEnthalpyInversion (Model to check computation of h(T) and its inverse with a controlleable tolerance).
Parameters
| Type | Name | Default | Description | 
|---|---|---|---|
| replaceable package Medium | PartialMedium | ||
| Temperature | T0 | 273.15 + 20 | Temperature [K] | 
| Real | tol | 1E-8 | Numerical tolerance | 
Connectors
| Type | Name | Description | 
|---|---|---|
| replaceable package Medium | ||
Modelica definition
 Buildings.Media.Examples.SteamDerivativeCheck
Buildings.Media.Examples.SteamDerivativeCheck
Model that tests the derivative implementation
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
 Buildings.Media.Examples.SteamProperties
Buildings.Media.Examples.SteamProperties
Model that tests the implementation of the steam superheated properties
Information
This example checks thermophysical properties of the medium.
Extends from Modelica.Icons.Example (Icon for runnable examples), Buildings.Media.Examples.BaseClasses.PartialProperties (Partial model that contains common parameters of the fluid properties).
Parameters
| Type | Name | Default | Description | 
|---|---|---|---|
| replaceable package Medium | PartialMedium | ||
| Temperature | TMin | 273.15 + 100 | Minimum temperature for the simulation [K] | 
| Temperature | TMax | 273.15 + 160 | Maximum temperature for the simulation [K] | 
| Pressure | p | 200000 | Pressure [Pa] | 
| MassFraction | X[Medium.nX] | Medium.X_default | Mass fraction [1] | 
| Real | errAbs | 1E-8 | Absolute error used in the check of the state calculations | 
Connectors
| Type | Name | Description | 
|---|---|---|
| replaceable package Medium | ||
Modelica definition
 Buildings.Media.Examples.SteamSaturationConsistencyCheck
Buildings.Media.Examples.SteamSaturationConsistencyCheck
Model that checks the consistency of saturated property functions
Information
This example checks the consistency of satuated property functions across the steam and liquid water mediums. It also checks if the inversion of saturated temperature and saturated pressure is implemented correctly for the steam model.
Errors are presented as percent differences between the standard property functions - e.g medium.specificEnthalpy(saturatedState) - and the IF97 saturated property functions as the baseline.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Parameters
| Type | Name | Default | Description | 
|---|---|---|---|
| Temperature | TMin | 273.15 + 100 | Minimum temperature for the simulation [K] | 
| Temperature | TMax | 273.15 + 179.886 | Maximum temperature for the simulation [K] | 
| Real | tol | 1E-8 | Numerical tolerance | 
Modelica definition
 Buildings.Media.Examples.SteamTemperatureEnthalpyInversion
Buildings.Media.Examples.SteamTemperatureEnthalpyInversion
Model to check computation of h(T) and its inverse
Information
This model tests whether the inversion of temperature and enthalpy is implemented correctly for the steam model.
Extends from Modelica.Icons.Example (Icon for runnable examples), Buildings.Media.Examples.BaseClasses.TestTemperatureEnthalpyInversion (Model to check computation of h(T) and its inverse with a controlleable tolerance).
Parameters
| Type | Name | Default | Description | 
|---|---|---|---|
| replaceable package Medium | PartialMedium | ||
| Temperature | T0 | 273.15 + 300 | Temperature [K] | 
| Real | tol | 1E-8 | Numerical tolerance | 
Connectors
| Type | Name | Description | 
|---|---|---|
| replaceable package Medium | ||
Modelica definition
 Buildings.Media.Examples.WaterDerivativeCheck
Buildings.Media.Examples.WaterDerivativeCheck
Model that tests the derivative implementation
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
 Buildings.Media.Examples.WaterProperties
Buildings.Media.Examples.WaterProperties
Model that tests the implementation of the fluid properties
Information
This example checks thermophysical properties of the medium.
Extends from Modelica.Icons.Example (Icon for runnable examples), Buildings.Media.Examples.BaseClasses.FluidProperties (Model that tests the implementation of the fluid properties).
Parameters
| Type | Name | Default | Description | 
|---|---|---|---|
| replaceable package Medium | PartialMedium | ||
| Temperature | TMin | 273.15 | Minimum temperature for the simulation [K] | 
| Temperature | TMax | 373.15 | Maximum temperature for the simulation [K] | 
| Pressure | p | Medium.p_default | Pressure [Pa] | 
| MassFraction | X[Medium.nX] | Medium.X_default | Mass fraction [1] | 
| Real | errAbs | 1E-8 | Absolute error used in the check of the state calculations | 
Connectors
| Type | Name | Description | 
|---|---|---|
| replaceable package Medium | ||
Modelica definition
 Buildings.Media.Examples.WaterTemperatureEnthalpyInversion
Buildings.Media.Examples.WaterTemperatureEnthalpyInversion
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), Buildings.Media.Examples.BaseClasses.TestTemperatureEnthalpyInversion (Model to check computation of h(T) and its inverse with a controlleable tolerance).
Parameters
| Type | Name | Default | Description | 
|---|---|---|---|
| replaceable package Medium | PartialMedium | ||
| Temperature | T0 | 273.15 + 20 | Temperature [K] | 
| Real | tol | 1E-8 | Numerical tolerance | 
Connectors
| Type | Name | Description | 
|---|---|---|
| replaceable package Medium | ||
