liquidMixtureProperties.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) 2011-2017 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::liquidMixtureProperties
28 
29 Description
30  A mixture of liquids
31 
32  An example of a two component liquid mixture:
33  \verbatim
34  <parentDictionary>
35  {
36  H2O; // employ default coefficients
37 
38  C7H16
39  {
40  // ... user defined properties for C7H16
41  }
42  }
43  \endverbatim
44 
45 SourceFiles
46  liquidMixtureProperties.C
47 
48 See also
49  Foam::liquidProperties
50 
51 \*---------------------------------------------------------------------------*/
52 
53 #ifndef liquidMixtureProperties_H
54 #define liquidMixtureProperties_H
55 
56 #include "liquidProperties.H"
57 #include "PtrList.H"
58 #include "scalarField.H"
59 
60 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
61 
62 namespace Foam
63 {
64 
65 /*---------------------------------------------------------------------------*\
66  Class liquidMixtureProperties Declaration
67 \*---------------------------------------------------------------------------*/
68 
70 {
71  // Private data
72 
73  //- Maximum reduced temperature
74  static const scalar TrMax;
75 
76  //- The names of the liquids
77  List<word> components_;
78 
79  //- The liquid properties
80  PtrList<liquidProperties> properties_;
81 
82 
83 public:
84 
85  // Constructors
86 
87  //- Construct from dictionary
89 
90  //- Construct copy
92 
93  //- Construct and return a clone
95  {
97  }
98 
99 
100  //- Destructor
101  virtual ~liquidMixtureProperties() = default;
102 
103 
104  // Selectors
105 
106  //- Select construct from dictionary
108 
109 
110  // Member Functions
111 
112  //- Return the liquid names
113  inline const List<word>& components() const
114  {
115  return components_;
116  }
117 
118  //- Return the liquid properties
119  inline const PtrList<liquidProperties>& properties() const
120  {
121  return properties_;
122  }
123 
124  //- Return the number of liquids in the mixture
125  inline label size() const
126  {
127  return components_.size();
128  }
129 
130  //- Calculate the critical temperature of mixture
131  scalar Tc(const scalarField& X) const;
132 
133  //- Invert the vapour pressure relationship to retrieve the boiling
134  // temperature of the mixture as a function of pressure
135  scalar pvInvert(const scalar p, const scalarField& X) const;
136 
137  //- Return pseudocritical temperature according to Kay's rule
138  scalar Tpc(const scalarField& X) const;
139 
140  //- Return pseudocritical pressure (modified Prausnitz and Gunn)
141  scalar Ppc(const scalarField& X) const;
142 
143  //- Return pseudo triple point temperature (mole averaged formulation)
144  scalar Tpt(const scalarField& X) const;
145 
146  //- Return mixture accentric factor
147  scalar omega(const scalarField& X) const;
148 
149  //- Return the surface molar fractions
151  (
152  const scalar p,
153  const scalar Tg,
154  const scalar Tl,
155  const scalarField& Xg,
156  const scalarField& Xl
157  ) const;
158 
159  //- Calculate the mean molecular weight [kg/kmol]
160  // from mole fractions
161  scalar W(const scalarField& X) const;
162 
163  //- Returns the mass fractions corresponding to the given mole fractions
164  scalarField Y(const scalarField& X) const;
165 
166  //- Returns the mole fractions corresponding to the given mass fractions
167  scalarField X(const scalarField& Y) const;
168 
169  //- Calculate the mixture density [kg/m^3]
170  scalar rho
171  (
172  const scalar p,
173  const scalar T,
174  const scalarField& X
175  ) const;
176 
177  //- Calculate the mixture vapour pressure [Pa]
178  scalar pv
179  (
180  const scalar p,
181  const scalar T,
182  const scalarField& X
183  ) const;
184 
185  //- Calculate the mixture latent heat [J/kg]
186  scalar hl
187  (
188  const scalar p,
189  const scalar T,
190  const scalarField& X
191  ) const;
192 
193  //- Calculate the mixture heat capacity [J/(kg K)]
194  scalar Cp
195  (
196  const scalar p,
197  const scalar T,
198  const scalarField& X
199  ) const;
200 
201  //- Estimate mixture surface tension [N/m]
202  scalar sigma
203  (
204  const scalar p,
205  const scalar T,
206  const scalarField& X
207  ) const;
208 
209  //- Calculate the mixture viscosity [Pa s]
210  scalar mu
211  (
212  const scalar p,
213  const scalar T,
214  const scalarField& X
215  ) const;
216 
217  //- Estimate thermal conductivity [W/(m K)]
218  // Li's method, Eq. 10-12.27 - 10.12-19
219  scalar kappa
220  (
221  const scalar p,
222  const scalar T,
223  const scalarField& X
224  ) const;
225 
226  //- Vapour diffusivity [m2/s]
227  scalar D
228  (
229  const scalar p,
230  const scalar T,
231  const scalarField& X
232  ) const;
233 };
234 
235 
236 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
237 
238 } // End namespace Foam
239 
240 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
241 
242 #endif
243 
244 // ************************************************************************* //
Foam::autoPtr::New
static autoPtr< T > New(Args &&... args)
Construct autoPtr of T with forwarding arguments.
Foam::liquidMixtureProperties::pvInvert
scalar pvInvert(const scalar p, const scalarField &X) const
Invert the vapour pressure relationship to retrieve the boiling.
Definition: liquidMixtureProperties.C:132
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::liquidMixtureProperties::Xs
scalarField Xs(const scalar p, const scalar Tg, const scalar Tl, const scalarField &Xg, const scalarField &Xl) const
Return the surface molar fractions.
Definition: liquidMixtureProperties.C:217
Foam::liquidMixtureProperties::size
label size() const
Return the number of liquids in the mixture.
Definition: liquidMixtureProperties.H:124
scalarField.H
Foam::liquidMixtureProperties::Tc
scalar Tc(const scalarField &X) const
Calculate the critical temperature of mixture.
Definition: liquidMixtureProperties.C:102
Foam::liquidMixtureProperties::hl
scalar hl(const scalar p, const scalar T, const scalarField &X) const
Calculate the mixture latent heat [J/kg].
Definition: liquidMixtureProperties.C:342
Foam::liquidMixtureProperties::Y
scalarField Y(const scalarField &X) const
Returns the mass fractions corresponding to the given mole fractions.
Definition: liquidMixtureProperties.C:251
Foam::liquidMixtureProperties::mu
scalar mu(const scalar p, const scalar T, const scalarField &X) const
Calculate the mixture viscosity [Pa s].
Definition: liquidMixtureProperties.C:431
Foam::liquidMixtureProperties::kappa
scalar kappa(const scalar p, const scalar T, const scalarField &X) const
Estimate thermal conductivity [W/(m K)].
Definition: liquidMixtureProperties.C:453
Foam::liquidMixtureProperties::Tpc
scalar Tpc(const scalarField &X) const
Return pseudocritical temperature according to Kay's rule.
Definition: liquidMixtureProperties.C:175
Foam::liquidMixtureProperties::New
static autoPtr< liquidMixtureProperties > New(const dictionary &)
Select construct from dictionary.
Definition: liquidMixtureProperties.C:92
Foam::liquidMixtureProperties::rho
scalar rho(const scalar p, const scalar T, const scalarField &X) const
Calculate the mixture density [kg/m^3].
Definition: liquidMixtureProperties.C:286
Foam::liquidMixtureProperties::liquidMixtureProperties
liquidMixtureProperties(const dictionary &dict)
Construct from dictionary.
Definition: liquidMixtureProperties.C:41
Foam::liquidMixtureProperties::X
scalarField X(const scalarField &Y) const
Returns the mole fractions corresponding to the given mass fractions.
Definition: liquidMixtureProperties.C:268
Foam::liquidMixtureProperties::sigma
scalar sigma(const scalar p, const scalar T, const scalarField &X) const
Estimate mixture surface tension [N/m].
Definition: liquidMixtureProperties.C:394
Foam::liquidMixtureProperties::Tpt
scalar Tpt(const scalarField &X) const
Return pseudo triple point temperature (mole averaged formulation)
Definition: liquidMixtureProperties.C:118
Foam::Field< scalar >
Foam::T
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Definition: FieldFieldFunctions.C:58
Foam::PtrList
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: List.H:59
Foam::liquidMixtureProperties::components
const List< word > & components() const
Return the liquid names.
Definition: liquidMixtureProperties.H:112
Foam::liquidMixtureProperties::Ppc
scalar Ppc(const scalarField &X) const
Return pseudocritical pressure (modified Prausnitz and Gunn)
Definition: liquidMixtureProperties.C:188
Foam::liquidMixtureProperties::~liquidMixtureProperties
virtual ~liquidMixtureProperties()=default
Destructor.
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::liquidMixtureProperties::W
scalar W(const scalarField &X) const
Calculate the mean molecular weight [kg/kmol].
Definition: liquidMixtureProperties.C:238
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::liquidMixtureProperties::D
scalar D(const scalar p, const scalar T, const scalarField &X) const
Vapour diffusivity [m2/s].
Definition: liquidMixtureProperties.C:499
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
liquidProperties.H
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::liquidMixtureProperties::Cp
scalar Cp(const scalar p, const scalar T, const scalarField &X) const
Calculate the mixture heat capacity [J/(kg K)].
Definition: liquidMixtureProperties.C:368
Foam::liquidMixtureProperties
A mixture of liquids.
Definition: liquidMixtureProperties.H:68
Foam::liquidMixtureProperties::pv
scalar pv(const scalar p, const scalar T, const scalarField &X) const
Calculate the mixture vapour pressure [Pa].
Definition: liquidMixtureProperties.C:316
Foam::List< word >
Foam::liquidMixtureProperties::omega
scalar omega(const scalarField &X) const
Return mixture accentric factor.
Definition: liquidMixtureProperties.C:203
PtrList.H
Foam::liquidMixtureProperties::properties
const PtrList< liquidProperties > & properties() const
Return the liquid properties.
Definition: liquidMixtureProperties.H:118
Foam::liquidMixtureProperties::clone
virtual autoPtr< liquidMixtureProperties > clone() const
Construct and return a clone.
Definition: liquidMixtureProperties.H:93