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::inhomogeneousMixture
28 Foam::inhomogeneousMixture
31 inhomogeneousMixture.C
33 \*---------------------------------------------------------------------------*/
35 #ifndef inhomogeneousMixture_H
36 #define inhomogeneousMixture_H
38 #include "basicMultiComponentMixture.H"
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 /*---------------------------------------------------------------------------*\
46 Class inhomogeneousMixture Declaration
47 \*---------------------------------------------------------------------------*/
49 template<class ThermoType>
50 class inhomogeneousMixture
52 public basicMultiComponentMixture
56 static const int nSpecies_ = 2;
57 static const char* specieNames_[2];
59 dimensionedScalar stoicRatio_;
65 mutable ThermoType mixture_;
73 //- Construct as copy (not implemented)
74 inhomogeneousMixture(const inhomogeneousMixture<ThermoType>&);
79 //- The type of thermodynamics this mixture is instantiated for
80 typedef ThermoType thermoType;
85 //- Construct from dictionary and mesh
86 inhomogeneousMixture(const dictionary&, const fvMesh&);
90 virtual ~inhomogeneousMixture()
96 const dimensionedScalar& stoicRatio() const
101 const ThermoType& mixture(const scalar, const scalar) const;
103 const ThermoType& cellMixture(const label celli) const
105 return mixture(ft_[celli], b_[celli]);
108 const ThermoType& patchFaceMixture
116 ft_.boundaryField()[patchi][facei],
117 b_.boundaryField()[patchi][facei]
121 const ThermoType& cellReactants(const label celli) const
123 return mixture(ft_[celli], 1);
126 const ThermoType& patchFaceReactants
134 ft_.boundaryField()[patchi][facei],
139 const ThermoType& cellProducts(const label celli) const
141 return mixture(ft_[celli], 0);
144 const ThermoType& patchFaceProducts
152 ft_.boundaryField()[patchi][facei],
158 void read(const dictionary&);
160 //- Return thermo based on index
161 const ThermoType& getLocalThermo(const label specieI) const;
164 // Per specie properties
166 //- Number of moles []
167 virtual scalar nMoles(const label specieI) const;
169 //- Molecular weight [kg/kmol]
170 virtual scalar W(const label specieI) const;
173 // Per specie thermo properties
175 //- Heat capacity at constant pressure [J/(kg K)]
176 virtual scalar Cp(const label specieI, const scalar T) const;
178 //- Heat capacity at constant volume [J/(kg K)]
179 virtual scalar Cv(const label specieI, const scalar T) const;
182 virtual scalar H(const label specieI, const scalar T) const;
184 //- Sensible enthalpy [J/kg]
185 virtual scalar Hs(const label specieI, const scalar T) const;
187 //- Chemical enthalpy [J/kg]
188 virtual scalar Hc(const label specieI) const;
190 //- Entropy [J/(kg K)]
191 virtual scalar S(const label specieI, const scalar T) const;
193 //- Internal energy [J/kg]
194 virtual scalar E(const label specieI, const scalar T) const;
196 //- Gibbs free energy [J/kg]
197 virtual scalar G(const label specieI, const scalar T) const;
199 //- Helmholtz free energy [J/kg]
200 virtual scalar A(const label specieI, const scalar T) const;
203 // Per specie transport properties
205 //- Dynamic viscosity [kg/m/s]
206 virtual scalar mu(const label specieI, const scalar T) const;
208 //- Thermal conductivity [W/m/K]
209 virtual scalar kappa(const label specieI, const scalar T) const;
211 //- Thermal diffusivity [kg/m/s]
212 virtual scalar alpha(const label specieI, const scalar T) const;
216 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
218 } // End namespace Foam
220 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
223 # include "inhomogeneousMixture.C"
226 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
230 // ************************************************************************* //