1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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.
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
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/>.
25 Foam::basicMultiComponentMixture
28 Multi-component mixture. Provides a list of mass fraction fields and helper
29 functions to query mixture composition.
32 basicMultiComponentMixture.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef basicMultiComponentMixture_H
37 #define basicMultiComponentMixture_H
39 #include "volFields.H"
41 #include "speciesTable.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 /*---------------------------------------------------------------------------*\
49 Class basicMultiComponentMixture Declaration
50 \*---------------------------------------------------------------------------*/
52 class basicMultiComponentMixture
59 //- Table of specie names
60 speciesTable species_;
62 //- Species mass fractions
63 PtrList<volScalarField> Y_;
70 //- Construct from dictionary and mesh
71 basicMultiComponentMixture
74 const wordList& specieNames,
80 virtual ~basicMultiComponentMixture()
86 //- Return the table of species
87 const speciesTable& species() const
92 //- Return the mass-fraction fields
93 inline PtrList<volScalarField>& Y();
95 //- Return the const mass-fraction fields
96 inline const PtrList<volScalarField>& Y() const;
98 //- Return the mass-fraction field for a specie given by index
99 inline volScalarField& Y(const label i);
101 //- Return the const mass-fraction field for a specie given by index
102 inline const volScalarField& Y(const label i) const;
104 //- Return the mass-fraction field for a specie given by name
105 inline volScalarField& Y(const word& specieName);
107 //- Return the const mass-fraction field for a specie given by name
108 inline const volScalarField& Y(const word& specieName) const;
110 //- Does the mixture include this specie?
111 inline bool contains(const word& specieName) const;
113 inline scalar fres(const scalar ft, const scalar stoicRatio) const;
115 inline tmp<volScalarField> fres
117 const volScalarField& ft,
118 const dimensionedScalar& stoicRatio
122 // Per specie properties
124 //- Number of moles []
125 virtual scalar nMoles(const label specieI) const = 0;
127 //- Molecular weight [kg/kmol]
128 virtual scalar W(const label specieI) const = 0;
131 // Per specie thermo properties
133 //- Heat capacity at constant pressure [J/(kg K)]
134 virtual scalar Cp(const label specieI, const scalar T) const = 0;
136 //- Heat capacity at constant volume [J/(kg K)]
137 virtual scalar Cv(const label specieI, const scalar T) const = 0;
140 virtual scalar H(const label specieI, const scalar T) const = 0;
142 //- Sensible enthalpy [J/kg]
143 virtual scalar Hs(const label specieI, const scalar T) const = 0;
145 //- Chemical enthalpy [J/kg]
146 virtual scalar Hc(const label specieI) const = 0;
148 //- Entropy [J/(kg K)]
149 virtual scalar S(const label specieI, const scalar T) const = 0;
151 //- Internal energy [J/kg]
152 virtual scalar E(const label specieI, const scalar T) const = 0;
154 //- Gibbs free energy [J/kg]
155 virtual scalar G(const label specieI, const scalar T) const = 0;
157 //- Helmholtz free energy [J/kg]
158 virtual scalar A(const label specieI, const scalar T) const = 0;
161 // Per specie transport properties
163 //- Dynamic viscosity [kg/m/s]
164 virtual scalar mu(const label specieI, const scalar T) const = 0;
166 //- Thermal conductivity [W/m/K]
167 virtual scalar kappa(const label specieI, const scalar T) const = 0;
169 //- Thermal diffusivity [kg/m/s]
170 virtual scalar alpha(const label specieI, const scalar T) const = 0;
174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 } // End namespace Foam
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 #include "basicMultiComponentMixtureI.H"
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 // ************************************************************************* //