packagePartialSimpleAlloy_TableBased
Extends from TRANSFORM.Media.Interfaces.Solids.PartialSimpleAlloy (Material properties based on tables).
Information
This is the base package for medium models of incompressible fluids based on tables. The minimal data to provide for a useful medium description is tables of density and heat capacity as functions of temperature.
It should be noted that incompressible media only have 1 state per control volume (usually T), but have both T and p as inputs for fully correct properties. The error of using only T-dependent properties is small, therefore a Boolean flag enthalpyOfT exists. If it is true, the enumeration Choices.independentVariables is set to Choices.independentVariables.T otherwise it is set to Choices.independentVariables.pT.
Using the package TableBased
To implement a new medium model, create a package that extends TableBased and provides one or more of the constant tables:
tableDensity = [T, d]; tableHeatCapacity = [T, Cp]; tableConductivity = [T, lam]; tableViscosity = [T, eta]; tableVaporPressure = [T, pVap];
The table data is used to fit constant polynomials of order npol, the temperature data points do not need to be same for different properties. Properties like enthalpy, inner energy and entropy are calculated consistently from integrals and derivatives of d(T) and Cp(T). The minimal data for a useful medium model is thus density and heat capacity. Transport properties and vapor pressure are optional, if the data tables are empty the corresponding function calls can not be used.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| String | mediumName (from PartialAlloy) | "unusablePartialMedium" | Name of the medium |
| String[:] | substanceNames (from PartialAlloy) | {mediumName} | Names of the mixture substances. Set substanceNames={mediumName} if only one substance. |
| Modelica.Media.Interfaces.Types.Temperature | T_reference (from PartialAlloy) | 298.15 | Reference temperature of Medium: default 25 deg Celsius |
| Modelica.Media.Interfaces.Types.SpecificEnthalpy | h_reference (from PartialAlloy) | 0 | Reference enthalpy at T_reference |
| Temperature | T_default (from PartialAlloy) | 293.15 | Default value for temperature of medium (for initialization) |
| SpecificEnthalpy | h_default (from PartialAlloy) | specificEnthalpy_T(T_default) | Default value for specific enthalpy of medium (for initialization) |
| Modelica.SIunits.Temperature | T_min (from PartialSimpleAlloy) | Minimum temperature valid for medium model | |
| Modelica.SIunits.Temperature | T_max (from PartialSimpleAlloy) | Maximum temperature valid for medium model | |
| MolarMass | MM_const (from PartialSimpleAlloy) | 0.1 | Molar mass |
| Integer | npol | 2 | Degree of polynomial used for fitting |
| Integer | npolDensity | npol | Degree of polynomial used for fitting d(T) |
| Integer | npolHeatCapacity | npol | Degree of polynomial used for fitting cp(T) |
| Integer | npolConductivity | npol | Degree of polynomial used for fitting lambda(T) |
| Real | tableDensity | Table for d(T) | |
| Real | tableHeatCapacity | Table for cp(T) | |
| Real | tableConductivity | Table for lambda(T) | |
| Real[:] | poly_d | if size(tableDensity, 1) > 0 then Poly.fitting(tableDensity[:, 1], tableDensity[:, 2], npolDensity) else zeros(npolDensity + 1) | |
| Real[:] | poly_cp | if size(tableHeatCapacity, 1) > 0 then Poly.fitting(tableHeatCapacity[:, 1], tableHeatCapacity[:, 2], npolHeatCapacity) else zeros(npolHeatCapacity + 1) | |
| Real[:] | poly_lambda | if size(tableConductivity, 1) > 0 then Poly.fitting(tableConductivity[:, 1], tableConductivity[:, 2], npolConductivity) else zeros(npolConductivity + 1) |
Contents
| Name | Description |
|---|---|
| Return density as a function of the thermodynamic state record | |
| Return specific enthalpy as a function of the thermodynamic state record | |
| Specific heat capacity at constant volume (or pressure) of medium | |
| Return thermal conductivity as a function of the thermodynamic state record | |
| Temporary Functions operating on polynomials (including polynomial fitting); only to be used in Modelica.Media.Incompressible.TableBased |