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-2020 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;
109  const thermoMixtureType& cellThermoMixture(const label celli) const
110  {
111  return mixture(b_[celli]);
112  }
113 
114  const transportMixtureType& patchFaceThermoMixture
115  (
116  const label patchi,
117  const label facei
118  ) const
119  {
120  return mixture(b_.boundaryField()[patchi][facei]);
121  }
122 
123  const transportMixtureType& cellTransportMixture
124  (
125  const label celli
126  ) const
127  {
128  return cellThermoMixture(celli);
129  }
130 
131  const transportMixtureType& patchFaceTransportMixture
132  (
133  const label patchi,
134  const label facei
135  ) const
136  {
137  return patchFaceThermoMixture(patchi, facei);
138  }
139 
140  const transportMixtureType& cellTransportMixture
141  (
142  const label,
143  const thermoMixtureType& thermoMixture
144  ) const
145  {
146  return thermoMixture;
147  }
148 
149  const transportMixtureType& patchFaceTransportMixture
150  (
151  const label,
152  const label,
153  const thermoMixtureType& thermoMixture
154  ) const
155  {
156  return thermoMixture;
157  }
159  const thermoType& cellReactants(const label) const
160  {
161  return reactants_;
162  }
164  const thermoType& patchFaceReactants(const label, const label) const
165  {
166  return reactants_;
167  }
169  const thermoType& cellProducts(const label) const
170  {
171  return products_;
172  }
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 // ************************************************************************* //
ThermoType thermoMixtureType
Mixing type for thermodynamic properties.
ThermoType transportMixtureType
Mixing type for transport properties.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
const Boundary & boundaryField() const
Return const-reference to the boundary field.
void operator=(const homogeneousMixture< ThermoType > &)=delete
Disallow default bitwise assignment.
const thermoType & cellProducts(const label) const
const thermoType & cellReactants(const label) const
const thermoType & mixture(const scalar) const
const thermoType & patchFaceProducts(const label, const label) const
virtual ~homogeneousMixture()
Destructor.
static word typeName()
Return the instantiated type name.
const transportMixtureType & patchFaceTransportMixture(const label patchi, const label facei) const
A class for handling words, derived from string.
Definition: word.H:59
Specialisation of the basicMixture for combustion.
const ThermoType & specieThermo(const label speciei) const
Return thermo based on index.
const thermoMixtureType & cellThermoMixture(const label celli) const
Foam::homogeneousMixture.
const transportMixtureType & cellTransportMixture(const label celli) const
ThermoType thermoType
The type of thermodynamics this mixture is instantiated for.
label patchi
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:95
void read(const dictionary &)
Read dictionary.
const transportMixtureType & patchFaceThermoMixture(const label patchi, const label facei) const
homogeneousMixture(const dictionary &, const fvMesh &, const word &)
Construct from dictionary, mesh and phase name.
const thermoType & patchFaceReactants(const label, const label) const
Namespace for OpenFOAM.