liquid.H
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
27Class
28 Foam::liquid
29
30Description
31 Generic thermophysical properties class for a liquid in which the
32 functions and coefficients for each property are run-time selected.
33
34SourceFiles
35 liquid.C
36 liquidI.H
37
38\*---------------------------------------------------------------------------*/
39
40#ifndef liquid_H
41#define liquid_H
42
43#include "liquidProperties.H"
44#include "Function1.H"
45
46// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47
48namespace Foam
49{
50
51/*---------------------------------------------------------------------------*\
52 Class liquid Declaration
53\*---------------------------------------------------------------------------*/
55class liquid
56:
57 public liquidProperties
58{
59 // Private Data
60
74
75
76public:
78 friend class liquidProperties;
79
80 //- Runtime type information
81 TypeName("liquid");
82
83
84 // Constructors
85
86 //- Construct from dictionary
87 explicit liquid(const dictionary& dict);
88
89 //- Copy construct
90 liquid(const liquid& rhs);
91
92
93 //- Construct and return clone
94 virtual autoPtr<liquidProperties> clone() const
95 {
96 return autoPtr<liquidProperties>(new liquid(*this));
97 }
98
99
100 // Member Functions
101
102 //- Liquid density [kg/m^3]
103 inline scalar rho(scalar p, scalar T) const;
104
105 //- Vapour pressure [Pa]
106 inline scalar pv(scalar p, scalar T) const;
107
108 //- Heat of vapourisation [J/kg]
109 inline scalar hl(scalar p, scalar T) const;
110
111 //- Liquid heat capacity [J/(kg K)]
112 inline scalar Cp(scalar p, scalar T) const;
113
114 //- Liquid Enthalpy [J/(kg)]
115 inline scalar h(scalar p, scalar T) const;
116
117 //- Ideal gas heat capacity [J/(kg K)]
118 inline scalar Cpg(scalar p, scalar T) const;
119
120 //- Second Virial Coefficient [m^3/kg]
121 inline scalar B(scalar p, scalar T) const;
122
123 //- Liquid viscosity [Pa s]
124 inline scalar mu(scalar p, scalar T) const;
125
126 //- Vapour viscosity [Pa s]
127 inline scalar mug(scalar p, scalar T) const;
128
129 //- Liquid thermal conductivity [W/(m K)]
130 inline scalar kappa(scalar p, scalar T) const;
131
132 //- Vapour thermal conductivity [W/(m K)]
133 inline scalar kappag(scalar p, scalar T) const;
134
135 //- Surface tension [N/m]
136 inline scalar sigma(scalar p, scalar T) const;
137
138 //- Vapour diffusivity [m2/s]
139 inline scalar D(scalar p, scalar T) const;
140
141 //- Vapour diffusivity [m2/s] with specified binary pair
142 inline scalar D(scalar p, scalar T, scalar Wb) const;
143
144
145 // I-O
146
147 //- Write the function coefficients
148 void writeData(Ostream& os) const;
149};
150
151
152// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153
154} // End namespace Foam
155
156// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157
158#include "liquidI.H"
159
160// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161
162#endif
163
164// ************************************************************************* //
static const Foam::dimensionedScalar B("", Foam::dimless, 18.678)
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
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
TypeName("liquid")
Runtime type information.
scalar Cpg(scalar p, scalar T) const
Ideal gas heat capacity [J/(kg K)].
Definition: liquidI.H:58
void writeData(Ostream &os) const
Write the function coefficients.
Definition: liquid.C:116
virtual autoPtr< liquidProperties > clone() const
Construct and return clone.
Definition: liquid.H:93
scalar kappa(scalar p, scalar T) const
Liquid thermal conductivity [W/(m K)].
Definition: liquidI.H:82
scalar mug(scalar p, scalar T) const
Vapour viscosity [Pa s].
Definition: liquidI.H:76
scalar pv(scalar p, scalar T) const
Vapour pressure [Pa].
Definition: liquidI.H:34
scalar hl(scalar p, scalar T) const
Heat of vapourisation [J/kg].
Definition: liquidI.H:40
scalar kappag(scalar p, scalar T) const
Vapour thermal conductivity [W/(m K)].
Definition: liquidI.H:88
volScalarField & p
const volScalarField & T
const volScalarField & mu
const volScalarField & Cp
Definition: EEqn.H:7
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
dictionary dict
volScalarField & h
const dimensionedScalar & D
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73