homogeneousMixture.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 | Copyright (C) 2011-2016 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  const ThermoType& mixture(const scalar) const;
91 
92  const ThermoType& cellMixture(const label celli) const
93  {
94  return mixture(b_[celli]);
95  }
96 
97  const ThermoType& patchFaceMixture
98  (
99  const label patchi,
100  const label facei
101  ) const
102  {
103  return mixture(b_.boundaryField()[patchi][facei]);
104  }
106  const ThermoType& cellReactants(const label) const
107  {
108  return reactants_;
109  }
111  const ThermoType& patchFaceReactants(const label, const label) const
112  {
113  return reactants_;
114  }
116  const ThermoType& cellProducts(const label) const
117  {
118  return products_;
119  }
121  const ThermoType& patchFaceProducts(const label, const label) const
122  {
123  return products_;
124  }
125 
126  //- Read dictionary
127  void read(const dictionary&);
128 
129  //- Return thermo based on index
130  const ThermoType& getLocalThermo(const label speciei) const;
131 };
132 
133 
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 
136 } // End namespace Foam
137 
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
139 
140 #ifdef NoRepository
141  #include "homogeneousMixture.C"
142 #endif
143 
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 
146 #endif
147 
148 // ************************************************************************* //
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:137
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
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.