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-2021 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 {
37  defineTypeNameAndDebug(liquid, 0);
38  addToRunTimeSelectionTable(liquidProperties, liquid, dictionary);
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  {
52  return Function1<scalar>::New(name, dict);
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 :
68  liquidProperties(dict),
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 
86 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
87 
89 {
90  liquidProperties::write(os); os << nl;
91  rho_->write(os); os << nl;
92  pv_->write(os); os << nl;
93  hl_->write(os); os << nl;
94  Cp_->write(os); os << nl;
95  h_->write(os); os << nl;
96  Cpg_->write(os); os << nl;
97  B_->write(os); os << nl;
98  mu_->write(os); os << nl;
99  mug_->write(os); os << nl;
100  kappa_->write(os); os << nl;
101  kappag_->write(os); os << nl;
102  sigma_->write(os); os << nl;
103  D_->write(os); os << endl;
104 }
105 
106 
107 // ************************************************************************* //
dictionary dict
virtual void write(Ostream &os) const =0
Write data to dictionary stream.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
liquid(const dictionary &dict)
Construct from dictionary.
Definition: liquid.C:66
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
Thermodynamic scalar constants.
Macros for easy insertion into run-time selection tables.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
const scalar & Tstd
Standard temperature (default in [K])
The thermophysical properties of a liquid.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
static const char nl
Definition: Ostream.H:260
defineTypeNameAndDebug(combustionModel, 0)
void write(Ostream &os) const
Write the function coefficients.
Definition: liquid.C:88
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
virtual void write(Ostream &os) const =0
Write the function coefficients.
Namespace for OpenFOAM.
static autoPtr< Function1< Type > > New(const word &name, const dictionary &dict)
Selector.
Definition: Function1New.C:32