coefficientWilkeMulticomponentMixture.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) 2020-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::coefficientWilkeMulticomponentMixture
26 
27 Description
28  Thermophysical properties mixing class which applies mass-fraction weighted
29  mixing to the thermodynamic coefficients and Wilke's equation to
30  transport properties.
31 
32  Reference:
33  \verbatim
34  Wilke, C. R. (1950).
35  A viscosity equation for gas mixtures.
36  The journal of chemical physics, 18(4), 517-519.
37  \endverbatim
38 
39 SourceFiles
40  coefficientWilkeMulticomponentMixture.C
41 
42 \*---------------------------------------------------------------------------*/
43 
44 #ifndef coefficientWilkeMulticomponentMixture_H
45 #define coefficientWilkeMulticomponentMixture_H
46 
47 #include "multicomponentMixture.H"
48 #include "FieldListSlice.H"
49 #include "scalarMatrices.H"
50 
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 
53 namespace Foam
54 {
55 
56 /*---------------------------------------------------------------------------*\
57  Class coefficientWilkeMulticomponentMixture Declaration
58 \*---------------------------------------------------------------------------*/
59 
60 template<class ThermoType>
62 :
63  public multicomponentMixture<ThermoType>
64 {
65 public:
66 
67  // Public Classes/Typedefs
68 
69  //- Mixing type for thermodynamic properties
70  typedef typename ThermoType::thermoType thermoMixtureType;
71 
72  //- Mixing type for transport properties
74  {
75  // Private Data
76 
77  //- List of specie thermo
78  const PtrList<ThermoType>& specieThermos_;
79 
80  //- List of molecular weights
81  scalarList M_;
82 
83  //- Matrix of (4/sqrt(2.0))*sqrt(1 + M_[i]/M_[j])
85 
86  //- Matrix of sqrt(M_[j]/M_[i])
88 
89  //- List of mole fractions
90  mutable scalarList X_;
91 
92  //- List of specie viscosities
93  mutable scalarList mu_;
94 
95  //- List of Wilke weights
96  mutable scalarList w_;
97 
98  //- Viscosity cache state to avoid recalculation of the Wilke
99  // weight for kappa
100  mutable bool muCached_;
101 
102  //- Calculate the Wilke weights and store in w_
103  void WilkeWeights(const scalar p, const scalar T) const;
104 
105 
106  public:
107 
109 
110 
111  // Constructors
112 
113  //- Construct from list of specie thermo
115 
116 
117  // Transport properties
118 
119  //- Dynamic viscosity [kg/m/s]
120  scalar mu(const scalar p, const scalar T) const;
121 
122  //- Thermal conductivity [W/m/K]
123  scalar kappa(const scalar p, const scalar T) const;
124  };
125 
126 
127 private:
128 
129  // Private Data
130 
131  //- Temporary storage for the cell/face mixture thermo data
132  mutable thermoMixtureType mixture_;
133 
134  //- Mutable storage for the cell/face mixture transport data
135  mutable transportMixtureType transportMixture_;
136 
137 
138 public:
139 
140  // Constructors
141 
142  //- Construct from a dictionary
144 
145  //- Disallow default bitwise copy construction
147  (
149  ) = delete;
150 
151 
152  //- Destructor
154  {}
155 
156 
157  // Member Functions
158 
159  //- Return the instantiated type name
160  static word typeName()
161  {
162  return
163  "coefficientWilkeMulticomponentMixture<"
164  + ThermoType::typeName() + '>';
165  }
166 
167  //- Return the mixture for thermodynamic properties
169  (
170  const scalarFieldListSlice&
171  ) const;
172 
173  //- Return the mixture for transport properties
174  const transportMixtureType& transportMixture
175  (
176  const scalarFieldListSlice&
177  ) const;
178 
179  //- Return the mixture for transport properties
180  const transportMixtureType& transportMixture
181  (
182  const scalarFieldListSlice&,
183  const thermoMixtureType&
184  ) const;
185 };
186 
187 
188 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189 
190 } // End namespace Foam
191 
192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
193 
194 #ifdef NoRepository
196 #endif
197 
198 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
199 
200 #endif
201 
202 // ************************************************************************* //
scalar mu(const scalar p, const scalar T) const
Dynamic viscosity [kg/m/s].
transportMixtureType(const PtrList< ThermoType > &specieThermos)
Construct from list of specie thermo.
scalar kappa(const scalar p, const scalar T) const
Thermal conductivity [W/m/K].
Thermophysical properties mixing class which applies mass-fraction weighted mixing to the thermodynam...
const thermoMixtureType & thermoMixture(const scalarFieldListSlice &) const
Return the mixture for thermodynamic properties.
static word typeName()
Return the instantiated type name.
coefficientWilkeMulticomponentMixture(const dictionary &)
Construct from a dictionary.
const transportMixtureType & transportMixture(const scalarFieldListSlice &) const
Return the mixture for transport properties.
ThermoType::thermoType thermoMixtureType
Mixing type for thermodynamic properties.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
Foam::multicomponentMixture.
const PtrList< ThermoType > & specieThermos() const
Return the raw specie thermodynamic data.
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)
volScalarField & p