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::veryInhomogeneousMixture
28 Foam::veryInhomogeneousMixture
31 veryInhomogeneousMixture.C
33 \*---------------------------------------------------------------------------*/
35 #ifndef veryInhomogeneousMixture_H
36 #define veryInhomogeneousMixture_H
38 #include "basicMultiComponentMixture.H"
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 /*---------------------------------------------------------------------------*\
46 Class veryInhomogeneousMixture Declaration
47 \*---------------------------------------------------------------------------*/
49 template<class ThermoType>
50 class veryInhomogeneousMixture
52 public basicMultiComponentMixture
56 static const int nSpecies_ = 3;
57 static const char* specieNames_[3];
59 dimensionedScalar stoicRatio_;
65 mutable ThermoType mixture_;
70 //- Fuel mass fraction
76 //- Construct as copy (not implemented)
77 veryInhomogeneousMixture(const veryInhomogeneousMixture<ThermoType>&);
82 //- The type of thermodynamics this mixture is instantiated for
83 typedef ThermoType thermoType;
88 //- Construct from dictionary and mesh
89 veryInhomogeneousMixture(const dictionary&, const fvMesh&);
93 virtual ~veryInhomogeneousMixture()
99 const dimensionedScalar& stoicRatio() const
104 const ThermoType& mixture(const scalar, const scalar) const;
106 const ThermoType& cellMixture(const label celli) const
108 return mixture(ft_[celli], fu_[celli]);
111 const ThermoType& patchFaceMixture
119 ft_.boundaryField()[patchi][facei],
120 fu_.boundaryField()[patchi][facei]
124 const ThermoType& cellReactants(const label celli) const
126 return mixture(ft_[celli], ft_[celli]);
129 const ThermoType& patchFaceReactants
137 ft_.boundaryField()[patchi][facei],
138 ft_.boundaryField()[patchi][facei]
142 const ThermoType& cellProducts(const label celli) const
144 scalar ft = ft_[celli];
145 return mixture(ft, fres(ft, stoicRatio().value()));
148 const ThermoType& patchFaceProducts
154 scalar ft = ft_.boundaryField()[patchi][facei];
155 return mixture(ft, fres(ft, stoicRatio().value()));
159 void read(const dictionary&);
161 //- Return thermo based on index
162 const ThermoType& getLocalThermo(const label specieI) const;
165 // Per specie properties
167 //- Number of moles []
168 virtual scalar nMoles(const label specieI) const;
170 //- Molecular weight [kg/kmol]
171 virtual scalar W(const label specieI) const;
174 // Per specie thermo properties
176 //- Heat capacity at constant pressure [J/(kg K)]
177 virtual scalar Cp(const label specieI, const scalar T) const;
179 //- Heat capacity at constant volume [J/(kg K)]
180 virtual scalar Cv(const label specieI, const scalar T) const;
183 virtual scalar H(const label specieI, const scalar T) const;
185 //- Sensible enthalpy [J/kg]
186 virtual scalar Hs(const label specieI, const scalar T) const;
188 //- Chemical enthalpy [J/kg]
189 virtual scalar Hc(const label specieI) const;
191 //- Entropy [J/(kg K)]
192 virtual scalar S(const label specieI, const scalar T) const;
194 //- Internal energy [J/kg]
195 virtual scalar E(const label specieI, const scalar T) const;
197 //- Gibbs free energy [J/kg]
198 virtual scalar G(const label specieI, const scalar T) const;
200 //- Helmholtz free energy [J/kg]
201 virtual scalar A(const label specieI, const scalar T) const;
204 // Per specie transport properties
206 //- Dynamic viscosity [kg/m/s]
207 virtual scalar mu(const label specieI, const scalar T) const;
209 //- Thermal conductivity [W/m/K]
210 virtual scalar kappa(const label specieI, const scalar T) const;
212 //- Thermal diffusivity [kg/m/s]
213 virtual scalar alpha(const label specieI, const scalar T) const;
217 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
219 } // End namespace Foam
221 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
224 # include "veryInhomogeneousMixture.C"
227 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
231 // ************************************************************************* //