OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

solidParticle.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     Foam::solidParticle
00027 
00028 Description
00029     Simple solid spherical particle class with one-way coupling with the
00030     continuous phase.
00031 
00032 SourceFiles
00033     solidParticleI.H
00034     solidParticle.C
00035     solidParticleIO.C
00036 
00037 \*---------------------------------------------------------------------------*/
00038 
00039 #ifndef solidParticle_H
00040 #define solidParticle_H
00041 
00042 #include "Particle.H"
00043 #include "IOstream.H"
00044 #include "autoPtr.H"
00045 #include "interpolationCellPoint.H"
00046 #include "contiguous.H"
00047 
00048 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00049 
00050 namespace Foam
00051 {
00052 
00053 class solidParticleCloud;
00054 
00055 /*---------------------------------------------------------------------------*\
00056                            Class solidParticle Declaration
00057 \*---------------------------------------------------------------------------*/
00058 
00059 class solidParticle
00060 :
00061     public Particle<solidParticle>
00062 {
00063     // Private member data
00064 
00065         //- Diameter
00066         scalar d_;
00067 
00068         //- Velocity of parcel
00069         vector U_;
00070 
00071 
00072 public:
00073 
00074     friend class Cloud<solidParticle>;
00075 
00076     //- Class used to pass tracking data to the trackToFace function
00077     class trackData
00078     {
00079         //- Reference to the cloud containing this particle
00080         solidParticleCloud& spc_;
00081 
00082         // Interpolators for continuous phase fields
00083 
00084             const interpolationCellPoint<scalar>& rhoInterp_;
00085             const interpolationCellPoint<vector>& UInterp_;
00086             const interpolationCellPoint<scalar>& nuInterp_;
00087 
00088         //- Local gravitational or other body-force acceleration
00089         const vector& g_;
00090 
00091 
00092     public:
00093 
00094         bool switchProcessor;
00095         bool keepParticle;
00096 
00097 
00098         // Constructors
00099 
00100             inline trackData
00101             (
00102                 solidParticleCloud& spc,
00103                 const interpolationCellPoint<scalar>& rhoInterp,
00104                 const interpolationCellPoint<vector>& UInterp,
00105                 const interpolationCellPoint<scalar>& nuInterp,
00106                 const vector& g
00107             );
00108 
00109 
00110         // Member functions
00111 
00112             inline solidParticleCloud& spc();
00113 
00114             inline const interpolationCellPoint<scalar>& rhoInterp() const;
00115 
00116             inline const interpolationCellPoint<vector>& UInterp() const;
00117 
00118             inline const interpolationCellPoint<scalar>& nuInterp() const;
00119 
00120             inline const vector& g() const;
00121     };
00122 
00123 
00124     // Constructors
00125 
00126         //- Construct from components
00127         inline solidParticle
00128         (
00129             const Cloud<solidParticle>& c,
00130             const vector& position,
00131             const label celli,
00132             const scalar m,
00133             const vector& U
00134         );
00135 
00136         //- Construct from Istream
00137         solidParticle
00138         (
00139             const Cloud<solidParticle>& c,
00140             Istream& is,
00141             bool readFields = true
00142         );
00143 
00144         //- Construct and return a clone
00145         autoPtr<solidParticle> clone() const
00146         {
00147             return autoPtr<solidParticle>(new solidParticle(*this));
00148         }
00149 
00150 
00151     // Member Functions
00152 
00153         // Access
00154 
00155             //- Return diameter
00156             inline scalar d() const;
00157 
00158             //- Return velocity
00159             inline const vector& U() const;
00160 
00161             //- The nearest distance to a wall that
00162             //  the particle can be in the n direction
00163             inline scalar wallImpactDistance(const vector& n) const;
00164 
00165 
00166         // Tracking
00167 
00168             //- Move
00169             bool move(trackData&);
00170 
00171 
00172         // Patch interactions
00173 
00174             //- Overridable function to handle the particle hitting a patch
00175             //  Executed before other patch-hitting functions
00176             bool hitPatch
00177             (
00178                 const polyPatch&,
00179                 solidParticle::trackData& td,
00180                 const label patchI
00181             );
00182 
00183             //- Overridable function to handle the particle hitting a patch
00184             //  Executed before other patch-hitting functions without trackData
00185             bool hitPatch
00186             (
00187                 const polyPatch& p,
00188                 int& td,
00189                 const label patchI
00190             );
00191 
00192             //- Overridable function to handle the particle hitting a
00193             //  processorPatch
00194             void hitProcessorPatch
00195             (
00196                 const processorPolyPatch&,
00197                 solidParticle::trackData& td
00198             );
00199 
00200             //- Overridable function to handle the particle hitting a
00201             //  processorPatch without trackData
00202             void hitProcessorPatch
00203             (
00204                 const processorPolyPatch&,
00205                 int&
00206             );
00207 
00208             //- Overridable function to handle the particle hitting a wallPatch
00209             void hitWallPatch
00210             (
00211                 const wallPolyPatch&,
00212                 solidParticle::trackData& td
00213             );
00214 
00215             //- Overridable function to handle the particle hitting a wallPatch
00216             //- without trackData
00217             void hitWallPatch
00218             (
00219                 const wallPolyPatch&,
00220                 int&
00221             );
00222 
00223             //- Overridable function to handle the particle hitting a polyPatch
00224             void hitPatch
00225             (
00226                 const polyPatch&,
00227                 solidParticle::trackData& td
00228             );
00229 
00230             //- Overridable function to handle the particle hitting a polyPatch
00231             //- without trackData
00232             void hitPatch
00233             (
00234                 const polyPatch&,
00235                 int&
00236             );
00237 
00238             //- Transform the physical properties of the particle
00239             //  according to the given transformation tensor
00240             void transformProperties
00241             (
00242                 const tensor& T
00243             );
00244 
00245             //- Transform the physical properties of the particle
00246             //  according to the given separation vector
00247             void transformProperties
00248             (
00249                 const vector& separation
00250             );
00251 
00252 
00253     // I-O
00254 
00255         static void readFields(Cloud<solidParticle>& c);
00256 
00257         static void writeFields(const Cloud<solidParticle>& c);
00258 
00259 
00260     // Ostream Operator
00261 
00262         friend Ostream& operator<<(Ostream&, const solidParticle&);
00263 };
00264 
00265 
00266 template<>
00267 inline bool contiguous<solidParticle>()
00268 {
00269     return true;
00270 }
00271 
00272 
00273 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00274 
00275 } // End namespace Foam
00276 
00277 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00278 
00279 #include "solidParticleI.H"
00280 
00281 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00282 
00283 #endif
00284 
00285 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd