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-2020 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 "basicCombustionMixture.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 /*---------------------------------------------------------------------------*\
46  Class veryInhomogeneousMixture 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_ = 3;
72  static const char* specieNames_[3];
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  //- Fuel mass fraction
86  volScalarField& fu_;
87 
88  //- Regress variable
89  volScalarField& b_;
90 
91 
92 public:
93 
94  // Constructors
95 
96  //- Construct from dictionary, mesh and phase name
98  (
99  const dictionary&,
100  const fvMesh&,
101  const word&
102  );
103 
104  //- Disallow default bitwise copy construction
106  (
108  ) = delete;
109 
110  //- Destructor
111  virtual ~veryInhomogeneousMixture()
112  {}
113 
114 
115  // Member Functions
116 
117  //- Return the instantiated type name
118  static word typeName()
119  {
120  return "veryInhomogeneousMixture<" + ThermoType::typeName() + '>';
121  }
123  const dimensionedScalar& stoicRatio() const
124  {
125  return stoicRatio_;
126  }
127 
128  const thermoType& mixture(const scalar, const scalar) const;
130  const thermoMixtureType& cellThermoMixture(const label celli) const
131  {
132  return mixture(ft_[celli], fu_[celli]);
133  }
134 
135  const thermoMixtureType& patchFaceThermoMixture
136  (
137  const label patchi,
138  const label facei
139  ) const
140  {
141  return mixture
142  (
143  ft_.boundaryField()[patchi][facei],
144  fu_.boundaryField()[patchi][facei]
145  );
146  }
147 
148  const transportMixtureType& cellTransportMixture
149  (
150  const label celli
151  ) const
152  {
153  return cellThermoMixture(celli);
154  }
155 
156  const transportMixtureType& patchFaceTransportMixture
157  (
158  const label patchi,
159  const label facei
160  ) const
161  {
162  return patchFaceThermoMixture(patchi, facei);
163  }
164 
165  const transportMixtureType& cellTransportMixture
166  (
167  const label,
168  const thermoMixtureType& thermoMixture
169  ) const
170  {
171  return thermoMixture;
172  }
173 
174  const transportMixtureType& patchFaceTransportMixture
175  (
176  const label,
177  const label,
178  const thermoMixtureType& thermoMixture
179  ) const
180  {
181  return thermoMixture;
182  }
184  const thermoType& cellReactants(const label celli) const
185  {
186  return mixture(ft_[celli], ft_[celli]);
187  }
188 
189  const thermoType& patchFaceReactants
190  (
191  const label patchi,
192  const label facei
193  ) const
194  {
195  return mixture
196  (
197  ft_.boundaryField()[patchi][facei],
198  ft_.boundaryField()[patchi][facei]
199  );
200  }
202  const thermoType& cellProducts(const label celli) const
203  {
204  scalar ft = ft_[celli];
205  return mixture(ft, fres(ft, stoicRatio().value()));
206  }
207 
208  const thermoType& patchFaceProducts
209  (
210  const label patchi,
211  const label facei
212  ) const
213  {
214  scalar ft = ft_.boundaryField()[patchi][facei];
215  return mixture(ft, fres(ft, stoicRatio().value()));
216  }
217 
218  //- Read dictionary
219  void read(const dictionary&);
220 
221  //- Return thermo based on index
222  const ThermoType& specieThermo(const label speciei) const;
223 
224 
225  // Member Operators
226 
227  //- Disallow default bitwise assignment
228  void operator=(const veryInhomogeneousMixture<ThermoType>&) = delete;
229 };
230 
231 
232 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
233 
234 } // End namespace Foam
235 
236 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
237 
238 #ifdef NoRepository
239  #include "veryInhomogeneousMixture.C"
240 #endif
241 
242 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
243 
244 #endif
245 
246 // ************************************************************************* //
const thermoType & mixture(const scalar, const scalar) const
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
scalar fres(const scalar ft, const scalar stoicRatio) const
void operator=(const veryInhomogeneousMixture< ThermoType > &)=delete
Disallow default bitwise assignment.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
const Boundary & boundaryField() const
Return const-reference to the boundary field.
const dimensionedScalar & stoicRatio() const
const transportMixtureType & patchFaceTransportMixture(const label patchi, const label facei) const
ThermoType transportMixtureType
Mixing type for transport properties.
const thermoMixtureType & patchFaceThermoMixture(const label patchi, const label facei) const
static word typeName()
Return the instantiated type name.
ThermoType thermoType
The type of thermodynamics this mixture is instantiated for.
const thermoType & patchFaceReactants(const label patchi, const label facei) const
const transportMixtureType & cellTransportMixture(const label celli) const
void read(const dictionary &)
Read dictionary.
A class for handling words, derived from string.
Definition: word.H:59
Specialisation of the basicMixture for combustion.
const thermoType & patchFaceProducts(const label patchi, const label facei) const
const thermoType & cellReactants(const label celli) const
const thermoMixtureType & cellThermoMixture(const label celli) const
const ThermoType & specieThermo(const label speciei) const
Return thermo based on index.
label patchi
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
const thermoType & cellProducts(const label celli) const
virtual ~veryInhomogeneousMixture()
Destructor.
Foam::veryInhomogeneousMixture.
ThermoType thermoMixtureType
Mixing type for thermodynamic properties.
veryInhomogeneousMixture(const dictionary &, const fvMesh &, const word &)
Construct from dictionary, mesh and phase name.
Namespace for OpenFOAM.