| 1 | within Modelica.Media; |
|---|
| 2 | package CompressibleLiquids "compressible liquid models" |
|---|
| 3 | package Common "base classes for compressible liquids" |
|---|
| 4 | extends Icons.Library; |
|---|
| 5 | partial package LinearWater_pT |
|---|
| 6 | "base class for liquid, linear compressibility water models" |
|---|
| 7 | extends Media.Interfaces.PartialLinearFluid( |
|---|
| 8 | constantJacobian=true, |
|---|
| 9 | reference_d=Modelica.Media.Water.StandardWater.density(state), |
|---|
| 10 | reference_h=Modelica.Media.Water.StandardWater.specificEnthalpy(state), |
|---|
| 11 | reference_s=Modelica.Media.Water.StandardWater.specificEntropy(state), |
|---|
| 12 | cp_const=Modelica.Media.Water.StandardWater.specificHeatCapacityCp(state), |
|---|
| 13 | beta_const= |
|---|
| 14 | Modelica.Media.Water.StandardWater.isobaricExpansionCoefficient(state), |
|---|
| 15 | kappa_const=Modelica.Media.Water.StandardWater.isothermalCompressibility( |
|---|
| 16 | state), |
|---|
| 17 | MM_const=Modelica.Media.Water.StandardWater.molarMass(state)); |
|---|
| 18 | |
|---|
| 19 | constant Modelica.Media.Water.StandardWater.ThermodynamicState state= |
|---|
| 20 | Modelica.Media.Water.StandardWater.setState_pT(reference_p, reference_T); |
|---|
| 21 | end LinearWater_pT; |
|---|
| 22 | end Common; |
|---|
| 23 | |
|---|
| 24 | package LinearColdWater "cold water model with linear compressibility" |
|---|
| 25 | extends Media.Interfaces.PartialLinearFluid( |
|---|
| 26 | constantJacobian=true, |
|---|
| 27 | reference_p=101325, |
|---|
| 28 | reference_T=278.15, |
|---|
| 29 | reference_d=997.05, |
|---|
| 30 | reference_h=104929, |
|---|
| 31 | reference_s=100.0, |
|---|
| 32 | cp_const=4181.9, |
|---|
| 33 | beta_const=2.5713e-4, |
|---|
| 34 | kappa_const=4.5154e-10, |
|---|
| 35 | MM_const=0.018015268); |
|---|
| 36 | |
|---|
| 37 | redeclare function extends dynamicViscosity "Dynamic viscosity of water" |
|---|
| 38 | algorithm |
|---|
| 39 | eta := 0.15; |
|---|
| 40 | end dynamicViscosity; |
|---|
| 41 | |
|---|
| 42 | redeclare function extends thermalConductivity |
|---|
| 43 | "Thermal conductivity of water" |
|---|
| 44 | algorithm |
|---|
| 45 | lambda := 0.1; |
|---|
| 46 | end thermalConductivity; |
|---|
| 47 | |
|---|
| 48 | end LinearColdWater; |
|---|
| 49 | |
|---|
| 50 | package LinearWater_pT_Ambient |
|---|
| 51 | "liquid, linear compressibility water model at 1.01325 bar and 25 degree Celsius" |
|---|
| 52 | extends Modelica.Media.CompressibleLiquids.Common.LinearWater_pT( |
|---|
| 53 | reference_p = 101325, reference_T = 298.15); |
|---|
| 54 | annotation (Documentation(info="<html> |
|---|
| 55 | <h4>Water model with linear compressibility at ambient conditions</h4> |
|---|
| 56 | </html>")); |
|---|
| 57 | end LinearWater_pT_Ambient; |
|---|
| 58 | |
|---|
| 59 | annotation (Documentation(info="<html> |
|---|
| 60 | |
|---|
| 61 | <h4>Fluid models with linear compressibility, using PartialLinearFluid as base class.</h4> |
|---|
| 62 | <p>The linear compressibility fluid models contained in this package are based on the assumptions that: |
|---|
| 63 | </p> |
|---|
| 64 | <ul> |
|---|
| 65 | <li>The specific heat capacity at constant pressure (cp) is constant</li> |
|---|
| 66 | <li>The isobaric expansion coefficient (beta) is constant</li> |
|---|
| 67 | <li>The isothermal compressibility (kappa) is constant</li> |
|---|
| 68 | <li>Pressure and temperature are used as states</li> |
|---|
| 69 | </ul> |
|---|
| 70 | <p> |
|---|
| 71 | This results in models that are only valid for small temperature ranges, but sufficient to model compressibility and e.g. the \"water hammer\" effect. ANother advantage id that only 3 values need to be measured to have an initial model. Hydraulic fluids can often be approximated by this type of model. |
|---|
| 72 | </p> |
|---|
| 73 | <p> |
|---|
| 74 | That means that the density is a linear function in temperature and in pressure. |
|---|
| 75 | In order to define the complete model, a number of constant reference values are needed which |
|---|
| 76 | are computed at the reference values of the states pressure p and temperature T. The model can |
|---|
| 77 | be interprested as a linearization of a full non-linear fluid model (but it is not linear in all |
|---|
| 78 | thermodynamic coordinates). Reference values are needed for |
|---|
| 79 | </p> |
|---|
| 80 | <ol> |
|---|
| 81 | <li>the density (reference_d),</li> |
|---|
| 82 | <li>the specific enthalpy (reference_h),</li> |
|---|
| 83 | <li>the specific entropy (reference_s).</li> |
|---|
| 84 | </ol> |
|---|
| 85 | <p> |
|---|
| 86 | Apart from that, a user needs to define the molar mass, MM_const. |
|---|
| 87 | Note that it is possible to define a fluid by computing the reference |
|---|
| 88 | values from a full non-linear fluid model by computing the package constants |
|---|
| 89 | using the standard functions defined in a fluid package (see example in Common, LinearWater_pT). |
|---|
| 90 | </p> |
|---|
| 91 | |
|---|
| 92 | </html>")); |
|---|
| 93 | end CompressibleLiquids; |
|---|