veryInhomogeneousMixture.H
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-2023 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 Class
25  Foam::veryInhomogeneousMixture
26 
27 Description
28  Foam::veryInhomogeneousMixture
29 
30 SourceFiles
31  veryInhomogeneousMixture.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef veryInhomogeneousMixture_H
36 #define veryInhomogeneousMixture_H
37 
38 #include "dimensionedTypes.H"
39 #include "FieldListSlice.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class veryInhomogeneousMixture Declaration
48 \*---------------------------------------------------------------------------*/
49 
50 template<class ThermoType>
52 {
53 public:
54 
55  // Public Typedefs
56 
57  //- The type of thermodynamics this mixture is instantiated for
58  typedef ThermoType thermoType;
59 
60  //- Mixing type for thermodynamic properties
61  typedef ThermoType thermoMixtureType;
62 
63  //- Mixing type for transport properties
64  typedef ThermoType transportMixtureType;
65 
66 
67 private:
68 
69  // Private Enumerations
70 
71  //- Specie indices
72  enum species { FT, FU, B };
73 
74 
75  // Private Data
76 
77  //- Stoichiometric air/fuel ratio
78  dimensionedScalar stoicRatio_;
79 
80  //- Fuel thermodynamic model
81  thermoType fuel_;
82 
83  //- Oxidant thermodynamic model
84  thermoType oxidant_;
85 
86  //- Product thermodynamic model
87  thermoType products_;
88 
89  //- Mutable storage for the mixed thermodynamic model
90  mutable thermoType mixture_;
91 
92 
93 public:
94 
95  // Constructors
96 
97  //- Construct from a dictionary
99 
100  //- Disallow default bitwise copy construction
102  (
104  ) = delete;
105 
106 
107  //- Destructor
108  virtual ~veryInhomogeneousMixture()
109  {}
110 
111 
112  // Member Functions
113 
114  //- Return the instantiated type name
115  static word typeName()
116  {
117  return "veryInhomogeneousMixture<" + ThermoType::typeName() + '>';
118  }
119 
120  //- Return the specie names
121  static wordList specieNames()
122  {
123  return {"ft", "fu", "b"};
124  }
125 
126  //- Return the residual fraction of fuel in the burnt mixture
127  scalar fres(const scalar ft) const
128  {
129  return max(ft - (scalar(1) - ft)/stoicRatio_.value(), scalar(0));
130  }
131 
132  //- Return the mixture for the given composition
133  const thermoType& mixture(const scalar ft, const scalar fu) const;
134 
135  //- Return the mixture for thermodynamic properties
137  (
138  const scalarFieldListSlice&
139  ) const;
140 
141  //- Return the mixture for transport properties
143  (
144  const scalarFieldListSlice&
145  ) const;
146 
147  //- Return the mixture for transport properties
149  (
150  const scalarFieldListSlice&,
151  const thermoMixtureType&
152  ) const;
153 
154  //- Return the reactant mixture
155  const thermoType& reactants(const scalarFieldListSlice&) const;
156 
157  //- Return the product mixture
158  const thermoType& products(const scalarFieldListSlice&) const;
159 
160  //- Read dictionary
161  void read(const dictionary&);
162 
163 
164  // Member Operators
165 
166  //- Disallow default bitwise assignment
167  void operator=(const veryInhomogeneousMixture<ThermoType>&) = delete;
168 };
169 
170 
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 
173 } // End namespace Foam
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
176 
177 #ifdef NoRepository
178  #include "veryInhomogeneousMixture.C"
179 #endif
180 
181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 
183 #endif
184 
185 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
const Type & value() const
Return const reference to value.
Foam::veryInhomogeneousMixture.
static wordList specieNames()
Return the specie names.
veryInhomogeneousMixture(const dictionary &)
Construct from a dictionary.
const thermoType & reactants(const scalarFieldListSlice &) const
Return the reactant mixture.
ThermoType thermoType
The type of thermodynamics this mixture is instantiated for.
static word typeName()
Return the instantiated type name.
virtual ~veryInhomogeneousMixture()
Destructor.
ThermoType transportMixtureType
Mixing type for transport properties.
void operator=(const veryInhomogeneousMixture< ThermoType > &)=delete
Disallow default bitwise assignment.
ThermoType thermoMixtureType
Mixing type for thermodynamic properties.
const thermoMixtureType & thermoMixture(const scalarFieldListSlice &) const
Return the mixture for thermodynamic properties.
const thermoType & products(const scalarFieldListSlice &) const
Return the product mixture.
void read(const dictionary &)
Read dictionary.
const transportMixtureType & transportMixture(const scalarFieldListSlice &) const
Return the mixture for transport properties.
const thermoType & mixture(const scalar ft, const scalar fu) const
Return the mixture for the given composition.
scalar fres(const scalar ft) const
Return the residual fraction of fuel in the burnt mixture.
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)