leanInhomogeneousMixture.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2025 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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
19  for more details.
20 
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/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
27 
28 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
29 
30 template<class ThermoType>
32 (
33  const dictionary& dict
34 )
35 :
36  stoicRatio_(dict.lookup<scalar>("stoichiometricAirFuelMassRatio")),
37  fuel_("fuel", dict.subDict("fuel")),
38  oxidant_("oxidant", dict.subDict("oxidant")),
39  products_("burntProducts", dict.subDict("burntProducts")),
40  mixture_("mixture", fuel_)
41 {}
42 
43 
44 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
45 
46 template<class ThermoType>
48 (
49  const scalar ft
50 ) const
51 {
52  return max(ft - (scalar(1) - ft)/stoicRatio_, scalar(0));
53 }
54 
55 
56 template<class ThermoType>
58 (
59  const scalarFieldListSlice& Y
60 ) const
61 {
62  return fres(Y[FT]);
63 }
64 
65 
66 template<class ThermoType>
68 (
69  const scalarFieldListSlice& Y
70 ) const
71 {
72  return stoicRatio_*Y[FT]/max(scalar(1) - Y[FT], small);
73 }
74 
75 
76 template<class ThermoType>
78 (
79  const scalar ft,
80  const scalar b
81 ) const
82 {
83  if (ft < 0.0001)
84  {
85  return oxidant_;
86  }
87  else
88  {
89  const scalar fu = b*ft + (1 - b)*fres(ft);
90  const scalar ox = 1 - ft - (ft - fu)*stoicRatio_;
91  const scalar pr = 1 - fu - ox;
92 
93  mixture_ = fu*fuel_;
94  mixture_ += ox*oxidant_;
95  mixture_ += pr*products_;
96 
97  return mixture_;
98  }
99 }
100 
101 
102 template<class ThermoType>
105 (
106  const scalarFieldListSlice& Y
107 ) const
108 {
109  return mixture(Y[FT], Y[B]);
110 }
111 
112 
113 template<class ThermoType>
116 (
117  const scalarFieldListSlice& Y
118 ) const
119 {
120  return mixture(Y[FT], Y[B]);
121 }
122 
123 
124 template<class ThermoType>
127 (
128  const scalarFieldListSlice&,
130 ) const
131 {
132  return mixture;
133 }
134 
135 
136 template<class ThermoType>
139 (
140  const scalarFieldListSlice& Y
141 ) const
142 {
143  return mixture(Y[FT], 1);
144 }
145 
146 
147 template<class ThermoType>
150 (
151  const scalarFieldListSlice& Y
152 ) const
153 {
154  return mixture(Y[FT], 0);
155 }
156 
157 
158 template<class ThermoType>
160 {
161  stoicRatio_ = dict.lookup<scalar>("stoichiometricAirFuelMassRatio");
162  fuel_ = ThermoType("fuel", dict.subDict("fuel"));
163  oxidant_ = ThermoType("oxidant", dict.subDict("oxidant"));
164  products_ = ThermoType("burntProducts", dict.subDict("burntProducts"));
165 }
166 
167 
168 // ************************************************************************* //
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
Definition: dictionary.C:669
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
Definition: dictionary.C:778
const thermoMixtureType & thermoMixture(const scalarFieldListSlice &) const
Return the mixture for thermodynamic properties.
const thermoType & mixture(const scalar ft, const scalar b) const
Return the mixture for the given composition.
ThermoType thermoType
The type of thermodynamics this mixture is instantiated for.
leanInhomogeneousMixture(const dictionary &)
Construct from a dictionary.
ThermoType transportMixtureType
Mixing type for transport properties.
ThermoType thermoMixtureType
Mixing type for thermodynamic properties.
const transportMixtureType & transportMixture(const scalarFieldListSlice &) const
Return the mixture for transport properties.
scalar Phi(const scalarFieldListSlice &Y) const
Return the fuel-oxidant equivalence ratio.
const thermoType & products(const scalarFieldListSlice &) const
Return the product mixture.
void read(const dictionary &)
Read dictionary.
scalar fres(const scalar ft) const
Return the residual fraction of fuel in the burnt mixture.
const thermoType & reactants(const scalarFieldListSlice &) const
Return the reactant mixture.
volScalarField & b
Definition: createFields.H:27
static const coefficient B("B", dimless, 18.678)
const unitSet & lookup(const word &unitName)
Lookup and return the named unit from the table.
Definition: units.C:346
dimensioned< Type > max(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
dictionary dict
PtrList< volScalarField > & Y