Demonstrate usage of property models

- Each medium has a model called BaseProperties. BaseProperties contains the minimum set of medium properties needed in a dynamic control volume model.
- Each instance of BaseProperties contains a "state" record that is an input to all the functions to compute properties. If these functions need further inputs, like e.g., the molarMass, these are accessible as constants in the package.
- The simplest way to compute properties at any other reference
point is to declare an instance of ThermodynamicState and use that as
input to arbitrary property functions.

A small library of generic volume, pipe, pump and ambient models is provided in Modelica.Media.Examples.Tests.Components to demonstrate how fluid components should be implemented that are using Modelica.Media models. This library is also used to test all media models in Modelica.Media.Examples.Tests.MediaTestModels.

Extends from `Modelica.Icons.ExamplesPackage`

(Icon for packages containing runnable examples).

Name | Description |
---|---|

`IdealGasH2O` | IdealGas H20 medium model |

`MixtureGases` | Test gas mixtures |

`MoistAir` | Example for moist air |

`PsychrometricData` | Produces plot data for psychrometric charts |

`R134a` … | Examples for R134a |

`ReferenceAir` … | Examples for detailed dry air and moist air medium models |

`SimpleLiquidWater` | Example for Water.SimpleLiquidWater medium model |

`SolveOneNonlinearEquation` … | Demonstrate how to solve one non-linear algebraic equation in one unknown |

`TestOnly` … | Examples to show the testing of media |

`Tests` … | Library to test that all media models simulate and fulfill the expected structural properties |

`TwoPhaseWater` … | Extension of the StandardWater package |

`Utilities` … | Functions, connectors and models needed for the media model tests |

`WaterIF97` | WaterIF97 medium model |

Example for Water.SimpleLiquidWater medium model

Extends from `Modelica.Icons.Example`

(Icon for runnable examples).

Type | Name | Default | Description |
---|---|---|---|

`Volume` | `V` | `1` | Volume |

`EnthalpyFlowRate` | `H_flow_ext` | `1000000` | Constant enthalpy flow rate into the volume |

IdealGas H20 medium model

An example for using ideal gas properties and how to compute isentropic enthalpy changes. The function that is implemented is approximate, but usually very good: the second medium record medium2 is given to compare the approximation.

Extends from `Modelica.Icons.Example`

(Icon for runnable examples).

WaterIF97 medium model

Extends from `Modelica.Icons.Example`

(Icon for runnable examples).

Type | Name | Default | Description |
---|---|---|---|

`VolumeFlowRate` | `dV` | `0` | Fixed time derivative of volume |

`MassFlowRate` | `m_flow_ext` | `0` | Fixed mass flow rate into volume |

`EnthalpyFlowRate` | `H_flow_ext` | `10000` | Fixed enthalpy flow rate into volume |

Test gas mixtures

Extends from `Modelica.Icons.Example`

(Icon for runnable examples).

Type | Name | Default | Description |
---|---|---|---|

`Volume` | `V` | `1` | Fixed size of volume 1 and volume 2 |

`MassFlowRate` | `m_flow_ext` | `0.01` | Fixed mass flow rate in to volume 1 and in to volume 2 |

`EnthalpyFlowRate` | `H_flow_ext` | `5000` | Fixed enthalpy flow rate in to volume and in to volume 2 |

Example for moist air

An example for using ideal gas properties and how to compute isentropic enthalpy changes. The function that is implemented is approximate, but usually very good: the second medium record medium2 is given to compare the approximation.

Extends from `Modelica.Icons.Example`

(Icon for runnable examples).

Type | Name | Default | Description |
---|---|---|---|

`MolarMass` | `MMx[2]` | `{Medium.dryair.MM, Medium.steam.MM}` | Vector of molar masses (consisting of dry air and of steam) |

Produces plot data for psychrometric charts

This model produces psychrometric data from the moist air model in this library to be plotted in charts. The two most common chart varieties are the Mollier Diagram and the Psychrometric Chart. The first is widely used in some European countries while the second is more common in the Anglo-American world. Specific enthalpy is plotted over absolute humidity in the Mollier Diagram, it is the other way round in the Psychrometric Chart.

It must be noted that the relationship of both axis variables is not right-angled, the absolute humidity follows a slope which equals the enthalpy of vaporization at 0 °C. For better reading and in order to reduce the fog region the humidity axis is rotated to obtain a right-angled plot. Both charts usually contain additional information as isochores or auxiliary scales for e.g., heat ratios. Those information are omitted in this model and the charts below. Other important features of psychrometric chart data are that all mass specific variables (like absolute humidity, specific enthalpy etc.) are expressed in terms of kg dry air and that their baseline of 0 enthalpy is found at 0 °C and zero humidity.

**Legend:** blue - constant specific enthalpy, red - constant temperature, black - constant relative humidity

The model provides data for lines of constant specific enthalpy, temperature and relative humidity in a Mollier Diagram or Psychrometric Chart as they were used for the figures above. For limitations and ranges of validity please refer to the MoistAir package description. Absolute humidity **x** is increased with time in this model. The specific enthalpies adjusted for plotting are then obtained from:

**y_h**: constant specific enthalpy**y_T**: constant temperature**y_phi**: constant relative humidity

Extends from `Modelica.Icons.Example`

(Icon for runnable examples).

Type | Name | Default | Description |
---|---|---|---|

`Pressure` | `p_const` | `100000` | Pressure |

`Integer` | `n_T` | `11` | Number of isotherms |

`Temperature` | `T_min` | `253.15` | Lowest isotherm |

`Temperature` | `T_step` | `10` | Temperature step between two isotherms |

`Integer` | `n_h` | `16` | Number of lines with constant specific enthalpy |

`SpecificEnthalpy` | `h_min` | `-20000` | Lowest line of constant enthalpy |

`SpecificEnthalpy` | `h_step` | `10000` | Enthalpy step between two lines of constant enthalpy |

`Integer` | `n_phi` | `10` | Number of lines with constant relative humidity |

`Real` | `phi_min` | `0.1` | Lowest line of constant humidity |

`Real` | `phi_step` | `0.1` | Step between two lines of constant humidity |

`MassFraction` | `x_min` | `0` | Minimum diagram absolute humidity |

`MassFraction` | `x_max` | `0.03` | Maximum diagram absolute humidity |

`Time` | `t` | `1` | Simulation time |

`Temperature` | `T_const[n_T]` | `{T_min - T_step + i * T_step for i in 1:n_T}` | Constant temperatures |

`SpecificEnthalpy` | `h_const[n_h]` | `{(i - 1) * h_step + h_min for i in 1:n_h}` | Constant enthalpies |

`Real` | `phi_const[n_phi]` | `{(i - 1) * phi_step + phi_min for i in 1:n_phi}` | Constant relative humidities |

`Real` | `diagSlope` | `Medium.enthalpyOfVaporization(273.15)` | Rotation of diagram that zero degrees isotherm becomes horizontal outside the fog region |

`MassFraction` | `x_start` | `x_min` | Initial absolute humidity in kg water/kg dry air |