homogeneousMixture.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-2022 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::homogeneousMixture
26 
27 Description
28  Foam::homogeneousMixture
29 
30 SourceFiles
31  homogeneousMixture.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef homogeneousMixture_H
36 #define homogeneousMixture_H
37 
38 #include "basicCombustionMixture.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 /*---------------------------------------------------------------------------*\
46  Class homogeneousMixture 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_ = 1;
72  static const char* specieNames_[1];
73 
74  thermoType reactants_;
75  thermoType products_;
76 
77  mutable thermoType mixture_;
78 
79  //- Regress variable
80  volScalarField& b_;
81 
82 
83 public:
84 
85  // Constructors
86 
87  //- Construct from dictionary, mesh and phase name
88  homogeneousMixture(const dictionary&, const fvMesh&, const word&);
89 
90  //- Disallow default bitwise copy construction
92 
93 
94  //- Destructor
95  virtual ~homogeneousMixture()
96  {}
97 
98 
99  // Member Functions
100 
101  //- Return the instantiated type name
102  static word typeName()
103  {
104  return "homogeneousMixture<" + ThermoType::typeName() + '>';
105  }
106 
107  const thermoType& mixture(const scalar) const;
108 
109  const thermoMixtureType& cellThermoMixture(const label celli) const
110  {
111  return mixture(b_[celli]);
112  }
113 
115  (
116  const label patchi,
117  const label facei
118  ) const
119  {
120  return mixture(b_.boundaryField()[patchi][facei]);
121  }
122 
124  (
125  const label celli
126  ) const
127  {
128  return cellThermoMixture(celli);
129  }
130 
132  (
133  const label patchi,
134  const label facei
135  ) const
136  {
137  return patchFaceThermoMixture(patchi, facei);
138  }
139 
141  (
142  const label,
143  const thermoMixtureType& thermoMixture
144  ) const
145  {
146  return thermoMixture;
147  }
148 
150  (
151  const label,
152  const label,
153  const thermoMixtureType& thermoMixture
154  ) const
155  {
156  return thermoMixture;
157  }
158 
159  const thermoType& cellReactants(const label) const
160  {
161  return reactants_;
162  }
163 
164  const thermoType& patchFaceReactants(const label, const label) const
165  {
166  return reactants_;
167  }
168 
169  const thermoType& cellProducts(const label) const
170  {
171  return products_;
172  }
173 
174  const thermoType& patchFaceProducts(const label, const label) const
175  {
176  return products_;
177  }
178 
179  //- Read dictionary
180  void read(const dictionary&);
181 
182  //- Return thermo based on index
183  const ThermoType& specieThermo(const label speciei) const;
184 
185 
186  // Member Operators
187 
188  //- Disallow default bitwise assignment
189  void operator=(const homogeneousMixture<ThermoType>&) = delete;
190 };
191 
192 
193 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
194 
195 } // End namespace Foam
196 
197 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
198 
199 #ifdef NoRepository
200  #include "homogeneousMixture.C"
201 #endif
202 
203 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 
205 #endif
206 
207 // ************************************************************************* //
Generic GeometricField class.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
Specialisation of the basicMixture for combustion.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:101
Foam::homogeneousMixture.
const transportMixtureType & patchFaceTransportMixture(const label patchi, const label facei) const
const transportMixtureType & cellTransportMixture(const label celli) const
void operator=(const homogeneousMixture< ThermoType > &)=delete
Disallow default bitwise assignment.
const ThermoType & specieThermo(const label speciei) const
Return thermo based on index.
const thermoType & cellProducts(const label) const
ThermoType thermoType
The type of thermodynamics this mixture is instantiated for.
static word typeName()
Return the instantiated type name.
const thermoType & cellReactants(const label) const
const thermoType & patchFaceProducts(const label, const label) const
ThermoType transportMixtureType
Mixing type for transport properties.
virtual ~homogeneousMixture()
Destructor.
ThermoType thermoMixtureType
Mixing type for thermodynamic properties.
const thermoMixtureType & cellThermoMixture(const label celli) const
const thermoType & patchFaceReactants(const label, const label) const
void read(const dictionary &)
Read dictionary.
const thermoType & mixture(const scalar) const
homogeneousMixture(const dictionary &, const fvMesh &, const word &)
Construct from dictionary, mesh and phase name.
const transportMixtureType & patchFaceThermoMixture(const label patchi, const label facei) const
A class for handling words, derived from string.
Definition: word.H:62
label patchi
Namespace for OpenFOAM.
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