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