veryInhomogeneousMixture.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2017 OpenFOAM Foundation
9  Copyright (C) 2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::veryInhomogeneousMixture
29 
30 Group
31  grpReactionThermophysicalMixtures
32 
33 Description
34  The very inhomogeneous mixture contains species ("ft", "fu", "b").
35 
36 SourceFiles
37  veryInhomogeneousMixture.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef veryInhomogeneousMixture_H
42 #define veryInhomogeneousMixture_H
43 
44 #include "basicCombustionMixture.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 /*---------------------------------------------------------------------------*\
52  Class veryInhomogeneousMixture Declaration
53 \*---------------------------------------------------------------------------*/
54 
55 template<class ThermoType>
57 :
59 {
60  // Private Data
61 
62  dimensionedScalar stoicRatio_;
63 
64  ThermoType fuel_;
65  ThermoType oxidant_;
66  ThermoType products_;
67 
68  mutable ThermoType mixture_;
69 
70  //- Mixture fraction
71  volScalarField& ft_;
72 
73  //- Fuel mass fraction
74  volScalarField& fu_;
75 
76  //- Regress variable
77  volScalarField& b_;
78 
79  //- No copy construct
81  (
83  ) = delete;
84 
85 
86 public:
87 
88  //- The type of thermodynamics this mixture is instantiated for
89  typedef ThermoType thermoType;
90 
91 
92  // Constructors
93 
94  //- Construct from dictionary, mesh and phase name
96  (
97  const dictionary& thermoDict,
98  const fvMesh& mesh,
99  const word& phaseName
100  );
101 
102 
103  //- Destructor
104  virtual ~veryInhomogeneousMixture() = default;
105 
106 
107  // Member functions
108 
109  //- Return the instantiated type name
110  static word typeName()
111  {
112  return "veryInhomogeneousMixture<" + ThermoType::typeName() + '>';
113  }
114 
115  const dimensionedScalar& stoicRatio() const
116  {
117  return stoicRatio_;
118  }
119 
120  const ThermoType& mixture(const scalar, const scalar) const;
121 
122  const ThermoType& cellMixture(const label celli) const
123  {
124  return mixture(ft_[celli], fu_[celli]);
125  }
126 
127  const ThermoType& cellVolMixture
128  (
129  const scalar p,
130  const scalar T,
131  const label celli
132  ) const
133  {
134  return mixture(ft_[celli], fu_[celli]);
135  }
136 
137  const ThermoType& patchFaceMixture
138  (
139  const label patchi,
140  const label facei
141  ) const
142  {
143  return mixture
144  (
145  ft_.boundaryField()[patchi][facei],
146  fu_.boundaryField()[patchi][facei]
147  );
148  }
149 
150  const ThermoType& patchFaceVolMixture
151  (
152  const scalar p,
153  const scalar T,
154  const label patchi,
155  const label facei
156  ) const
157  {
158  return mixture
159  (
160  ft_.boundaryField()[patchi][facei],
161  fu_.boundaryField()[patchi][facei]
162  );
163  }
164 
165 
166  const ThermoType& cellReactants(const label celli) const
167  {
168  return mixture(ft_[celli], ft_[celli]);
169  }
170 
171  const ThermoType& patchFaceReactants
172  (
173  const label patchi,
174  const label facei
175  ) const
176  {
177  return mixture
178  (
179  ft_.boundaryField()[patchi][facei],
180  ft_.boundaryField()[patchi][facei]
181  );
182  }
183 
184  const ThermoType& cellProducts(const label celli) const
185  {
186  scalar ft = ft_[celli];
187  return mixture(ft, fres(ft, stoicRatio().value()));
188  }
189 
190  const ThermoType& patchFaceProducts
191  (
192  const label patchi,
193  const label facei
194  ) const
195  {
196  scalar ft = ft_.boundaryField()[patchi][facei];
197  return mixture(ft, fres(ft, stoicRatio().value()));
198  }
199 
200  //- Read dictionary
201  void read(const dictionary&);
202 
203  //- Return thermo based on index
204  const ThermoType& getLocalThermo(const label speciei) const;
205 };
206 
207 
208 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
209 
210 } // End namespace Foam
211 
212 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
213 
214 #ifdef NoRepository
215  #include "veryInhomogeneousMixture.C"
216 #endif
217 
218 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
219 
220 #endif
221 
222 // ************************************************************************* //
Foam::veryInhomogeneousMixture::getLocalThermo
const ThermoType & getLocalThermo(const label speciei) const
Return thermo based on index.
Definition: veryInhomogeneousMixture.C:104
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::veryInhomogeneousMixture
The very inhomogeneous mixture contains species ("ft", "fu", "b").
Definition: veryInhomogeneousMixture.H:55
Foam::veryInhomogeneousMixture::cellProducts
const ThermoType & cellProducts(const label celli) const
Definition: veryInhomogeneousMixture.H:183
Foam::veryInhomogeneousMixture::mixture
const ThermoType & mixture(const scalar, const scalar) const
Definition: veryInhomogeneousMixture.C:67
veryInhomogeneousMixture.C
Foam::veryInhomogeneousMixture::typeName
static word typeName()
Return the instantiated type name.
Definition: veryInhomogeneousMixture.H:109
Foam::veryInhomogeneousMixture::patchFaceVolMixture
const ThermoType & patchFaceVolMixture(const scalar p, const scalar T, const label patchi, const label facei) const
Definition: veryInhomogeneousMixture.H:150
basicCombustionMixture.H
Foam::veryInhomogeneousMixture::thermoType
ThermoType thermoType
The type of thermodynamics this mixture is instantiated for.
Definition: veryInhomogeneousMixture.H:88
Foam::T
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Definition: FieldFieldFunctions.C:58
Foam::basicCombustionMixture
Specialization of the basicSpecieMixture for combustion.
Definition: basicCombustionMixture.H:53
Foam::veryInhomogeneousMixture::patchFaceReactants
const ThermoType & patchFaceReactants(const label patchi, const label facei) const
Definition: veryInhomogeneousMixture.H:171
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::veryInhomogeneousMixture::cellReactants
const ThermoType & cellReactants(const label celli) const
Definition: veryInhomogeneousMixture.H:165
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::dimensioned< scalar >
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::veryInhomogeneousMixture::cellMixture
const ThermoType & cellMixture(const label celli) const
Definition: veryInhomogeneousMixture.H:121
Foam::veryInhomogeneousMixture::~veryInhomogeneousMixture
virtual ~veryInhomogeneousMixture()=default
Destructor.
Foam::veryInhomogeneousMixture::read
void read(const dictionary &)
Read dictionary.
Definition: veryInhomogeneousMixture.C:92
thermoDict
const dictionary & thermoDict
Definition: EEqn.H:16
Foam::veryInhomogeneousMixture::patchFaceProducts
const ThermoType & patchFaceProducts(const label patchi, const label facei) const
Definition: veryInhomogeneousMixture.H:190
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::veryInhomogeneousMixture::patchFaceMixture
const ThermoType & patchFaceMixture(const label patchi, const label facei) const
Definition: veryInhomogeneousMixture.H:137
Foam::veryInhomogeneousMixture::stoicRatio
const dimensionedScalar & stoicRatio() const
Definition: veryInhomogeneousMixture.H:114
Foam::GeometricField::boundaryField
const Boundary & boundaryField() const
Return const-reference to the boundary field.
Definition: GeometricFieldI.H:62
Foam::veryInhomogeneousMixture::cellVolMixture
const ThermoType & cellVolMixture(const scalar p, const scalar T, const label celli) const
Definition: veryInhomogeneousMixture.H:127
Foam::basicCombustionMixture::fres
scalar fres(const scalar ft, const scalar stoicRatio) const
Definition: basicCombustionMixtureI.H:29