FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

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-2010 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
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your 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, see <http://www.gnu.org/licenses/>.
00023 
00024 Class
00025     Foam::solidParticle
00026 
00027 Description
00028     Simple solid spherical particle class with one-way coupling with the
00029     continuous phase.
00030 
00031 SourceFiles
00032     solidParticleI.H
00033     solidParticle.C
00034     solidParticleIO.C
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                            Class solidParticle Declaration
00056 \*---------------------------------------------------------------------------*/
00057 
00058 class solidParticle
00059 :
00060     public Particle<solidParticle>
00061 {
00062     // Private member data
00063 
00064         //- Diameter
00065         scalar d_;
00066 
00067         //- Velocity of parcel
00068         vector U_;
00069 
00070 
00071 public:
00072 
00073     friend class Cloud<solidParticle>;
00074 
00075     //- Class used to pass tracking data to the trackToFace function
00076     class trackData
00077     {
00078         //- Reference to the cloud containing this particle
00079         solidParticleCloud& spc_;
00080 
00081         // Interpolators for continuous phase fields
00082 
00083             const interpolationCellPoint<scalar>& rhoInterp_;
00084             const interpolationCellPoint<vector>& UInterp_;
00085             const interpolationCellPoint<scalar>& nuInterp_;
00086 
00087         //- Local gravitational or other body-force acceleration
00088         const vector& g_;
00089 
00090 
00091     public:
00092 
00093         bool switchProcessor;
00094         bool keepParticle;
00095 
00096 
00097         // Constructors
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         // Member functions
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     // Constructors
00124 
00125         //- Construct from components
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         //- Construct from Istream
00136         solidParticle
00137         (
00138             const Cloud<solidParticle>& c,
00139             Istream& is,
00140             bool readFields = true
00141         );
00142 
00143         //- Construct and return a clone
00144         autoPtr<solidParticle> clone() const
00145         {
00146             return autoPtr<solidParticle>(new solidParticle(*this));
00147         }
00148 
00149 
00150     // Member Functions
00151 
00152         // Access
00153 
00154             //- Return diameter
00155             inline scalar d() const;
00156 
00157             //- Return velocity
00158             inline const vector& U() const;
00159 
00160             //- The nearest distance to a wall that
00161             //  the particle can be in the n direction
00162             inline scalar wallImpactDistance(const vector& n) const;
00163 
00164 
00165         // Tracking
00166 
00167             //- Move
00168             bool move(trackData&);
00169 
00170 
00171         // Patch interactions
00172 
00173             //- Overridable function to handle the particle hitting a patch
00174             //  Executed before other patch-hitting functions
00175             bool hitPatch
00176             (
00177                 const polyPatch&,
00178                 solidParticle::trackData& td,
00179                 const label patchI
00180             );
00181 
00182             //- Overridable function to handle the particle hitting a patch
00183             //  Executed before other patch-hitting functions without trackData
00184             bool hitPatch
00185             (
00186                 const polyPatch& p,
00187                 int& td,
00188                 const label patchI
00189             );
00190 
00191             //- Overridable function to handle the particle hitting a
00192             //  processorPatch
00193             void hitProcessorPatch
00194             (
00195                 const processorPolyPatch&,
00196                 solidParticle::trackData& td
00197             );
00198 
00199             //- Overridable function to handle the particle hitting a
00200             //  processorPatch without trackData
00201             void hitProcessorPatch
00202             (
00203                 const processorPolyPatch&,
00204                 int&
00205             );
00206 
00207             //- Overridable function to handle the particle hitting a wallPatch
00208             void hitWallPatch
00209             (
00210                 const wallPolyPatch&,
00211                 solidParticle::trackData& td
00212             );
00213 
00214             //- Overridable function to handle the particle hitting a wallPatch
00215             //- without trackData
00216             void hitWallPatch
00217             (
00218                 const wallPolyPatch&,
00219                 int&
00220             );
00221 
00222             //- Overridable function to handle the particle hitting a polyPatch
00223             void hitPatch
00224             (
00225                 const polyPatch&,
00226                 solidParticle::trackData& td
00227             );
00228 
00229             //- Overridable function to handle the particle hitting a polyPatch
00230             //- without trackData
00231             void hitPatch
00232             (
00233                 const polyPatch&,
00234                 int&
00235             );
00236 
00237             //- Transform the physical properties of the particle
00238             //  according to the given transformation tensor
00239             void transformProperties
00240             (
00241                 const tensor& T
00242             );
00243 
00244             //- Transform the physical properties of the particle
00245             //  according to the given separation vector
00246             void transformProperties
00247             (
00248                 const vector& separation
00249             );
00250 
00251 
00252     // I-O
00253 
00254         static void readFields(Cloud<solidParticle>& c);
00255 
00256         static void writeFields(const Cloud<solidParticle>& c);
00257 
00258 
00259     // Ostream Operator
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 } // End namespace Foam
00275 
00276 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00277 
00278 #include <solidParticle/solidParticleI.H>
00279 
00280 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00281 
00282 #endif
00283 
00284 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines