inhomogeneousMixture.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::inhomogeneousMixture
29 
30 Group
31  grpReactionThermophysicalMixtures
32 
33 Description
34  The inhomogeneous mixture contains species ("ft", "b").
35 
36 SourceFiles
37  inhomogeneousMixture.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef inhomogeneousMixture_H
42 #define inhomogeneousMixture_H
43 
44 #include "basicCombustionMixture.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 /*---------------------------------------------------------------------------*\
52  Class inhomogeneousMixture 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  //- Regress variable
74  volScalarField& b_;
75 
76  //- No copy construct
78  (
80  ) = delete;
81 
82 
83 public:
84 
85  //- The type of thermodynamics this mixture is instantiated for
86  typedef ThermoType thermoType;
87 
88 
89  // Constructors
90 
91  //- Construct from dictionary, mesh and phase name
93  (
94  const dictionary& thermoDict,
95  const fvMesh& mesh,
96  const word& phaseName
97  );
98 
99 
100  //- Destructor
101  virtual ~inhomogeneousMixture() = default;
102 
103 
104  // Member functions
105 
106  //- Return the instantiated type name
107  static word typeName()
108  {
109  return "inhomogeneousMixture<" + ThermoType::typeName() + '>';
110  }
111 
112  const dimensionedScalar& stoicRatio() const
113  {
114  return stoicRatio_;
115  }
116 
117  const ThermoType& mixture(const scalar, const scalar) const;
118 
119  const ThermoType& cellMixture(const label celli) const
120  {
121  return mixture(ft_[celli], b_[celli]);
122  }
123 
124  const ThermoType& cellVolMixture
125  (
126  const scalar p,
127  const scalar T,
128  const label celli
129  ) const
130  {
131  return mixture(ft_[celli], b_[celli]);
132  }
133 
134  const ThermoType& patchFaceMixture
135  (
136  const label patchi,
137  const label facei
138  ) const
139  {
140  return mixture
141  (
142  ft_.boundaryField()[patchi][facei],
143  b_.boundaryField()[patchi][facei]
144  );
145  }
146 
147  const ThermoType& patchFaceVolMixture
148  (
149  const scalar p,
150  const scalar T,
151  const label patchi,
152  const label facei
153  ) const
154  {
155  return mixture
156  (
157  ft_.boundaryField()[patchi][facei],
158  b_.boundaryField()[patchi][facei]
159  );
160  }
161 
162  const ThermoType& cellReactants(const label celli) const
163  {
164  return mixture(ft_[celli], 1);
165  }
166 
167  const ThermoType& patchFaceReactants
168  (
169  const label patchi,
170  const label facei
171  ) const
172  {
173  return mixture
174  (
175  ft_.boundaryField()[patchi][facei],
176  1
177  );
178  }
179 
180  const ThermoType& cellProducts(const label celli) const
181  {
182  return mixture(ft_[celli], 0);
183  }
184 
185  const ThermoType& patchFaceProducts
186  (
187  const label patchi,
188  const label facei
189  ) const
190  {
191  return mixture
192  (
193  ft_.boundaryField()[patchi][facei],
194  0
195  );
196  }
197 
198  //- Read dictionary
199  void read(const dictionary&);
200 
201  //- Return thermo based on index
202  const ThermoType& getLocalThermo(const label speciei) const;
203 };
204 
205 
206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
207 
208 } // End namespace Foam
209 
210 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
211 
212 #ifdef NoRepository
213  #include "inhomogeneousMixture.C"
214 #endif
215 
216 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
217 
218 #endif
219 
220 // ************************************************************************* //
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::inhomogeneousMixture::patchFaceMixture
const ThermoType & patchFaceMixture(const label patchi, const label facei) const
Definition: inhomogeneousMixture.H:134
inhomogeneousMixture.C
Foam::inhomogeneousMixture::cellProducts
const ThermoType & cellProducts(const label celli) const
Definition: inhomogeneousMixture.H:179
Foam::inhomogeneousMixture::typeName
static word typeName()
Return the instantiated type name.
Definition: inhomogeneousMixture.H:106
basicCombustionMixture.H
Foam::inhomogeneousMixture::~inhomogeneousMixture
virtual ~inhomogeneousMixture()=default
Destructor.
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::inhomogeneousMixture::stoicRatio
const dimensionedScalar & stoicRatio() const
Definition: inhomogeneousMixture.H:111
Foam::inhomogeneousMixture::cellMixture
const ThermoType & cellMixture(const label celli) const
Definition: inhomogeneousMixture.H:118
Foam::inhomogeneousMixture::mixture
const ThermoType & mixture(const scalar, const scalar) const
Definition: inhomogeneousMixture.C:66
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::dimensioned< scalar >
Foam::inhomogeneousMixture::patchFaceReactants
const ThermoType & patchFaceReactants(const label patchi, const label facei) const
Definition: inhomogeneousMixture.H:167
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::inhomogeneousMixture::cellVolMixture
const ThermoType & cellVolMixture(const scalar p, const scalar T, const label celli) const
Definition: inhomogeneousMixture.H:124
Foam::inhomogeneousMixture::thermoType
ThermoType thermoType
The type of thermodynamics this mixture is instantiated for.
Definition: inhomogeneousMixture.H:85
thermoDict
const dictionary & thermoDict
Definition: EEqn.H:16
Foam::inhomogeneousMixture::patchFaceVolMixture
const ThermoType & patchFaceVolMixture(const scalar p, const scalar T, const label patchi, const label facei) const
Definition: inhomogeneousMixture.H:147
Foam::inhomogeneousMixture::patchFaceProducts
const ThermoType & patchFaceProducts(const label patchi, const label facei) const
Definition: inhomogeneousMixture.H:185
Foam::inhomogeneousMixture::read
void read(const dictionary &)
Read dictionary.
Definition: inhomogeneousMixture.C:91
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::inhomogeneousMixture
The inhomogeneous mixture contains species ("ft", "b").
Definition: inhomogeneousMixture.H:55
Foam::GeometricField::boundaryField
const Boundary & boundaryField() const
Return const-reference to the boundary field.
Definition: GeometricFieldI.H:62
Foam::inhomogeneousMixture::getLocalThermo
const ThermoType & getLocalThermo(const label speciei) const
Return thermo based on index.
Definition: inhomogeneousMixture.C:103
Foam::inhomogeneousMixture::cellReactants
const ThermoType & cellReactants(const label celli) const
Definition: inhomogeneousMixture.H:161