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 -------------------------------------------------------------------------------
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::inhomogeneousMixture
28 
29 Group
30  grpReactionThermophysicalMixtures
31 
32 Description
33  The inhomogeneous mixture contains species ("ft", "b").
34 
35 SourceFiles
36  inhomogeneousMixture.C
37 
38 \*---------------------------------------------------------------------------*/
39 
40 #ifndef inhomogeneousMixture_H
41 #define inhomogeneousMixture_H
42 
43 #include "basicCombustionMixture.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class inhomogeneousMixture 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  //- Regress variable
73  volScalarField& b_;
74 
75  //- No copy construct
77  (
79  ) = delete;
80 
81 
82 public:
83 
84  //- The type of thermodynamics this mixture is instantiated for
85  typedef ThermoType thermoType;
86 
87 
88  // Constructors
89 
90  //- Construct from dictionary, mesh and phase name
92  (
93  const dictionary& thermoDict,
94  const fvMesh& mesh,
95  const word& phaseName
96  );
97 
98 
99  //- Destructor
100  virtual ~inhomogeneousMixture() = default;
101 
102 
103  // Member functions
104 
105  //- Return the instantiated type name
106  static word typeName()
107  {
108  return "inhomogeneousMixture<" + ThermoType::typeName() + '>';
109  }
110 
111  const dimensionedScalar& stoicRatio() const
112  {
113  return stoicRatio_;
114  }
115 
116  const ThermoType& mixture(const scalar, const scalar) const;
117 
118  const ThermoType& cellMixture(const label celli) const
119  {
120  return mixture(ft_[celli], b_[celli]);
121  }
122 
123  const ThermoType& patchFaceMixture
124  (
125  const label patchi,
126  const label facei
127  ) const
128  {
129  return mixture
130  (
131  ft_.boundaryField()[patchi][facei],
132  b_.boundaryField()[patchi][facei]
133  );
134  }
135 
136  const ThermoType& cellReactants(const label celli) const
137  {
138  return mixture(ft_[celli], 1);
139  }
140 
141  const ThermoType& patchFaceReactants
142  (
143  const label patchi,
144  const label facei
145  ) const
146  {
147  return mixture
148  (
149  ft_.boundaryField()[patchi][facei],
150  1
151  );
152  }
153 
154  const ThermoType& cellProducts(const label celli) const
155  {
156  return mixture(ft_[celli], 0);
157  }
158 
159  const ThermoType& patchFaceProducts
160  (
161  const label patchi,
162  const label facei
163  ) const
164  {
165  return mixture
166  (
167  ft_.boundaryField()[patchi][facei],
168  0
169  );
170  }
171 
172  //- Read dictionary
173  void read(const dictionary&);
174 
175  //- Return thermo based on index
176  const ThermoType& getLocalThermo(const label speciei) const;
177 };
178 
179 
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 
182 } // End namespace Foam
183 
184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 
186 #ifdef NoRepository
187  #include "inhomogeneousMixture.C"
188 #endif
189 
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191 
192 #endif
193 
194 // ************************************************************************* //
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::inhomogeneousMixture::patchFaceMixture
const ThermoType & patchFaceMixture(const label patchi, const label facei) const
Definition: inhomogeneousMixture.H:123
inhomogeneousMixture.C
Foam::inhomogeneousMixture::cellProducts
const ThermoType & cellProducts(const label celli) const
Definition: inhomogeneousMixture.H:153
Foam::inhomogeneousMixture::typeName
static word typeName()
Return the instantiated type name.
Definition: inhomogeneousMixture.H:105
basicCombustionMixture.H
Foam::inhomogeneousMixture::~inhomogeneousMixture
virtual ~inhomogeneousMixture()=default
Destructor.
Foam::basicCombustionMixture
Specialization of the basicSpecieMixture for combustion.
Definition: basicCombustionMixture.H:53
Foam::inhomogeneousMixture::stoicRatio
const dimensionedScalar & stoicRatio() const
Definition: inhomogeneousMixture.H:110
Foam::inhomogeneousMixture::cellMixture
const ThermoType & cellMixture(const label celli) const
Definition: inhomogeneousMixture.H:117
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:121
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:141
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:84
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::inhomogeneousMixture::thermoType
ThermoType thermoType
The type of thermodynamics this mixture is instantiated for.
Definition: inhomogeneousMixture.H:84
thermoDict
const dictionary & thermoDict
Definition: EEqn.H:16
Foam::inhomogeneousMixture::patchFaceProducts
const ThermoType & patchFaceProducts(const label patchi, const label facei) const
Definition: inhomogeneousMixture.H:159
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:54
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:135