1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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.
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
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/>.
25 Foam::ReactingMultiphaseCloud
28 Templated base class for multiphase reacting cloud
30 - Adds to reacting cloud
31 - multiphase composition
36 ReactingMultiphaseCloudI.H
37 ReactingMultiphaseCloud.C
39 \*---------------------------------------------------------------------------*/
41 #ifndef ReactingMultiphaseCloud_H
42 #define ReactingMultiphaseCloud_H
44 #include "reactingMultiphaseCloud.H"
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 // Forward declaration of classes
53 template<class CloudType>
54 class DevolatilisationModel;
56 template<class CloudType>
57 class SurfaceReactionModel;
59 /*---------------------------------------------------------------------------*\
60 Class ReactingMultiphaseCloud Declaration
61 \*---------------------------------------------------------------------------*/
63 template<class CloudType>
64 class ReactingMultiphaseCloud
67 public reactingMultiphaseCloud
73 //- Type of cloud this cloud was instantiated for
74 typedef CloudType cloudType;
76 //- Type of parcel the cloud was instantiated for
77 typedef typename CloudType::particleType parcelType;
79 //- Convenience typedef for this cloud type
80 typedef ReactingMultiphaseCloud<CloudType> reactingMultiphaseCloudType;
87 //- Cloud copy pointer
88 autoPtr<ReactingMultiphaseCloud<CloudType> > cloudCopyPtr_;
91 // Private member functions
93 //- Disallow default bitwise copy construct
94 ReactingMultiphaseCloud(const ReactingMultiphaseCloud&);
96 //- Disallow default bitwise assignment
97 void operator=(const ReactingMultiphaseCloud&);
104 //- Parcel constant properties
105 typename parcelType::constantProperties constProps_;
108 // References to the cloud sub-models
110 //- Devolatilisation model
113 DevolatilisationModel<ReactingMultiphaseCloud<CloudType> >
115 devolatilisationModel_;
117 //- Surface reaction model
120 SurfaceReactionModel<ReactingMultiphaseCloud<CloudType> >
122 surfaceReactionModel_;
127 //- Total mass transferred to continuous phase via devolatilisation
128 scalar dMassDevolatilisation_;
130 //- Total mass transferred to continuous phase via surface
132 scalar dMassSurfaceReaction_;
135 // Protected Member Functions
139 //- Set cloud sub-models
143 // Cloud evolution functions
145 //- Reset state of cloud
146 void cloudReset(ReactingMultiphaseCloud<CloudType>& c);
153 //- Construct given carrier gas fields
154 ReactingMultiphaseCloud
156 const word& cloudName,
157 const volScalarField& rho,
158 const volVectorField& U,
159 const dimensionedVector& g,
160 const SLGThermo& thermo,
161 bool readFields = true
165 //- Copy constructor with new name
166 ReactingMultiphaseCloud
168 ReactingMultiphaseCloud<CloudType>& c,
172 //- Copy constructor with new name - creates bare cloud
173 ReactingMultiphaseCloud
177 const ReactingMultiphaseCloud<CloudType>& c
180 //- Construct and return clone based on (this) with new name
181 virtual autoPtr<Cloud<parcelType> > clone(const word& name)
183 return autoPtr<Cloud<parcelType> >
185 new ReactingMultiphaseCloud(*this, name)
189 //- Construct and return bare clone based on (this) with new name
190 virtual autoPtr<Cloud<parcelType> > cloneBare(const word& name) const
192 return autoPtr<Cloud<parcelType> >
194 new ReactingMultiphaseCloud(this->mesh(), name, *this)
200 virtual ~ReactingMultiphaseCloud();
207 //- Return a reference to the cloud copy
208 inline const ReactingMultiphaseCloud& cloudCopy() const;
210 //- Return the constant properties
211 inline const typename parcelType::constantProperties&
217 //- Return reference to devolatilisation model
218 inline const DevolatilisationModel
220 ReactingMultiphaseCloud<CloudType>
222 devolatilisation() const;
224 //- Return reference to reacting surface reaction model
225 inline const SurfaceReactionModel
227 ReactingMultiphaseCloud<CloudType>
229 surfaceReaction() const;
234 //- Add to cumulative volatilisation mass transfer
235 void addToMassDevolatilisation(const scalar dMass);
237 //- Add to cumulative surface reaction transfer
238 void addToMassSurfaceReaction(const scalar dMass);
241 // Cloud evolution functions
243 //- Set parcel thermo properties
244 void setParcelThermoProperties
247 const scalar lagrangianDt
250 //- Check parcel properties
251 void checkParcelProperties
254 const scalar lagrangianDt,
255 const bool fullyDescribed
258 //- Store the current cloud state
261 //- Reset the current cloud to the previously stored state
264 //- Reset the cloud source terms
265 void resetSourceTerms();
270 //- Print cloud information
276 //- Write the field data for the cloud
277 virtual void writeFields() const;
281 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
283 } // End namespace Foam
285 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
287 #include "ReactingMultiphaseCloudI.H"
289 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
292 # include "ReactingMultiphaseCloud.C"
295 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
299 // ************************************************************************* //