MulticomponentThermo.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-2026 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::MulticomponentThermo
26 
27 Description
28  Multi-component thermo implementation
29 
30 SourceFiles
31  MulticomponentThermo.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef MulticomponentThermo_H
36 #define MulticomponentThermo_H
37 
38 #include "BasicThermo.H"
39 #include "speciesTable.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class MulticomponentThermo Declaration
48 \*---------------------------------------------------------------------------*/
49 
50 template<class BaseThermo>
52 :
53  public BaseThermo
54 {
55 protected:
56 
57  // Protected Member Functions
58 
59  //- Return a volScalarField of the given property
60  template<class Method, class ... Args>
62  (
63  const word& psiName,
64  const dimensionSet& psiDim,
65  Method psiMethod,
66  const label speciei,
67  const Args& ... args
68  ) const;
69 
70  //- Return a volScalarField::Internal of the given property
71  template<class Method, class ... Args>
73  (
74  const word& psiName,
75  const dimensionSet& psiDim,
76  Method psiMethod,
77  const label speciei,
78  const Args& ... args
79  ) const;
80 
81  //- Return a scalarField of the given property
82  template<class Method, class Arg, class ... Args>
84  (
85  Method psiMethod,
86  const label speciei,
87  const Arg& arg,
88  const Args& ... args
89  ) const;
90 
91 
92 public:
93 
94  // Constructors
95 
96  //- Construct from mesh and phase name
97  MulticomponentThermo(const fvMesh&, const word& phaseName);
98 
99  //- Disallow default bitwise copy construction
101 
102 
103  //- Destructor
104  virtual ~MulticomponentThermo();
105 
106 
107  // Member Functions
108 
109  // Species set
110 
111  //- Return the table of species
112  virtual const speciesTable& species() const
113  {
114  return BaseThermo::mixtureType::species();
115  }
116 
117 
118  // Specie molecular properties
119 
120  //- Molecular weight [kg/kmol]
121  virtual scalar WiValue(const label speciei) const;
122 
123  //- Molecular weight [kg/kmol]
124  virtual dimensionedScalar Wi(const label speciei) const;
125 
126 
127  // Specie active list
128 
129  //- Access the specie active flags
130  virtual const boolList& speciesActive() const
131  {
132  return BaseThermo::mixtureType::speciesActive();
133  }
134 
135  //- Access the specie active flags
136  virtual boolList& speciesActive()
137  {
138  return BaseThermo::mixtureType::speciesActive();
139  }
140 
141 
142  // Specie thermodynamic properties
143 
144  //- Density [kg/m^3]
145  virtual scalar rhoi
146  (
147  const label speciei,
148  const scalar p,
149  const scalar T
150  ) const;
151 
152  //- Density [kg/m^3]
153  virtual tmp<volScalarField> rhoi
154  (
155  const label speciei,
156  const volScalarField& p,
157  const volScalarField& T
158  ) const;
159 
160  //- Heat capacity at constant pressure [J/kg/K]
161  virtual scalar Cpi
162  (
163  const label speciei,
164  const scalar p,
165  const scalar T
166  ) const;
167 
168  //- Heat capacity at constant pressure [J/kg/K]
169  virtual tmp<volScalarField> Cpi
170  (
171  const label speciei,
172  const volScalarField& p,
173  const volScalarField& T
174  ) const;
175 
176  //- Enthalpy/Internal energy [J/kg]
177  virtual scalar hei
178  (
179  const label speciei,
180  const scalar p,
181  const scalar T
182  ) const;
183 
184  //- Enthalpy/Internal energy [J/kg]
185  virtual tmp<scalarField> hei
186  (
187  const label speciei,
188  const scalarField& p,
189  const scalarField& T
190  ) const;
191 
192  //- Enthalpy/Internal energy [J/kg]
194  (
195  const label speciei,
198  ) const;
199 
200  //- Enthalpy/Internal energy [J/kg]
201  virtual tmp<volScalarField> hei
202  (
203  const label speciei,
204  const volScalarField& p,
205  const volScalarField& T
206  ) const;
207 
208  //- Sensible enthalpy [J/kg]
209  virtual scalar hsi
210  (
211  const label speciei,
212  const scalar p,
213  const scalar T
214  ) const;
215 
216  //- Sensible enthalpy [J/kg]
217  virtual tmp<scalarField> hsi
218  (
219  const label speciei,
220  const scalarField& p,
221  const scalarField& T
222  ) const;
223 
224  //- Sensible enthalpy [J/kg]
226  (
227  const label speciei,
230  ) const;
231 
232  //- Sensible enthalpy [J/kg]
233  virtual tmp<volScalarField> hsi
234  (
235  const label speciei,
236  const volScalarField& p,
237  const volScalarField& T
238  ) const;
239 
240  //- Absolute enthalpy [J/kg]
241  virtual scalar hai
242  (
243  const label speciei,
244  const scalar p,
245  const scalar T
246  ) const;
247 
248  //- Absolute enthalpy [J/kg]
249  virtual tmp<scalarField> hai
250  (
251  const label speciei,
252  const scalarField& p,
253  const scalarField& T
254  ) const;
255 
256  //- Absolute enthalpy [J/kg]
258  (
259  const label speciei,
262  ) const;
263 
264  //- Absolute enthalpy [J/kg]
265  virtual tmp<volScalarField> hai
266  (
267  const label speciei,
268  const volScalarField& p,
269  const volScalarField& T
270  ) const;
271 
272  //- Enthalpy of formation [J/kg]
273  virtual scalar hfiValue(const label speciei) const;
274 
275  //- Enthalpy of formation [J/kg]
276  virtual dimensionedScalar hfi(const label speciei) const;
277 
278 
279  // Specie transport properties
280 
281  //- Thermal conductivity [W/m/K]
282  virtual scalar kappai
283  (
284  const label speciei,
285  const scalar p,
286  const scalar T
287  ) const;
288 
289  //- Thermal conductivity [W/m/K]
291  (
292  const label speciei,
293  const volScalarField& p,
294  const volScalarField& T
295  ) const;
296 };
297 
298 
299 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
300 
301 } // End namespace Foam
302 
303 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
304 
305 #ifdef NoRepository
306  #include "MulticomponentThermo.C"
307 #endif
308 
309 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
310 
311 #endif
312 
313 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Generic GeometricField class.
Multi-component thermo implementation.
virtual ~MulticomponentThermo()
Destructor.
virtual const speciesTable & species() const
Return the table of species.
virtual const boolList & speciesActive() const
Access the specie active flags.
virtual scalar WiValue(const label speciei) const
Molecular weight [kg/kmol].
virtual scalar kappai(const label speciei, const scalar p, const scalar T) const
Thermal conductivity [W/m/K].
virtual scalar Cpi(const label speciei, const scalar p, const scalar T) const
Heat capacity at constant pressure [J/kg/K].
virtual scalar rhoi(const label speciei, const scalar p, const scalar T) const
Density [kg/m^3].
virtual dimensionedScalar hfi(const label speciei) const
Enthalpy of formation [J/kg].
tmp< volScalarField::Internal > volInternalScalarFieldPropertyi(const word &psiName, const dimensionSet &psiDim, Method psiMethod, const label speciei, const Args &... args) const
Return a volScalarField::Internal of the given property.
tmp< volScalarField > volScalarFieldPropertyi(const word &psiName, const dimensionSet &psiDim, Method psiMethod, const label speciei, const Args &... args) const
Return a volScalarField of the given property.
MulticomponentThermo(const fvMesh &, const word &phaseName)
Construct from mesh and phase name.
virtual scalar hfiValue(const label speciei) const
Enthalpy of formation [J/kg].
virtual dimensionedScalar Wi(const label speciei) const
Molecular weight [kg/kmol].
tmp< scalarField > scalarFieldPropertyi(Method psiMethod, const label speciei, const Arg &arg, const Args &... args) const
Return a scalarField of the given property.
virtual scalar hai(const label speciei, const scalar p, const scalar T) const
Absolute enthalpy [J/kg].
virtual scalar hei(const label speciei, const scalar p, const scalar T) const
Enthalpy/Internal energy [J/kg].
virtual scalar hsi(const label speciei, const scalar p, const scalar T) const
Sensible enthalpy [J/kg].
Dimension set for the base types.
Definition: dimensionSet.H:125
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:98
A wordList with hashed indices for faster lookup by name.
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:63
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(GeometricField< Type, GeoMesh, PrimitiveField1 > &gf, const GeometricField< Type, GeoMesh, PrimitiveField2 > &gf1)
Foam::argList args(argc, argv)
volScalarField & p