ReactingHeterogeneousCloud.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) 2018-2019 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::ReactingHeterogeneousCloud
28 
29 Group
30  grpLagrangianIntermediateClouds
31 
32 Description
33  Templated base class for reacting heterogeneous cloud
34 
35  - Adds to reacting cloud:
36  - Heterogeneous reaction model
37 
38 SourceFiles
39  ReactingHeterogeneousCloudI.H
40  ReactingHeterogeneousCloud.C
41 
42 \*---------------------------------------------------------------------------*/
43 
44 #ifndef ReactingHeterogeneousCloud_H
45 #define ReactingHeterogeneousCloud_H
46 
48 
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 
51 namespace Foam
52 {
53 
54 // Forward declaration of classes
55 template<class CloudType>
57 
58 
59 /*---------------------------------------------------------------------------*\
60  Class ReactingHeterogeneousCloud Declaration
61 \*---------------------------------------------------------------------------*/
62 
63 template<class CloudType>
65 :
66  public CloudType,
68 {
69 public:
70 
71  // Public typedefs
72 
73  //- Type of cloud this cloud was instantiated for
74  typedef CloudType cloudType;
75 
76  //- Type of parcel the cloud was instantiated for
77  typedef typename CloudType::particleType parcelType;
78 
79  //- Convenience typedef for this cloud type
82 
83 
84 private:
85 
86  // Private Data
87 
88  //- Cloud copy pointer
90 
91 
92  // Private Member Functions
93 
94  //- No copy construct
96 
97  //- No copy assignment
98  void operator=(const ReactingHeterogeneousCloud&) = delete;
99 
100 
101 protected:
102 
103  // Protected Data
104 
105  // References to the cloud sub-models
106 
107  //- Heterogeneous reaction model
108  autoPtr
109  <
111  <
113  >
115 
116 
117  // Protected Member Functions
118 
119  // Initialisation
120 
121  //- Set cloud sub-models
122  void setModels();
124 
125  // Cloud evolution functions
126 
127  //- Reset state of cloud
129 
130 
131 public:
132 
133  // Constructors
134 
135  //- Construct given carrier gas fields
137  (
138  const word& cloudName,
139  const volScalarField& rho,
140  const volVectorField& U,
141  const dimensionedVector& g,
142  const SLGThermo& thermo,
143  bool readFields = true
144  );
145 
146  //- Copy constructor with new name
148  (
150  );
151 
152  //- Copy constructor with new name - creates bare cloud
154  (
155  const fvMesh& mesh,
156  const word& name,
158  );
159 
160  //- Construct and return clone based on (this) with new name
161  virtual autoPtr<Cloud<parcelType>> clone(const word& name)
162  {
164  (
165  new ReactingHeterogeneousCloud(*this, name)
166  );
167  }
168 
169  //- Construct and return bare clone based on (this) with new name
170  virtual autoPtr<Cloud<parcelType>> cloneBare(const word& name) const
171  {
173  (
174  new ReactingHeterogeneousCloud(this->mesh(), name, *this)
175  );
176  }
177 
178 
179  //- Destructor
180  virtual ~ReactingHeterogeneousCloud() = default;
181 
183  // Member Functions
184 
185  // Access
186 
187  //- Return a reference to the cloud copy
188  inline const ReactingHeterogeneousCloud& cloudCopy() const;
189 
190  //- Return progress variable dimension
191  inline label nF() const;
192 
194  // Sub-models
195 
196  //- Return reference to model
197  inline const HeterogeneousReactingModel
198  <
200  >& heterogeneousReaction() const;
201 
202 
204  <
207 
208 
209  // Cloud evolution functions
210 
211  //- Set parcel thermo properties
213  (
214  parcelType& parcel,
215  const scalar lagrangianDt
216  );
217 
218  //- Check parcel properties
220  (
221  parcelType& parcel,
222  const scalar lagrangianDt,
223  const bool fullyDescribed
224  );
225 
226  //- Store the current cloud state
227  void storeState();
228 
229  //- Reset the current cloud to the previously stored state
230  void restoreState();
231 
232  //- Evolve the cloud
233  void evolve();
234 
235 
236  // Mapping
237 
238  //- Remap the cells of particles corresponding to the
239  // mesh topology change with a default tracking data object
240  virtual void autoMap(const mapPolyMesh&);
241 
242 
243  // I-O
244 
245  //- Print cloud information
246  void info();
247 
248  //- Read particle fields as objects from the obr registry
249  virtual void readObjects(const objectRegistry& obr);
250 
251  //- Write the field data for the cloud
252  virtual void writeFields() const;
253 
254  //- Write particle fields as objects into the obr registry
255  virtual void writeObjects(objectRegistry& obr) const;
256 };
257 
258 
259 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
260 
261 } // End namespace Foam
262 
263 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
264 
266 
267 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
268 
269 #ifdef NoRepository
271 #endif
272 
273 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
274 
275 #endif
276 
277 // ************************************************************************* //
ParcelType particleType
Definition: Cloud.H:130
autoPtr< IOobject > clone() const
Clone.
Definition: IOobject.H:621
virtual void autoMap(const mapPolyMesh &)
Remap the cells of particles corresponding to the.
const word & cloudName() const
Return the cloud type.
Definition: DSMCCloudI.H:30
const word & name() const noexcept
Return the object name.
Definition: IOobjectI.H:195
void setParcelThermoProperties(parcelType &parcel, const scalar lagrangianDt)
Set parcel thermo properties.
CloudType cloudType
Type of cloud this cloud was instantiated for.
void restoreState()
Reset the current cloud to the previously stored state.
label nF() const
Return progress variable dimension.
Templated base class for reacting heterogeneous cloud.
Virtual abstract base class for templated ReactingCloud.
virtual autoPtr< Cloud< parcelType > > cloneBare(const word &name) const
Construct and return bare clone based on (this) with new name.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:157
CloudType::particleType parcelType
Type of parcel the cloud was instantiated for.
void storeState()
Store the current cloud state.
void cloudReset(ReactingHeterogeneousCloud< CloudType > &c)
Reset state of cloud.
virtual void writeObjects(objectRegistry &obr) const
Write particle fields as objects into the obr registry.
ReactingHeterogeneousCloud< CloudType > reactingHeterogeneousCloudType
Convenience typedef for this cloud type.
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const NameMatchPredicate &selectedFields, DynamicList< regIOobject *> &storedObjects)
Read the selected GeometricFields of the templated type and store on the objectRegistry.
A class for handling words, derived from Foam::string.
Definition: word.H:63
void setModels()
Set cloud sub-models.
Thermo package for (S)olids (L)iquids and (G)ases Takes reference to thermo package, and provides:
Definition: SLGThermo.H:60
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:290
const uniformDimensionedVectorField & g
const fvMesh & mesh() const
Return reference to the mesh.
Definition: DSMCCloudI.H:37
autoPtr< HeterogeneousReactingModel< ReactingHeterogeneousCloud< CloudType > > > heterogeneousReactionModel_
Heterogeneous reaction model.
void checkParcelProperties(parcelType &parcel, const scalar lagrangianDt, const bool fullyDescribed)
Check parcel properties.
U
Definition: pEqn.H:72
void info()
Print cloud information.
Base class for heterogeneous reacting models.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
const dimensionedScalar c
Speed of light in a vacuum.
virtual void writeFields() const
Write the field data for the cloud.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
Registry of regIOobjects.
const HeterogeneousReactingModel< ReactingHeterogeneousCloud< CloudType > > & heterogeneousReaction() const
Return reference to model.
virtual ~ReactingHeterogeneousCloud()=default
Destructor.
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:67
Namespace for OpenFOAM.
const ReactingHeterogeneousCloud & cloudCopy() const
Return a reference to the cloud copy.
virtual void readObjects(const objectRegistry &obr)
Read particle fields as objects from the obr registry.