liquid.H
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-2023 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 Class
25  Foam::liquid
26 
27 Description
28  Generic thermophysical properties class for a liquid in which the
29  functions and coefficients for each property are run-time selected.
30 
31 SourceFiles
32  liquid.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef liquid_H
37 #define liquid_H
38 
39 #include "liquidProperties.H"
40 #include "Function1.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class liquid Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 class liquid
52 :
53  public liquidProperties
54 {
55  // Private Data
56 
70 
71  //- Liquid heat of formation [J/kg]
72  scalar Hf_;
73 
74 
75  // Private Member Functions
76 
78  (
79  const word& name,
80  const dictionary& dict
81  );
82 
83 
84 public:
85 
86  friend class liquidProperties;
87 
88  //- Runtime type information
89  TypeName("liquid");
90 
91 
92  // Constructors
93 
94  //- Construct from dictionary
95  liquid(const dictionary& dict);
96 
97  //- Copy constructor
98  liquid(const liquid& lm);
99 
100  //- Construct and return clone
101  virtual autoPtr<liquidProperties> clone() const
102  {
103  return autoPtr<liquidProperties>(new liquid(*this));
104  }
105 
106 
107  // Member Functions
108 
109  //- Liquid density [kg/m^3]
110  inline scalar rho(scalar p, scalar T) const;
111 
112  //- Vapour pressure [Pa]
113  inline scalar pv(scalar p, scalar T) const;
114 
115  //- Heat of vapourisation [J/kg]
116  inline scalar hl(scalar p, scalar T) const;
117 
118  //- Liquid heat capacity [J/kg/K]
119  inline scalar Cp(scalar p, scalar T) const;
120 
121  //- Liquid sensible enthalpy [J/kg]
122  inline scalar Hs(scalar p, scalar T) const;
123 
124  //- Liquid heat of formation [J/kg]
125  inline scalar Hf() const;
126 
127  //- Liquid absolute enthalpy [J/kg]
128  inline scalar Ha(scalar p, scalar T) const;
129 
130  //- Ideal gas heat capacity [J/kg/K]
131  inline scalar Cpg(scalar p, scalar T) const;
132 
133  //- Second Virial Coefficient [m^3/kg]
134  inline scalar B(scalar p, scalar T) const;
135 
136  //- Liquid viscosity [Pa s]
137  inline scalar mu(scalar p, scalar T) const;
138 
139  //- Vapour viscosity [Pa s]
140  inline scalar mug(scalar p, scalar T) const;
141 
142  //- Liquid thermal conductivity [W/m/K]
143  inline scalar kappa(scalar p, scalar T) const;
144 
145  //- Vapour thermal conductivity [W/m/K]
146  inline scalar kappag(scalar p, scalar T) const;
147 
148  //- Surface tension [N/m]
149  inline scalar sigma(scalar p, scalar T) const;
150 
151  //- Vapour diffusivity [m^2/s]
152  inline scalar D(scalar p, scalar T) const;
153 
154  //- Vapour diffusivity [m^2/s] with specified binary pair
155  inline scalar D(scalar p, scalar T, scalar Wb) const;
156 
157 
158  // I-O
159 
160  //- Write the function coefficients
161  void write(Ostream& os) const;
162 };
163 
164 
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 
167 } // End namespace Foam
168 
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 
171 #include "liquidI.H"
172 
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 
175 #endif
176 
177 // ************************************************************************* //
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
The thermophysical properties of a liquid.
virtual const word & name() const
Return the name of the liquid.
Generic thermophysical properties class for a liquid in which the functions and coefficients for each...
Definition: liquid.H:53
scalar Hf() const
Liquid heat of formation [J/kg].
Definition: liquidI.H:56
scalar B(scalar p, scalar T) const
Second Virial Coefficient [m^3/kg].
Definition: liquidI.H:74
TypeName("liquid")
Runtime type information.
scalar D(scalar p, scalar T) const
Vapour diffusivity [m^2/s].
Definition: liquidI.H:110
scalar mu(scalar p, scalar T) const
Liquid viscosity [Pa s].
Definition: liquidI.H:80
scalar Ha(scalar p, scalar T) const
Liquid absolute enthalpy [J/kg].
Definition: liquidI.H:62
scalar Cpg(scalar p, scalar T) const
Ideal gas heat capacity [J/kg/K].
Definition: liquidI.H:68
void write(Ostream &os) const
Write the function coefficients.
Definition: liquid.C:109
scalar rho(scalar p, scalar T) const
Liquid density [kg/m^3].
Definition: liquidI.H:26
scalar sigma(scalar p, scalar T) const
Surface tension [N/m].
Definition: liquidI.H:104
scalar kappa(scalar p, scalar T) const
Liquid thermal conductivity [W/m/K].
Definition: liquidI.H:92
scalar Hs(scalar p, scalar T) const
Liquid sensible enthalpy [J/kg].
Definition: liquidI.H:50
scalar Cp(scalar p, scalar T) const
Liquid heat capacity [J/kg/K].
Definition: liquidI.H:44
scalar mug(scalar p, scalar T) const
Vapour viscosity [Pa s].
Definition: liquidI.H:86
scalar pv(scalar p, scalar T) const
Vapour pressure [Pa].
Definition: liquidI.H:32
liquid(const dictionary &dict)
Construct from dictionary.
Definition: liquid.C:66
scalar hl(scalar p, scalar T) const
Heat of vapourisation [J/kg].
Definition: liquidI.H:38
scalar kappag(scalar p, scalar T) const
Vapour thermal conductivity [W/m/K].
Definition: liquidI.H:98
virtual autoPtr< liquidProperties > clone() const
Construct and return clone.
Definition: liquid.H:100
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
dictionary dict
volScalarField & p