This linear compressibility fluid model is based on the assumptions that:
That means that the density is a linear function in temperature and in pressure. In order to define the complete model, a number of constant reference values are needed which are computed at the reference values of the states pressure p and temperature T. The model can be interpreted as a linearization of a full non-linear fluid model (but it is not linear in all thermodynamic coordinates). Reference values are needed for
Apart from that, a user needs to define the molar mass, MM_const. Note that it is possible to define a fluid by computing the reference values from a full non-linear fluid model by computing the package constants using the standard functions defined in a fluid package (see example in liquids package).
In order to avoid numerical inversion of the temperature in the T_ph and T_ps functions, the density is always taken to be the reference density in the computation of h, s, u and cv. For liquids (and this model is intended only for liquids) the relative error of doing so is 1e-3 to 1e-4 at most. The model would be more "correct" based on the other assumptions, if occurrences of reference_d in the computations of h,s,u and cv would be replaced by a call to density(state). That would require a numerical solution for T_ps, while T_ph can be solved symbolically from a quadratic function. Errors from this approximation are small because liquid density varies little.
One of the main reasons to use a simple, linear fluid model is to achieve high performance in simulations. There are a number of possible compromises and possibilities to improve performance. Some of them can be influenced by a flag. The following rules where used in this model:
Name | Description |
---|---|
ThermodynamicState | A selection of variables that uniquely defines the thermodynamic state |
BaseProperties | Base properties of medium |
setState_pTX | Set the thermodynamic state record from p and T (X not needed) |
setState_phX | Set the thermodynamic state record from p and h (X not needed) |
setState_psX | Set the thermodynamic state record from p and s (X not needed) |
setState_dTX | Set the thermodynamic state record from d and T (X not needed) |
setSmoothState | Return thermodynamic state so that it smoothly approximates: if x > 0 then state_a else state_b |
pressure | Return the pressure from the thermodynamic state |
temperature | Return the temperature from the thermodynamic state |
density | Return the density from the thermodynamic state |
specificEnthalpy | Return the specific enthalpy from the thermodynamic state |
specificEntropy | Return the specific entropy from the thermodynamic state |
specificInternalEnergy | Return the specific internal energy from the thermodynamic state |
specificGibbsEnergy | Return specific Gibbs energy from the thermodynamic state |
specificHelmholtzEnergy | Return specific Helmholtz energy from the thermodynamic state |
velocityOfSound | Return velocity of sound from the thermodynamic state |
isentropicExponent | Return isentropic exponent from the thermodynamic state |
isentropicEnthalpy | Return isentropic enthalpy |
specificHeatCapacityCp | Return specific heat capacity at constant volume |
specificHeatCapacityCv | Return specific heat capacity at constant volume from the thermodynamic state |
isothermalCompressibility | Return the isothermal compressibility kappa |
isobaricExpansionCoefficient | Return the isobaric expansion coefficient |
density_derp_h | Return density derivative w.r.t. pressure at const specific enthalpy |
density_derh_p | Return density derivative w.r.t. specific enthalpy at constant pressure |
density_derp_T | Return density derivative w.r.t. pressure at const temperature |
density_derT_p | Return density derivative w.r.t. temperature at constant pressure |
density_derX | Returns the partial derivative of density with respect to mass fractions at constant pressure and temperature |
molarMass | Return molar mass |
T_ph | Return temperature from pressure and specific enthalpy |
T_ps | Return temperature from pressure and specific entropy |