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 // ************************************************************************* //
Foam::liquid::pv
scalar pv(scalar p, scalar T) const
Vapour pressure [Pa].
Definition: liquidI.H:34
Foam::liquid::mug
scalar mug(scalar p, scalar T) const
Vapour viscosity [Pa s].
Definition: liquidI.H:76
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::liquid::Cp
scalar Cp(scalar p, scalar T) const
Liquid heat capacity [J/(kg K)].
Definition: liquidI.H:46
Foam::liquid::D
scalar D(scalar p, scalar T) const
Vapour diffusivity [m2/s].
Definition: liquidI.H:100
Foam::liquid::TypeName
TypeName("liquid")
Runtime type information.
Function1.H
Foam::liquid::B
scalar B(scalar p, scalar T) const
Second Virial Coefficient [m^3/kg].
Definition: liquidI.H:64
Foam::liquid::Cpg
scalar Cpg(scalar p, scalar T) const
Ideal gas heat capacity [J/(kg K)].
Definition: liquidI.H:58
Foam::liquid
Generic thermophysical properties class for a liquid in which the functions and coefficients for each...
Definition: liquid.H:54
Foam::liquid::hl
scalar hl(scalar p, scalar T) const
Heat of vapourisation [J/kg].
Definition: liquidI.H:40
Foam::liquid::kappag
scalar kappag(scalar p, scalar T) const
Vapour thermal conductivity [W/(m K)].
Definition: liquidI.H:88
Foam::liquidProperties
The thermophysical properties of a liquid.
Definition: liquidProperties.H:51
Foam::T
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Definition: FieldFieldFunctions.C:58
liquidI.H
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::liquid::kappa
scalar kappa(scalar p, scalar T) const
Liquid thermal conductivity [W/(m K)].
Definition: liquidI.H:82
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
os
OBJstream os(runTime.globalPath()/outputName)
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::liquid::writeData
void writeData(Ostream &os) const
Write the function coefficients.
Definition: liquid.C:116
liquidProperties.H
Foam::liquid::rho
scalar rho(scalar p, scalar T) const
Liquid density [kg/m^3].
Definition: liquidI.H:28
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::liquid::clone
virtual autoPtr< liquidProperties > clone() const
Construct and return clone.
Definition: liquid.H:93
Foam::liquid::liquid
liquid(const dictionary &dict)
Construct from dictionary.
Definition: liquid.C:75
Foam::liquid::sigma
scalar sigma(scalar p, scalar T) const
Surface tension [N/m].
Definition: liquidI.H:94
Foam::liquid::h
scalar h(scalar p, scalar T) const
Liquid Enthalpy [J/(kg)].
Definition: liquidI.H:52
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::liquid::mu
scalar mu(scalar p, scalar T) const
Liquid viscosity [Pa s].
Definition: liquidI.H:70