1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
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
29 Reactinf parcel class with one/two-way coupling with the continuous
30 phase. Includes thermo parcel sub-models, plus:
38 \*---------------------------------------------------------------------------*/
40 #ifndef ReactingParcel_H
41 #define ReactingParcel_H
45 #include "interpolationCellPoint.H"
46 #include "contiguous.H"
48 #include "ThermoParcel.H"
49 #include "ReactingCloud.H"
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56 template<class ParcelType>
59 template<class ParcelType>
63 const ReactingParcel<ParcelType>&
66 /*---------------------------------------------------------------------------*\
67 Class ReactingParcel Declaration
68 \*---------------------------------------------------------------------------*/
70 template<class ParcelType>
73 public ThermoParcel<ParcelType>
78 //- Class to hold reacting particle constant properties
79 class constantProperties
81 public ThermoParcel<ParcelType>::constantProperties
86 //- Vapourisation temperature [K]
92 //- Latent heat of devolatilisation [J/kg]
99 constantProperties(const dictionary& dict);
103 //- Return const access to the vapourisation temperature
104 inline scalar Tvap() const;
106 //- Return const access to the boiling point
107 inline scalar Tbp() const;
109 //- Return const access to the latent heat of devolatilisation
110 inline scalar Ldevol() const;
114 //- Class used to pass reacting tracking data to the trackToFace function
117 public ThermoParcel<ParcelType>::trackData
122 //- Reference to the cloud containing this particle
123 ReactingCloud<ParcelType>& cloud_;
125 //- Particle constant properties
126 const constantProperties& constProps_;
128 //- Interpolator for continuous phase pressure field
129 const interpolation<scalar>& pInterp_;
136 //- Construct from components
139 ReactingCloud<ParcelType>& cloud,
140 const constantProperties& constProps,
141 const interpolation<scalar>& rhoInterp,
142 const interpolation<vector>& UInterp,
143 const interpolation<scalar>& muInterp,
144 const interpolation<scalar>& TInterp,
145 const interpolation<scalar>& CpInterp,
146 const interpolation<scalar>& pInterp,
153 //- Return access to the owner cloud
154 inline ReactingCloud<ParcelType>& cloud();
156 //- Return const access to the constant properties
157 inline const constantProperties& constProps() const;
159 //- Return conat access to the interpolator for continuous
160 // phase pressure field
161 inline const interpolation<scalar>& pInterp() const;
171 //- Initial particle mass [kg]
174 //- Mass fractions of mixture []
175 scalarField YMixture_;
177 //- Mass fractions of gases []
180 //- Mass fractions of liquids []
181 scalarField YLiquid_;
183 //- Mass fractions of solids []
186 //- Flag to say that the particle is allowed to combust
187 // Only true after volatile content falls below threshold value
191 // Cell-based quantities
197 // Protected member functions
199 //- Calculate mass transfer
200 template<class TrackData>
201 void calcMassTransfer
210 //- Calculate surface reactions
211 template<class TrackData>
212 void calcSurfaceReactions
219 const scalarList& dMassMT,
227 //- Runtime type information
228 TypeName("ReactingParcel");
230 friend class Cloud<ParcelType>;
235 //- Construct from components
236 inline ReactingParcel
238 ReactingCloud<ParcelType>& owner,
240 const vector& position,
244 const scalar nParticle0,
245 const scalarField& YGas0,
246 const scalarField& YLiquid0,
247 const scalarField& YSolid0,
248 const scalarField& YMixture0,
249 const constantProperties& constProps
252 //- Construct from Istream
255 const Cloud<ParcelType>& c,
257 bool readFields = true
260 //- Construct and return a clone
261 autoPtr<ParcelType> clone() const
263 return autoPtr<ParcelType>(new ReactingParcel<ParcelType>(*this));
271 //- Return const access to mass fractions of gases
272 inline const scalarField& YGas() const;
274 //- Return const access to mass fractions of liquids
275 inline const scalarField& YLiquid() const;
277 //- Return const access to mass fractions of solids
278 inline const scalarField& YSolid() const;
280 //- Return const access to mass fractions of mixture
281 inline const scalarField& YMixture() const;
283 //- Return const access to initial mass
284 inline scalar mass0() const;
289 //- Return access to mass fractions of gases
290 inline scalarField& YGas();
292 //- Return access to mass fractions of liquids
293 inline scalarField& YLiquid();
295 //- Return access to mass fractions of solids
296 inline scalarField& YSolid();
298 //- Return access to mass fractions of mixture
299 inline scalarField& YMixture();
301 //- Return access to initial mass
302 inline scalar& mass0();
305 // Main calculation loop
307 //- Update cell based quantities
308 template<class TrackData>
309 void updateCellQuantities
316 //- Coupled calculation with the continuous phase
317 template<class TrackData>
325 //- Uncoupled calculation with the continuous phase
326 template<class TrackData>
337 static void readFields(ReactingCloud<ParcelType>& c);
339 static void writeFields(const ReactingCloud<ParcelType>& c);
344 friend Ostream& operator<< <ParcelType>
347 const ReactingParcel<ParcelType>&
352 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
354 } // End namespace Foam
356 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
358 #include "ReactingParcelI.H"
360 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
363 #include "ReactingParcel.C"
366 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
370 // ************************************************************************* //