OpenFOAM logo
The Open Source CFD Toolbox
  Programmer’s C++ Doxygen 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-2007 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     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         bool move(trackData&);
00168 
00169 
00170         //- Overridable function to handle the particle hitting a processorPatch
00171         void hitProcessorPatch
00172         (
00173             const processorPolyPatch&,
00174             solidParticle::trackData& td
00175         );
00176 
00177         //- Overridable function to handle the particle hitting a processorPatch
00178         //- without trackData
00179         void hitProcessorPatch
00180         (
00181             const processorPolyPatch&,
00182             int&
00183         );
00184 
00185         //- Overridable function to handle the particle hitting a wallPatch
00186         void hitWallPatch
00187         (
00188             const wallPolyPatch&,
00189             solidParticle::trackData& td
00190         );
00191 
00192         //- Overridable function to handle the particle hitting a wallPatch
00193         //- without trackData
00194         void hitWallPatch
00195         (
00196             const wallPolyPatch&,
00197             int&
00198         );
00199 
00200         //- Overridable function to handle the particle hitting a polyPatch
00201         void hitPatch
00202         (
00203             const polyPatch&,
00204             solidParticle::trackData& td
00205         );
00206 
00207         //- Overridable function to handle the particle hitting a polyPatch
00208         //- without trackData
00209         void hitPatch
00210         (
00211             const polyPatch&,
00212             int&
00213         );
00214 
00215 
00216     // Ostream Operator
00217 
00218         friend Ostream& operator<<(Ostream&, const solidParticle&);
00219 };
00220 
00221 
00222 template<>
00223 inline bool contiguous<solidParticle>()
00224 {
00225     return true;
00226 }
00227 
00228 template<>
00229 void Cloud<solidParticle>::readFields();
00230 
00231 template<>
00232 void Cloud<solidParticle>::writeFields() const;
00233 
00234 
00235 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00236 
00237 } // End namespace Foam
00238 
00239 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00240 
00241 #include "solidParticleI.H"
00242 
00243 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00244 
00245 #endif
00246 
00247 // ************************************************************************* //
Copyright © 2000-2007 OpenCFD Ltd