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 | Copyright (C) 2011-2017 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 public:
62 
63  // Constructors
64 
65  //- Construct from dictionary, mesh and phase name
66  SpecieMixture(const dictionary&, const fvMesh&, const word& phaseName);
67 
68 
69  //- Destructor
70  virtual ~SpecieMixture()
71  {}
72 
73 
74  // Member functions
75 
76  // Per specie properties
77 
78  //- Molecular weight of the given specie [kg/kmol]
79  virtual scalar W(const label speciei) const;
80 
81 
82  // Per specie thermo properties
83 
84  //- Heat capacity at constant pressure [J/(kg K)]
85  virtual scalar Cp
86  (
87  const label speciei,
88  const scalar p,
89  const scalar T
90  ) const;
91 
92  //- Heat capacity at constant volume [J/(kg K)]
93  virtual scalar Cv
94  (
95  const label speciei,
96  const scalar p,
97  const scalar T
98  ) const;
99 
100  //- Absolute enthalpy [J/kg]
101  virtual scalar Ha
102  (
103  const label speciei,
104  const scalar p,
105  const scalar T
106  ) const;
107 
108  //- Sensible enthalpy [J/kg]
109  virtual scalar Hs
110  (
111  const label speciei,
112  const scalar p,
113  const scalar T
114  ) const;
115 
116  //- Chemical enthalpy [J/kg]
117  virtual scalar Hc(const label speciei) const;
118 
119  //- Entropy [J/(kg K)]
120  virtual scalar S
121  (
122  const label speciei,
123  const scalar p,
124  const scalar T
125  ) const;
126 
127  //- Sensible internal energy [J/kg]
128  virtual scalar Es
129  (
130  const label speciei,
131  const scalar p,
132  const scalar T
133  ) const;
134 
135  //- Gibbs free energy [J/kg]
136  virtual scalar G
137  (
138  const label speciei,
139  const scalar p,
140  const scalar T
141  ) const;
142 
143  //- Helmholtz free energy [J/kg]
144  virtual scalar A
145  (
146  const label speciei,
147  const scalar p,
148  const scalar T
149  ) const;
150 
151 
152  // Per specie transport properties
153 
154  //- Dynamic viscosity [kg/m/s]
155  virtual scalar mu
156  (
157  const label speciei,
158  const scalar p,
159  const scalar T
160  ) const;
161 
162  //- Thermal conductivity [W/m/K]
163  virtual scalar kappa
164  (
165  const label speciei,
166  const scalar p,
167  const scalar T
168  ) const;
169 
170  //- Thermal diffusivity of enthalpy [kg/m/s]
171  virtual scalar alphah
172  (
173  const label speciei,
174  const scalar p,
175  const scalar T
176  ) const;
177 
178  //- Density [kg/m3]
179  virtual scalar rho
180  (
181  const label speciei,
182  const scalar p,
183  const scalar T
184  ) const;
185 
186 
187  // Field properties abstract functions
188  // provided here to avoid issues with inheritance of virtual functions
189  // in heThermo
190 
191  //- Heat capacity at constant pressure for patch [J/kg/K]
192  virtual tmp<scalarField> Cp
193  (
194  const scalarField& p,
195  const scalarField& T,
196  const label patchi
197  ) const = 0;
198 
199  //- Heat capacity at constant pressure for patch [J/kg/K]
200  virtual tmp<volScalarField> Cp() const = 0;
201 
202  //- Heat capacity at constant volume for patch [J/kg/K]
203  virtual tmp<scalarField> Cv
204  (
205  const scalarField& p,
206  const scalarField& T,
207  const label patchi
208  ) const = 0;
209 
210  //- Heat capacity at constant volume [J/kg/K]
211  virtual tmp<volScalarField> Cv() const = 0;
212 
213  //- Thermal diffusivity for temperature
214  // of mixture for patch [J/m/s/K]
215  virtual tmp<scalarField> kappa
216  (
217  const label patchi
218  ) const = 0;
219 
220  //- Thermal diffusivity for temperature of mixture [J/m/s/K]
221  virtual tmp<volScalarField> kappa() const = 0;
222 };
223 
224 
225 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
226 
227 } // End namespace Foam
228 
229 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
230 
231 #ifdef NoRepository
232  #include "SpecieMixture.C"
233 #endif
234 
235 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
236 
237 #endif
238 
239 // ************************************************************************* //
Foam::SpecieMixture.
Definition: SpecieMixture.H:55
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
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
virtual scalar Hs(const label speciei, const scalar p, const scalar T) const
Sensible enthalpy [J/kg].
Definition: SpecieMixture.C:99
virtual scalar S(const label speciei, const scalar p, const scalar T) const
Entropy [J/(kg K)].
virtual scalar Hc(const label speciei) const
Chemical enthalpy [J/kg].
virtual scalar alphah(const label speciei, const scalar p, const scalar T) const
Thermal diffusivity of enthalpy [kg/m/s].
SpecieMixture(const dictionary &, const fvMesh &, const word &phaseName)
Construct from dictionary, mesh and phase name.
Definition: SpecieMixture.C:34
A class for handling words, derived from string.
Definition: word.H:59
virtual tmp< volScalarField > Cv() const =0
Heat capacity at constant volume [J/kg/K].
virtual scalar Ha(const label speciei, const scalar p, const scalar T) const
Absolute enthalpy [J/kg].
Definition: SpecieMixture.C:87
virtual ~SpecieMixture()
Destructor.
Definition: SpecieMixture.H:69
virtual scalar W(const label speciei) const
Molecular weight of the given specie [kg/kmol].
Definition: SpecieMixture.C:53
virtual scalar A(const label speciei, const scalar p, const scalar T) const
Helmholtz free energy [J/kg].
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
virtual scalar rho(const label speciei, const scalar p, const scalar T) const
Density [kg/m3].
label patchi
virtual scalar mu(const label speciei, const scalar p, const scalar T) const
Dynamic viscosity [kg/m/s].
virtual scalar Es(const label speciei, const scalar p, const scalar T) const
Sensible internal energy [J/kg].
virtual tmp< volScalarField > kappa() const =0
Thermal diffusivity for temperature of mixture [J/m/s/K].
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
volScalarField & p
A class for managing temporary objects.
Definition: PtrList.H:53
virtual scalar G(const label speciei, const scalar p, const scalar T) const
Gibbs free energy [J/kg].
virtual tmp< volScalarField > Cp() const =0
Heat capacity at constant pressure for patch [J/kg/K].
Namespace for OpenFOAM.