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 -------------------------------------------------------------------------------
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::basicMultiComponentMixture
28 
29 Group
30  grpReactionThermophysicalMixtures
31 
32 Description
33  Multi-component mixture.
34 
35  Provides a list of mass fraction fields and helper functions to
36  query mixture composition.
37 
38 SourceFiles
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 
54 namespace Foam
55 {
56 
57 /*---------------------------------------------------------------------------*\
58  Class basicMultiComponentMixture Declaration
59 \*---------------------------------------------------------------------------*/
60 
62 :
63  public basicMixture
64 {
65 
66 protected:
67 
68  // Protected data
69 
70  //- Table of specie names
72 
73  //- List of specie active flags
75 
76  //- Species mass fractions
78 
79 
80 public:
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  (
95  const dictionary& thermoDict,
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 // ************************************************************************* //
volFields.H
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::basicMultiComponentMixture::basicMixtureType
basicMultiComponentMixture basicMixtureType
The base class of the mixture.
Definition: basicMultiComponentMixture.H:86
typeInfo.H
Foam::basicMultiComponentMixture::species
const speciesTable & species() const
Return the table of species.
Definition: basicMultiComponentMixtureI.H:29
speciesTable.H
Foam::basicMultiComponentMixture::setInactive
void setInactive(label speciei)
Set speciei inactive.
Definition: basicMultiComponentMixtureI.H:62
Foam::basicMultiComponentMixture::Y
PtrList< volScalarField > & Y()
Return the mass-fraction fields.
Definition: basicMultiComponentMixtureI.H:69
Foam::basicMultiComponentMixture::active_
List< bool > active_
List of specie active flags.
Definition: basicMultiComponentMixture.H:73
Foam::basicMultiComponentMixture::active
const List< bool > & active() const
Return the bool list of active species.
Definition: basicMultiComponentMixtureI.H:50
Foam::basicMultiComponentMixture::TypeName
TypeName("basicMultiComponentMixture")
Run time type information.
Foam::hashedWordList
A wordList with hashed named lookup, which can be faster in some situations than using the normal lis...
Definition: hashedWordList.H:54
Foam::PtrList
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: List.H:59
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::basicMultiComponentMixture::setActive
void setActive(label speciei)
Set speciei active.
Definition: basicMultiComponentMixtureI.H:56
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::basicMultiComponentMixture::contains
bool contains(const word &specieName) const
Does the mixture include this specie?
Definition: basicMultiComponentMixtureI.H:36
Foam::basicMultiComponentMixture::Y_
PtrList< volScalarField > Y_
Species mass fractions.
Definition: basicMultiComponentMixture.H:76
Foam::basicMultiComponentMixture::species_
speciesTable species_
Table of specie names.
Definition: basicMultiComponentMixture.H:70
thermoDict
const dictionary & thermoDict
Definition: EEqn.H:16
Foam::basicMultiComponentMixture::basicMultiComponentMixture
basicMultiComponentMixture(const dictionary &thermoDict, const wordList &specieNames, const fvMesh &mesh, const word &phaseName)
Construct from dictionary, species names, mesh and phase name.
Definition: basicMultiComponentMixture.C:40
Foam::List< bool >
basicMixture.H
Foam::basicMultiComponentMixture::~basicMultiComponentMixture
virtual ~basicMultiComponentMixture()=default
Destructor.
PtrList.H
basicMultiComponentMixtureI.H
Foam::basicMultiComponentMixture
Multi-component mixture.
Definition: basicMultiComponentMixture.H:60
Foam::basicMixture
Foam::basicMixture.
Definition: basicMixture.H:51
Foam::GeometricField< scalar, fvPatchField, volMesh >