1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
7 -------------------------------------------------------------------------------
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
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
29 Simple solid spherical particle class with one-way coupling with the
37 \*---------------------------------------------------------------------------*/
39 #ifndef solidParticle_H
40 #define solidParticle_H
45 #include "interpolationCellPoint.H"
46 #include "contiguous.H"
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 class solidParticleCloud;
55 /*---------------------------------------------------------------------------*\
56 Class solidParticle Declaration
57 \*---------------------------------------------------------------------------*/
61 public Particle<solidParticle>
63 // Private member data
68 //- Velocity of particle
74 friend class Cloud<solidParticle>;
76 //- Class used to pass tracking data to the trackToFace function
79 //- Reference to the cloud containing this particle
80 solidParticleCloud& spc_;
82 // Interpolators for continuous phase fields
84 const interpolationCellPoint<scalar>& rhoInterp_;
85 const interpolationCellPoint<vector>& UInterp_;
86 const interpolationCellPoint<scalar>& nuInterp_;
88 //- Local gravitational or other body-force acceleration
102 solidParticleCloud& spc,
103 const interpolationCellPoint<scalar>& rhoInterp,
104 const interpolationCellPoint<vector>& UInterp,
105 const interpolationCellPoint<scalar>& nuInterp,
112 inline solidParticleCloud& spc();
114 inline const interpolationCellPoint<scalar>& rhoInterp() const;
116 inline const interpolationCellPoint<vector>& UInterp() const;
118 inline const interpolationCellPoint<scalar>& nuInterp() const;
120 inline const vector& g() const;
126 //- Construct from components
129 const Cloud<solidParticle>& c,
130 const vector& position,
136 //- Construct from Istream
139 const Cloud<solidParticle>& c,
141 bool readFields = true
144 //- Construct and return a clone
145 autoPtr<solidParticle> clone() const
147 return autoPtr<solidParticle>(new solidParticle(*this));
156 inline scalar d() const;
159 inline const vector& U() const;
161 //- The nearest distance to a wall that
162 // the particle can be in the n direction
163 inline scalar wallImpactDistance(const vector& n) const;
169 bool move(trackData&);
172 // Patch interactions
174 //- Overridable function to handle the particle hitting a patch
175 // Executed before other patch-hitting functions
179 solidParticle::trackData& td,
183 //- Overridable function to handle the particle hitting a patch
184 // Executed before other patch-hitting functions without trackData
192 //- Overridable function to handle the particle hitting a
194 void hitProcessorPatch
196 const processorPolyPatch&,
197 solidParticle::trackData& td
200 //- Overridable function to handle the particle hitting a
201 // processorPatch without trackData
202 void hitProcessorPatch
204 const processorPolyPatch&,
208 //- Overridable function to handle the particle hitting a wallPatch
211 const wallPolyPatch&,
212 solidParticle::trackData& td
215 //- Overridable function to handle the particle hitting a wallPatch
216 //- without trackData
219 const wallPolyPatch&,
223 //- Overridable function to handle the particle hitting a polyPatch
227 solidParticle::trackData& td
230 //- Overridable function to handle the particle hitting a polyPatch
231 //- without trackData
238 //- Transform the physical properties of the particle
239 // according to the given transformation tensor
240 void transformProperties
245 //- Transform the physical properties of the particle
246 // according to the given separation vector
247 void transformProperties
249 const vector& separation
255 static void readFields(Cloud<solidParticle>& c);
257 static void writeFields(const Cloud<solidParticle>& c);
262 friend Ostream& operator<<(Ostream&, const solidParticle&);
267 inline bool contiguous<solidParticle>()
273 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
275 } // End namespace Foam
277 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
279 #include "solidParticleI.H"
281 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
285 // ************************************************************************* //