initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / lagrangian / intermediate / particleForces / particleForces.H
blobfbe88a6dc832e7fd545a1a673aaf2dce90178a23
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2008-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
11     OpenFOAM is free software; you can redistribute it and/or modify it
12     under the terms of the GNU General Public License as published by the
13     Free Software Foundation; either version 2 of the License, or (at your
14     option) any later version.
16     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
19     for more details.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Class
26     Foam::particleForces
28 Description
29     Particle forces
31 SourceFiles
32     particleForces.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef particleForces_H
37 #define particleForces_H
39 #include "dictionary.H"
40 #include "Switch.H"
41 #include "vector.H"
42 #include "volFieldsFwd.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 namespace Foam
49 // Forward class declarations
50 class fvMesh;
52 /*---------------------------------------------------------------------------*\
53                       Class particleForces Declaration
54 \*---------------------------------------------------------------------------*/
56 class particleForces
58     // Private data
60         //- Reference to the mesh database
61         const fvMesh& mesh_;
63         //- The particleForces dictionary
64         const dictionary& dict_;
66         //- Gravity
67         const vector g_;
69         //- Velocity gradient field
70         const volTensorField* gradUPtr_;
73         // Forces to include in particle motion evaluation
75             //- Gravity
76             Switch gravity_;
78             //- Virtual mass
79             Switch virtualMass_;
81             //- Virtual mass force coefficient
82             scalar Cvm_;
84             //- Pressure gradient
85             Switch pressureGradient_;
88         // Additional info
90             //- Name of velucity field - default = "U"
91             const word UName_;
94 public:
96     // Constructors
98         //- Construct from mesh, dictionary and gravity
99         particleForces
100         (
101             const fvMesh& mesh,
102             const dictionary& dict,
103             const vector& g
104         );
106         //- Construct copy
107         particleForces(const particleForces& f);
110     //- Destructor
111     ~particleForces();
114     // Member Functions
116         // Access
118             //- Return the particleForces dictionary
119             const dictionary& dict() const;
121             //- Return the gravity vector
122             const vector& g() const;
124             //- Return gravity force activate switch
125             Switch gravity() const;
127             //- Return virtual mass force activate switch
128             Switch virtualMass() const;
130             //- Return virtual mass force coefficient
131             Switch Cvm() const;
133             //- Return pressure gradient force activate switch
134             Switch pressureGradient() const;
136             //- Return name of velocity field
137             const word& UName() const;
140        // Evaluation
142             //- Cache carrier fields
143             void cacheFields(const bool store);
145             //- Calculate action/reaction forces between carrier and particles
146             vector calcCoupled
147             (
148                 const label cellI,
149                 const scalar dt,
150                 const scalar rhoc,
151                 const scalar rho,
152                 const vector& Uc,
153                 const vector& U
154             ) const;
156             //- Calculate external forces applied to the particles
157             vector calcNonCoupled
158             (
159                 const label cellI,
160                 const scalar dt,
161                 const scalar rhoc,
162                 const scalar rho,
163                 const vector& Uc,
164                 const vector& U
165             ) const;
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 } // End namespace Foam
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 #endif
177 // ************************************************************************* //