packageTemperatureDependentDensity
Extends from Modelica.Media.Interfaces.PartialPureSubstance (Base class for pure substances of one chemical substance), Modelica.Icons.Package (Icon for standard packages).
Information
This medium package models liquid water.
The mass density is computed using a 3rd order polynomial, which yields the density as a function of temperature as shown in the figure below. Note, however, that computing density as a function of temperature can lead to considerably slower computing time compared to using Buildings.Media.Water in which the density is a constant. We therefore recommend to use Buildings.Media.Water for typical building energy simulations.
For the specific heat capacities at constant pressure and at constant volume, a constant value of 4184 J/(kg K), which corresponds to 20°C is used. The figure below shows the relative error of the specific heat capacity that is introduced by this simplification. Using a constant value for the specific heat capacity allows to compute temperature from enthalpy without having to solve an implicit equation, and therefore leads to faster simulation.
Thermal conductivity is calculated as a function of temperature as shown in the figure below. The correlation used to calculate the thermal conductivity is
λ(T) = λ(298.15 K) ⋅ (-1.48445+4.12292⋅(T/298.15)-1.63866⋅(T/298.15)2),
where λ(298.15 K) = 0.6065 W/(m ⋅ K) is the adopted standard value of the thermal conductivity of water at 298.15 K and 0.1 MPa.
Dynamic viscosity is calculated as the product of density and kinematic viscosity, both temperature dependent. However, the kinematic viscosity has its own temperature dependent correlation, implemented at Buildings.Media.Specialized.Water.TemperatureDependentDensity.kinematicViscosity. Results of the kinematic viscosity as a function of temperature are shown in the figure below.
The enthalpy is computed using the convention that h=0 if T=0 °C.
Limitations
Phase changes are not modeled.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Media.Interfaces.Choices.IndependentVariables | ThermoStates (from PartialMedium) | Enumeration type for independent variables | |
| String | mediumName (from PartialMedium) | "unusablePartialMedium" | Name of the medium |
| String[:] | substanceNames (from PartialMedium) | {mediumName} | Names of the mixture substances. Set substanceNames={mediumName} if only one substance. |
| String[:] | extraPropertiesNames (from PartialMedium) | fill("", 0) | Names of the additional (extra) transported properties. Set extraPropertiesNames=fill("",0) if unused |
| Boolean | singleState (from PartialMedium) | = true, if u and d are not a function of pressure | |
| Boolean | reducedX (from PartialMedium) | true | = true, if medium contains the equation sum(X) = 1.0; set reducedX=true, if only one substance (see docu for details) |
| Boolean | fixedX (from PartialMedium) | false | = true, if medium contains the equation X = reference_X |
| AbsolutePressure | reference_p (from PartialMedium) | 101325 | Reference pressure of Medium: default 1 atmosphere |
| Temperature | reference_T (from PartialMedium) | 298.15 | Reference temperature of Medium: default 25 deg Celsius |
| MassFraction[nX] | reference_X (from PartialMedium) | fill(1/nX, nX) | Default mass fractions of medium |
| AbsolutePressure | p_default (from PartialMedium) | 101325 | Default value for pressure of medium (for initialization) |
| Temperature | T_default (from PartialMedium) | Modelica.Units.Conversions.from_degC(20) | Default value for temperature of medium (for initialization) |
| SpecificEnthalpy | h_default (from PartialMedium) | specificEnthalpy_pTX(p_default, T_default, X_default) | Default value for specific enthalpy of medium (for initialization) |
| MassFraction[nX] | X_default (from PartialMedium) | reference_X | Default value for mass fractions of medium (for initialization) |
| ExtraProperty[nC] | C_default (from PartialMedium) | fill(0, nC) | Default value for trace substances of medium (for initialization) |
| Integer | nS (from PartialMedium) | size(substanceNames, 1) | Number of substances |
| Integer | nX (from PartialMedium) | nS | Number of mass fractions |
| Integer | nXi (from PartialMedium) | if fixedX then 0 else if reducedX then nS - 1 else nS | Number of structurally independent mass fractions (see docu for details) |
| Integer | nC (from PartialMedium) | size(extraPropertiesNames, 1) | Number of extra (outside of standard mass-balance) transported properties |
| Real[nC] | C_nominal (from PartialMedium) | 1.0e-6*ones(nC) | Default for the nominal values for the extra properties |
| Modelica.Units.SI.SpecificHeatCapacity | cp_const | 4184 | Specific heat capacity at constant pressure |
Contents
| Name | Description |
|---|---|
| Thermodynamic state variables | |
| Base properties | |
| Return the density | |
| Return the dynamic viscosity | |
| Return the specific enthalpy | |
| Return the specific enthalpy of liquid | |
| Return the specific enthalpy | |
| Return the specific entropy | |
| Return the specific Gibbs energy | |
| Return the specific Helmholtz energy | |
| Return the isentropic enthalpy | |
| Return the isobaric expansion coefficient | |
| Return the isothermal compressibility factor | |
| Return the partial derivative of density with respect to pressure at constant temperature | |
| Return the partial derivative of density with respect to temperature at constant pressure | |
| Return the partial derivative of density with respect to mass fractions at constant pressure and temperature | |
| Return the specific heat capacity at constant pressure | |
| Return the specific heat capacity at constant volume | |
| Return the thermal conductivity | |
| Return the pressure | |
| Return the temperature | |
| Return the molar mass | |
| Return thermodynamic state from d, T, and X or Xi | |
| Return the thermodynamic state as function of pressure p, specific enthalpy h and composition X or Xi | |
| Return the thermodynamic state as function of p, T and composition X or Xi | |
| Return the thermodynamic state as function of p, s and composition X or Xi | |
| Return the derivative of the specific heat capacity at constant pressure | |
| Temperature derivative of enthalpy of liquid per unit mass of liquid | |
| Return the kinematic viscosity |
Revisions
-
April 5, 2022, by Michael Wetter:
Corrected assignment ofR_sinBasePropertiesto avoid a unit error.
This is for #1603. -
July 7, 2016, by Carles Ribas Tugores:
Correct Documentation. This is for #487. -
June 6, 2015, by Michael Wetter:
SetAbsolutePressure(start=p_default)andTemperature(start=T_default)to have to have conistent start values. See also revision notes of Buildings.Media.Water. This is for #266. -
May 1, 2015, by Michael Wetter:
AddedInline=truefor issue 227. -
February 25, 2015, by Michael Wetter:
RemovedstateSelectattribute on pressure as this caused Buildings.Examples.Tutorial.SpaceCooling.System3 to fail with the error message "differentiated if-then-else was not continuous". -
February 3, 2015, by Michael Wetter:
RemovedstateSelect.preferfor temperature. This is for #160. -
October 15, 2014, by Michael Wetter:
Renamed fromBuildings.Media.WatertoBuildings.Media.Water.Detailedto allow addition ofBuildings.Media.Water.Simple. -
September 12, 2014, by Michael Wetter:
SetT(start=T_default)andp(start=p_default)in theThermodynamicStaterecord. Setting the start value forTis required to avoid an error due to conflicting start values when checking Buildings.Examples.VAVReheat.ClosedLoop in pedantic mode. -
December 18, 2013, by Michael Wetter:
First implementation.