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-2022 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 "basicCombustionMixture.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 /*---------------------------------------------------------------------------*\
46  Class inhomogeneousMixture Declaration
47 \*---------------------------------------------------------------------------*/
48 
49 template<class ThermoType>
51 :
53 {
54 
55 public:
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 Data
70 
71  static const int nSpecies_ = 2;
72  static const char* specieNames_[2];
73 
74  dimensionedScalar stoicRatio_;
75 
76  thermoType fuel_;
77  thermoType oxidant_;
78  thermoType products_;
79 
80  mutable thermoType mixture_;
81 
82  //- Mixture fraction
83  volScalarField& ft_;
84 
85  //- Regress variable
86  volScalarField& b_;
87 
88 
89 public:
90 
91  // Constructors
92 
93  //- Construct from dictionary, mesh and phase name
94  inhomogeneousMixture(const dictionary&, const fvMesh&, const word&);
95 
96  //- Disallow default bitwise copy construction
98 
99 
100  //- Destructor
101  virtual ~inhomogeneousMixture()
102  {}
103 
104 
105  // Member Functions
106 
107  //- Return the instantiated type name
108  static word typeName()
109  {
110  return "inhomogeneousMixture<" + ThermoType::typeName() + '>';
111  }
112 
113  const dimensionedScalar& stoicRatio() const
114  {
115  return stoicRatio_;
116  }
117 
118  const thermoType& mixture(const scalar, const scalar) const;
119 
120  const thermoMixtureType& cellThermoMixture(const label celli) const
121  {
122  return mixture(ft_[celli], b_[celli]);
123  }
124 
126  (
127  const label patchi,
128  const label facei
129  ) const
130  {
131  return mixture
132  (
133  ft_.boundaryField()[patchi][facei],
134  b_.boundaryField()[patchi][facei]
135  );
136  }
137 
139  (
140  const label celli
141  ) const
142  {
143  return cellThermoMixture(celli);
144  }
145 
147  (
148  const label patchi,
149  const label facei
150  ) const
151  {
152  return patchFaceThermoMixture(patchi, facei);
153  }
154 
156  (
157  const label,
158  const thermoMixtureType& thermoMixture
159  ) const
160  {
161  return thermoMixture;
162  }
163 
165  (
166  const label,
167  const label,
168  const thermoMixtureType& thermoMixture
169  ) const
170  {
171  return thermoMixture;
172  }
173 
174  const thermoType& cellReactants(const label celli) const
175  {
176  return mixture(ft_[celli], 1);
177  }
178 
180  (
181  const label patchi,
182  const label facei
183  ) const
184  {
185  return mixture
186  (
187  ft_.boundaryField()[patchi][facei],
188  1
189  );
190  }
191 
192  const thermoType& cellProducts(const label celli) const
193  {
194  return mixture(ft_[celli], 0);
195  }
196 
198  (
199  const label patchi,
200  const label facei
201  ) const
202  {
203  return mixture
204  (
205  ft_.boundaryField()[patchi][facei],
206  0
207  );
208  }
209 
210  //- Read dictionary
211  void read(const dictionary&);
212 
213  //- Return thermo based on index
214  const ThermoType& specieThermo(const label speciei) const;
215 
216 
217  // Member Operators
218 
219  //- Disallow default bitwise assignment
220  void operator=(const inhomogeneousMixture<ThermoType>&) = delete;
221 };
222 
223 
224 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
225 
226 } // End namespace Foam
227 
228 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
229 
230 #ifdef NoRepository
231  #include "inhomogeneousMixture.C"
232 #endif
233 
234 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
235 
236 #endif
237 
238 // ************************************************************************* //
Generic GeometricField class.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
Specialisation of the basicMixture for combustion.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:101
Foam::inhomogeneousMixture.
const transportMixtureType & patchFaceTransportMixture(const label patchi, const label facei) const
const transportMixtureType & cellTransportMixture(const label celli) const
const thermoType & patchFaceReactants(const label patchi, const label facei) const
const ThermoType & specieThermo(const label speciei) const
Return thermo based on index.
inhomogeneousMixture(const dictionary &, const fvMesh &, const word &)
Construct from dictionary, mesh and phase name.
ThermoType thermoType
The type of thermodynamics this mixture is instantiated for.
const thermoType & cellReactants(const label celli) const
const thermoType & mixture(const scalar, const scalar) const
static word typeName()
Return the instantiated type name.
const thermoMixtureType & patchFaceThermoMixture(const label patchi, const label facei) const
ThermoType transportMixtureType
Mixing type for transport properties.
ThermoType thermoMixtureType
Mixing type for thermodynamic properties.
const thermoType & patchFaceProducts(const label patchi, const label facei) const
const thermoMixtureType & cellThermoMixture(const label celli) const
const thermoType & cellProducts(const label celli) const
void read(const dictionary &)
Read dictionary.
void operator=(const inhomogeneousMixture< ThermoType > &)=delete
Disallow default bitwise assignment.
virtual ~inhomogeneousMixture()
Destructor.
const dimensionedScalar & stoicRatio() const
A class for handling words, derived from string.
Definition: word.H:62
label patchi
Namespace for OpenFOAM.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59