multiComponentMixture.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) 2021 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::multiComponentMixture
29
30Group
31 grpReactionThermophysicalMixtures
32
33Description
34 Foam::multiComponentMixture
35
36SourceFiles
37 multiComponentMixture.C
38
39\*---------------------------------------------------------------------------*/
40
41#ifndef multiComponentMixture_H
42#define multiComponentMixture_H
43
44#include "basicSpecieMixture.H"
45#include "Reaction.H" // For ReactionTable
46
47// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48
49namespace Foam
50{
51
52/*---------------------------------------------------------------------------*\
53 Class multiComponentMixture Declaration
54\*---------------------------------------------------------------------------*/
55
56template<class ThermoType>
58:
60{
61 // Private Data
62
63 //- Species data
64 PtrList<ThermoType> speciesData_;
65
66 //- Temporary storage for the cell/face mixture thermo data
67 mutable ThermoType mixture_;
68
69 //- Temporary storage for the volume weighted
70 // cell/face mixture thermo data
71 mutable ThermoType mixtureVol_;
72
73
74 // Private Member Functions
75
76 //- Construct the species data from the given dictionary and return the
77 // data for the first specie to initialise the mixture thermo data
78 const ThermoType& constructSpeciesData(const dictionary& thermoDict);
79
80 //- Correct the mass fractions to sum to 1
81 void correctMassFractions();
82
83 //- Construct as copy (not implemented)
85
86
87public:
88
89 //- The type of thermodynamics this mixture is instantiated for
90 typedef ThermoType thermoType;
91
92
93 // Constructors
94
95 //- Construct from dictionary, specie names, thermo database,
96 //- mesh and phase name
98 (
99 const dictionary&,
100 const wordList& specieNames,
101 const ReactionTable<ThermoType>& thermoData,
102 const fvMesh& mesh,
103 const word& phaseName
104 );
105
106 //- Construct from dictionary, mesh and phase name
108 (
109 const dictionary& thermoDict,
110 const fvMesh& mesh,
111 const word& phaseName
112 );
113
114
115 //- Destructor
116 virtual ~multiComponentMixture() = default;
117
118
119 // Member functions
120
121 //- Return the instantiated type name
122 static word typeName()
123 {
124 return "multiComponentMixture<" + ThermoType::typeName() + '>';
125 }
126
127 const ThermoType& cellMixture(const label celli) const;
128
129 const ThermoType& patchFaceMixture
130 (
131 const label patchi,
132 const label facei
133 ) const;
134
135 const ThermoType& cellVolMixture
136 (
137 const scalar p,
138 const scalar T,
139 const label celli
140 ) const;
141
142 const ThermoType& patchFaceVolMixture
143 (
144 const scalar p,
145 const scalar T,
146 const label patchi,
147 const label facei
148 ) const;
149
150 //- Return the raw specie thermodynamic data
151 const PtrList<ThermoType>& speciesData() const
152 {
153 return speciesData_;
154 }
155
156 //- Read dictionary
157 void read(const dictionary&);
158
159 //- Return thermo based on index
160 inline const ThermoType& getLocalThermo(const label speciei) const
161 {
162 return speciesData_[speciei];
163 }
164};
165
166
167// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168
169} // End namespace Foam
170
171// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172
173#ifdef NoRepository
174 #include "multiComponentMixture.C"
175#endif
176
177// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178
179#endif
180
181// ************************************************************************* //
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: PtrList.H:73
Specialization of basicMultiComponentMixture for a mixture consisting of a number for molecular speci...
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
Foam::multiComponentMixture.
const ThermoType & cellMixture(const label celli) const
const PtrList< ThermoType > & speciesData() const
Return the raw specie thermodynamic data.
ThermoType thermoType
The type of thermodynamics this mixture is instantiated for.
virtual ~multiComponentMixture()=default
Destructor.
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
void read(const dictionary &)
Read dictionary.
const ThermoType & getLocalThermo(const label speciei) const
Return thermo based on index.
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.