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 solidParticle_H
00039 #define solidParticle_H
00040 
00041 #include <lagrangian/Particle.H>
00042 #include <OpenFOAM/IOstream.H>
00043 #include <OpenFOAM/autoPtr.H>
00044 #include <finiteVolume/interpolationCellPoint.H>
00045 #include <OpenFOAM/contiguous.H>
00046 
00047 
00048 
00049 namespace Foam
00050 {
00051 
00052 class solidParticleCloud;
00053 
00054 
00055 
00056 
00057 
00058 class solidParticle
00059 :
00060     public Particle<solidParticle>
00061 {
00062     
00063 
00064         
00065         scalar d_;
00066 
00067         
00068         vector U_;
00069 
00070 
00071 public:
00072 
00073     friend class Cloud<solidParticle>;
00074 
00075     
00076     class trackData
00077     {
00078         
00079         solidParticleCloud& spc_;
00080 
00081         
00082 
00083             const interpolationCellPoint<scalar>& rhoInterp_;
00084             const interpolationCellPoint<vector>& UInterp_;
00085             const interpolationCellPoint<scalar>& nuInterp_;
00086 
00087         
00088         const vector& g_;
00089 
00090 
00091     public:
00092 
00093         bool switchProcessor;
00094         bool keepParticle;
00095 
00096 
00097         
00098 
00099             inline trackData
00100             (
00101                 solidParticleCloud& spc,
00102                 const interpolationCellPoint<scalar>& rhoInterp,
00103                 const interpolationCellPoint<vector>& UInterp,
00104                 const interpolationCellPoint<scalar>& nuInterp,
00105                 const vector& g
00106             );
00107 
00108 
00109         
00110 
00111             inline solidParticleCloud& spc();
00112 
00113             inline const interpolationCellPoint<scalar>& rhoInterp() const;
00114 
00115             inline const interpolationCellPoint<vector>& UInterp() const;
00116 
00117             inline const interpolationCellPoint<scalar>& nuInterp() const;
00118 
00119             inline const vector& g() const;
00120     };
00121 
00122 
00123     
00124 
00125         
00126         inline solidParticle
00127         (
00128             const Cloud<solidParticle>& c,
00129             const vector& position,
00130             const label celli,
00131             const scalar m,
00132             const vector& U
00133         );
00134 
00135         
00136         solidParticle
00137         (
00138             const Cloud<solidParticle>& c,
00139             Istream& is,
00140             bool readFields = true
00141         );
00142 
00143         
00144         autoPtr<solidParticle> clone() const
00145         {
00146             return autoPtr<solidParticle>(new solidParticle(*this));
00147         }
00148 
00149 
00150     
00151 
00152         
00153 
00154             
00155             inline scalar d() const;
00156 
00157             
00158             inline const vector& U() const;
00159 
00160             
00161             
00162             inline scalar wallImpactDistance(const vector& n) const;
00163 
00164 
00165         
00166 
00167             
00168             bool move(trackData&);
00169 
00170 
00171         
00172 
00173             
00174             
00175             bool hitPatch
00176             (
00177                 const polyPatch&,
00178                 solidParticle::trackData& td,
00179                 const label patchI
00180             );
00181 
00182             
00183             
00184             bool hitPatch
00185             (
00186                 const polyPatch& p,
00187                 int& td,
00188                 const label patchI
00189             );
00190 
00191             
00192             
00193             void hitProcessorPatch
00194             (
00195                 const processorPolyPatch&,
00196                 solidParticle::trackData& td
00197             );
00198 
00199             
00200             
00201             void hitProcessorPatch
00202             (
00203                 const processorPolyPatch&,
00204                 int&
00205             );
00206 
00207             
00208             void hitWallPatch
00209             (
00210                 const wallPolyPatch&,
00211                 solidParticle::trackData& td
00212             );
00213 
00214             
00215             
00216             void hitWallPatch
00217             (
00218                 const wallPolyPatch&,
00219                 int&
00220             );
00221 
00222             
00223             void hitPatch
00224             (
00225                 const polyPatch&,
00226                 solidParticle::trackData& td
00227             );
00228 
00229             
00230             
00231             void hitPatch
00232             (
00233                 const polyPatch&,
00234                 int&
00235             );
00236 
00237             
00238             
00239             void transformProperties
00240             (
00241                 const tensor& T
00242             );
00243 
00244             
00245             
00246             void transformProperties
00247             (
00248                 const vector& separation
00249             );
00250 
00251 
00252     
00253 
00254         static void readFields(Cloud<solidParticle>& c);
00255 
00256         static void writeFields(const Cloud<solidParticle>& c);
00257 
00258 
00259     
00260 
00261         friend Ostream& operator<<(Ostream&, const solidParticle&);
00262 };
00263 
00264 
00265 template<>
00266 inline bool contiguous<solidParticle>()
00267 {
00268     return true;
00269 }
00270 
00271 
00272 
00273 
00274 } 
00275 
00276 
00277 
00278 #include <solidParticle/solidParticleI.H>
00279 
00280 
00281 
00282 #endif
00283 
00284