1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
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::multiComponentMixture
28 Foam::multiComponentMixture
31 multiComponentMixture.C
33 \*---------------------------------------------------------------------------*/
35 #ifndef multiComponentMixture_H
36 #define multiComponentMixture_H
38 #include "basicMultiComponentMixture.H"
39 #include "HashPtrTable.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 /*---------------------------------------------------------------------------*\
47 Class multiComponentMixture Declaration
48 \*---------------------------------------------------------------------------*/
50 template<class ThermoType>
51 class multiComponentMixture
53 public basicMultiComponentMixture
58 PtrList<ThermoType> speciesData_;
60 //- Temporary storage for the cell/face mixture thermo data
61 mutable ThermoType mixture_;
64 // Private Member Functions
66 //- Construct the species data from the given dictionary and return the
67 // data for the first specie to initialise the mixture thermo data
68 const ThermoType& constructSpeciesData(const dictionary& thermoDict);
70 //- Correct the mass fractions to sum to 1
71 void correctMassFractions();
73 //- Construct as copy (not implemented)
74 multiComponentMixture(const multiComponentMixture<ThermoType>&);
79 //- The type of thermodynamics this mixture is instantiated for
80 typedef ThermoType thermoType;
85 //- Construct from dictionary, specie names, thermo database and mesh
89 const wordList& specieNames,
90 const HashPtrTable<ThermoType>& specieThermoData,
94 //- Construct from dictionary and mesh
95 multiComponentMixture(const dictionary&, const fvMesh&);
99 virtual ~multiComponentMixture()
105 const ThermoType& cellMixture(const label celli) const;
107 const ThermoType& patchFaceMixture
113 //- Return the raw specie thermodynamic data
114 const PtrList<ThermoType>& speciesData() const
120 void read(const dictionary&);
123 // Per specie properties
125 //- Number of moles []
126 virtual scalar nMoles(const label specieI) const;
128 //- Molecular weight [kg/kmol]
129 virtual scalar W(const label specieI) const;
132 // Per specie thermo properties
134 //- Heat capacity at constant pressure [J/(kg K)]
135 virtual scalar Cp(const label specieI, const scalar T) const;
137 //- Heat capacity at constant volume [J/(kg K)]
138 virtual scalar Cv(const label specieI, const scalar T) const;
141 virtual scalar H(const label specieI, const scalar T) const;
143 //- Sensible enthalpy [J/kg]
144 virtual scalar Hs(const label specieI, const scalar T) const;
146 //- Chemical enthalpy [J/kg]
147 virtual scalar Hc(const label specieI) const;
149 //- Entropy [J/(kg K)]
150 virtual scalar S(const label specieI, const scalar T) const;
152 //- Internal energy [J/kg]
153 virtual scalar E(const label specieI, const scalar T) const;
155 //- Gibbs free energy [J/kg]
156 virtual scalar G(const label specieI, const scalar T) const;
158 //- Helmholtz free energy [J/kg]
159 virtual scalar A(const label specieI, const scalar T) const;
162 // Per specie transport properties
164 //- Dynamic viscosity [kg/m/s]
165 virtual scalar mu(const label specieI, const scalar T) const;
167 //- Thermal conductivity [W/m/K]
168 virtual scalar kappa(const label specieI, const scalar T) const;
170 //- Thermal diffusivity [kg/m/s]
171 virtual scalar alpha(const label specieI, const scalar T) const;
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 } // End namespace Foam
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 # include "multiComponentMixture.C"
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
189 // ************************************************************************* //