KinematicParcel.H
Go to the documentation of this file.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
00040
00041
00042
00043
00044 #ifndef KinematicParcel_H
00045 #define KinematicParcel_H
00046
00047 #include "Particle.H"
00048 #include "IOstream.H"
00049 #include "autoPtr.H"
00050 #include "interpolationCellPoint.H"
00051 #include "contiguous.H"
00052 #include "mathematicalConstants.H"
00053
00054 #include "KinematicCloud.H"
00055
00056
00057
00058 namespace Foam
00059 {
00060
00061 template<class ParcelType>
00062 class KinematicParcel;
00063
00064
00065
00066 template<class ParcelType>
00067 Ostream& operator<<
00068 (
00069 Ostream&,
00070 const KinematicParcel<ParcelType>&
00071 );
00072
00073
00074
00075
00076
00077 template<class ParcelType>
00078 class KinematicParcel
00079 :
00080 public Particle<ParcelType>
00081 {
00082 public:
00083
00084
00085 class constantProperties
00086 {
00087
00088
00089
00090 const dictionary dict_;
00091
00092
00093 const scalar rhoMin_;
00094
00095
00096 const scalar rho0_;
00097
00098
00099 const scalar minParticleMass_;
00100
00101
00102 public:
00103
00104
00105 constantProperties(const dictionary& parentDict);
00106
00107
00108
00109
00110 inline const dictionary& dict() const;
00111
00112
00113 inline scalar rhoMin() const;
00114
00115
00116 inline scalar rho0() const;
00117
00118
00119 inline scalar minParticleMass() const;
00120 };
00121
00122
00123
00124 class trackData
00125 :
00126 public Particle<ParcelType>::trackData
00127 {
00128
00129
00130
00131 KinematicCloud<ParcelType>& cloud_;
00132
00133
00134 const constantProperties& constProps_;
00135
00136
00137
00138
00139
00140 const interpolation<scalar>& rhoInterp_;
00141
00142
00143 const interpolation<vector>& UInterp_;
00144
00145
00146 const interpolation<scalar>& muInterp_;
00147
00148
00149 const vector& g_;
00150
00151
00152 public:
00153
00154
00155
00156
00157 inline trackData
00158 (
00159 KinematicCloud<ParcelType>& cloud,
00160 const constantProperties& constProps,
00161 const interpolation<scalar>& rhoInterp,
00162 const interpolation<vector>& UInterp,
00163 const interpolation<scalar>& muInterp,
00164 const vector& g
00165 );
00166
00167
00168
00169
00170
00171 inline KinematicCloud<ParcelType>& cloud();
00172
00173
00174 inline const constantProperties& constProps() const;
00175
00176
00177
00178 inline const interpolation<scalar>& rhoInterp() const;
00179
00180
00181
00182 inline const interpolation<vector>& UInterp() const;
00183
00184
00185
00186 inline const interpolation<scalar>& muInterp() const;
00187
00188
00189 inline const vector& g() const;
00190 };
00191
00192
00193 protected:
00194
00195
00196
00197
00198
00199
00200 label typeId_;
00201
00202
00203 scalar nParticle_;
00204
00205
00206 scalar d_;
00207
00208
00209 vector U_;
00210
00211
00212 scalar rho_;
00213
00214
00215 scalar tTurb_;
00216
00217
00218 vector UTurb_;
00219
00220
00221
00222
00223
00224 scalar rhoc_;
00225
00226
00227 vector Uc_;
00228
00229
00230 scalar muc_;
00231
00232
00233
00234
00235
00236 template<class TrackData>
00237 const vector calcVelocity
00238 (
00239 TrackData& td,
00240 const scalar dt,
00241 const label cellI,
00242 const scalar d,
00243 const vector& U,
00244 const scalar rho,
00245 const scalar mass,
00246 const vector& Su,
00247 vector& dUTrans
00248 ) const;
00249
00250
00251 public:
00252
00253
00254
00255
00256 static string propHeader;
00257
00258
00259 TypeName("KinematicParcel");
00260
00261
00262 friend class Cloud<ParcelType>;
00263
00264
00265
00266
00267
00268
00269 inline KinematicParcel
00270 (
00271 KinematicCloud<ParcelType>& owner,
00272 const vector& position,
00273 const label cellI
00274 );
00275
00276
00277 inline KinematicParcel
00278 (
00279 KinematicCloud<ParcelType>& owner,
00280 const vector& position,
00281 const label cellI,
00282 const label typeId,
00283 const scalar nParticle0,
00284 const scalar d0,
00285 const vector& U0,
00286 const constantProperties& constProps
00287 );
00288
00289
00290 KinematicParcel
00291 (
00292 const Cloud<ParcelType>& c,
00293 Istream& is,
00294 bool readFields = true
00295 );
00296
00297
00298 KinematicParcel(const KinematicParcel& p);
00299
00300
00301 autoPtr<KinematicParcel> clone() const
00302 {
00303 return autoPtr<KinematicParcel>(new KinematicParcel(*this));
00304 }
00305
00306
00307
00308
00309
00310
00311
00312 inline label typeId() const;
00313
00314
00315 inline scalar nParticle() const;
00316
00317
00318 inline scalar d() const;
00319
00320
00321 inline const vector& U() const;
00322
00323
00324 inline scalar rho() const;
00325
00326
00327 inline scalar tTurb() const;
00328
00329
00330 inline const vector& UTurb() const;
00331
00332
00333
00334
00335
00336 inline label typeId();
00337
00338
00339 inline scalar& nParticle();
00340
00341
00342 inline scalar& d();
00343
00344
00345 inline vector& U();
00346
00347
00348 inline scalar& rho();
00349
00350
00351 inline scalar& tTurb();
00352
00353
00354 inline vector& UTurb();
00355
00356
00357
00358
00359
00360
00361 inline scalar wallImpactDistance(const vector& n) const;
00362
00363
00364
00365 inline label faceInterpolation() const;
00366
00367
00368 inline scalar massCell(const label cellI) const;
00369
00370
00371 inline scalar mass() const;
00372
00373
00374 inline scalar volume() const;
00375
00376
00377 inline scalar volume(const scalar d) const;
00378
00379
00380 inline scalar areaP() const;
00381
00382
00383 inline scalar areaP(const scalar d) const;
00384
00385
00386 inline scalar areaS() const;
00387
00388
00389 inline scalar areaS(const scalar d) const;
00390
00391
00392
00393
00394
00395 template<class TrackData>
00396 void setCellValues
00397 (
00398 TrackData& td,
00399 const scalar dt,
00400 const label cellI
00401 );
00402
00403
00404 template<class TrackData>
00405 void cellValueSourceCorrection
00406 (
00407 TrackData& td,
00408 const scalar dt,
00409 const label cellI
00410 );
00411
00412
00413 template<class TrackData>
00414 void calc
00415 (
00416 TrackData& td,
00417 const scalar dt,
00418 const label cellI
00419 );
00420
00421
00422
00423
00424
00425 template<class TrackData>
00426 bool move(TrackData& td);
00427
00428
00429
00430
00431
00432
00433 template<class TrackData>
00434 bool hitPatch
00435 (
00436 const polyPatch& p,
00437 TrackData& td,
00438 const label patchI
00439 );
00440
00441
00442
00443
00444 bool hitPatch
00445 (
00446 const polyPatch& p,
00447 int& td,
00448 const label patchI
00449 );
00450
00451
00452
00453
00454 template<class TrackData>
00455 void hitProcessorPatch
00456 (
00457 const processorPolyPatch&,
00458 TrackData& td
00459 );
00460
00461
00462
00463 void hitProcessorPatch
00464 (
00465 const processorPolyPatch&,
00466 int&
00467 );
00468
00469
00470 template<class TrackData>
00471 void hitWallPatch
00472 (
00473 const wallPolyPatch&,
00474 TrackData& td
00475 );
00476
00477
00478
00479 void hitWallPatch
00480 (
00481 const wallPolyPatch&,
00482 int&
00483 );
00484
00485
00486 template<class TrackData>
00487 void hitPatch
00488 (
00489 const polyPatch&,
00490 TrackData& td
00491 );
00492
00493
00494
00495 void hitPatch
00496 (
00497 const polyPatch&,
00498 int&
00499 );
00500
00501
00502
00503 void transformProperties(const tensor& T);
00504
00505
00506
00507 void transformProperties(const vector& separation);
00508
00509
00510
00511
00512
00513 static void readFields(KinematicCloud<ParcelType>& c);
00514
00515
00516 static void writeFields(const KinematicCloud<ParcelType>& c);
00517
00518
00519
00520
00521 friend Ostream& operator<< <ParcelType>
00522 (
00523 Ostream&,
00524 const KinematicParcel<ParcelType>&
00525 );
00526 };
00527
00528
00529
00530
00531 }
00532
00533
00534
00535 #include "KinematicParcelI.H"
00536
00537
00538
00539 #define defineParcelTypeNameAndDebug(Type, DebugSwitch) \
00540 template<> \
00541 const Foam::word KinematicParcel<Type>::typeName(#Type); \
00542 template<> \
00543 int KinematicParcel<Type>::debug \
00544 ( \
00545 Foam::debug::debugSwitch(#Type, DebugSwitch) \
00546 );
00547
00548
00549
00550 #ifdef NoRepository
00551 #include "KinematicParcel.C"
00552 #endif
00553
00554
00555
00556 #endif
00557
00558
00559
Copyright © 2000-2009 OpenCFD Ltd