DsmcParcel.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 #ifndef DsmcParcel_H
00039 #define DsmcParcel_H
00040
00041 #include "Particle.H"
00042 #include "IOstream.H"
00043 #include "autoPtr.H"
00044 #include "contiguous.H"
00045 #include "mathematicalConstants.H"
00046
00047 #include "DsmcCloud.H"
00048
00049
00050
00051 namespace Foam
00052 {
00053
00054 template<class ParcelType>
00055 class DsmcParcel;
00056
00057
00058
00059 template<class ParcelType>
00060 Ostream& operator<<
00061 (
00062 Ostream&,
00063 const DsmcParcel<ParcelType>&
00064 );
00065
00066
00067
00068
00069
00070 template<class ParcelType>
00071 class DsmcParcel
00072 :
00073 public Particle<ParcelType>
00074 {
00075 public:
00076
00077
00078 class constantProperties
00079 {
00080
00081
00082
00083 scalar mass_;
00084
00085
00086 scalar d_;
00087
00088
00089 scalar internalDegreesOfFreedom_;
00090
00091
00092 scalar omega_;
00093
00094
00095 public:
00096
00097
00098
00099
00100
00101 inline constantProperties();
00102
00103
00104 inline constantProperties(const dictionary& dict);
00105
00106
00107
00108
00109
00110 inline scalar mass() const;
00111
00112
00113 inline scalar d() const;
00114
00115
00116 inline scalar sigmaT() const;
00117
00118
00119 inline scalar internalDegreesOfFreedom() const;
00120
00121
00122 inline scalar omega() const;
00123
00124 };
00125
00126
00127
00128 class trackData
00129 :
00130 public Particle<ParcelType>::trackData
00131 {
00132
00133
00134
00135 DsmcCloud<ParcelType>& cloud_;
00136
00137
00138 public:
00139
00140
00141
00142
00143 inline trackData
00144 (
00145 DsmcCloud<ParcelType>& cloud
00146 );
00147
00148
00149
00150
00151
00152 inline DsmcCloud<ParcelType>& cloud();
00153 };
00154
00155
00156 protected:
00157
00158
00159
00160
00161
00162
00163 vector U_;
00164
00165
00166
00167 scalar Ei_;
00168
00169
00170 label typeId_;
00171
00172
00173 public:
00174
00175
00176 TypeName("DsmcParcel");
00177
00178 friend class Cloud<ParcelType>;
00179
00180
00181
00182
00183
00184 inline DsmcParcel
00185 (
00186 DsmcCloud<ParcelType>& owner,
00187 const vector& position,
00188 const vector& U,
00189 const scalar Ei,
00190 const label celli,
00191 const label typeId
00192 );
00193
00194
00195 DsmcParcel
00196 (
00197 const Cloud<ParcelType>& c,
00198 Istream& is,
00199 bool readFields = true
00200 );
00201
00202
00203 autoPtr<ParcelType> clone() const
00204 {
00205 return autoPtr<ParcelType>(new DsmcParcel<ParcelType>(*this));
00206 }
00207
00208
00209
00210
00211
00212
00213
00214 inline label typeId() const;
00215
00216
00217 inline const vector& U() const;
00218
00219
00220 inline scalar Ei() const;
00221
00222
00223
00224
00225 inline vector& U();
00226
00227
00228 inline scalar& Ei();
00229
00230
00231
00232
00233
00234
00235
00236 template<class TrackData>
00237 bool move(TrackData& td);
00238
00239
00240
00241
00242
00243
00244 template<class TrackData>
00245 bool hitPatch
00246 (
00247 const polyPatch&,
00248 TrackData& td,
00249 const label patchI
00250 );
00251
00252
00253
00254 template<class TrackData>
00255 void hitProcessorPatch
00256 (
00257 const processorPolyPatch&,
00258 TrackData& td
00259 );
00260
00261
00262
00263 void hitProcessorPatch
00264 (
00265 const processorPolyPatch&,
00266 int&
00267 );
00268
00269
00270 template<class TrackData>
00271 void hitWallPatch
00272 (
00273 const wallPolyPatch&,
00274 TrackData& td
00275 );
00276
00277
00278
00279 void hitWallPatch
00280 (
00281 const wallPolyPatch&,
00282 int&
00283 );
00284
00285
00286 template<class TrackData>
00287 void hitPatch
00288 (
00289 const polyPatch&,
00290 TrackData& td
00291 );
00292
00293
00294
00295 void hitPatch
00296 (
00297 const polyPatch&,
00298 int&
00299 );
00300
00301
00302
00303 void transformProperties(const tensor& T);
00304
00305
00306
00307 void transformProperties(const vector& separation);
00308
00309
00310
00311
00312 static void readFields(DsmcCloud<ParcelType>& c);
00313
00314 static void writeFields(const DsmcCloud<ParcelType>& c);
00315
00316
00317
00318
00319 friend Ostream& operator<< <ParcelType>
00320 (
00321 Ostream&,
00322 const DsmcParcel<ParcelType>&
00323 );
00324 };
00325
00326
00327
00328
00329 }
00330
00331
00332
00333 #include "DsmcParcelI.H"
00334
00335
00336
00337 #define defineParcelTypeNameAndDebug(Type, DebugSwitch) \
00338 template<> \
00339 const Foam::word DsmcParcel<Type>::typeName(#Type); \
00340 template<> \
00341 int DsmcParcel<Type>::debug \
00342 ( \
00343 Foam::debug::debugSwitch(#Type, DebugSwitch) \
00344 );
00345
00346
00347
00348 #ifdef NoRepository
00349 #include "DsmcParcel.C"
00350 #endif
00351
00352
00353
00354 #endif
00355
00356
00357
Copyright © 2000-2009 OpenCFD Ltd