multicomponentMixture.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2026 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::multicomponentMixture
26 
27 Description
28  Foam::multicomponentMixture
29 
30 SourceFiles
31  multicomponentMixture.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef multicomponentMixture_H
36 #define multicomponentMixture_H
37 
38 #include "PtrList.H"
39 #include "specieElement.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class multicomponentMixture Declaration
48 \*---------------------------------------------------------------------------*/
49 
50 template<class ThermoType>
52 {
53 public:
54 
55  // Public Typedefs
56 
57  //- The type of thermodynamics this mixture is instantiated for
58  typedef ThermoType thermoType;
59 
60 
61 private:
62 
63  // Private Data
64 
65  //- Table of specie names
66  speciesTable species_;
67 
68  //- List of specie thermo
69  PtrList<ThermoType> specieThermos_;
70 
71  //- Table of species composition
72  List<List<specieElement>> specieCompositions_;
73 
74  //- List of specie active flags
75  boolList active_;
76 
77  //- Cached IO error locations for delayed error messages
78  List<IOerrorLocation> specieDictLocations_;
79 
80 
81 public:
82 
83  // Constructors
84 
85  //- Construct from a dictionary
87 
88  //- Disallow default bitwise copy construction
90  (
92  ) = delete;
93 
94 
95  // Member Functions
96 
97  //- Return the table of species
98  const speciesTable& species() const
99  {
100  return species_;
101  }
102 
103  //- Read dictionary
104  void read(const dictionary&);
105 
106  //- Return the raw specie thermodynamic data
107  inline const PtrList<ThermoType>& specieThermos() const
108  {
109  return specieThermos_;
110  }
111 
112  //- Return thermo based on index
113  inline const ThermoType& specieThermo(const label speciei) const
114  {
115  return specieThermos_[speciei];
116  }
117 
118  //- Return composition based on index
119  const List<specieElement>& specieComposition(const label speciei) const;
120 
121  //- Access the specie active flags
122  const boolList& speciesActive() const;
123 
124  //- Access the specie active flags
126 };
127 
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 } // End namespace Foam
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
135 #ifdef NoRepository
136  #include "multicomponentMixture.C"
137 #endif
138 
139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 
141 #endif
142 
143 // ************************************************************************* //
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: List.H:91
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
A wordList with hashed indices for faster lookup by name.
Foam::multicomponentMixture.
const ThermoType & specieThermo(const label speciei) const
Return thermo based on index.
const List< specieElement > & specieComposition(const label speciei) const
Return composition based on index.
ThermoType thermoType
The type of thermodynamics this mixture is instantiated for.
const boolList & speciesActive() const
Access the specie active flags.
multicomponentMixture(const dictionary &)
Construct from a dictionary.
void read(const dictionary &)
Read dictionary.
const speciesTable & species() const
Return the table of species.
const PtrList< ThermoType > & specieThermos() const
Return the raw specie thermodynamic data.
Namespace for OpenFOAM.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59