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]
96 constantProperties(const dictionary& dict);
100 //- Return const access to the vapourisation temperature
101 inline scalar Tvap() const;
103 //- Return const access to the boiling point
104 inline scalar Tbp() const;
108 //- Class used to pass reacting tracking data to the trackToFace function
111 public ThermoParcel<ParcelType>::trackData
116 //- Reference to the cloud containing this particle
117 ReactingCloud<ParcelType>& cloud_;
119 //- Particle constant properties
120 const constantProperties& constProps_;
122 //- Interpolator for continuous phase pressure field
123 const interpolation<scalar>& pInterp_;
130 //- Construct from components
133 ReactingCloud<ParcelType>& cloud,
134 const constantProperties& constProps,
135 const interpolation<scalar>& rhoInterp,
136 const interpolation<vector>& UInterp,
137 const interpolation<scalar>& muInterp,
138 const interpolation<scalar>& TInterp,
139 const interpolation<scalar>& CpInterp,
140 const interpolation<scalar>& pInterp,
147 //- Return access to the owner cloud
148 inline ReactingCloud<ParcelType>& cloud();
150 //- Return const access to the constant properties
151 inline const constantProperties& constProps() const;
153 //- Return conat access to the interpolator for continuous
154 // phase pressure field
155 inline const interpolation<scalar>& pInterp() const;
165 //- Initial particle mass [kg]
168 //- Mass fractions of mixture []
169 scalarField YMixture_;
171 //- Mass fractions of gases []
174 //- Mass fractions of liquids []
175 scalarField YLiquid_;
177 //- Mass fractions of solids []
180 //- Flag to say that the particle is allowed to combust
181 // Only true after volatile content falls below threshold value
185 // Cell-based quantities
191 // Protected member functions
193 //- Calculate mass transfer
194 template<class TrackData>
195 void calcMassTransfer
204 //- Calculate surface reactions
205 template<class TrackData>
206 void calcSurfaceReactions
220 //- Runtime type information
221 TypeName("ReactingParcel");
223 friend class Cloud<ParcelType>;
228 //- Construct from components
229 inline ReactingParcel
231 ReactingCloud<ParcelType>& owner,
233 const vector& position,
237 const scalar nParticle0,
238 const scalarField& YGas0,
239 const scalarField& YLiquid0,
240 const scalarField& YSolid0,
241 const scalarField& YMixture0,
242 const constantProperties& constProps
245 //- Construct from Istream
248 const Cloud<ParcelType>& c,
250 bool readFields = true
253 //- Construct and return a clone
254 autoPtr<ParcelType> clone() const
256 return autoPtr<ParcelType>(new ReactingParcel<ParcelType>(*this));
264 //- Return const access to mass fractions of gases
265 inline const scalarField& YGas() const;
267 //- Return const access to mass fractions of liquids
268 inline const scalarField& YLiquid() const;
270 //- Return const access to mass fractions of solids
271 inline const scalarField& YSolid() const;
273 //- Return const access to mass fractions of mixture
274 inline const scalarField& YMixture() const;
276 //- Return const access to initial mass
277 inline scalar mass0() const;
282 //- Return access to mass fractions of gases
283 inline scalarField& YGas();
285 //- Return access to mass fractions of liquids
286 inline scalarField& YLiquid();
288 //- Return access to mass fractions of solids
289 inline scalarField& YSolid();
291 //- Return access to mass fractions of mixture
292 inline scalarField& YMixture();
294 //- Return access to initial mass
295 inline scalar& mass0();
298 // Main calculation loop
300 //- Update cell based quantities
301 template<class TrackData>
302 void updateCellQuantities
309 //- Coupled calculation with the continuous phase
310 template<class TrackData>
318 //- Uncoupled calculation with the continuous phase
319 template<class TrackData>
330 static void readFields(ReactingCloud<ParcelType>& c);
332 static void writeFields(const ReactingCloud<ParcelType>& c);
337 friend Ostream& operator<< <ParcelType>
340 const ReactingParcel<ParcelType>&
345 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
347 } // End namespace Foam
349 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
351 #include "ReactingParcelI.H"
353 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
356 #include "ReactingParcel.C"
359 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
363 // ************************************************************************* //