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 -------------------------------------------------------------------------------
11 License
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 Class
28  Foam::liquid
29 
30 Description
31  Generic thermophysical properties class for a liquid in which the
32  functions and coefficients for each property are run-time selected.
33 
34 SourceFiles
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 
48 namespace Foam
49 {
50 
51 /*---------------------------------------------------------------------------*\
52  Class liquid Declaration
53 \*---------------------------------------------------------------------------*/
54 
55 class liquid
56 :
57  public liquidProperties
58 {
59  // Private Data
60 
74 
75 
76 public:
77 
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 // ************************************************************************* //
Generic thermophysical properties class for a liquid in which the functions and coefficients for each...
Definition: liquid.H:50
dictionary dict
scalar kappag(scalar p, scalar T) const
Vapour thermal conductivity [W/(m K)].
Definition: liquidI.H:81
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
scalar hl(scalar p, scalar T) const
Heat of vapourisation [J/kg].
Definition: liquidI.H:33
scalar mu(scalar p, scalar T) const
Liquid viscosity [Pa s].
Definition: liquidI.H:63
liquid(const dictionary &dict)
Construct from dictionary.
Definition: liquid.C:68
scalar Cpg(scalar p, scalar T) const
Ideal gas heat capacity [J/(kg K)].
Definition: liquidI.H:51
void writeData(Ostream &os) const
Write the function coefficients.
Definition: liquid.C:109
scalar B(scalar p, scalar T) const
Second Virial Coefficient [m^3/kg].
Definition: liquidI.H:57
scalar rho(scalar p, scalar T) const
Liquid density [kg/m^3].
Definition: liquidI.H:21
The thermophysical properties of a liquid.
scalar Cp(scalar p, scalar T) const
Liquid heat capacity [J/(kg K)].
Definition: liquidI.H:39
scalar D(scalar p, scalar T) const
Vapour diffusivity [m2/s].
Definition: liquidI.H:93
scalar kappa(scalar p, scalar T) const
Liquid thermal conductivity [W/(m K)].
Definition: liquidI.H:75
virtual autoPtr< liquidProperties > clone() const
Construct and return clone.
Definition: liquid.H:97
scalar h(scalar p, scalar T) const
Liquid Enthalpy [J/(kg)].
Definition: liquidI.H:45
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
OBJstream os(runTime.globalPath()/outputName)
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
scalar mug(scalar p, scalar T) const
Vapour viscosity [Pa s].
Definition: liquidI.H:69
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
scalar pv(scalar p, scalar T) const
Vapour pressure [Pa].
Definition: liquidI.H:27
volScalarField & p
scalar sigma(scalar p, scalar T) const
Surface tension [N/m].
Definition: liquidI.H:87
Namespace for OpenFOAM.
TypeName("liquid")
Runtime type information.