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