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/>.
33 \*---------------------------------------------------------------------------*/
35 #ifndef dieselMixture_H
36 #define dieselMixture_H
38 #include "basicMultiComponentMixture.H"
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 /*---------------------------------------------------------------------------*\
46 Class dieselMixture Declaration
47 \*---------------------------------------------------------------------------*/
49 template<class ThermoType>
52 public basicMultiComponentMixture
56 static const int nSpecies_ = 2;
57 static const char* specieNames_[2];
59 dimensionedScalar stoicRatio_;
65 mutable ThermoType mixture_;
70 //- Construct as copy (not implemented)
71 dieselMixture(const dieselMixture<ThermoType>&);
76 //- The type of thermodynamics this mixture is instantiated for
77 typedef ThermoType thermoType;
82 //- Construct from dictionary and mesh
83 dieselMixture(const dictionary&, const fvMesh&);
87 virtual ~dieselMixture()
93 const dimensionedScalar& stoicRatio() const
98 const ThermoType& mixture(const scalar, const scalar) const;
100 const ThermoType& cellMixture(const label celli) const
102 return mixture(ft_[celli], fu_[celli]);
105 const ThermoType& patchFaceMixture
113 ft_.boundaryField()[patchi][facei],
114 fu_.boundaryField()[patchi][facei]
118 const ThermoType& cellReactants(const label celli) const
120 return mixture(ft_[celli], ft_[celli]);
123 const ThermoType& patchFaceReactants
131 ft_.boundaryField()[patchi][facei],
132 ft_.boundaryField()[patchi][facei]
136 const ThermoType& cellProducts(const label celli) const
138 scalar ft = ft_[celli];
139 return mixture(ft, fres(ft, stoicRatio().value()));
142 const ThermoType& patchFaceProducts
148 scalar ft = ft_.boundaryField()[patchi][facei];
149 return mixture(ft, fres(ft, stoicRatio().value()));
153 void read(const dictionary&);
155 //- Return thermo based on index
156 const ThermoType& getLocalThermo(const label specieI) const;
159 // Per specie properties
161 //- Number of moles []
162 virtual scalar nMoles(const label specieI) const;
164 //- Molecular weight [kg/kmol]
165 virtual scalar W(const label specieI) const;
168 // Per specie thermo properties
170 //- Heat capacity at constant pressure [J/(kg K)]
171 virtual scalar Cp(const label specieI, const scalar T) const;
173 //- Heat capacity at constant volume [J/(kg K)]
174 virtual scalar Cv(const label specieI, const scalar T) const;
177 virtual scalar H(const label specieI, const scalar T) const;
179 //- Sensible enthalpy [J/kg]
180 virtual scalar Hs(const label specieI, const scalar T) const;
182 //- Chemical enthalpy [J/kg]
183 virtual scalar Hc(const label specieI) const;
185 //- Entropy [J/(kg K)]
186 virtual scalar S(const label specieI, const scalar T) const;
188 //- Internal energy [J/kg]
189 virtual scalar E(const label specieI, const scalar T) const;
191 //- Gibbs free energy [J/kg]
192 virtual scalar G(const label specieI, const scalar T) const;
194 //- Helmholtz free energy [J/kg]
195 virtual scalar A(const label specieI, const scalar T) const;
198 // Per specie transport properties
200 //- Dynamic viscosity [kg/m/s]
201 virtual scalar mu(const label specieI, const scalar T) const;
203 //- Thermal conductivity [W/m/K]
204 virtual scalar kappa(const label specieI, const scalar T) const;
206 //- Thermal diffusivity [kg/m/s]
207 virtual scalar alpha(const label specieI, const scalar T) const;
211 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
213 } // End namespace Foam
215 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
218 # include "dieselMixture.C"
221 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
225 // ************************************************************************* //