UInhomogeneousMixture.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 "UInhomogeneousMixture.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  mixture_("mixture", fuel_)
40 {}
41 
42 
43 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
44 
45 template<class ThermoType>
47 (
48  const scalar fu
49 ) const
50 {
51  if (fu < 0.0001)
52  {
53  return oxidant_;
54  }
55  else
56  {
57  const scalar ox = 1 - fu;
58 
59  mixture_ = fu*fuel_;
60  mixture_ += ox*oxidant_;
61 
62  return mixture_;
63  }
64 }
65 
66 
67 template<class ThermoType>
70 (
71  const scalarFieldListSlice& Y
72 ) const
73 {
74  return mixture(Y[FU]);
75 }
76 
77 
78 template<class ThermoType>
81 (
82  const scalarFieldListSlice& Y
83 ) const
84 {
85  return mixture(Y[FU]);
86 }
87 
88 
89 template<class ThermoType>
92 (
93  const scalarFieldListSlice&,
95 ) const
96 {
97  return mixture;
98 }
99 
100 
101 template<class ThermoType>
103 {
105  fuel_ = ThermoType("fuel", dict.subDict("fuel"));
106  oxidant_ = ThermoType("oxidant", dict.subDict("oxidant"));
107 }
108 
109 
110 // ************************************************************************* //
Templated unburnt 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.
ThermoType thermoMixtureType
Mixing type for thermodynamic properties.
void read(const dictionary &)
Read dictionary.
const transportMixtureType & transportMixture(const scalarFieldListSlice &) const
Return the mixture for transport properties.
UInhomogeneousMixture(const dictionary &)
Construct from a 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
Unburnt gas combustion mixture for inhomogeneous lean, stoichiometric or rich conditions.
void read(const dictionary &)
Read dictionary.
dictionary dict
PtrList< volScalarField > & Y