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