zonalMixture.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) 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::zonalMixture
26 
27 Description
28  Foam::zonalMixture
29 
30 SourceFiles
31  zonalMixture.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef zonalMixture_H
36 #define zonalMixture_H
37 
38 #include "PtrList.H"
39 #include "hashedWordList.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class zonalMixture Declaration
48 \*---------------------------------------------------------------------------*/
49 
50 template<class ThermoType>
51 class zonalMixture
52 {
53 public:
54 
55  // Public Typedefs
56 
57  //- The type of thermodynamics this mixture is instantiated for
58  typedef ThermoType thermoType;
59 
60  //- Mixing type for thermodynamic properties
61  typedef ThermoType thermoMixtureType;
62 
63  //- Mixing type for transport properties
64  typedef ThermoType transportMixtureType;
65 
66 
67 private:
68 
69  // Private Data
70 
71  //- Table of zone names
72  hashedWordList zones_;
73 
74  //- List of zone thermos
75  PtrList<ThermoType> zoneThermos_;
76 
77 
78 public:
79 
80  // Constructors
81 
82  //- Construct from a dictionary
83  zonalMixture(const dictionary&);
84 
85  //- Disallow default bitwise copy construction
87  (
89  ) = delete;
90 
91 
92  // Member Functions
93 
94  //- Return the instantiated type name
95  inline static word typeName()
96  {
97  return "zonalMixture<" + ThermoType::typeName() + '>';
98  }
99 
100  //- Return the table of zones
101  inline const hashedWordList& zones() const
102  {
103  return zones_;
104  }
105 
106  //- Read dictionary
107  void read(const dictionary&);
108 
109  //- Return the raw zone thermodynamic data
110  inline const PtrList<ThermoType>& zoneThermos() const
111  {
112  return zoneThermos_;
113  }
114 
115  //- Return thermo based on index
116  inline const ThermoType& zoneThermo(const label zonei) const
117  {
118  return zoneThermos_[zonei];
119  }
120 
121  //- Return the mixture for thermodynamic properties
122  inline const thermoMixtureType& thermoMixture
123  (
124  const label zonei
125  ) const
126  {
127  return zoneThermos_[zonei];
128  }
129 
130  //- Return the mixture for transport properties
132  (
133  const label zonei
134  ) const
135  {
136  return zoneThermos_[zonei];
137  }
138 
139  //- Return the mixture for transport properties
141  (
142  const label zonei,
143  const thermoMixtureType&
144  ) const
145  {
146  return zoneThermos_[zonei];
147  }
148 };
149 
150 
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 
153 } // End namespace Foam
154 
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 
157 #ifdef NoRepository
158  #include "zonalMixture.C"
159 #endif
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 #endif
164 
165  // ************************************************************************* //
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.
A class for handling words, derived from string.
Definition: word.H:63
Foam::zonalMixture.
Definition: zonalMixture.H:51
const thermoMixtureType & thermoMixture(const label zonei) const
Return the mixture for thermodynamic properties.
Definition: zonalMixture.H:122
const transportMixtureType & transportMixture(const label zonei) const
Return the mixture for transport properties.
Definition: zonalMixture.H:131
ThermoType thermoType
The type of thermodynamics this mixture is instantiated for.
Definition: zonalMixture.H:57
static word typeName()
Return the instantiated type name.
Definition: zonalMixture.H:94
ThermoType transportMixtureType
Mixing type for transport properties.
Definition: zonalMixture.H:63
const PtrList< ThermoType > & zoneThermos() const
Return the raw zone thermodynamic data.
Definition: zonalMixture.H:109
ThermoType thermoMixtureType
Mixing type for thermodynamic properties.
Definition: zonalMixture.H:60
void read(const dictionary &)
Read dictionary.
Definition: zonalMixture.C:43
zonalMixture(const dictionary &)
Construct from a dictionary.
Definition: zonalMixture.C:32
const hashedWordList & zones() const
Return the table of zones.
Definition: zonalMixture.H:100
const ThermoType & zoneThermo(const label zonei) const
Return thermo based on index.
Definition: zonalMixture.H:115
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
String typeName(const std::type_info &info)
Return the un-mangled name given the standard type info.