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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2017 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::homogeneousMixture
28 
29 Group
30  grpReactionThermophysicalMixtures
31 
32 Description
33  The homogeneous mixture contains species ("b").
34 
35 SourceFiles
36  homogeneousMixture.C
37 
38 \*---------------------------------------------------------------------------*/
39 
40 #ifndef homogeneousMixture_H
41 #define homogeneousMixture_H
42 
43 #include "basicCombustionMixture.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class homogeneousMixture Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 template<class ThermoType>
56 :
58 {
59  // Private Data
60 
61  ThermoType reactants_;
62  ThermoType products_;
63 
64  mutable ThermoType mixture_;
65 
66  //- Regress variable
67  volScalarField& b_;
68 
69  //- No copy construct
71 
72 
73 public:
74 
75  //- The type of thermodynamics this mixture is instantiated for
76  typedef ThermoType thermoType;
77 
78 
79  // Constructors
80 
81  //- Construct from dictionary, mesh and phase name
83  (
84  const dictionary& thermoDict,
85  const fvMesh& mesh,
86  const word& phaseName
87  );
88 
89 
90  //- Destructor
91  virtual ~homogeneousMixture() = default;
92 
93 
94  // Member functions
95 
96  //- Return the instantiated type name
97  static word typeName()
98  {
99  return "homogeneousMixture<" + ThermoType::typeName() + '>';
100  }
101 
102  const ThermoType& mixture(const scalar) const;
103 
104  const ThermoType& cellMixture(const label celli) const
105  {
106  return mixture(b_[celli]);
107  }
108 
109  const ThermoType& patchFaceMixture
110  (
111  const label patchi,
112  const label facei
113  ) const
114  {
115  return mixture(b_.boundaryField()[patchi][facei]);
116  }
117 
118  const ThermoType& cellReactants(const label) const
119  {
120  return reactants_;
121  }
122 
123  const ThermoType& patchFaceReactants(const label, const label) const
124  {
125  return reactants_;
126  }
127 
128  const ThermoType& cellProducts(const label) const
129  {
130  return products_;
131  }
132 
133  const ThermoType& patchFaceProducts(const label, const label) const
134  {
135  return products_;
136  }
137 
138  //- Read dictionary
139  void read(const dictionary&);
140 
141  //- Return thermo based on index
142  const ThermoType& getLocalThermo(const label speciei) const;
143 };
144 
145 
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147 
148 } // End namespace Foam
149 
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 
152 #ifdef NoRepository
153  #include "homogeneousMixture.C"
154 #endif
155 
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 
158 #endif
159 
160 // ************************************************************************* //
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::homogeneousMixture::read
void read(const dictionary &)
Read dictionary.
Definition: homogeneousMixture.C:83
homogeneousMixture.C
Foam::homogeneousMixture::patchFaceReactants
const ThermoType & patchFaceReactants(const label, const label) const
Definition: homogeneousMixture.H:122
Foam::homogeneousMixture
The homogeneous mixture contains species ("b").
Definition: homogeneousMixture.H:54
Foam::homogeneousMixture::patchFaceMixture
const ThermoType & patchFaceMixture(const label patchi, const label facei) const
Definition: homogeneousMixture.H:109
Foam::homogeneousMixture::cellReactants
const ThermoType & cellReactants(const label) const
Definition: homogeneousMixture.H:117
Foam::homogeneousMixture::cellMixture
const ThermoType & cellMixture(const label celli) const
Definition: homogeneousMixture.H:103
basicCombustionMixture.H
Foam::homogeneousMixture::thermoType
ThermoType thermoType
The type of thermodynamics this mixture is instantiated for.
Definition: homogeneousMixture.H:75
Foam::basicCombustionMixture
Specialization of the basicSpecieMixture for combustion.
Definition: basicCombustionMixture.H:53
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam::homogeneousMixture::cellProducts
const ThermoType & cellProducts(const label) const
Definition: homogeneousMixture.H:127
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:84
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::homogeneousMixture::patchFaceProducts
const ThermoType & patchFaceProducts(const label, const label) const
Definition: homogeneousMixture.H:132
Foam::homogeneousMixture::mixture
const ThermoType & mixture(const scalar) const
Definition: homogeneousMixture.C:60
thermoDict
const dictionary & thermoDict
Definition: EEqn.H:16
Foam::homogeneousMixture::getLocalThermo
const ThermoType & getLocalThermo(const label speciei) const
Return thermo based on index.
Definition: homogeneousMixture.C:92
Foam::homogeneousMixture::typeName
static word typeName()
Return the instantiated type name.
Definition: homogeneousMixture.H:96
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::homogeneousMixture::~homogeneousMixture
virtual ~homogeneousMixture()=default
Destructor.
Foam::GeometricField::boundaryField
const Boundary & boundaryField() const
Return const-reference to the boundary field.
Definition: GeometricFieldI.H:62