BilgerMixtureFraction.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2020 Thorsten Zirwes
9 Copyright (C) 2020 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::functionObjects::BilgerMixtureFraction
29
30Group
31 grpThermophysicalFunctionObjects
32
33Description
34 Calculates the Bilger mixture-fraction field (i.e.
35 \f$f_{\mathrm{Bilger}}\f$) based on the elemental composition
36 of the mixture. Elements \c C, \c H, \c S and \c O are considered.
37
38 \f$f_{\mathrm{Bilger}}\f$ is the mass mixing ratio of fuel and oxidiser
39 in [kg fuel / kg mixture], and is invariant to the reaction progress of
40 the mixture (e.g. the same for unburnt and burnt mixtures).
41
42 \f$f_{\mathrm{Bilger}}\f$ equals to the unity
43 for pure fuel and to zero for pure oxidiser.
44
45 The Bilger mixture-fraction field is computed based on the following:
46
47 \f[
48 f_{\mathrm{Bilger}} =
49 \frac{\beta - \beta_{\mathrm{ox}}}{\beta_{\mathrm{fuel}}
50 - \beta_{\mathrm{ox}}}
51 \f]
52
53 with
54
55 \f[
56 \beta =
57 2\frac{Y_C}{W_C}
58 + 2\frac{Y_S}{W_S}
59 + \frac{1}{2}\frac{Y_H}{W_H}
60 - \frac{Y_O}{W_O}
61 \f]
62
63 where
64 \vartable
65 \beta | Coupling function [kmol/kg]
66 Y_e | Elemental mass fraction of element, e
67 W_e | Atomic weight of element, e
68 {.}_{\mathrm{ox}} | Subscript to denote oxidiser composition
69 {.}_{\mathrm{fuel}} | Subscript to denote fuel composition
70 \endvartable
71
72 Operands:
73 \table
74 Operand | Type | Location
75 input | - | -
76 output file | - | -
77 output field | volScalarField | $FOAM_CASE/<time>/<outField>
78 \endtable
79
80 References:
81 \verbatim
82 Original method:
83 Bilger, R. W. (1979).
84 Turbulent jet diffusion flames.
85 Energy and Combustion Science, p. 109-131.
86 DOI:10.1016/B978-0-08-024780-9.50011-3
87
88 Implementation:
89 Zirwes, T., Zhang, F., Habisreuther, P., Hansinger, M.,
90 Bockhorn, H., Pfitzner, M., & Trimis, D. (2019).
91 Quasi-DNS dataset of a piloted flame
92 with inhomogeneous inlet conditions.
93 Flow, Turbulence and Combustion, vol 104, p. 997-1027.
94 DOI:10.1007/s10494-019-00081-5
95 \endverbatim
96
97Usage
98 Minimal example by using \c system/controlDict.functions:
99 \verbatim
100 BilgerMixtureFraction1
101 {
102 // Mandatory entries (unmodifiable)
103 type BilgerMixtureFraction;
104 libs (fieldFunctionObjects);
105
106 // Mandatory entries (runtime modifiable)
107 fuel
108 {
109 // Optional entries (runtime modifiable)
110 fractionBasis mass;
111
112 // Conditional mandatory entries (runtime modifiable)
113 CH4 1;
114 }
115
116 oxidiser
117 {
118 // Optional entries (runtime modifiable)
119 fractionBasis mole;
120
121 // Conditional mandatory entries (runtime modifiable)
122 O2 0.23;
123 N2 0.77;
124 }
125
126 // Optional entries (runtime modifiable)
127 phase <phaseName>;
128 result <resultName>;
129
130 // Optional (inherited) entries
131 ...
132 }
133 \endverbatim
134
135 where the entries mean:
136 \table
137 Property | Description | Type | Reqd | Dflt
138 type | Type name: BilgerMixtureFraction | word | yes | -
139 libs | Library name: fieldFunctionObjects | word | yes | -
140 fuel | Dictionary for fuel composition | dict | yes | -
141 oxidiser | Dictionary for oxidiser composition | dict | yes | -
142 phase | Name of phase (e.g. "gas") | word | no | ""
143 result | Name of resulting field | word | no | f_Bilger
144 fractionBasis | Species-fraction interpretation method | word | no | mass
145 \endtable
146
147 Options for the \c fractionBasis entry:
148 \verbatim
149 mass | Interpret species fractions as mass fractions
150 mole | Interpret species fractions as mole fractions
151 \endverbatim
152
153 The inherited entries are elaborated in:
154 - \link functionObject.H \endlink
155
156 Usage by the \c postProcess utility is not available.
157
158Note
159 - The mole or mass fractions are automatically normalized to the unity.
160
161See also
162 - Foam::functionObject
163 - Foam::functionObjects::fvMeshFunctionObject
164
165SourceFiles
166 BilgerMixtureFraction.C
167
168\*---------------------------------------------------------------------------*/
169
170#ifndef BilgerMixtureFraction_H
171#define BilgerMixtureFraction_H
172
173#include "fvMeshFunctionObject.H"
174#include "specieElement.H"
175#include "basicSpecieMixture.H"
176
177// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178
179namespace Foam
180{
181namespace functionObjects
182{
183/*---------------------------------------------------------------------------*\
184 Class BilgerMixtureFraction Declaration
185\*---------------------------------------------------------------------------*/
186
187class BilgerMixtureFraction
188:
189 public fvMeshFunctionObject
190{
191 // Private Data
192
193 //- Name of the phase (e.g. "gas" for multiphase applications)
194 word phaseName_;
195
196 //- Name of the resulting mixture-fraction field
197 word resultName_;
198
199 //- Reference to thermo object
200 const basicSpecieMixture& thermo_;
201
202 //- Number of species
203 label nSpecies_;
204
205 // Amount of oxygen required to fully oxidise the oxidiser
206 scalar o2RequiredOx_;
207
208 // Amount of oxygen required to oxidise the fuel minus the oxidiser
209 scalar o2RequiredFuelOx_;
210
211 //- Number of carbon atoms for each species
212 labelField nAtomsC_;
213
214 //- Number of sulphur atoms for each species
215 labelField nAtomsS_;
216
217 //- Number of hydrogen atoms for each species
218 labelField nAtomsH_;
219
220 //- Number of oxygen atoms for each species
221 labelField nAtomsO_;
222
223 //- Mass fractions of species in the oxidiser
224 scalarField Yoxidiser_;
225
226 //- Mass fractions of species in the fuel
227 scalarField Yfuel_;
228
229
230 // Private Member Functions
231
232 //- Calculate the Bilger mixture-fraction
233 void calcBilgerMixtureFraction();
234
235 //- Read composition of fuel and oxidiser from subdictionary
236 bool readComposition
237 (
238 const dictionary& subDict,
239 scalarField& comp
240 );
241
242 //- Compute amount of oxygen required to oxidise a mixture
243 scalar o2Present(const scalarField&) const;
244
245 //- Compute amount of oxygen present in a mixture
246 scalar o2Required(const scalarField&) const;
247
248
249public:
250
251 //- Runtime type information
252 TypeName("BilgerMixtureFraction");
253
254
255 // Constructors
256
257 //- Construct from Time and dictionary
259 (
260 const word& name,
261 const Time& runTime,
262 const dictionary& dict
263 );
264
265 //- No copy construct
266 BilgerMixtureFraction(const BilgerMixtureFraction&) = delete;
267
268 //- No copy assignment
269 void operator=(const BilgerMixtureFraction&) = delete;
271
272 //- Destructor
273 virtual ~BilgerMixtureFraction() = default;
274
275
276 // Member Functions
277
278 //- Read the BilgerMixtureFraction data
279 virtual bool read(const dictionary&);
280
281 //- Calculate the Bilger mixture-fraction field
282 virtual bool execute();
283
284 //- Clear the Bilger mixture-fraction field from registry
285 virtual bool clear();
286
287 //- Write Bilger mixture-fraction field
288 virtual bool write();
289};
290
291
292// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
293
294} // End namespace functionObjects
295} // End namespace Foam
296
297// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
298
299#endif
300
301// ************************************************************************* //
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:80
Specialization of basicMultiComponentMixture for a mixture consisting of a number for molecular speci...
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
const word & name() const noexcept
Return the name of this functionObject.
Calculates the Bilger mixture-fraction field (i.e. ) based on the elemental composition of the mixtur...
BilgerMixtureFraction(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
void operator=(const BilgerMixtureFraction &)=delete
No copy assignment.
virtual bool clear()
Clear the Bilger mixture-fraction field from registry.
BilgerMixtureFraction(const BilgerMixtureFraction &)=delete
No copy construct.
virtual ~BilgerMixtureFraction()=default
Destructor.
TypeName("BilgerMixtureFraction")
Runtime type information.
virtual bool execute()
Calculate the Bilger mixture-fraction field.
virtual bool write()
Write Bilger mixture-fraction field.
virtual bool read(const dictionary &)
Read the BilgerMixtureFraction data.
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
A class for handling words, derived from Foam::string.
Definition: word.H:68
engineTime & runTime
Namespace for OpenFOAM.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Field< label > labelField
Specialisation of Field<T> for label.
Definition: labelField.H:52
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73