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-2021 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  //- Construct and return clone
98  virtual autoPtr<liquidProperties> clone() const
99  {
100  return autoPtr<liquidProperties>(new liquid(*this));
101  }
102 
103 
104  // Member Functions
105 
106  //- Liquid density [kg/m^3]
107  inline scalar rho(scalar p, scalar T) const;
108 
109  //- Vapour pressure [Pa]
110  inline scalar pv(scalar p, scalar T) const;
111 
112  //- Heat of vapourisation [J/kg]
113  inline scalar hl(scalar p, scalar T) const;
114 
115  //- Liquid heat capacity [J/kg/K]
116  inline scalar Cp(scalar p, scalar T) const;
117 
118  //- Liquid sensible enthalpy [J/kg]
119  inline scalar Hs(scalar p, scalar T) const;
120 
121  //- Liquid heat of formation [J/kg]
122  inline scalar Hf() const;
123 
124  //- Liquid absolute enthalpy [J/kg]
125  inline scalar Ha(scalar p, scalar T) const;
126 
127  //- Ideal gas heat capacity [J/kg/K]
128  inline scalar Cpg(scalar p, scalar T) const;
129 
130  //- Second Virial Coefficient [m^3/kg]
131  inline scalar B(scalar p, scalar T) const;
132 
133  //- Liquid viscosity [Pa s]
134  inline scalar mu(scalar p, scalar T) const;
135 
136  //- Vapour viscosity [Pa s]
137  inline scalar mug(scalar p, scalar T) const;
138 
139  //- Liquid thermal conductivity [W/m/K]
140  inline scalar kappa(scalar p, scalar T) const;
141 
142  //- Vapour thermal conductivity [W/m/K]
143  inline scalar kappag(scalar p, scalar T) const;
144 
145  //- Surface tension [N/m]
146  inline scalar sigma(scalar p, scalar T) const;
147 
148  //- Vapour diffusivity [m^2/s]
149  inline scalar D(scalar p, scalar T) const;
150 
151  //- Vapour diffusivity [m^2/s] with specified binary pair
152  inline scalar D(scalar p, scalar T, scalar Wb) const;
153 
154 
155  // I-O
156 
157  //- Write the function coefficients
158  void write(Ostream& os) const;
159 };
160 
161 
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 
164 } // End namespace Foam
165 
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 
168 #include "liquidI.H"
169 
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 
172 #endif
173 
174 // ************************************************************************* //
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:98
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
scalar hl(scalar p, scalar T) const
Heat of vapourisation [J/kg].
Definition: liquidI.H:38
scalar mu(scalar p, scalar T) const
Liquid viscosity [Pa s].
Definition: liquidI.H:80
liquid(const dictionary &dict)
Construct from dictionary.
Definition: liquid.C:66
scalar Hf() const
Liquid heat of formation [J/kg].
Definition: liquidI.H:56
scalar Cpg(scalar p, scalar T) const
Ideal gas heat capacity [J/kg/K].
Definition: liquidI.H:68
virtual const word & name() const
Return the name of the liquid.
scalar B(scalar p, scalar T) const
Second Virial Coefficient [m^3/kg].
Definition: liquidI.H:74
scalar rho(scalar p, scalar T) const
Liquid density [kg/m^3].
Definition: liquidI.H:26
A class for handling words, derived from string.
Definition: word.H:59
The thermophysical properties of a liquid.
scalar Cp(scalar p, scalar T) const
Liquid heat capacity [J/kg/K].
Definition: liquidI.H:44
scalar D(scalar p, scalar T) const
Vapour diffusivity [m^2/s].
Definition: liquidI.H:110
scalar kappa(scalar p, scalar T) const
Liquid thermal conductivity [W/m/K].
Definition: liquidI.H:92
virtual autoPtr< liquidProperties > clone() const
Construct and return clone.
Definition: liquid.H:97
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
void write(Ostream &os) const
Write the function coefficients.
Definition: liquid.C:88
scalar mug(scalar p, scalar T) const
Vapour viscosity [Pa s].
Definition: liquidI.H:86
scalar Hs(scalar p, scalar T) const
Liquid sensible enthalpy [J/kg].
Definition: liquidI.H:50
scalar Ha(scalar p, scalar T) const
Liquid absolute enthalpy [J/kg].
Definition: liquidI.H:62
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
scalar pv(scalar p, scalar T) const
Vapour pressure [Pa].
Definition: liquidI.H:32
volScalarField & p
scalar sigma(scalar p, scalar T) const
Surface tension [N/m].
Definition: liquidI.H:104
Namespace for OpenFOAM.
TypeName("liquid")
Runtime type information.