FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

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-2010 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
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your 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, see <http://www.gnu.org/licenses/>.
00023 
00024 \*---------------------------------------------------------------------------*/
00025 
00026 #include <OpenFOAM/mathematicalConstants.H>
00027 
00028 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00029 
00030 template <class ParcelType>
00031 inline Foam::KinematicParcel<ParcelType>::constantProperties::constantProperties
00032 (
00033     const dictionary& parentDict
00034 )
00035 :
00036     dict_(parentDict.subDict("constantProperties")),
00037     rhoMin_(dimensionedScalar(dict_.lookup("rhoMin")).value()),
00038     rho0_(dimensionedScalar(dict_.lookup("rho0")).value()),
00039     minParticleMass_
00040     (
00041         dimensionedScalar(dict_.lookup("minParticleMass")).value()
00042     )
00043 {}
00044 
00045 
00046 template <class ParcelType>
00047 inline Foam::KinematicParcel<ParcelType>::trackData::trackData
00048 (
00049     KinematicCloud<ParcelType>& cloud,
00050     const constantProperties& constProps,
00051     const interpolation<scalar>& rhoInterp,
00052     const interpolation<vector>& UInterp,
00053     const interpolation<scalar>& muInterp,
00054     const vector& g
00055 )
00056 :
00057     Particle<ParcelType>::trackData(cloud),
00058     cloud_(cloud),
00059     constProps_(constProps),
00060     rhoInterp_(rhoInterp),
00061     UInterp_(UInterp),
00062     muInterp_(muInterp),
00063     g_(g)
00064 {}
00065 
00066 
00067 template <class ParcelType>
00068 inline Foam::KinematicParcel<ParcelType>::KinematicParcel
00069 (
00070     KinematicCloud<ParcelType>& owner,
00071     const vector& position,
00072     const label cellI
00073 )
00074 :
00075     Particle<ParcelType>(owner, position, cellI),
00076     active_(true),
00077     typeId_(owner.parcelTypeId()),
00078     nParticle_(0),
00079     d_(0.0),
00080     U_(vector::zero),
00081     rho_(0.0),
00082     tTurb_(0.0),
00083     UTurb_(vector::zero),
00084     rhoc_(0.0),
00085     Uc_(vector::zero),
00086     muc_(0.0)
00087 {}
00088 
00089 
00090 template <class ParcelType>
00091 inline Foam::KinematicParcel<ParcelType>::KinematicParcel
00092 (
00093     KinematicCloud<ParcelType>& owner,
00094     const vector& position,
00095     const label cellI,
00096     const label typeId,
00097     const scalar nParticle0,
00098     const scalar d0,
00099     const vector& U0,
00100     const constantProperties& constProps
00101 )
00102 :
00103     Particle<ParcelType>(owner, position, cellI),
00104     active_(true),
00105     typeId_(typeId),
00106     nParticle_(nParticle0),
00107     d_(d0),
00108     U_(U0),
00109     rho_(constProps.rho0()),
00110     tTurb_(0.0),
00111     UTurb_(vector::zero),
00112     rhoc_(0.0),
00113     Uc_(vector::zero),
00114     muc_(0.0)
00115 {}
00116 
00117 
00118 // * * * * * * * * * constantProperties Member Functions * * * * * * * * * * //
00119 
00120 template <class ParcelType>
00121 inline const Foam::dictionary&
00122 Foam::KinematicParcel<ParcelType>::constantProperties::dict() const
00123 {
00124     return dict_;
00125 }
00126 
00127 
00128 template <class ParcelType>
00129 inline Foam::scalar
00130 Foam::KinematicParcel<ParcelType>::constantProperties::rhoMin() const
00131 {
00132     return rhoMin_;
00133 }
00134 
00135 
00136 template <class ParcelType>
00137 inline Foam::scalar
00138 Foam::KinematicParcel<ParcelType>::constantProperties::rho0() const
00139 {
00140     return rho0_;
00141 }
00142 
00143 
00144 template <class ParcelType>
00145 inline Foam::scalar
00146 Foam::KinematicParcel<ParcelType>::constantProperties::minParticleMass() const
00147 {
00148     return minParticleMass_;
00149 }
00150 
00151 
00152 // * * * * * * * * * * * trackData Member Functions  * * * * * * * * * * * * //
00153 
00154 template <class ParcelType>
00155 inline Foam::KinematicCloud<ParcelType>&
00156 Foam::KinematicParcel<ParcelType>::trackData::cloud()
00157 {
00158     return cloud_;
00159 }
00160 
00161 
00162 template <class ParcelType>
00163 inline const typename Foam::KinematicParcel<ParcelType>::constantProperties&
00164 Foam::KinematicParcel<ParcelType>::trackData::constProps() const
00165 {
00166     return constProps_;
00167 }
00168 
00169 
00170 template<class ParcelType>
00171 inline const Foam::interpolation<Foam::scalar>&
00172 Foam::KinematicParcel<ParcelType>::trackData::rhoInterp() const
00173 {
00174     return rhoInterp_;
00175 }
00176 
00177 
00178 template <class ParcelType>
00179 inline const Foam::interpolation<Foam::vector>&
00180 Foam::KinematicParcel<ParcelType>::trackData::UInterp() const
00181 {
00182     return UInterp_;
00183 }
00184 
00185 
00186 template<class ParcelType>
00187 inline const Foam::interpolation<Foam::scalar>&
00188 Foam::KinematicParcel<ParcelType>::trackData::muInterp() const
00189 {
00190     return muInterp_;
00191 }
00192 
00193 
00194 template<class ParcelType>
00195 inline const Foam::vector&
00196 Foam::KinematicParcel<ParcelType>::trackData::g() const
00197 {
00198     return g_;
00199 }
00200 
00201 
00202 // * * * * * * * * * * KinematicParcel Member Functions  * * * * * * * * * * //
00203 
00204 template <class ParcelType>
00205 inline bool Foam::KinematicParcel<ParcelType>::active() const
00206 {
00207     return active_;
00208 }
00209 
00210 
00211 template <class ParcelType>
00212 inline Foam::label Foam::KinematicParcel<ParcelType>::typeId() const
00213 {
00214     return typeId_;
00215 }
00216 
00217 
00218 template <class ParcelType>
00219 inline Foam::scalar Foam::KinematicParcel<ParcelType>::nParticle() const
00220 {
00221     return nParticle_;
00222 }
00223 
00224 
00225 template <class ParcelType>
00226 inline Foam::scalar Foam::KinematicParcel<ParcelType>::d() const
00227 {
00228     return d_;
00229 }
00230 
00231 
00232 template <class ParcelType>
00233 inline const Foam::vector& Foam::KinematicParcel<ParcelType>::U() const
00234 {
00235     return U_;
00236 }
00237 
00238 
00239 template <class ParcelType>
00240 inline Foam::scalar Foam::KinematicParcel<ParcelType>::rho() const
00241 {
00242     return rho_;
00243 }
00244 
00245 
00246 template <class ParcelType>
00247 inline Foam::scalar Foam::KinematicParcel<ParcelType>::tTurb() const
00248 {
00249     return tTurb_;
00250 }
00251 
00252 
00253 template <class ParcelType>
00254 inline const Foam::vector& Foam::KinematicParcel<ParcelType>::UTurb() const
00255 {
00256     return UTurb_;
00257 }
00258 
00259 
00260 template <class ParcelType>
00261 inline bool& Foam::KinematicParcel<ParcelType>::active()
00262 {
00263     return active_;
00264 }
00265 
00266 
00267 template <class ParcelType>
00268 inline Foam::label Foam::KinematicParcel<ParcelType>::typeId()
00269 {
00270     return typeId_;
00271 }
00272 
00273 
00274 template <class ParcelType>
00275 inline Foam::scalar& Foam::KinematicParcel<ParcelType>::nParticle()
00276 {
00277     return nParticle_;
00278 }
00279 
00280 
00281 template <class ParcelType>
00282 inline Foam::scalar& Foam::KinematicParcel<ParcelType>::d()
00283 {
00284     return d_;
00285 }
00286 
00287 
00288 template <class ParcelType>
00289 inline Foam::vector& Foam::KinematicParcel<ParcelType>::U()
00290 {
00291     return U_;
00292 }
00293 
00294 
00295 template <class ParcelType>
00296 inline Foam::scalar& Foam::KinematicParcel<ParcelType>::rho()
00297 {
00298     return rho_;
00299 }
00300 
00301 
00302 template <class ParcelType>
00303 inline Foam::scalar& Foam::KinematicParcel<ParcelType>::tTurb()
00304 {
00305     return tTurb_;
00306 }
00307 
00308 
00309 template <class ParcelType>
00310 inline Foam::vector& Foam::KinematicParcel<ParcelType>::UTurb()
00311 {
00312     return UTurb_;
00313 }
00314 
00315 
00316 template <class ParcelType>
00317 inline Foam::scalar Foam::KinematicParcel<ParcelType>::wallImpactDistance
00318 (
00319     const vector&
00320 ) const
00321 {
00322     return 0.5*d_;
00323 }
00324 
00325 
00326 template <class ParcelType>
00327 inline Foam::label Foam::KinematicParcel<ParcelType>::faceInterpolation() const
00328 {
00329     // Use volume-based interpolation if dealing with external faces
00330     if (this->cloud().internalFace(this->face()))
00331     {
00332         return this->face();
00333     }
00334     else
00335     {
00336         return -1;
00337     }
00338 }
00339 
00340 
00341 template <class ParcelType>
00342 inline Foam::scalar Foam::KinematicParcel<ParcelType>::massCell
00343 (
00344     const label cellI
00345 ) const
00346 {
00347     return rhoc_*this->cloud().pMesh().cellVolumes()[cellI];
00348 }
00349 
00350 
00351 template <class ParcelType>
00352 inline Foam::scalar Foam::KinematicParcel<ParcelType>::mass() const
00353 {
00354     return rho_*volume();
00355 }
00356 
00357 
00358 template <class ParcelType>
00359 inline Foam::scalar Foam::KinematicParcel<ParcelType>::volume() const
00360 {
00361     return volume(d_);
00362 }
00363 
00364 
00365 template <class ParcelType>
00366 inline Foam::scalar
00367 Foam::KinematicParcel<ParcelType>::volume(const scalar d) const
00368 {
00369     return mathematicalConstant::pi/6.0*pow3(d);
00370 }
00371 
00372 
00373 template <class ParcelType>
00374 inline Foam::scalar Foam::KinematicParcel<ParcelType>::areaP() const
00375 {
00376     return areaP(d_);
00377 }
00378 
00379 
00380 template <class ParcelType>
00381 inline Foam::scalar
00382 Foam::KinematicParcel<ParcelType>::areaP(const scalar d) const
00383 {
00384     return 0.25*areaS(d);
00385 }
00386 
00387 
00388 template <class ParcelType>
00389 inline Foam::scalar Foam::KinematicParcel<ParcelType>::areaS() const
00390 {
00391     return areaS(d_);
00392 }
00393 
00394 
00395 template <class ParcelType>
00396 inline Foam::scalar
00397 Foam::KinematicParcel<ParcelType>::areaS(const scalar d) const
00398 {
00399     return mathematicalConstant::pi*d*d;
00400 }
00401 
00402 
00403 template <class ParcelType>
00404 inline Foam::scalar
00405 Foam::KinematicParcel<ParcelType>::Re
00406 (
00407     const vector& U,
00408     const scalar d,
00409     const scalar rhoc,
00410     const scalar muc
00411 ) const
00412 {
00413     return rhoc*mag(U - Uc_)*d/muc;
00414 }
00415 
00416 
00417 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines