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-2023 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  //- List of specie thermo
66  PtrList<ThermoType> specieThermos_;
67 
68  //- Table of species composition
69  List<List<specieElement>> specieCompositions_;
70 
71  //- Cached IO error locations for delayed error messages
72  List<IOerrorLocation> specieDictLocations_;
73 
74 
75 public:
76 
77  // Constructors
78 
79  //- Construct from a dictionary
81 
82  //- Disallow default bitwise copy construction
84  (
86  ) = delete;
87 
88 
89  //- Destructor
90  virtual ~multicomponentMixture()
91  {}
92 
93 
94  // Member Functions
95 
96  //- Return the specie names
97  wordList specieNames() const;
98 
99  //- Read dictionary
100  void read(const dictionary&);
101 
102  //- Return the raw specie thermodynamic data
103  inline const PtrList<ThermoType>& specieThermos() const
104  {
105  return specieThermos_;
106  }
107 
108  //- Return thermo based on index
109  inline const ThermoType& specieThermo(const label speciei) const
110  {
111  return specieThermos_[speciei];
112  }
113 
114  //- Return composition based on index
115  const List<specieElement>& specieComposition(const label speciei) const;
116 };
117 
118 
119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
120 
121 } // End namespace Foam
122 
123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124 
125 #ifdef NoRepository
126  #include "multicomponentMixture.C"
127 #endif
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 #endif
132 
133 // ************************************************************************* //
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 keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
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.
multicomponentMixture(const dictionary &)
Construct from a dictionary.
void read(const dictionary &)
Read dictionary.
virtual ~multicomponentMixture()
Destructor.
const PtrList< ThermoType > & specieThermos() const
Return the raw specie thermodynamic data.
wordList specieNames() const
Return the specie names.
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