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-2024 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 dimensionSet& dims,
81  const dictionary& dict
82  );
83 
84 
85 public:
86 
87  friend class liquidProperties;
88 
89  //- Runtime type information
90  TypeName("liquid");
91 
92 
93  // Constructors
94 
95  //- Construct from dictionary
96  liquid(const dictionary& dict);
97 
98  //- Copy constructor
99  liquid(const liquid& lm);
100 
101  //- Construct and return clone
102  virtual autoPtr<liquidProperties> clone() const
103  {
104  return autoPtr<liquidProperties>(new liquid(*this));
105  }
106 
107 
108  // Member Functions
109 
110  //- Liquid density [kg/m^3]
111  inline scalar rho(scalar p, scalar T) const;
112 
113  //- Vapour pressure [Pa]
114  inline scalar pv(scalar p, scalar T) const;
115 
116  //- Heat of vapourisation [J/kg]
117  inline scalar hl(scalar p, scalar T) const;
118 
119  //- Liquid heat capacity [J/kg/K]
120  inline scalar Cp(scalar p, scalar T) const;
121 
122  //- Liquid sensible enthalpy [J/kg]
123  inline scalar hs(scalar p, scalar T) const;
124 
125  //- Liquid heat of formation [J/kg]
126  inline scalar hf() const;
127 
128  //- Liquid absolute enthalpy [J/kg]
129  inline scalar ha(scalar p, scalar T) const;
130 
131  //- Ideal gas heat capacity [J/kg/K]
132  inline scalar Cpg(scalar p, scalar T) const;
133 
134  //- Second Virial Coefficient [m^3/kg]
135  inline scalar B(scalar p, scalar T) const;
136 
137  //- Liquid viscosity [Pa s]
138  inline scalar mu(scalar p, scalar T) const;
139 
140  //- Vapour viscosity [Pa s]
141  inline scalar mug(scalar p, scalar T) const;
142 
143  //- Liquid thermal conductivity [W/m/K]
144  inline scalar kappa(scalar p, scalar T) const;
145 
146  //- Vapour thermal conductivity [W/m/K]
147  inline scalar kappag(scalar p, scalar T) const;
148 
149  //- Surface tension [N/m]
150  inline scalar sigma(scalar p, scalar T) const;
151 
152  //- Vapour diffusivity [m^2/s]
153  inline scalar D(scalar p, scalar T) const;
154 
155  //- Vapour diffusivity [m^2/s] with specified binary pair
156  inline scalar D(scalar p, scalar T, scalar Wb) const;
157 
158 
159  // I-O
160 
161  //- Write the function coefficients
162  void write(Ostream& os) const;
163 };
164 
165 
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 
168 } // End namespace Foam
169 
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 
172 #include "liquidI.H"
173 
174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 
176 #endif
177 
178 // ************************************************************************* //
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:162
Dimension set for the base types.
Definition: dimensionSet.H:125
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 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 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:107
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 Cp(scalar p, scalar T) const
Liquid heat capacity [J/kg/K].
Definition: liquidI.H:44
scalar hf() const
Liquid heat of formation [J/kg].
Definition: liquidI.H:56
scalar hs(scalar p, scalar T) const
Liquid sensible enthalpy [J/kg].
Definition: liquidI.H:50
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:64
scalar ha(scalar p, scalar T) const
Liquid absolute enthalpy [J/kg].
Definition: liquidI.H:62
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:101
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