liquid.C
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2020 OpenFOAM Foundation
9 Copyright (C) 2021 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27\*---------------------------------------------------------------------------*/
28
29#include "liquid.H"
30#include "NoneFunction1.H"
32
33// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
34
35namespace Foam
36{
39}
40
41
42// * * * * * * * * * * * * * * * Local Functions * * * * * * * * * * * * * * //
43
44namespace Foam
45{
46
47template<class Type>
49(
50 const word& entryName,
51 const dictionary& dict
52)
53{
55 (
57 );
58
59 if (!ptr)
60 {
61 ptr.reset
62 (
63 new Function1Types::None<Type>(entryName, dict)
64 );
65 }
66
67 return ptr;
68}
69
70} // End namespace Foam
71
72
73// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
74
76:
78 rho_(NewOrNone<scalar>("rho", dict)),
79 pv_(NewOrNone<scalar>("pv", dict)),
80 hl_(NewOrNone<scalar>("hl", dict)),
81 Cp_(NewOrNone<scalar>("Cp", dict)),
82 h_(NewOrNone<scalar>("h", dict)),
83 Cpg_(NewOrNone<scalar>("Cpg", dict)),
84 B_(NewOrNone<scalar>("B", dict)),
85 mu_(NewOrNone<scalar>("mu", dict)),
86 mug_(NewOrNone<scalar>("mug", dict)),
87 kappa_(NewOrNone<scalar>("kappa", dict)),
88 kappag_(NewOrNone<scalar>("kappag", dict)),
89 sigma_(NewOrNone<scalar>("sigma", dict)),
90 D_(NewOrNone<scalar>("D", dict))
91{}
92
93
94
96:
98 rho_(rhs.rho_.clone()),
99 pv_(rhs.pv_.clone()),
100 hl_(rhs.hl_.clone()),
101 Cp_(rhs.Cp_.clone()),
102 h_(rhs.h_.clone()),
103 Cpg_(rhs.Cpg_.clone()),
104 B_(rhs.B_.clone()),
105 mu_(rhs.mu_.clone()),
106 mug_(rhs.mug_.clone()),
107 kappa_(rhs.kappa_.clone()),
108 kappag_(rhs.kappag_.clone()),
109 sigma_(rhs.sigma_.clone()),
110 D_(rhs.D_.clone())
111{}
112
113
114// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
115
117{
118 liquidProperties::writeData(os); os << nl;
119 rho_->writeData(os); os << nl;
120 pv_->writeData(os); os << nl;
121 hl_->writeData(os); os << nl;
122 Cp_->writeData(os); os << nl;
123 h_->writeData(os); os << nl;
124 Cpg_->writeData(os); os << nl;
125 B_->writeData(os); os << nl;
126 mu_->writeData(os); os << nl;
127 mug_->writeData(os); os << nl;
128 kappa_->writeData(os); os << nl;
129 kappag_->writeData(os); os << nl;
130 sigma_->writeData(os); os << nl;
131 D_->writeData(os); os << endl;
132}
133
134
135// ************************************************************************* //
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
Templated placeholder function that returns an error message if called.
Definition: NoneFunction1.H:56
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
Definition: Function1.H:96
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
void reset(autoPtr< T > &&other) noexcept
Delete managed object and set to new given pointer.
Definition: autoPtrI.H:117
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
The thermophysical properties of a liquid.
Generic thermophysical properties class for a liquid in which the functions and coefficients for each...
Definition: liquid.H:57
void writeData(Ostream &os) const
Write the function coefficients.
Definition: liquid.C:116
A class for handling words, derived from Foam::string.
Definition: word.H:68
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition: className.H:121
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:372
static autoPtr< Function1< Type > > NewOrNone(const word &entryName, const dictionary &dict)
Definition: liquid.C:49
constexpr char nl
The newline '\n' character (0x0a)
Definition: Ostream.H:53
dictionary dict