inhomogeneousMixture.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::inhomogeneousMixture
26 
27 Description
28  Foam::inhomogeneousMixture
29 
30 SourceFiles
31  inhomogeneousMixture.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef inhomogeneousMixture_H
36 #define inhomogeneousMixture_H
37 
38 #include "dimensionedTypes.H"
39 #include "FieldListSlice.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class inhomogeneousMixture 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, 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 
103 
104  //- Destructor
105  virtual ~inhomogeneousMixture()
106  {}
107 
108 
109  // Member Functions
110 
111  //- Return the instantiated type name
112  static word typeName()
113  {
114  return "inhomogeneousMixture<" + ThermoType::typeName() + '>';
115  }
116 
117  //- Return the specie names
118  static wordList specieNames()
119  {
120  return {"ft", "b"};
121  }
122 
123  //- Return the residual fraction of fuel in the burnt mixture
124  scalar fres(const scalar ft) const
125  {
126  return max(ft - (scalar(1) - ft)/stoicRatio_.value(), scalar(0));
127  }
128 
129  //- Return the mixture for the given composition
130  const thermoType& mixture(const scalar ft, const scalar b) const;
131 
132  //- Return the mixture for thermodynamic properties
134  (
135  const scalarFieldListSlice&
136  ) const;
137 
138  //- Return the mixture for transport properties
140  (
141  const scalarFieldListSlice&
142  ) const;
143 
144  //- Return the mixture for transport properties
146  (
147  const scalarFieldListSlice&,
148  const thermoMixtureType&
149  ) const;
150 
151  //- Return the reactant mixture
152  const thermoType& reactants(const scalarFieldListSlice&) const;
153 
154  //- Return the product mixture
155  const thermoType& products(const scalarFieldListSlice&) const;
156 
157  //- Read dictionary
158  void read(const dictionary&);
159 
160 
161  // Member Operators
162 
163  //- Disallow default bitwise assignment
164  void operator=(const inhomogeneousMixture<ThermoType>&) = delete;
165 };
166 
167 
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 
170 } // End namespace Foam
171 
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
173 
174 #ifdef NoRepository
175  #include "inhomogeneousMixture.C"
176 #endif
177 
178 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
179 
180 #endif
181 
182 // ************************************************************************* //
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::inhomogeneousMixture.
static wordList specieNames()
Return the specie names.
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.
const thermoType & products(const scalarFieldListSlice &) const
Return the product mixture.
static word typeName()
Return the instantiated type name.
ThermoType transportMixtureType
Mixing type for transport properties.
inhomogeneousMixture(const dictionary &)
Construct from a dictionary.
ThermoType thermoMixtureType
Mixing type for thermodynamic properties.
const thermoType & reactants(const scalarFieldListSlice &) const
Return the reactant mixture.
const transportMixtureType & transportMixture(const scalarFieldListSlice &) const
Return the mixture for transport properties.
void read(const dictionary &)
Read dictionary.
const thermoMixtureType & thermoMixture(const scalarFieldListSlice &) const
Return the mixture for thermodynamic properties.
void operator=(const inhomogeneousMixture< ThermoType > &)=delete
Disallow default bitwise assignment.
scalar fres(const scalar ft) const
Return the residual fraction of fuel in the burnt mixture.
virtual ~inhomogeneousMixture()
Destructor.
A class for handling words, derived from string.
Definition: word.H:62
volScalarField & b
Definition: createFields.H:25
Namespace for OpenFOAM.
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)