pureZoneMixture.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) 2021,2022 OpenCFD Ltd.
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::pureZoneMixture
28 
29 Description
30  Version of pureMixture that uses different mixtures for different
31  cellZones.
32  Every cellZone has to provide an entry for its mixture. A reserved
33  entry 'none' is for all unzoned cells.
34 
35  Example of the zone based mixture specification:
36  \verbatim
37  mixture
38  {
39  solid1
40  {
41  specie
42  {
43  molWeight 50;
44  }
45 
46  transport
47  {
48  kappa 80;
49  }
50 
51  thermodynamics
52  {
53  Hf 0;
54  Cp 450;
55  }
56 
57  equationOfState
58  {
59  rho 8000;
60  }
61  }
62  solid2
63  {
64  //- Start off from 'solid1' properties
65  ${solid1}
66 
67  //- Selectively overwrite properties
68  transport
69  {
70  kappa 8;
71  }
72  }
73  }
74  \endverbatim
75 
76 
77 SourceFiles
78  pureZoneMixture.C
79 
80 \*---------------------------------------------------------------------------*/
81 
82 #ifndef pureZoneMixture_H
83 #define pureZoneMixture_H
84 
85 #include "basicMixture.H"
86 
87 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
88 
89 namespace Foam
90 {
91 
92 /*---------------------------------------------------------------------------*\
93  Class pureZoneMixture Declaration
94 \*---------------------------------------------------------------------------*/
95 
96 template<class ThermoType>
97 class pureZoneMixture
98 :
99  public basicMixture
100 {
101  // Private data
102 
103  const fvMesh& mesh_;
104 
105  //- Inverse zone info
106  labelList zoneID_;
107 
108  //- Species data
109  PtrList<ThermoType> speciesData_;
110 
111  //- Temporary storage for the cell/face mixture thermo data
112  mutable ThermoType mixture_;
113 
114 
115  // Private Member Functions
116 
117  //- Construct the species data from the given dictionary and return the
118  // data for the first specie to initialise the mixture thermo data
119  const ThermoType& constructSpeciesData(const dictionary& thermoDict);
120 
121  //- No copy construct
123 
124 
125 public:
126 
127  //- The type of thermodynamics this mixture is instantiated for
128  typedef ThermoType thermoType;
129 
130 
131  // Constructors
132 
133  //- Construct from dictionary, mesh and phase name
135  (
136  const dictionary& thermoDict,
137  const fvMesh& mesh,
138  const word& phaseName
139  );
140 
141 
142  //- Destructor
143  virtual ~pureZoneMixture() = default;
144 
145 
146  // Member functions
147 
148  //- Return the instantiated type name
149  static word typeName()
150  {
151  return "pureZoneMixture<" + ThermoType::typeName() + '>';
152  }
153 
154  const ThermoType& cellMixture(const label celli) const;
155 
156  const ThermoType& patchFaceMixture
157  (
158  const label patchi,
159  const label facei
160  ) const;
161 
162  const ThermoType& cellVolMixture
163  (
164  const scalar p,
165  const scalar T,
166  const label celli
167  ) const;
168 
169  const ThermoType& patchFaceVolMixture
170  (
171  const scalar p,
172  const scalar T,
173  const label patchi,
174  const label facei
175  ) const;
176 
177  //- Read dictionary
178  void read(const dictionary&);
179 };
180 
181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 
183 } // End namespace Foam
184 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 #ifdef NoRepository
188  #include "pureZoneMixture.C"
189 #endif
190 
191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 
193 #endif
194 
195 // ************************************************************************* //
void read(const dictionary &)
Read dictionary.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
Version of pureMixture that uses different mixtures for different cellZones. Every cellZone has to pr...
const ThermoType & cellVolMixture(const scalar p, const scalar T, const label celli) const
dynamicFvMesh & mesh
A class for handling words, derived from Foam::string.
Definition: word.H:63
virtual ~pureZoneMixture()=default
Destructor.
ThermoType thermoType
The type of thermodynamics this mixture is instantiated for.
const dictionary & thermoDict
Definition: EEqn.H:16
static word typeName()
Return the instantiated type name.
Foam::basicMixture.
Definition: basicMixture.H:47
const ThermoType & cellMixture(const label celli) const
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
const ThermoType & patchFaceVolMixture(const scalar p, const scalar T, const label patchi, const label facei) const
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
volScalarField & p
Namespace for OpenFOAM.
const ThermoType & patchFaceMixture(const label patchi, const label facei) const