1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend 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 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
28 Simple solid spherical particle class with one-way coupling with the
36 \*---------------------------------------------------------------------------*/
38 #ifndef solidParticle_H
39 #define solidParticle_H
44 #include "interpolationCellPoint.H"
45 #include "contiguous.H"
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 class solidParticleCloud;
54 /*---------------------------------------------------------------------------*\
55 Class solidParticle Declaration
56 \*---------------------------------------------------------------------------*/
60 public Particle<solidParticle>
62 // Private member data
67 //- Velocity of particle
73 friend class Cloud<solidParticle>;
75 //- Class used to pass tracking data to the trackToFace function
78 //- Reference to the cloud containing this particle
79 solidParticleCloud& spc_;
81 // Interpolators for continuous phase fields
83 const interpolationCellPoint<scalar>& rhoInterp_;
84 const interpolationCellPoint<vector>& UInterp_;
85 const interpolationCellPoint<scalar>& nuInterp_;
87 //- Local gravitational or other body-force acceleration
101 solidParticleCloud& spc,
102 const interpolationCellPoint<scalar>& rhoInterp,
103 const interpolationCellPoint<vector>& UInterp,
104 const interpolationCellPoint<scalar>& nuInterp,
111 inline solidParticleCloud& spc();
113 inline const interpolationCellPoint<scalar>& rhoInterp() const;
115 inline const interpolationCellPoint<vector>& UInterp() const;
117 inline const interpolationCellPoint<scalar>& nuInterp() const;
119 inline const vector& g() const;
125 //- Construct from components
128 const Cloud<solidParticle>& c,
129 const vector& position,
135 //- Construct from Istream
138 const Cloud<solidParticle>& c,
140 bool readFields = true
143 //- Construct and return a clone
144 autoPtr<solidParticle> clone() const
146 return autoPtr<solidParticle>(new solidParticle(*this));
155 inline scalar d() const;
158 inline const vector& U() const;
160 //- The nearest distance to a wall that
161 // the particle can be in the n direction
162 inline scalar wallImpactDistance(const vector& n) const;
168 bool move(trackData&);
171 // Patch interactions
173 //- Overridable function to handle the particle hitting a patch
174 // Executed before other patch-hitting functions
178 solidParticle::trackData& td,
182 //- Overridable function to handle the particle hitting a patch
183 // Executed before other patch-hitting functions without trackData
191 //- Overridable function to handle the particle hitting a
193 void hitProcessorPatch
195 const processorPolyPatch&,
196 solidParticle::trackData& td
199 //- Overridable function to handle the particle hitting a
200 // processorPatch without trackData
201 void hitProcessorPatch
203 const processorPolyPatch&,
207 //- Overridable function to handle the particle hitting a wallPatch
210 const wallPolyPatch&,
211 solidParticle::trackData& td
214 //- Overridable function to handle the particle hitting a wallPatch
215 //- without trackData
218 const wallPolyPatch&,
222 //- Overridable function to handle the particle hitting a polyPatch
226 solidParticle::trackData& td
229 //- Overridable function to handle the particle hitting a polyPatch
230 //- without trackData
237 //- Transform the physical properties of the particle
238 // according to the given transformation tensor
239 void transformProperties
244 //- Transform the physical properties of the particle
245 // according to the given separation vector
246 void transformProperties
248 const vector& separation
254 static void readFields(Cloud<solidParticle>& c);
256 static void writeFields(const Cloud<solidParticle>& c);
261 friend Ostream& operator<<(Ostream&, const solidParticle&);
266 inline bool contiguous<solidParticle>()
272 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
274 } // End namespace Foam
276 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
278 #include "solidParticleI.H"
280 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
284 // ************************************************************************* //