FreeFOAM The Cross-Platform CFD Toolkit
particleForces.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
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.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::particleForces
26 
27 Description
28  Provides a mechanism to calculate particle forces
29  Note: forces are force per unit mass (accelerations)
30 
31 SourceFiles
32  particleForces.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef particleForces_H
37 #define particleForces_H
38 
39 #include <OpenFOAM/dictionary.H>
40 #include <OpenFOAM/Switch.H>
41 #include <OpenFOAM/vector.H>
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 // Forward class declarations
50 class fvMesh;
51 
52 /*---------------------------------------------------------------------------*\
53  Class particleForces Declaration
54 \*---------------------------------------------------------------------------*/
55 
57 {
58  // Private data
59 
60  //- Reference to the mesh database
61  const fvMesh& mesh_;
62 
63  //- The particleForces dictionary
64  const dictionary& dict_;
65 
66  //- Gravity
67  const vector g_;
68 
69  //- Velocity gradient field
70  const volTensorField* gradUPtr_;
71 
72 
73  // Forces to include in particle motion evaluation
74 
75  //- Gravity
76  Switch gravity_;
77 
78  //- Virtual mass
79  Switch virtualMass_;
80 
81  //- Virtual mass force coefficient
82  scalar Cvm_;
83 
84  //- Pressure gradient
85  Switch pressureGradient_;
86 
87 
88  // Additional info
89 
90  //- Name of velucity field - default = "U"
91  const word UName_;
92 
93 
94 public:
95 
96  // Constructors
97 
98  //- Construct from mesh, dictionary and gravity
100  (
101  const fvMesh& mesh,
102  const dictionary& dict,
103  const vector& g
104  );
105 
106  //- Construct copy
108 
109 
110  //- Destructor
111  ~particleForces();
112 
113 
114  // Member Functions
115 
116  // Access
117 
118  //- Return the particleForces dictionary
119  const dictionary& dict() const;
120 
121  //- Return the gravity vector
122  const vector& g() const;
123 
124  //- Return gravity force activate switch
125  Switch gravity() const;
126 
127  //- Return virtual mass force activate switch
128  Switch virtualMass() const;
129 
130  //- Return virtual mass force coefficient
131  Switch Cvm() const;
132 
133  //- Return pressure gradient force activate switch
134  Switch pressureGradient() const;
135 
136  //- Return name of velocity field
137  const word& UName() const;
138 
139 
140  // Evaluation
141 
142  //- Cache carrier fields
143  void cacheFields(const bool store);
144 
145  //- Calculate action/reaction forces between carrier and particles
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;
155 
156  //- Calculate external forces applied to the particles
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;
166 };
167 
168 
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 
171 } // End namespace Foam
172 
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 
175 #endif
176 
177 // ************************ vim: set sw=4 sts=4 et: ************************ //