1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 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, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 Foam::ReactingMultiphaseParcel
29 Multiphase variant of the reacting parcel class with one/two-way coupling
30 with the continuous phase.
33 ReactingMultiphaseParcelI.H
34 ReactingMultiphaseParcel.C
35 ReactingMultiphaseParcelIO.C
37 \*---------------------------------------------------------------------------*/
39 #ifndef ReactingMultiphaseParcel_H
40 #define ReactingMultiphaseParcel_H
42 #include "ReactingParcel.H"
43 #include "ReactingMultiphaseCloud.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 template<class ParcelType>
51 class ReactingMultiphaseParcel;
53 template<class ParcelType>
57 const ReactingMultiphaseParcel<ParcelType>&
60 /*---------------------------------------------------------------------------*\
61 Class ReactingMultiphaseParcel Declaration
62 \*---------------------------------------------------------------------------*/
64 template<class ParcelType>
65 class ReactingMultiphaseParcel
67 public ReactingParcel<ParcelType>
71 // IDs of phases in ReacingParcel phase list (Y)
73 static const label GAS;
74 static const label LIQ;
75 static const label SLD;
78 //- Class to hold reacting multiphase particle constant properties
79 class constantProperties
81 public ReactingParcel<ParcelType>::constantProperties
85 //- Latent heat of devolatilisation [J/kg]
88 //- Fraction of enthalpy retained by parcel due to surface
90 scalar hRetentionCoeff_;
96 constantProperties(const dictionary& parentDict);
100 //- Return const access to the latent heat of devolatilisation
101 inline scalar LDevol() const;
103 //- Return const access to the fraction of enthalpy retained by
104 // parcel due to surface reactions
105 inline scalar hRetentionCoeff() const;
109 //- Class used to pass reacting tracking data to the trackToFace function
112 public ReactingParcel<ParcelType>::trackData
116 //- Reference to the cloud containing this particle
117 ReactingMultiphaseCloud<ParcelType>& cloud_;
119 //- Particle constant properties
120 const constantProperties& constProps_;
127 //- Construct from components
130 ReactingMultiphaseCloud<ParcelType>& cloud,
131 const constantProperties& constProps,
132 const interpolation<scalar>& rhoInterp,
133 const interpolation<vector>& UInterp,
134 const interpolation<scalar>& muInterp,
135 const interpolation<scalar>& TInterp,
136 const interpolation<scalar>& CpInterp,
137 const interpolation<scalar>& pInterp,
144 //- Return access to the owner cloud
145 inline ReactingMultiphaseCloud<ParcelType>& cloud();
147 //- Return const access to the constant properties
148 inline const constantProperties& constProps() const;
154 // Private member functions
156 //- Return the mixture effective specific heat capacity
157 template<class TrackData>
168 //- Return the mixture effective enthalpy
169 template<class TrackData>
180 //- Return the mixture effective latent heat
181 template<class TrackData>
192 //- Update the mass fractions (Y, YGas, YLiquid, YSolid)
193 scalar updateMassFractions
196 const scalarField& dMassGas,
197 const scalarField& dMassLiquid,
198 const scalarField& dMassSolid
208 //- Mass fractions of gases []
211 //- Mass fractions of liquids []
212 scalarField YLiquid_;
214 //- Mass fractions of solids []
217 //- Flag to say that the particle is allowed to combust
218 // Only true after volatile content falls below threshold value
222 // Protected member functions
224 //- Calculate Devolatilisation
225 template<class TrackData>
226 void calcDevolatilisation
229 const scalar dt, // timestep
230 const scalar Ts, // Surface temperature
231 const scalar d, // diameter
232 const scalar T, // temperature
233 const scalar mass, // mass
234 const scalar mass0, // mass (initial on injection)
235 const label idVolatile, // id of volatile phase
236 const scalar YVolatileTot, // total volatile mass fraction
237 const scalarField& YVolatile, // volatile component mass fractions
238 bool& canCombust, // 'can combust' flag
239 scalarField& dMassDV, // mass transfer - local to particle
240 scalar& Sh, // explicit particle enthalpy source
241 scalar& N, // flux of species emitted from particle
242 scalar& NCpW, // sum of N*Cp*W of emission species
243 scalarField& Cs // carrier conc. of emission species
246 //- Calculate surface reactions
247 template<class TrackData>
248 void calcSurfaceReactions
251 const scalar dt, // timestep
252 const label cellI, // owner cell
253 const scalar d, // diameter
254 const scalar T, // temperature
255 const scalar mass, // mass
256 const bool canCombust, // 'can combust' flag
257 const scalar N, // flux of species emitted from particle
258 const scalarField& YMix, // mixture mass fractions
259 const scalarField& YGas, // gas-phase mass fractions
260 const scalarField& YLiquid,// liquid-phase mass fractions
261 const scalarField& YSolid, // solid-phase mass fractions
262 scalarField& dMassSRGas, // gas-phase mass transfer - local
263 scalarField& dMassSRLiquid,// liquid-phase mass transfer - local
264 scalarField& dMassSRSolid, // solid-phase mass transfer - local
265 scalarField& dMassSRCarrier, // carrier phase mass transfer
266 scalar& Sh, // explicit particle enthalpy source
267 scalar& dhsTrans // sensible enthalpy transfer to carrier
273 // Static data members
275 //- String representation of properties
276 static string propHeader;
278 //- Runtime type information
279 TypeName("ReactingMultiphaseParcel");
282 friend class Cloud<ParcelType>;
287 //- Construct from owner, position, and cloud owner
288 // Other properties initialised as null
289 inline ReactingMultiphaseParcel
291 ReactingMultiphaseCloud<ParcelType>& owner,
292 const vector& position,
297 //- Construct from components
298 inline ReactingMultiphaseParcel
300 ReactingMultiphaseCloud<ParcelType>& owner,
301 const vector& position,
304 const scalar nParticle0,
307 const scalarField& Y0,
308 const scalarField& YGas0,
309 const scalarField& YLiquid0,
310 const scalarField& YSolid0,
311 const constantProperties& constProps
314 //- Construct from Istream
315 ReactingMultiphaseParcel
317 const Cloud<ParcelType>& c,
319 bool readFields = true
322 //- Construct as a copy
323 ReactingMultiphaseParcel(const ReactingMultiphaseParcel& p);
325 //- Construct and return a clone
326 autoPtr<ReactingMultiphaseParcel> clone() const
329 autoPtr<ReactingMultiphaseParcel>
331 new ReactingMultiphaseParcel(*this)
340 //- Return const access to mass fractions of gases
341 inline const scalarField& YGas() const;
343 //- Return const access to mass fractions of liquids
344 inline const scalarField& YLiquid() const;
346 //- Return const access to mass fractions of solids
347 inline const scalarField& YSolid() const;
349 //- Return const access to the canCombust flag
350 inline bool canCombust() const;
355 //- Return access to mass fractions of gases
356 inline scalarField& YGas();
358 //- Return access to mass fractions of liquids
359 inline scalarField& YLiquid();
361 //- Return access to mass fractions of solids
362 inline scalarField& YSolid();
364 //- Return access to the canCombust flag
365 inline bool& canCombust();
368 // Main calculation loop
371 template<class TrackData>
379 //- Correct cell values using latest transfer information
380 template<class TrackData>
381 void cellValueSourceCorrection
388 //- Update parcel properties over the time interval
389 template<class TrackData>
401 static void readFields(Cloud<ParcelType>& c);
404 static void writeFields(const Cloud<ParcelType>& c);
409 friend Ostream& operator<< <ParcelType>
412 const ReactingMultiphaseParcel<ParcelType>&
417 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
419 } // End namespace Foam
421 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
423 #include "ReactingMultiphaseParcelI.H"
425 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
428 #include "ReactingMultiphaseParcel.C"
431 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
435 // ************************************************************************* //