SpecieMixture.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) 2011-2022 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::SpecieMixture
26 
27 Description
28  Foam::SpecieMixture
29 
30 SourceFiles
31  SpecieMixture.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef SpecieMixture_H
36 #define SpecieMixture_H
37 
38 #include "scalar.H"
39 #include "volFields.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 // Forward declaration of classes
47 class dictionary;
48 class fvMesh;
49 
50 
51 /*---------------------------------------------------------------------------*\
52  Class SpecieMixture Declaration
53 \*---------------------------------------------------------------------------*/
54 
55 template<class MixtureType>
56 class SpecieMixture
57 :
58  public MixtureType
59 {
60 
61  // Private Member Functions
62 
63  //- Return a volScalarField of the given property
64  tmp<volScalarField> volScalarFieldProperty
65  (
66  const word& psiName,
67  const dimensionSet& psiDim,
68  scalar (MixtureType::thermoType::*psiMethod)
69  (
70  const scalar,
71  const scalar
72  ) const,
73  const label speciei,
74  const volScalarField& p,
75  const volScalarField& T
76  ) const;
77 
78  //- Return a field of the given property
79  tmp<scalarField> fieldProperty
80  (
81  scalar (MixtureType::thermoType::*psiMethod)
82  (
83  const scalar,
84  const scalar
85  ) const,
86  const label speciei,
87  const scalarField& p,
88  const scalarField& T
89  ) const;
90 
91 
92 public:
93 
94  // Constructors
95 
96  //- Construct from dictionary, mesh and phase name
97  SpecieMixture(const dictionary&, const fvMesh&, const word& phaseName);
98 
99 
100  //- Destructor
101  virtual ~SpecieMixture()
102  {}
103 
104 
105  // Member Functions
106 
107  // Specie properties
108 
109  //- Molecular weight of the given specie [kg/kmol]
110  virtual scalar Wi(const label speciei) const;
111 
112  //- Enthalpy of formation [J/kg]
113  virtual scalar Hf(const label speciei) const;
114 
115  //- Density [kg/m^3]
116  virtual scalar rho
117  (
118  const label speciei,
119  const scalar p,
120  const scalar T
121  ) const;
122 
123  //- Density [kg/m^3]
124  virtual tmp<volScalarField> rho
125  (
126  const label speciei,
127  const volScalarField& p,
128  const volScalarField& T
129  ) const;
130 
131  //- Heat capacity at constant pressure [J/kg/K]
132  virtual scalar Cp
133  (
134  const label speciei,
135  const scalar p,
136  const scalar T
137  ) const;
138 
139  //- Heat capacity at constant pressure [J/kg/K]
140  virtual tmp<volScalarField> Cp
141  (
142  const label speciei,
143  const volScalarField& p,
144  const volScalarField& T
145  ) const;
146 
147  //- Enthalpy/Internal energy [J/kg]
148  virtual scalar HE
149  (
150  const label speciei,
151  const scalar p,
152  const scalar T
153  ) const;
154 
155  //- Enthalpy/Internal energy [J/kg]
156  virtual tmp<scalarField> HE
157  (
158  const label speciei,
159  const scalarField& p,
160  const scalarField& T
161  ) const;
162 
163  //- Enthalpy/Internal energy [J/kg]
164  virtual tmp<volScalarField> HE
165  (
166  const label speciei,
167  const volScalarField& p,
168  const volScalarField& T
169  ) const;
170 
171  //- Sensible enthalpy [J/kg]
172  virtual scalar Hs
173  (
174  const label speciei,
175  const scalar p,
176  const scalar T
177  ) const;
178 
179  //- Sensible enthalpy [J/kg]
180  virtual tmp<scalarField> Hs
181  (
182  const label speciei,
183  const scalarField& p,
184  const scalarField& T
185  ) const;
186 
187  //- Sensible enthalpy [J/kg]
188  virtual tmp<volScalarField> Hs
189  (
190  const label speciei,
191  const volScalarField& p,
192  const volScalarField& T
193  ) const;
194 
195  //- Absolute enthalpy [J/kg]
196  virtual scalar Ha
197  (
198  const label speciei,
199  const scalar p,
200  const scalar T
201  ) const;
202 
203  //- Absolute enthalpy [J/kg]
204  virtual tmp<scalarField> Ha
205  (
206  const label speciei,
207  const scalarField& p,
208  const scalarField& T
209  ) const;
210 
211  //- Absolute enthalpy [J/kg]
212  virtual tmp<volScalarField> Ha
213  (
214  const label speciei,
215  const volScalarField& p,
216  const volScalarField& T
217  ) const;
218 
219 
220  // Per specie transport properties
221 
222  //- Dynamic viscosity [kg/m/s]
223  virtual scalar mu
224  (
225  const label speciei,
226  const scalar p,
227  const scalar T
228  ) const;
229 
230  //- Dynamic viscosity [kg/m/s]
231  virtual tmp<volScalarField> mu
232  (
233  const label speciei,
234  const volScalarField& p,
235  const volScalarField& T
236  ) const;
237 
238  //- Thermal conductivity [W/m/K]
239  virtual scalar kappa
240  (
241  const label speciei,
242  const scalar p,
243  const scalar T
244  ) const;
245 
246  //- Thermal conductivity [W/m/K]
247  virtual tmp<volScalarField> kappa
248  (
249  const label speciei,
250  const volScalarField& p,
251  const volScalarField& T
252  ) const;
253 
254 
255  // Field properties abstract functions provided here to avoid issues
256  // with inheritance of virtual functions in heThermo
257 
258  //- Heat capacity at constant pressure for patch [J/kg/K]
259  virtual const volScalarField& Cp() const = 0;
260 
261  //- Heat capacity at constant pressure for patch [J/kg/K]
262  virtual tmp<scalarField> Cp
263  (
264  const scalarField& T,
265  const label patchi
266  ) const = 0;
267 
268  //- Heat capacity at constant volume [J/kg/K]
269  virtual const volScalarField& Cv() const = 0;
270 
271  //- Heat capacity at constant volume for patch [J/kg/K]
272  virtual tmp<scalarField> Cv
273  (
274  const scalarField& T,
275  const label patchi
276  ) const = 0;
277 };
278 
279 
280 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
281 
282 } // End namespace Foam
283 
284 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
285 
286 #ifdef NoRepository
287  #include "SpecieMixture.C"
288 #endif
289 
290 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
291 
292 #endif
293 
294 // ************************************************************************* //
Generic GeometricField class.
Foam::SpecieMixture.
Definition: SpecieMixture.H:58
virtual scalar Wi(const label speciei) const
Molecular weight of the given specie [kg/kmol].
virtual ~SpecieMixture()
Destructor.
virtual const volScalarField & Cv() const =0
Heat capacity at constant volume [J/kg/K].
SpecieMixture(const dictionary &, const fvMesh &, const word &phaseName)
Construct from dictionary, mesh and phase name.
virtual scalar HE(const label speciei, const scalar p, const scalar T) const
Enthalpy/Internal energy [J/kg].
virtual scalar Ha(const label speciei, const scalar p, const scalar T) const
Absolute enthalpy [J/kg].
virtual const volScalarField & Cp() const =0
Heat capacity at constant pressure for patch [J/kg/K].
virtual scalar mu(const label speciei, const scalar p, const scalar T) const
Dynamic viscosity [kg/m/s].
virtual scalar Hs(const label speciei, const scalar p, const scalar T) const
Sensible enthalpy [J/kg].
virtual scalar kappa(const label speciei, const scalar p, const scalar T) const
Thermal conductivity [W/m/K].
virtual scalar Hf(const label speciei) const
Enthalpy of formation [J/kg].
virtual scalar rho(const label speciei, const scalar p, const scalar T) const
Density [kg/m^3].
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
Dimension set for the base types.
Definition: dimensionSet.H:122
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:101
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:62
label patchi
Namespace for OpenFOAM.
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
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
volScalarField & p