1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
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
13 the Free Software Foundation, either version 3 of the License, or
14 (at your 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, 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 \*---------------------------------------------------------------------------*/
62 // Private member data
67 //- Velocity of parcel
73 friend class Cloud<solidParticle>;
75 //- Class used to pass tracking data to the trackToFace function
78 public particle::TrackingData<solidParticleCloud>
80 // Interpolators for continuous phase fields
82 const interpolationCellPoint<scalar>& rhoInterp_;
83 const interpolationCellPoint<vector>& UInterp_;
84 const interpolationCellPoint<scalar>& nuInterp_;
86 //- Local gravitational or other body-force acceleration
96 solidParticleCloud& spc,
97 const interpolationCellPoint<scalar>& rhoInterp,
98 const interpolationCellPoint<vector>& UInterp,
99 const interpolationCellPoint<scalar>& nuInterp,
106 inline const interpolationCellPoint<scalar>& rhoInterp() const;
108 inline const interpolationCellPoint<vector>& UInterp() const;
110 inline const interpolationCellPoint<scalar>& nuInterp() const;
112 inline const vector& g() const;
118 //- Construct from components
121 const polyMesh& mesh,
122 const vector& position,
124 const label tetFaceI,
130 //- Construct from Istream
133 const polyMesh& mesh,
135 bool readFields = true
138 //- Construct and return a clone
139 virtual autoPtr<particle> clone() const
141 return autoPtr<particle>(new solidParticle(*this));
144 //- Factory class to read-construct particles used for
148 const polyMesh& mesh_;
152 iNew(const polyMesh& mesh)
157 autoPtr<solidParticle> operator()(Istream& is) const
159 return autoPtr<solidParticle>
161 new solidParticle(mesh_, is, true)
172 inline scalar d() const;
175 inline const vector& U() const;
181 bool move(trackingData&, const scalar);
184 // Patch interactions
186 //- Overridable function to handle the particle hitting a patch
187 // Executed before other patch-hitting functions
193 const scalar trackFraction,
194 const tetIndices& tetIs
197 //- Overridable function to handle the particle hitting a
199 void hitProcessorPatch
201 const processorPolyPatch&,
205 //- Overridable function to handle the particle hitting a wallPatch
208 const wallPolyPatch&,
213 //- Overridable function to handle the particle hitting a polyPatch
220 //- Transform the physical properties of the particle
221 // according to the given transformation tensor
222 virtual void transformProperties(const tensor& T);
224 //- Transform the physical properties of the particle
225 // according to the given separation vector
226 virtual void transformProperties(const vector& separation);
228 //- The nearest distance to a wall that
229 // the particle can be in the n direction
230 virtual scalar wallImpactDistance(const vector& n) const;
235 static void readFields(Cloud<solidParticle>& c);
237 static void writeFields(const Cloud<solidParticle>& c);
242 friend Ostream& operator<<(Ostream&, const solidParticle&);
247 inline bool contiguous<solidParticle>()
253 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
255 } // End namespace Foam
257 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
259 #include "solidParticleI.H"
261 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
265 // ************************************************************************* //