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-2019 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  // Private Data
55 
56  static const int nSpecies_ = 1;
57  static const char* specieNames_[1];
58 
59  ThermoType reactants_;
60  ThermoType products_;
61 
62  mutable ThermoType mixture_;
63 
64  //- Construct as copy (not implemented)
66 
67  //- Regress variable
68  volScalarField& b_;
69 
70 
71 public:
72 
73  //- The type of thermodynamics this mixture is instantiated for
74  typedef ThermoType thermoType;
75 
76 
77  // Constructors
78 
79  //- Construct from dictionary, mesh and phase name
80  homogeneousMixture(const dictionary&, const fvMesh&, const word&);
81 
82 
83  //- Destructor
84  virtual ~homogeneousMixture()
85  {}
86 
87 
88  // Member Functions
89 
90  //- Return the instantiated type name
91  static word typeName()
92  {
93  return "homogeneousMixture<" + ThermoType::typeName() + '>';
94  }
95 
96  const ThermoType& mixture(const scalar) const;
97 
98  const ThermoType& cellMixture(const label celli) const
99  {
100  return mixture(b_[celli]);
101  }
102 
103  const ThermoType& patchFaceMixture
104  (
105  const label patchi,
106  const label facei
107  ) const
108  {
109  return mixture(b_.boundaryField()[patchi][facei]);
110  }
112  const ThermoType& cellReactants(const label) const
113  {
114  return reactants_;
115  }
117  const ThermoType& patchFaceReactants(const label, const label) const
118  {
119  return reactants_;
120  }
122  const ThermoType& cellProducts(const label) const
123  {
124  return products_;
125  }
127  const ThermoType& patchFaceProducts(const label, const label) const
128  {
129  return products_;
130  }
131 
132  //- Read dictionary
133  void read(const dictionary&);
134 
135  //- Return thermo based on index
136  const ThermoType& getLocalThermo(const label speciei) const;
137 };
138 
139 
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 
142 } // End namespace Foam
143 
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
145 
146 #ifdef NoRepository
147  #include "homogeneousMixture.C"
148 #endif
149 
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 
152 #endif
153 
154 // ************************************************************************* //
const ThermoType & patchFaceReactants(const label, const label) const
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
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
const Boundary & boundaryField() const
Return const-reference to the boundary field.
const ThermoType & mixture(const scalar) const
virtual ~homogeneousMixture()
Destructor.
const ThermoType & patchFaceMixture(const label patchi, const label facei) const
static word typeName()
Return the instantiated type name.
A class for handling words, derived from string.
Definition: word.H:59
Specialization of the basicSpecieMixture for combustion.
const ThermoType & cellReactants(const label) const
const ThermoType & cellMixture(const label celli) const
Foam::homogeneousMixture.
const ThermoType & patchFaceProducts(const label, const label) 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:78
void read(const dictionary &)
Read dictionary.
const ThermoType & cellProducts(const label) const
const ThermoType & getLocalThermo(const label speciei) const
Return thermo based on index.
Namespace for OpenFOAM.