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-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::liquidMixtureProperties
28
29Description
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
45SourceFiles
46 liquidMixtureProperties.C
47
48See 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
62namespace Foam
63{
64
65/*---------------------------------------------------------------------------*\
66 Class liquidMixtureProperties Declaration
67\*---------------------------------------------------------------------------*/
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
83public:
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// ************************************************************************* //
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: List.H:77
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: PtrList.H:73
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
Definition: Time.C:717
void size(const label n)
Older name for setAddressableSize.
Definition: UList.H:114
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
virtual autoPtr< liquidMixtureProperties > clone() const
Construct and return a clone.
virtual ~liquidMixtureProperties()=default
Destructor.
static autoPtr< liquidMixtureProperties > New(const dictionary &)
Select construct from dictionary.
scalar Tpc(const scalarField &X) const
Return pseudocritical temperature according to Kay's rule.
scalarField Xs(const scalar p, const scalar Tg, const scalar Tl, const scalarField &Xg, const scalarField &Xl) const
Return the surface molar fractions.
scalar omega(const scalarField &X) const
Return mixture accentric factor.
scalar Tpt(const scalarField &X) const
Return pseudo triple point temperature (mole averaged formulation)
scalar W(const scalarField &X) const
Calculate the mean molecular weight [kg/kmol].
scalar Tc(const scalarField &X) const
Calculate the critical temperature of mixture.
label size() const
Return the number of liquids in the mixture.
scalar pv(const scalar p, const scalar T, const scalarField &X) const
Calculate the mixture vapour pressure [Pa].
const List< word > & components() const
Return the liquid names.
scalar pvInvert(const scalar p, const scalarField &X) const
Invert the vapour pressure relationship to retrieve the boiling.
scalarField X(const scalarField &Y) const
Returns the mole fractions corresponding to the given mass fractions.
scalar Ppc(const scalarField &X) const
Return pseudocritical pressure (modified Prausnitz and Gunn)
scalar kappa(const scalar p, const scalar T, const scalarField &X) const
Estimate thermal conductivity [W/(m K)].
scalar hl(const scalar p, const scalar T, const scalarField &X) const
Calculate the mixture latent heat [J/kg].
const PtrList< liquidProperties > & properties() const
Return the liquid properties.
volScalarField & p
PtrList< volScalarField > & Y
const volScalarField & T
const volScalarField & mu
const volScalarField & Cp
Definition: EEqn.H:7
Namespace for OpenFOAM.
dictionary dict
const dimensionedScalar & D