00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 #ifndef ReactingMultiphaseParcel_H
00040 #define ReactingMultiphaseParcel_H
00041
00042 #include "ReactingParcel.H"
00043 #include "ReactingMultiphaseCloud.H"
00044
00045
00046
00047 namespace Foam
00048 {
00049
00050 template<class ParcelType>
00051 class ReactingMultiphaseParcel;
00052
00053 template<class ParcelType>
00054 Ostream& operator<<
00055 (
00056 Ostream&,
00057 const ReactingMultiphaseParcel<ParcelType>&
00058 );
00059
00060
00061
00062
00063
00064 template<class ParcelType>
00065 class ReactingMultiphaseParcel
00066 :
00067 public ReactingParcel<ParcelType>
00068 {
00069 public:
00070
00071
00072
00073 static const label GAS;
00074 static const label LIQ;
00075 static const label SLD;
00076
00077
00078
00079 class constantProperties
00080 :
00081 public ReactingParcel<ParcelType>::constantProperties
00082 {
00083
00084
00085
00086 const scalar LDevol_;
00087
00088
00089
00090 scalar hRetentionCoeff_;
00091
00092
00093 public:
00094
00095
00096 constantProperties(const dictionary& parentDict);
00097
00098
00099
00100
00101 inline scalar LDevol() const;
00102
00103
00104
00105 inline scalar hRetentionCoeff() const;
00106 };
00107
00108
00109
00110 class trackData
00111 :
00112 public ReactingParcel<ParcelType>::trackData
00113 {
00114
00115
00116
00117 ReactingMultiphaseCloud<ParcelType>& cloud_;
00118
00119
00120 const constantProperties& constProps_;
00121
00122
00123 public:
00124
00125
00126
00127
00128 inline trackData
00129 (
00130 ReactingMultiphaseCloud<ParcelType>& cloud,
00131 const constantProperties& constProps,
00132 const interpolation<scalar>& rhoInterp,
00133 const interpolation<vector>& UInterp,
00134 const interpolation<scalar>& muInterp,
00135 const interpolation<scalar>& TInterp,
00136 const interpolation<scalar>& CpInterp,
00137 const interpolation<scalar>& pInterp,
00138 const vector& g
00139 );
00140
00141
00142
00143
00144
00145 inline ReactingMultiphaseCloud<ParcelType>& cloud();
00146
00147
00148 inline const constantProperties& constProps() const;
00149 };
00150
00151
00152 private:
00153
00154
00155
00156
00157 template<class TrackData>
00158 scalar cpEff
00159 (
00160 TrackData& td,
00161 const scalar p,
00162 const scalar T,
00163 const label idG,
00164 const label idL,
00165 const label idS
00166 ) const;
00167
00168
00169 template<class TrackData>
00170 scalar HEff
00171 (
00172 TrackData& td,
00173 const scalar p,
00174 const scalar T,
00175 const label idG,
00176 const label idL,
00177 const label idS
00178 ) const;
00179
00180
00181 template<class TrackData>
00182 scalar LEff
00183 (
00184 TrackData& td,
00185 const scalar p,
00186 const scalar T,
00187 const label idG,
00188 const label idL,
00189 const label idS
00190 ) const;
00191
00192
00193 scalar updateMassFractions
00194 (
00195 const scalar mass0,
00196 const scalarField& dMassGas,
00197 const scalarField& dMassLiquid,
00198 const scalarField& dMassSolid
00199 );
00200
00201
00202 protected:
00203
00204
00205
00206
00207
00208
00209 scalarField YGas_;
00210
00211
00212 scalarField YLiquid_;
00213
00214
00215 scalarField YSolid_;
00216
00217
00218
00219 bool canCombust_;
00220
00221
00222
00223
00224
00225 template<class TrackData>
00226 void calcDevolatilisation
00227 (
00228 TrackData& td,
00229 const scalar dt,
00230 const scalar T,
00231 const scalar mass,
00232 const scalar mass0,
00233 const label idVolatile,
00234 const scalar YVolatileTot,
00235 const scalarField& YVolatile,
00236 bool& canCombust,
00237 scalarField& dMassDV,
00238 scalar& Sh,
00239 scalar& dhsTrans
00240 ) const;
00241
00242
00243 template<class TrackData>
00244 void calcSurfaceReactions
00245 (
00246 TrackData& td,
00247 const scalar dt,
00248 const label cellI,
00249 const scalar d,
00250 const scalar T,
00251 const scalar mass,
00252 const bool canCombust,
00253 const scalarField& dMassVolatile,
00254 const scalarField& YMix,
00255 const scalarField& YGas,
00256 const scalarField& YLiquid,
00257 const scalarField& YSolid,
00258 scalarField& dMassSRGas,
00259 scalarField& dMassSRLiquid,
00260 scalarField& dMassSRSolid,
00261 scalarField& dMassSRCarrier,
00262 scalar& Sh,
00263 scalar& dhsTrans
00264 ) const;
00265
00266
00267 public:
00268
00269
00270
00271
00272 static string propHeader;
00273
00274
00275 TypeName("ReactingMultiphaseParcel");
00276
00277
00278 friend class Cloud<ParcelType>;
00279
00280
00281
00282
00283
00284
00285 inline ReactingMultiphaseParcel
00286 (
00287 ReactingMultiphaseCloud<ParcelType>& owner,
00288 const vector& position,
00289 const label cellI
00290 );
00291
00292
00293
00294 inline ReactingMultiphaseParcel
00295 (
00296 ReactingMultiphaseCloud<ParcelType>& owner,
00297 const vector& position,
00298 const label cellI,
00299 const label typeId,
00300 const scalar nParticle0,
00301 const scalar d0,
00302 const vector& U0,
00303 const scalarField& Y0,
00304 const scalarField& YGas0,
00305 const scalarField& YLiquid0,
00306 const scalarField& YSolid0,
00307 const constantProperties& constProps
00308 );
00309
00310
00311 ReactingMultiphaseParcel
00312 (
00313 const Cloud<ParcelType>& c,
00314 Istream& is,
00315 bool readFields = true
00316 );
00317
00318
00319 ReactingMultiphaseParcel(const ReactingMultiphaseParcel& p);
00320
00321
00322 autoPtr<ReactingMultiphaseParcel> clone() const
00323 {
00324 return
00325 autoPtr<ReactingMultiphaseParcel>
00326 (
00327 new ReactingMultiphaseParcel(*this)
00328 );
00329 }
00330
00331
00332
00333
00334
00335
00336
00337 inline const scalarField& YGas() const;
00338
00339
00340 inline const scalarField& YLiquid() const;
00341
00342
00343 inline const scalarField& YSolid() const;
00344
00345
00346 inline bool canCombust() const;
00347
00348
00349
00350
00351
00352 inline scalarField& YGas();
00353
00354
00355 inline scalarField& YLiquid();
00356
00357
00358 inline scalarField& YSolid();
00359
00360
00361 inline bool& canCombust();
00362
00363
00364
00365
00366
00367 template<class TrackData>
00368 void setCellValues
00369 (
00370 TrackData& td,
00371 const scalar dt,
00372 const label cellI
00373 );
00374
00375
00376 template<class TrackData>
00377 void cellValueSourceCorrection
00378 (
00379 TrackData& td,
00380 const scalar dt,
00381 const label cellI
00382 );
00383
00384
00385 template<class TrackData>
00386 void calc
00387 (
00388 TrackData& td,
00389 const scalar dt,
00390 const label cellI
00391 );
00392
00393
00394
00395
00396
00397 static void readFields(ReactingMultiphaseCloud<ParcelType>& c);
00398
00399
00400 static void writeFields
00401 (
00402 const ReactingMultiphaseCloud<ParcelType>& c
00403 );
00404
00405
00406
00407
00408 friend Ostream& operator<< <ParcelType>
00409 (
00410 Ostream&,
00411 const ReactingMultiphaseParcel<ParcelType>&
00412 );
00413 };
00414
00415
00416
00417
00418 }
00419
00420
00421
00422 #include "ReactingMultiphaseParcelI.H"
00423
00424
00425
00426 #ifdef NoRepository
00427 #include "ReactingMultiphaseParcel.C"
00428 #endif
00429
00430
00431
00432 #endif
00433
00434