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-2021 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 "basicSpecieMixture.H"
39 #include "HashPtrTable.H"
40 #include "specieElement.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class multiComponentMixture Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 template<class ThermoType>
53 :
54  public basicSpecieMixture
55 {
56 
57 public:
58 
59  //- The type of thermodynamics this mixture is instantiated for
60  typedef ThermoType thermoType;
61 
62 
63 private:
64 
65  // Private Data
66 
67  //- List of specie thermo
68  PtrList<ThermoType> specieThermos_;
69 
70  //- Table of species composition
71  List<List<specieElement>> specieCompositions_;
72 
73 
74  // Private Member Functions
75 
76  //- Read the species data from the given dictionary and return
77  PtrList<ThermoType> readSpeciesData(const dictionary& thermoDict) const;
78 
79  //- Read the species composition from the given dictionary and return
80  List<List<specieElement>> readSpeciesComposition
81  (
82  const dictionary& thermoDict
83  ) const;
84 
85 
86 public:
87 
88  // Constructors
89 
90  //- Construct from dictionary, mesh and phase name
91  multiComponentMixture(const dictionary&, const fvMesh&, const word&);
92 
93  //- Disallow default bitwise copy construction
95  (
97  ) = delete;
98 
99 
100  //- Destructor
101  virtual ~multiComponentMixture()
102  {}
103 
104 
105  // Member Functions
106 
107  //- Return the raw specie thermodynamic data
108  inline const PtrList<ThermoType>& specieThermos() const
109  {
110  return specieThermos_;
111  }
112 
113  //- Read dictionary
114  void read(const dictionary&);
115 
116  //- Return thermo based on index
117  inline const ThermoType& specieThermo(const label speciei) const
118  {
119  return specieThermos_[speciei];
120  }
121 
122  //- Return composition based on index
124  (
125  const label speciei
126  ) const;
127 };
128 
129 
130 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
131 
132 } // End namespace Foam
133 
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 
136 #ifdef NoRepository
137  #include "multiComponentMixture.C"
138 #endif
139 
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 
142 #endif
143 
144 // ************************************************************************* //
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
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
const ThermoType & specieThermo(const label speciei) const
Return thermo based on index.
Specialisation of basicMixture for a mixture consisting of a number for molecular species...
virtual ~multiComponentMixture()
Destructor.
const PtrList< ThermoType > & specieThermos() const
Return the raw specie thermodynamic data.
A class for handling words, derived from string.
Definition: word.H:59
Foam::multiComponentMixture.
ThermoType thermoType
The type of thermodynamics this mixture is instantiated for.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
const List< specieElement > & specieComposition(const label speciei) const
Return composition based on index.
multiComponentMixture(const dictionary &, const fvMesh &, const word &)
Construct from dictionary, mesh and phase name.
void read(const dictionary &)
Read dictionary.
Namespace for OpenFOAM.