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