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
25 \*---------------------------------------------------------------------------*/
27 #include "mathematicalConstants.H"
29 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
31 template <class ParcelType>
32 inline Foam::KinematicParcel<ParcelType>::constantProperties::constantProperties
34 const dictionary& parentDict
37 dict_(parentDict.subDict("constantProperties")),
38 rhoMin_(dimensionedScalar(dict_.lookup("rhoMin")).value()),
39 rho0_(dimensionedScalar(dict_.lookup("rho0")).value()),
42 dimensionedScalar(dict_.lookup("minParticleMass")).value()
47 template <class ParcelType>
48 inline Foam::KinematicParcel<ParcelType>::trackData::trackData
50 KinematicCloud<ParcelType>& cloud,
51 const constantProperties& constProps,
52 const interpolation<scalar>& rhoInterp,
53 const interpolation<vector>& UInterp,
54 const interpolation<scalar>& muInterp,
58 Particle<ParcelType>::trackData(cloud),
60 constProps_(constProps),
61 rhoInterp_(rhoInterp),
68 template <class ParcelType>
69 inline Foam::KinematicParcel<ParcelType>::KinematicParcel
71 KinematicCloud<ParcelType>& owner,
72 const vector& position,
76 Particle<ParcelType>(owner, position, cellI),
77 typeId_(owner.parcelTypeId()),
90 template <class ParcelType>
91 inline Foam::KinematicParcel<ParcelType>::KinematicParcel
93 KinematicCloud<ParcelType>& owner,
94 const vector& position,
97 const scalar nParticle0,
100 const constantProperties& constProps
103 Particle<ParcelType>(owner, position, cellI),
105 nParticle_(nParticle0),
108 rho_(constProps.rho0()),
110 UTurb_(vector::zero),
117 // * * * * * * * * * constantProperties Member Functions * * * * * * * * * * //
119 template <class ParcelType>
120 inline const Foam::dictionary&
121 Foam::KinematicParcel<ParcelType>::constantProperties::dict() const
127 template <class ParcelType>
129 Foam::KinematicParcel<ParcelType>::constantProperties::rhoMin() const
135 template <class ParcelType>
137 Foam::KinematicParcel<ParcelType>::constantProperties::rho0() const
143 template <class ParcelType>
145 Foam::KinematicParcel<ParcelType>::constantProperties::minParticleMass() const
147 return minParticleMass_;
151 // * * * * * * * * * * * trackData Member Functions * * * * * * * * * * * * //
153 template <class ParcelType>
154 inline Foam::KinematicCloud<ParcelType>&
155 Foam::KinematicParcel<ParcelType>::trackData::cloud()
161 template <class ParcelType>
162 inline const typename Foam::KinematicParcel<ParcelType>::constantProperties&
163 Foam::KinematicParcel<ParcelType>::trackData::constProps() const
169 template<class ParcelType>
170 inline const Foam::interpolation<Foam::scalar>&
171 Foam::KinematicParcel<ParcelType>::trackData::rhoInterp() const
177 template <class ParcelType>
178 inline const Foam::interpolation<Foam::vector>&
179 Foam::KinematicParcel<ParcelType>::trackData::UInterp() const
185 template<class ParcelType>
186 inline const Foam::interpolation<Foam::scalar>&
187 Foam::KinematicParcel<ParcelType>::trackData::muInterp() const
193 template<class ParcelType>
194 inline const Foam::vector&
195 Foam::KinematicParcel<ParcelType>::trackData::g() const
201 // * * * * * * * * * * KinematicParcel Member Functions * * * * * * * * * * //
203 template <class ParcelType>
204 inline Foam::label Foam::KinematicParcel<ParcelType>::typeId() const
210 template <class ParcelType>
211 inline Foam::scalar Foam::KinematicParcel<ParcelType>::nParticle() const
217 template <class ParcelType>
218 inline Foam::scalar Foam::KinematicParcel<ParcelType>::d() const
224 template <class ParcelType>
225 inline const Foam::vector& Foam::KinematicParcel<ParcelType>::U() const
231 template <class ParcelType>
232 inline Foam::scalar Foam::KinematicParcel<ParcelType>::rho() const
238 template <class ParcelType>
239 inline Foam::scalar Foam::KinematicParcel<ParcelType>::tTurb() const
245 template <class ParcelType>
246 inline const Foam::vector& Foam::KinematicParcel<ParcelType>::UTurb() const
252 template <class ParcelType>
253 inline Foam::label Foam::KinematicParcel<ParcelType>::typeId()
259 template <class ParcelType>
260 inline Foam::scalar& Foam::KinematicParcel<ParcelType>::nParticle()
266 template <class ParcelType>
267 inline Foam::scalar& Foam::KinematicParcel<ParcelType>::d()
273 template <class ParcelType>
274 inline Foam::vector& Foam::KinematicParcel<ParcelType>::U()
280 template <class ParcelType>
281 inline Foam::scalar& Foam::KinematicParcel<ParcelType>::rho()
287 template <class ParcelType>
288 inline Foam::scalar& Foam::KinematicParcel<ParcelType>::tTurb()
294 template <class ParcelType>
295 inline Foam::vector& Foam::KinematicParcel<ParcelType>::UTurb()
301 template <class ParcelType>
302 inline Foam::scalar Foam::KinematicParcel<ParcelType>::wallImpactDistance
311 template <class ParcelType>
312 inline Foam::label Foam::KinematicParcel<ParcelType>::faceInterpolation() const
314 // Use volume-based interpolation if dealing with external faces
315 if (this->cloud().internalFace(this->face()))
326 template <class ParcelType>
327 inline Foam::scalar Foam::KinematicParcel<ParcelType>::massCell
332 return rhoc_*this->cloud().pMesh().cellVolumes()[cellI];
336 template <class ParcelType>
337 inline Foam::scalar Foam::KinematicParcel<ParcelType>::mass() const
339 return rho_*volume();
343 template <class ParcelType>
344 inline Foam::scalar Foam::KinematicParcel<ParcelType>::volume() const
350 template <class ParcelType>
352 Foam::KinematicParcel<ParcelType>::volume(const scalar d) const
354 return mathematicalConstant::pi/6.0*pow3(d);
358 template <class ParcelType>
359 inline Foam::scalar Foam::KinematicParcel<ParcelType>::areaP() const
365 template <class ParcelType>
367 Foam::KinematicParcel<ParcelType>::areaP(const scalar d) const
369 return 0.25*areaS(d);
373 template <class ParcelType>
374 inline Foam::scalar Foam::KinematicParcel<ParcelType>::areaS() const
380 template <class ParcelType>
382 Foam::KinematicParcel<ParcelType>::areaS(const scalar d) const
384 return mathematicalConstant::pi*d*d;
388 template <class ParcelType>
390 Foam::KinematicParcel<ParcelType>::Re
398 return rhoc*mag(U - Uc_)*d/muc;
402 // ************************************************************************* //