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

particleForces.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) 2008-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::particleForces
00026 
00027 Description
00028     Provides a mechanism to calculate particle forces
00029     Note: forces are force per unit mass (accelerations)
00030 
00031 SourceFiles
00032     particleForces.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef particleForces_H
00037 #define particleForces_H
00038 
00039 #include <OpenFOAM/dictionary.H>
00040 #include <OpenFOAM/Switch.H>
00041 #include <OpenFOAM/vector.H>
00042 #include <finiteVolume/volFieldsFwd.H>
00043 
00044 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00045 
00046 namespace Foam
00047 {
00048 
00049 // Forward class declarations
00050 class fvMesh;
00051 
00052 /*---------------------------------------------------------------------------*\
00053                       Class particleForces Declaration
00054 \*---------------------------------------------------------------------------*/
00055 
00056 class particleForces
00057 {
00058     // Private data
00059 
00060         //- Reference to the mesh database
00061         const fvMesh& mesh_;
00062 
00063         //- The particleForces dictionary
00064         const dictionary& dict_;
00065 
00066         //- Gravity
00067         const vector g_;
00068 
00069         //- Velocity gradient field
00070         const volTensorField* gradUPtr_;
00071 
00072 
00073         // Forces to include in particle motion evaluation
00074 
00075             //- Gravity
00076             Switch gravity_;
00077 
00078             //- Virtual mass
00079             Switch virtualMass_;
00080 
00081             //- Virtual mass force coefficient
00082             scalar Cvm_;
00083 
00084             //- Pressure gradient
00085             Switch pressureGradient_;
00086 
00087 
00088         // Additional info
00089 
00090             //- Name of velucity field - default = "U"
00091             const word UName_;
00092 
00093 
00094 public:
00095 
00096     // Constructors
00097 
00098         //- Construct from mesh, dictionary and gravity
00099         particleForces
00100         (
00101             const fvMesh& mesh,
00102             const dictionary& dict,
00103             const vector& g
00104         );
00105 
00106         //- Construct copy
00107         particleForces(const particleForces& f);
00108 
00109 
00110     //- Destructor
00111     ~particleForces();
00112 
00113 
00114     // Member Functions
00115 
00116         // Access
00117 
00118             //- Return the particleForces dictionary
00119             const dictionary& dict() const;
00120 
00121             //- Return the gravity vector
00122             const vector& g() const;
00123 
00124             //- Return gravity force activate switch
00125             Switch gravity() const;
00126 
00127             //- Return virtual mass force activate switch
00128             Switch virtualMass() const;
00129 
00130             //- Return virtual mass force coefficient
00131             Switch Cvm() const;
00132 
00133             //- Return pressure gradient force activate switch
00134             Switch pressureGradient() const;
00135 
00136             //- Return name of velocity field
00137             const word& UName() const;
00138 
00139 
00140        // Evaluation
00141 
00142             //- Cache carrier fields
00143             void cacheFields(const bool store);
00144 
00145             //- Calculate action/reaction forces between carrier and particles
00146             vector calcCoupled
00147             (
00148                 const label cellI,
00149                 const scalar dt,
00150                 const scalar rhoc,
00151                 const scalar rho,
00152                 const vector& Uc,
00153                 const vector& U
00154             ) const;
00155 
00156             //- Calculate external forces applied to the particles
00157             vector calcNonCoupled
00158             (
00159                 const label cellI,
00160                 const scalar dt,
00161                 const scalar rhoc,
00162                 const scalar rho,
00163                 const vector& Uc,
00164                 const vector& U
00165             ) const;
00166 };
00167 
00168 
00169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00170 
00171 } // End namespace Foam
00172 
00173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00174 
00175 #endif
00176 
00177 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines