BInhomogeneousMixture.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) 2025-2026 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 
26 #include "BInhomogeneousMixture.H"
27 
28 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
29 
30 template<class ThermoType>
32 (
33  const dictionary& dict
34 )
35 :
37  fuel_("fuel", dict.subDict("fuel")),
38  oxidant_("oxidant", dict.subDict("oxidant")),
39  products_("products", dict.subDict("products")),
40  mixture_("mixture", fuel_)
41 {}
42 
43 
44 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
45 
46 template<class ThermoType>
48 (
49  const scalar ft
50 ) const
51 {
52  if (ft < 0.0001)
53  {
54  return oxidant_;
55  }
56  else
57  {
58  const scalar fu = max(ft - (scalar(1) - ft)/stoicRatio_, scalar(0));
59  const scalar ox = 1 - ft - (ft - fu)*stoicRatio_;
60  const scalar pr = 1 - fu - ox;
61 
62  mixture_ = fu*fuel_;
63  mixture_ += ox*oxidant_;
64  mixture_ += pr*products_;
65 
66  return mixture_;
67  }
68 }
69 
70 
71 template<class ThermoType>
74 (
75  const scalarFieldListSlice& Y
76 ) const
77 {
78  return mixture(Y[FT]);
79 }
80 
81 
82 template<class ThermoType>
85 (
86  const scalarFieldListSlice& Y
87 ) const
88 {
89  return mixture(Y[FT]);
90 }
91 
92 
93 template<class ThermoType>
96 (
97  const scalarFieldListSlice&,
99 ) const
100 {
101  return mixture;
102 }
103 
104 
105 template<class ThermoType>
107 {
109  fuel_ = ThermoType("fuel", dict.subDict("fuel"));
110  oxidant_ = ThermoType("oxidant", dict.subDict("oxidant"));
111  products_ = ThermoType("products", dict.subDict("products"));
112 }
113 
114 
115 // ************************************************************************* //
Templated burnt gas combustion mixture for inhomogeneous lean, stoichiometric or rich conditions.
const thermoMixtureType & thermoMixture(const scalarFieldListSlice &) const
Return the mixture for thermodynamic properties.
ThermoType transportMixtureType
Mixing type for transport properties.
const transportMixtureType & transportMixture(const scalarFieldListSlice &) const
Return the mixture for transport properties.
ThermoType thermoMixtureType
Mixing type for thermodynamic properties.
void read(const dictionary &)
Read dictionary.
BInhomogeneousMixture(const dictionary &)
Construct from a dictionary.
Burnt gas combustion mixture for inhomogeneous lean, stoichiometric or rich conditions.
void read(const dictionary &)
Read dictionary.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
Definition: dictionary.C:778
dimensioned< Type > max(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
dictionary dict
PtrList< volScalarField > & Y