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-2015 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
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  }
105 
106  const ThermoType& cellReactants(const label) const
107  {
108  return reactants_;
109  }
110 
111  const ThermoType& patchFaceReactants(const label, const label) const
112  {
113  return reactants_;
114  }
115 
116  const ThermoType& cellProducts(const label) const
117  {
118  return products_;
119  }
120 
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 // ************************************************************************* //
Foam::homogeneousMixture::homogeneousMixture
homogeneousMixture(const homogeneousMixture< ThermoType > &)
Construct as copy (not implemented)
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::homogeneousMixture::read
void read(const dictionary &)
Read dictionary.
Definition: homogeneousMixture.C:87
homogeneousMixture.C
Foam::homogeneousMixture::patchFaceReactants
const ThermoType & patchFaceReactants(const label, const label) const
Definition: homogeneousMixture.H:110
Foam::GeometricField::boundaryField
GeometricBoundaryField & boundaryField()
Return reference to GeometricBoundaryField.
Definition: GeometricField.C:735
Foam::homogeneousMixture::products_
ThermoType products_
Definition: homogeneousMixture.H:59
Foam::homogeneousMixture
Foam::homogeneousMixture.
Definition: homogeneousMixture.H:49
Foam::homogeneousMixture::patchFaceMixture
const ThermoType & patchFaceMixture(const label patchi, const label facei) const
Definition: homogeneousMixture.H:97
Foam::homogeneousMixture::mixture_
ThermoType mixture_
Definition: homogeneousMixture.H:61
Foam::homogeneousMixture::cellReactants
const ThermoType & cellReactants(const label) const
Definition: homogeneousMixture.H:105
Foam::homogeneousMixture::cellMixture
const ThermoType & cellMixture(const label celli) const
Definition: homogeneousMixture.H:91
basicCombustionMixture.H
Foam::homogeneousMixture::thermoType
ThermoType thermoType
The type of thermodynamics this mixture is instantiated for.
Definition: homogeneousMixture.H:73
Foam::label
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
Foam::basicCombustionMixture
Specialization of the basicSpecieMixture for combustion.
Definition: basicCombustionMixture.H:48
Foam::homogeneousMixture::b_
volScalarField & b_
Regress variable.
Definition: homogeneousMixture.H:67
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam::homogeneousMixture::cellProducts
const ThermoType & cellProducts(const label) const
Definition: homogeneousMixture.H:115
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::homogeneousMixture::patchFaceProducts
const ThermoType & patchFaceProducts(const label, const label) const
Definition: homogeneousMixture.H:120
Foam::homogeneousMixture::reactants_
ThermoType reactants_
Definition: homogeneousMixture.H:58
Foam::homogeneousMixture::mixture
const ThermoType & mixture(const scalar) const
Definition: homogeneousMixture.C:64
Foam::homogeneousMixture::getLocalThermo
const ThermoType & getLocalThermo(const label speciei) const
Return thermo based on index.
Definition: homogeneousMixture.C:96
patchi
label patchi
Definition: getPatchFieldScalar.H:1
Foam::homogeneousMixture::specieNames_
static const char * specieNames_[1]
Definition: homogeneousMixture.H:56
Foam::homogeneousMixture::nSpecies_
static const int nSpecies_
Definition: homogeneousMixture.H:55
Foam::GeometricField
Generic GeometricField class.
Definition: surfaceFieldsFwd.H:52
Foam::homogeneousMixture::~homogeneousMixture
virtual ~homogeneousMixture()
Destructor.
Definition: homogeneousMixture.H:83