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