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();
123 
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 
182 
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 
193 
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 // ************************************************************************* //
Foam::ReactingHeterogeneousCloud::checkParcelProperties
void checkParcelProperties(parcelType &parcel, const scalar lagrangianDt, const bool fullyDescribed)
Check parcel properties.
Definition: ReactingHeterogeneousCloud.C:163
Foam::ReactingHeterogeneousCloud::cloneBare
virtual autoPtr< Cloud< parcelType > > cloneBare(const word &name) const
Construct and return bare clone based on (this) with new name.
Definition: ReactingHeterogeneousCloud.H:169
Foam::ReactingHeterogeneousCloud::nF
label nF() const
Return progress variable dimension.
Definition: ReactingHeterogeneousCloudI.H:57
Foam::HeterogeneousReactingModel
Base class for heterogeneous reacting models.
Definition: ReactingHeterogeneousCloud.H:55
Foam::ReactingHeterogeneousCloud::readObjects
virtual void readObjects(const objectRegistry &obr)
Read particle fields as objects from the obr registry.
Definition: ReactingHeterogeneousCloud.C:263
Foam::ReactingHeterogeneousCloud::cloudCopy
const ReactingHeterogeneousCloud & cloudCopy() const
Return a reference to the cloud copy.
Definition: ReactingHeterogeneousCloudI.H:32
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::SLGThermo
Thermo package for (S)olids (L)iquids and (G)ases Takes reference to thermo package,...
Definition: SLGThermo.H:64
Foam::ReactingHeterogeneousCloud::restoreState
void restoreState()
Reset the current cloud to the previously stored state.
Definition: ReactingHeterogeneousCloud.C:215
thermo
Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the templa...
Foam::ReactingHeterogeneousCloud::heterogeneousReaction
const HeterogeneousReactingModel< ReactingHeterogeneousCloud< CloudType > > & heterogeneousReaction() const
Return reference to model.
Definition: ReactingHeterogeneousCloudI.H:41
Foam::ReactingHeterogeneousCloud::storeState
void storeState()
Store the current cloud state.
Definition: ReactingHeterogeneousCloud.C:202
Foam::ReactingHeterogeneousCloud
Templated base class for reacting heterogeneous cloud.
Definition: ReactingHeterogeneousCloud.H:63
Foam::ReactingHeterogeneousCloud::evolve
void evolve()
Evolve the cloud.
Definition: ReactingHeterogeneousCloud.C:223
Foam::reactingHeterogeneousCloud
Virtual abstract base class for templated ReactingCloud.
Definition: reactingHeterogeneousCloud.H:50
rho
rho
Definition: readInitialConditions.H:88
ReactingHeterogeneousCloud.C
Foam::ReactingHeterogeneousCloud::cloudReset
void cloudReset(ReactingHeterogeneousCloud< CloudType > &c)
Reset state of cloud.
Definition: ReactingHeterogeneousCloud.C:49
Foam::objectRegistry
Registry of regIOobjects.
Definition: objectRegistry.H:60
Foam::DSMCCloud::cloudName
const word & cloudName() const
Return the cloud type.
Definition: DSMCCloudI.H:37
Foam::ReactingHeterogeneousCloud::writeObjects
virtual void writeObjects(objectRegistry &obr) const
Write particle fields as objects into the obr registry.
Definition: ReactingHeterogeneousCloud.C:271
Foam::DSMCCloud::mesh
const fvMesh & mesh() const
Return reference to the mesh.
Definition: DSMCCloudI.H:44
Foam::ReactingHeterogeneousCloud::autoMap
virtual void autoMap(const mapPolyMesh &)
Remap the cells of particles corresponding to the.
Definition: ReactingHeterogeneousCloud.C:236
Foam::ReactingHeterogeneousCloud::writeFields
virtual void writeFields() const
Write the field data for the cloud.
Definition: ReactingHeterogeneousCloud.C:255
Foam::DSMCCloud
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:71
reactingHeterogeneousCloud.H
Foam::ReactingHeterogeneousCloud::setModels
void setModels()
Set cloud sub-models.
Definition: ReactingHeterogeneousCloud.C:34
Foam::dimensioned< vector >
Foam::ReactingHeterogeneousCloud::~ReactingHeterogeneousCloud
virtual ~ReactingHeterogeneousCloud()=default
Destructor.
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam::Cloud::particleType
ParticleType particleType
Definition: Cloud.H:114
g
const uniformDimensionedVectorField & g
Definition: createFluidFields.H:26
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::readFields
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const wordHashSet &selectedFields, LIFOStack< regIOobject * > &storedObjects)
Read the selected GeometricFields of the templated type.
Definition: ReadFieldsTemplates.C:312
Foam::ReactingHeterogeneousCloud::parcelType
CloudType::particleType parcelType
Type of parcel the cloud was instantiated for.
Definition: ReactingHeterogeneousCloud.H:76
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
U
U
Definition: pEqn.H:72
Foam::ReactingHeterogeneousCloud::reactingHeterogeneousCloudType
ReactingHeterogeneousCloud< CloudType > reactingHeterogeneousCloudType
Convenience typedef for this cloud type.
Definition: ReactingHeterogeneousCloud.H:80
Foam::ReactingHeterogeneousCloud::info
void info()
Print cloud information.
Definition: ReactingHeterogeneousCloud.C:247
Foam::ReactingHeterogeneousCloud::cloudType
CloudType cloudType
Type of cloud this cloud was instantiated for.
Definition: ReactingHeterogeneousCloud.H:73
Foam::ReactingHeterogeneousCloud::clone
virtual autoPtr< Cloud< parcelType > > clone(const word &name)
Construct and return clone based on (this) with new name.
Definition: ReactingHeterogeneousCloud.H:160
Foam::mapPolyMesh
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:161
Foam::constant::universal::c
const dimensionedScalar c
Speed of light in a vacuum.
Foam::name
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
ReactingHeterogeneousCloudI.H
Foam::ReactingHeterogeneousCloud::heterogeneousReactionModel_
autoPtr< HeterogeneousReactingModel< ReactingHeterogeneousCloud< CloudType > > > heterogeneousReactionModel_
Heterogeneous reaction model.
Definition: ReactingHeterogeneousCloud.H:113
Foam::ReactingHeterogeneousCloud::setParcelThermoProperties
void setParcelThermoProperties(parcelType &parcel, const scalar lagrangianDt)
Set parcel thermo properties.
Definition: ReactingHeterogeneousCloud.C:122
Foam::GeometricField< scalar, fvPatchField, volMesh >