liquid.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2019-2024 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "liquid.H"
27 #include "None.H"
29 
30 #include "thermodynamicConstants.H"
31 using namespace Foam::constant::thermodynamic;
32 
33 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
34 
35 namespace Foam
36 {
39 }
40 
41 
42 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
43 
45 (
46  const word& name,
47  const dimensionSet& dims,
48  const dictionary& dict
49 )
50 {
51  if (dict.isDict(name))
52  {
54  }
55  else
56  {
57  return autoPtr<Function1<scalar>>(new Function1s::None<scalar>(name));
58  }
59 }
60 
61 
62 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
63 
65 :
67  rho_(New("rho", dimDensity, dict)),
68  pv_(New("pv", dimPressure, dict)),
69  hl_(New("hl", dimEnergy/dimMass, dict)),
70  Cp_(New("Cp", dimSpecificHeatCapacity, dict)),
71  h_(New("h", dimEnergy/dimMass, dict)),
72  Cpg_(New("Cpg", dimSpecificHeatCapacity, dict)),
73  B_(New("B", dimVolume/dimMass, dict)),
74  mu_(New("mu", dimDynamicViscosity, dict)),
75  mug_(New("mug", dimDynamicViscosity, dict)),
76  kappa_(New("kappa", dimThermalConductivity, dict)),
77  kappag_(New("kappag", dimThermalConductivity, dict)),
78  sigma_(New("sigma", dimForce/dimLength, dict)),
79  D_(New("D", dimArea/dimTime, dict)),
80  hf_(h_->value(Tstd))
81 {}
82 
83 
85 :
86  liquidProperties(lm),
87  rho_(lm.rho_, false),
88  pv_(lm.pv_, false),
89  hl_(lm.hl_, false),
90  Cp_(lm.Cp_, false),
91  h_(lm.h_, false),
92  Cpg_(lm.Cpg_, false),
93  B_(lm.B_, false),
94  mu_(lm.mu_, false),
95  mug_(lm.mug_, false),
96  kappa_(lm.kappa_, false),
97  kappag_(lm.kappag_, false),
98  sigma_(lm.sigma_, false),
99  D_(lm.D_, false),
100  hf_(lm.hf_)
101 {}
102 
103 
104 
105 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
106 
108 {
109  liquidProperties::write(*this, os);
110 }
111 
112 
113 // ************************************************************************* //
Macros for easy insertion into run-time selection tables.
static autoPtr< Function1< Type > > New(const word &name, const Function1s::unitConversions &units, const dictionary &dict)
Select from dictionary.
Definition: Function1New.C:32
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
The thermophysical properties of a liquid.
virtual void write(Ostream &os) const =0
Write the function coefficients.
Generic thermophysical properties class for a liquid in which the functions and coefficients for each...
Definition: liquid.H:53
void write(Ostream &os) const
Write the function coefficients.
Definition: liquid.C:107
liquid(const dictionary &dict)
Construct from dictionary.
Definition: liquid.C:64
Thermodynamic scalar constants.
const scalar & Tstd
Standard temperature (default in [K])
Namespace for OpenFOAM.
const dimensionSet dimDynamicViscosity
addToRunTimeSelectionTable(polyPatch, mergedCyclicPolyPatch, word)
const dimensionSet dimEnergy
const dimensionSet dimPressure
word name(const bool)
Return a word representation of a bool.
Definition: boolIO.C:39
const dimensionSet dimLength
const dimensionSet dimTemperature
const dimensionSet dimForce
const dimensionSet dimSpecificHeatCapacity
const dimensionSet dimTime
const dimensionSet dimDensity
const dimensionSet dimVolume
defineTypeNameAndDebug(combustionModel, 0)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
const dimensionSet dimMass
const dimensionSet dimArea
const dimensionSet dimThermalConductivity
dictionary dict