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 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 "scalarMatrices.H"
49 
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 
52 namespace Foam
53 {
54 
55 /*---------------------------------------------------------------------------*\
56  Class coefficientWilkeMultiComponentMixture Declaration
57 \*---------------------------------------------------------------------------*/
58 
59 template<class ThermoType>
61 :
62  public multiComponentMixture<ThermoType>
63 {
64 
65 public:
66 
67  class transportMixture
68  {
69  //- List of specie thermo
70  const PtrList<ThermoType>& specieThermos_;
71 
72  //- List of molecular weights
73  scalarList M_;
74 
75  //- Matrix of (4/sqrt(2.0))*sqrt(1 + M_[i]/M_[j])
77 
78  //- Matrix of sqrt(M_[j]/M_[i])
80 
81  //- List of mole fractions
82  mutable scalarList X_;
83 
84  //- List of specie viscosities
85  mutable scalarList mu_;
86 
87  //- List of Wilke weights
88  mutable scalarList w_;
89 
90  //- mu cache state to avoid recalculation of the Wilke weight for kappa
91  mutable bool muCached_;
92 
93  //- Calculate the Wilke weights and store in w_
94  void WilkeWeights(const scalar p, const scalar T) const;
95 
96 
97  public:
98 
100 
101  // Constructors
102 
104  (
106  );
107 
108 
109  // Transport properties
110 
111  //- Dynamic viscosity [kg/m/s]
112  scalar mu(const scalar p, const scalar T) const;
113 
114  //- Thermal conductivity [W/m/K]
115  scalar kappa(const scalar p, const scalar T) const;
116  };
117 
118 
119 public:
120 
121  //- Mixing type for thermodynamic properties
122  typedef typename ThermoType::thermoType thermoMixtureType;
123 
124  //- Mixing type for transport properties
126 
127 
128 private:
129 
130  // Private Data
131 
132  //- Temporary storage for the cell/face mixture thermo data
133  mutable thermoMixtureType mixture_;
134 
135  //- Mutable storage for the cell/face mixture transport data
136  mutable transportMixtureType transportMixture_;
137 
138 
139 public:
140 
141  // Constructors
142 
143  //- Construct from dictionary, mesh and phase name
145  (
146  const dictionary&,
147  const fvMesh&,
148  const word&
149  );
150 
151  //- Disallow default bitwise copy construction
153  (
155  ) = delete;
156 
157 
158  //- Destructor
160  {}
161 
162 
163  // Member Functions
164 
165  //- Return the instantiated type name
166  static word typeName()
167  {
168  return
169  "coefficientWilkeMultiComponentMixture<"
170  + ThermoType::typeName() + '>';
171  }
172 
173  const thermoMixtureType& cellThermoMixture(const label celli) const;
174 
175  const thermoMixtureType& patchFaceThermoMixture
176  (
177  const label patchi,
178  const label facei
179  ) const;
180 
181  const transportMixtureType& cellTransportMixture
182  (
183  const label celli
184  ) const;
185 
186  const transportMixtureType& patchFaceTransportMixture
187  (
188  const label patchi,
189  const label facei
190  ) const;
191 
192  const transportMixtureType& cellTransportMixture
193  (
194  const label celli,
195  const thermoMixtureType& thermoMixture
196  ) const;
197 
198  const transportMixtureType& patchFaceTransportMixture
199  (
200  const label patchi,
201  const label facei,
202  const thermoMixtureType& thermoMixture
203  ) const;
204 };
205 
206 
207 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
208 
209 } // End namespace Foam
210 
211 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
212 
213 #ifdef NoRepository
215 #endif
216 
217 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
218 
219 #endif
220 
221 // ************************************************************************* //
const thermoMixtureType & cellThermoMixture(const label celli) const
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Thermophysical properties mixing class which applies mass-fraction weighted mixing to the thermodynam...
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
const thermoMixtureType & patchFaceThermoMixture(const label patchi, const label facei) const
const transportMixtureType & cellTransportMixture(const label celli) const
const PtrList< ThermoType > & specieThermos() const
Return the raw specie thermodynamic data.
A class for handling words, derived from string.
Definition: word.H:59
Foam::multiComponentMixture.
scalar mu(const scalar p, const scalar T) const
Dynamic viscosity [kg/m/s].
const transportMixtureType & patchFaceTransportMixture(const label patchi, const label facei) const
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
label patchi
scalar kappa(const scalar p, const scalar T) const
Thermal conductivity [W/m/K].
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
transportMixture transportMixtureType
Mixing type for transport properties.
volScalarField & p
ThermoType::thermoType thermoMixtureType
Mixing type for thermodynamic properties.
static word typeName()
Return the instantiated type name.
Namespace for OpenFOAM.