basicMultiComponentMixture.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-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::basicMultiComponentMixture
28
29Group
30 grpReactionThermophysicalMixtures
31
32Description
33 Multi-component mixture.
34
35 Provides a list of mass fraction fields and helper functions to
36 query mixture composition.
37
38SourceFiles
39 basicMultiComponentMixture.C
40
41\*---------------------------------------------------------------------------*/
42
43#ifndef basicMultiComponentMixture_H
44#define basicMultiComponentMixture_H
45
46#include "volFields.H"
47#include "PtrList.H"
48#include "basicMixture.H"
49#include "speciesTable.H"
50#include "typeInfo.H"
51
52// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53
54namespace Foam
55{
56
57/*---------------------------------------------------------------------------*\
58 Class basicMultiComponentMixture Declaration
59\*---------------------------------------------------------------------------*/
62:
63 public basicMixture
64{
65
66protected:
67
68 // Protected data
69
70 //- Table of specie names
72
73 //- List of specie active flags
75
76 //- Species mass fractions
78
79
80public:
81
82 //- Run time type information
83 TypeName("basicMultiComponentMixture");
84
85
86 //- The base class of the mixture
88
89
90 // Constructors
91
92 //- Construct from dictionary, species names, mesh and phase name
94 (
96 const wordList& specieNames,
97 const fvMesh& mesh,
98 const word& phaseName
99 );
100
101
102 //- Destructor
103 virtual ~basicMultiComponentMixture() = default;
104
105
106 // Member functions
107
108 //- Return the table of species
109 inline const speciesTable& species() const;
110
111 //- Does the mixture include this specie?
112 inline bool contains(const word& specieName) const;
113
114 //- Return true for active species
115 inline bool active(label speciei) const;
116
117 //- Return the bool list of active species
118 inline const List<bool>& active() const;
119
120 //- Set speciei active
121 inline void setActive(label speciei);
122
123 //- Set speciei inactive
124 inline void setInactive(label speciei);
125
126 //- Return the mass-fraction fields
127 inline PtrList<volScalarField>& Y();
128
129 //- Return the const mass-fraction fields
130 inline const PtrList<volScalarField>& Y() const;
131
132 //- Return the mass-fraction field for a specie given by index
133 inline volScalarField& Y(const label i);
134
135 //- Return the const mass-fraction field for a specie given by index
136 inline const volScalarField& Y(const label i) const;
137
138 //- Return the mass-fraction field for a specie given by name
139 inline volScalarField& Y(const word& specieName);
140
141 //- Return the const mass-fraction field for a specie given by name
142 inline const volScalarField& Y(const word& specieName) const;
143};
144
145
146// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147
148} // End namespace Foam
149
150// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151
153
154// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155
156#endif
157
158// ************************************************************************* //
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: List.H:77
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: PtrList.H:73
Foam::basicMixture.
Definition: basicMixture.H:52
const List< bool > & active() const
Return the bool list of active species.
basicMultiComponentMixture basicMixtureType
The base class of the mixture.
List< bool > active_
List of specie active flags.
void setActive(label speciei)
Set speciei active.
const speciesTable & species() const
Return the table of species.
TypeName("basicMultiComponentMixture")
Run time type information.
void setInactive(label speciei)
Set speciei inactive.
speciesTable species_
Table of specie names.
virtual ~basicMultiComponentMixture()=default
Destructor.
PtrList< volScalarField > & Y()
Return the mass-fraction fields.
PtrList< volScalarField > Y_
Species mass fractions.
bool contains(const word &specieName) const
Does the mixture include this specie?
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
A wordList with hashed named lookup, which can be faster in some situations than using the normal lis...
A class for handling words, derived from Foam::string.
Definition: word.H:68
const dictionary & thermoDict
Definition: EEqn.H:16
dynamicFvMesh & mesh
Namespace for OpenFOAM.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73