OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

KinematicParcelI.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 \*---------------------------------------------------------------------------*/
00026 
00027 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00028 
00029 template <class ParcelType>
00030 inline Foam::KinematicParcel<ParcelType>::constantProperties::constantProperties
00031 (
00032     const dictionary& parentDict
00033 )
00034 :
00035     dict_(parentDict.subDict("constantProperties")),
00036     rhoMin_(dimensionedScalar(dict_.lookup("rhoMin")).value()),
00037     rho0_(dimensionedScalar(dict_.lookup("rho0")).value()),
00038     minParticleMass_
00039     (
00040         dimensionedScalar(dict_.lookup("minParticleMass")).value()
00041     )
00042 {}
00043 
00044 
00045 template <class ParcelType>
00046 inline Foam::KinematicParcel<ParcelType>::trackData::trackData
00047 (
00048     KinematicCloud<ParcelType>& cloud,
00049     const constantProperties& constProps,
00050     const interpolation<scalar>& rhoInterp,
00051     const interpolation<vector>& UInterp,
00052     const interpolation<scalar>& muInterp,
00053     const vector& g
00054 )
00055 :
00056     Particle<ParcelType>::trackData(cloud),
00057     cloud_(cloud),
00058     constProps_(constProps),
00059     rhoInterp_(rhoInterp),
00060     UInterp_(UInterp),
00061     muInterp_(muInterp),
00062     g_(g)
00063 {}
00064 
00065 
00066 template <class ParcelType>
00067 inline Foam::KinematicParcel<ParcelType>::KinematicParcel
00068 (
00069     KinematicCloud<ParcelType>& owner,
00070     const vector& position,
00071     const label cellI
00072 )
00073 :
00074     Particle<ParcelType>(owner, position, cellI),
00075     typeId_(owner.parcelTypeId()),
00076     nParticle_(0),
00077     d_(0.0),
00078     U_(vector::zero),
00079     rho_(0.0),
00080     tTurb_(0.0),
00081     UTurb_(vector::zero),
00082     rhoc_(0.0),
00083     Uc_(vector::zero),
00084     muc_(0.0)
00085 {}
00086 
00087 
00088 template <class ParcelType>
00089 inline Foam::KinematicParcel<ParcelType>::KinematicParcel
00090 (
00091     KinematicCloud<ParcelType>& owner,
00092     const vector& position,
00093     const label cellI,
00094     const label typeId,
00095     const scalar nParticle0,
00096     const scalar d0,
00097     const vector& U0,
00098     const constantProperties& constProps
00099 )
00100 :
00101     Particle<ParcelType>(owner, position, cellI),
00102     typeId_(typeId),
00103     nParticle_(nParticle0),
00104     d_(d0),
00105     U_(U0),
00106     rho_(constProps.rho0()),
00107     tTurb_(0.0),
00108     UTurb_(vector::zero),
00109     rhoc_(0.0),
00110     Uc_(vector::zero),
00111     muc_(0.0)
00112 {}
00113 
00114 
00115 // * * * * * * * * * constantProperties Member Functions * * * * * * * * * * //
00116 
00117 template <class ParcelType>
00118 inline const Foam::dictionary&
00119 Foam::KinematicParcel<ParcelType>::constantProperties::dict() const
00120 {
00121     return dict_;
00122 }
00123 
00124 
00125 template <class ParcelType>
00126 inline Foam::scalar
00127 Foam::KinematicParcel<ParcelType>::constantProperties::rhoMin() const
00128 {
00129     return rhoMin_;
00130 }
00131 
00132 
00133 template <class ParcelType>
00134 inline Foam::scalar
00135 Foam::KinematicParcel<ParcelType>::constantProperties::rho0() const
00136 {
00137     return rho0_;
00138 }
00139 
00140 
00141 template <class ParcelType>
00142 inline Foam::scalar
00143 Foam::KinematicParcel<ParcelType>::constantProperties::minParticleMass() const
00144 {
00145     return minParticleMass_;
00146 }
00147 
00148 
00149 // * * * * * * * * * * * trackData Member Functions  * * * * * * * * * * * * //
00150 
00151 template <class ParcelType>
00152 inline Foam::KinematicCloud<ParcelType>&
00153 Foam::KinematicParcel<ParcelType>::trackData::cloud()
00154 {
00155     return cloud_;
00156 }
00157 
00158 
00159 template <class ParcelType>
00160 inline const typename Foam::KinematicParcel<ParcelType>::constantProperties&
00161 Foam::KinematicParcel<ParcelType>::trackData::constProps() const
00162 {
00163     return constProps_;
00164 }
00165 
00166 
00167 template<class ParcelType>
00168 inline const Foam::interpolation<Foam::scalar>&
00169 Foam::KinematicParcel<ParcelType>::trackData::rhoInterp() const
00170 {
00171     return rhoInterp_;
00172 }
00173 
00174 
00175 template <class ParcelType>
00176 inline const Foam::interpolation<Foam::vector>&
00177 Foam::KinematicParcel<ParcelType>::trackData::UInterp() const
00178 {
00179     return UInterp_;
00180 }
00181 
00182 
00183 template<class ParcelType>
00184 inline const Foam::interpolation<Foam::scalar>&
00185 Foam::KinematicParcel<ParcelType>::trackData::muInterp() const
00186 {
00187     return muInterp_;
00188 }
00189 
00190 
00191 template<class ParcelType>
00192 inline const Foam::vector&
00193 Foam::KinematicParcel<ParcelType>::trackData::g() const
00194 {
00195     return g_;
00196 }
00197 
00198 
00199 // * * * * * * * * * * KinematicParcel Member Functions  * * * * * * * * * * //
00200 
00201 template <class ParcelType>
00202 inline Foam::label Foam::KinematicParcel<ParcelType>::typeId() const
00203 {
00204     return typeId_;
00205 }
00206 
00207 
00208 template <class ParcelType>
00209 inline Foam::scalar Foam::KinematicParcel<ParcelType>::nParticle() const
00210 {
00211     return nParticle_;
00212 }
00213 
00214 
00215 template <class ParcelType>
00216 inline Foam::scalar Foam::KinematicParcel<ParcelType>::d() const
00217 {
00218     return d_;
00219 }
00220 
00221 
00222 template <class ParcelType>
00223 inline const Foam::vector& Foam::KinematicParcel<ParcelType>::U() const
00224 {
00225     return U_;
00226 }
00227 
00228 
00229 template <class ParcelType>
00230 inline Foam::scalar Foam::KinematicParcel<ParcelType>::rho() const
00231 {
00232     return rho_;
00233 }
00234 
00235 
00236 template <class ParcelType>
00237 inline Foam::scalar Foam::KinematicParcel<ParcelType>::tTurb() const
00238 {
00239     return tTurb_;
00240 }
00241 
00242 
00243 template <class ParcelType>
00244 inline const Foam::vector& Foam::KinematicParcel<ParcelType>::UTurb() const
00245 {
00246     return UTurb_;
00247 }
00248 
00249 
00250 template <class ParcelType>
00251 inline Foam::label Foam::KinematicParcel<ParcelType>::typeId()
00252 {
00253     return typeId_;
00254 }
00255 
00256 
00257 template <class ParcelType>
00258 inline Foam::scalar& Foam::KinematicParcel<ParcelType>::nParticle()
00259 {
00260     return nParticle_;
00261 }
00262 
00263 
00264 template <class ParcelType>
00265 inline Foam::scalar& Foam::KinematicParcel<ParcelType>::d()
00266 {
00267     return d_;
00268 }
00269 
00270 
00271 template <class ParcelType>
00272 inline Foam::vector& Foam::KinematicParcel<ParcelType>::U()
00273 {
00274     return U_;
00275 }
00276 
00277 
00278 template <class ParcelType>
00279 inline Foam::scalar& Foam::KinematicParcel<ParcelType>::rho()
00280 {
00281     return rho_;
00282 }
00283 
00284 
00285 template <class ParcelType>
00286 inline Foam::scalar& Foam::KinematicParcel<ParcelType>::tTurb()
00287 {
00288     return tTurb_;
00289 }
00290 
00291 
00292 template <class ParcelType>
00293 inline Foam::vector& Foam::KinematicParcel<ParcelType>::UTurb()
00294 {
00295     return UTurb_;
00296 }
00297 
00298 
00299 template <class ParcelType>
00300 inline Foam::scalar Foam::KinematicParcel<ParcelType>::wallImpactDistance
00301 (
00302     const vector&
00303 ) const
00304 {
00305     return 0.5*d_;
00306 }
00307 
00308 
00309 template <class ParcelType>
00310 inline Foam::label Foam::KinematicParcel<ParcelType>::faceInterpolation() const
00311 {
00312     // Use volume-based interpolation if dealing with external faces
00313     if (this->cloud().internalFace(this->face()))
00314     {
00315         return this->face();
00316     }
00317     else
00318     {
00319         return -1;
00320     }
00321 }
00322 
00323 
00324 template <class ParcelType>
00325 inline Foam::scalar Foam::KinematicParcel<ParcelType>::massCell
00326 (
00327     const label cellI
00328 ) const
00329 {
00330     return rhoc_*this->cloud().pMesh().cellVolumes()[cellI];
00331 }
00332 
00333 
00334 template <class ParcelType>
00335 inline Foam::scalar Foam::KinematicParcel<ParcelType>::mass() const
00336 {
00337     return rho_*volume();
00338 }
00339 
00340 
00341 template <class ParcelType>
00342 inline Foam::scalar Foam::KinematicParcel<ParcelType>::volume() const
00343 {
00344     return volume(d_);
00345 }
00346 
00347 
00348 template <class ParcelType>
00349 inline Foam::scalar
00350 Foam::KinematicParcel<ParcelType>::volume(const scalar d) const
00351 {
00352     return mathematicalConstant::pi/6.0*pow3(d);
00353 }
00354 
00355 
00356 template <class ParcelType>
00357 inline Foam::scalar Foam::KinematicParcel<ParcelType>::areaP() const
00358 {
00359     return areaP(d_);
00360 }
00361 
00362 
00363 template <class ParcelType>
00364 inline Foam::scalar
00365 Foam::KinematicParcel<ParcelType>::areaP(const scalar d) const
00366 {
00367     return 0.25*areaS(d);
00368 }
00369 
00370 
00371 template <class ParcelType>
00372 inline Foam::scalar Foam::KinematicParcel<ParcelType>::areaS() const
00373 {
00374     return areaS(d_);
00375 }
00376 
00377 
00378 template <class ParcelType>
00379 inline Foam::scalar
00380 Foam::KinematicParcel<ParcelType>::areaS(const scalar d) const
00381 {
00382     return mathematicalConstant::pi*d*d;
00383 }
00384 
00385 
00386 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd