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-2023 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 dictionary& dict
48 )
49 {
50  if (dict.isDict(name))
51  {
53  }
54  else
55  {
56  return autoPtr<Function1<scalar>>
57  (
58  new Function1s::None<scalar>(name, dict)
59  );
60  }
61 }
62 
63 
64 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
65 
67 :
69  rho_(New("rho", dict)),
70  pv_(New("pv", dict)),
71  hl_(New("hl", dict)),
72  Cp_(New("Cp", dict)),
73  h_(New("h", dict)),
74  Cpg_(New("Cpg", dict)),
75  B_(New("B", dict)),
76  mu_(New("mu", dict)),
77  mug_(New("mug", dict)),
78  kappa_(New("kappa", dict)),
79  kappag_(New("kappag", dict)),
80  sigma_(New("sigma", dict)),
81  D_(New("D", dict)),
82  Hf_(h_->value(Tstd))
83 {}
84 
85 
87 :
88  liquidProperties(lm),
89  rho_(lm.rho_, false),
90  pv_(lm.pv_, false),
91  hl_(lm.hl_, false),
92  Cp_(lm.Cp_, false),
93  h_(lm.h_, false),
94  Cpg_(lm.Cpg_, false),
95  B_(lm.B_, false),
96  mu_(lm.mu_, false),
97  mug_(lm.mug_, false),
98  kappa_(lm.kappa_, false),
99  kappag_(lm.kappag_, false),
100  sigma_(lm.sigma_, false),
101  D_(lm.D_, false),
102  Hf_(lm.Hf_)
103 {}
104 
105 
106 
107 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
108 
110 {
111  liquidProperties::write(os); os << nl;
112  rho_->write(os); os << nl;
113  pv_->write(os); os << nl;
114  hl_->write(os); os << nl;
115  Cp_->write(os); os << nl;
116  h_->write(os); os << nl;
117  Cpg_->write(os); os << nl;
118  B_->write(os); os << nl;
119  mu_->write(os); os << nl;
120  mug_->write(os); os << nl;
121  kappa_->write(os); os << nl;
122  kappag_->write(os); os << nl;
123  sigma_->write(os); os << nl;
124  D_->write(os); os << endl;
125 }
126 
127 
128 // ************************************************************************* //
Macros for easy insertion into run-time selection tables.
static autoPtr< Function1< Type > > New(const word &name, const dictionary &dict)
Selector.
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:160
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:109
liquid(const dictionary &dict)
Construct from dictionary.
Definition: liquid.C:66
Thermodynamic scalar constants.
const scalar & Tstd
Standard temperature (default in [K])
Namespace for OpenFOAM.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
defineTypeNameAndDebug(combustionModel, 0)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
static const char nl
Definition: Ostream.H:260
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
dictionary dict