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

parcel.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 Class
00026     Foam::parcel
00027 
00028 Description
00029     A parcel of particles
00030 
00031 \*---------------------------------------------------------------------------*/
00032 
00033 #ifndef parcel_H
00034 #define parcel_H
00035 
00036 #include "Particle.H"
00037 #include "contiguous.H"
00038 
00039 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00040 
00041 namespace Foam
00042 {
00043 
00044 class spray;
00045 
00046 /*---------------------------------------------------------------------------*\
00047                            Class parcel Declaration
00048 \*---------------------------------------------------------------------------*/
00049 
00050 class parcel
00051 :
00052     public Particle<parcel>
00053 {
00054     // Private member data
00055 
00056         // Reference to the names of the liquid components
00057             List<word> liquidComponents_;
00058 
00059         // Defining data (read and written to field files)
00060 
00061             //- Diameter of droplets in parcel
00062             scalar d_;
00063 
00064             //- Temperature of droplets in parcel
00065             scalar T_;
00066 
00067             //- Total parcel mass
00068             scalar m_;
00069 
00070             //- Spherical deviation of droplets in parcel
00071             scalar y_;
00072 
00073             //- Rate of change of spherical deviation of droplets in parcel
00074             scalar yDot_;
00075 
00076             //- Characteristic time of droplets in parcel
00077             scalar ct_;
00078 
00079             //- Stripped mass of droplets in parcel
00080             scalar ms_;
00081 
00082             //- Time spent in turbulent eddy
00083             scalar tTurb_;
00084 
00085             //- Part of liquid core (1-fully liquid, 0-droplet)
00086             scalar liquidCore_;
00087 
00088             //- injected from injector
00089             //  Should really be a label, but is scalar due to
00090             //  post-processing reasons
00091             scalar injector_;
00092 
00093             //- Velocity of parcel
00094             vector U_;
00095 
00096             //- Turbulent velocity fluctuation
00097             vector Uturb_;
00098 
00099             //- Normal n_ and axis describe the 2D plane
00100             //  in which the particle moves
00101             vector n_;
00102 
00103             //- Liquid components molar fractions
00104             scalarField X_;
00105 
00106         // Derived state information (not read or written)
00107 
00108             //- Momentum relaxation time of droplets in parcel
00109             scalar tMom_;
00110 
00111 
00112     // Private member functions
00113 
00114         //- Set the relaxation times
00115         void setRelaxationTimes
00116         (
00117             label celli,
00118             scalar& tauMomentum,
00119             scalarField& tauEvaporation,
00120             scalar& tauHeatTransfer,
00121             scalarField& tauBoiling,
00122             const spray& sprayDatabase,
00123             const scalar rho,
00124             const vector& Up,
00125             const scalar temperature,
00126             const scalar pressure,
00127             const scalarField& Yf,
00128             const scalarField& m0,
00129             const scalar dt
00130         );
00131 
00132 
00133         void updateParcelProperties
00134         (
00135             const scalar dt,
00136             spray& sprayData,
00137             const label celli,
00138             const label facei
00139         );
00140 
00141 
00142 public:
00143 
00144     friend class Cloud<parcel>;
00145 
00146 
00147     // Constructors
00148 
00149         //- Construct from components
00150         parcel
00151         (
00152             const Cloud<parcel>& cloud,
00153             const vector& position,
00154             const label celli,
00155             const vector& n,
00156             const scalar d,
00157             const scalar T,
00158             const scalar m,
00159             const scalar y,
00160             const scalar yDot,
00161             const scalar ct,
00162             const scalar ms,
00163             const scalar tTurb,
00164             const scalar liquidCore,
00165             const scalar injector,
00166             const vector& U,
00167             const vector& Uturb,
00168             const scalarField& X,
00169             const List<word>& liquidNames
00170         );
00171 
00172         //- Construct from Istream reading field values if required
00173         parcel
00174         (
00175             const Cloud<parcel>& cloud,
00176             Istream& is,
00177             bool readFields = true
00178         );
00179 
00180 
00181     // Member Functions
00182 
00183         // Access
00184 
00185             //- Return the names of the liquid components
00186             inline const List<word>& liquidNames() const;
00187 
00188             //- Return the names of the liquid fuel components - identical with liquidNames
00189             inline const List<word>& fuelNames() const;
00190 
00191             //- Return diameter of droplets in parcel
00192             inline scalar d() const;
00193 
00194             //- Return diameter of droplets in parcel
00195             inline scalar& d();
00196 
00197             //- Return temperature of droplets in parcel
00198             inline scalar T() const;
00199 
00200             //- Return temperature of droplets in parcel
00201             inline scalar& T();
00202 
00203             //- Return total parcel mass
00204             inline scalar m() const;
00205 
00206             //- Return total parcel mass
00207             inline scalar& m();
00208 
00209             //- Return spherical deviation of droplets in parcel
00210             inline scalar dev() const;
00211 
00212             //- Return spherical deviation of droplets in parcel
00213             inline scalar& dev();
00214 
00215             //- Return rate of change of spherical deviation of
00216             //  droplets in parcel
00217             inline scalar ddev() const;
00218 
00219             //- Return rate of change of spherical deviation of
00220             //  droplets in parcel
00221             inline scalar& ddev();
00222 
00223             //- Return characteristic time of droplets in parcel
00224             inline scalar ct() const;
00225 
00226             //- Return characteristic time of droplets in parcel
00227             inline scalar& ct();
00228 
00229             //- Return stripped mass of droplets in parcel
00230             inline scalar& ms();
00231 
00232             //- Return stripped mass of droplets in parcel
00233             inline scalar ms() const;
00234 
00235             //- Return time spent in turbulent eddy
00236             inline scalar& tTurb();
00237 
00238             //- Return time spent in turbulent eddy
00239             inline scalar tTurb() const;
00240 
00241             //- Return part of liquid liquidCore
00242             inline scalar& liquidCore();
00243 
00244             //- Return part of liquid liquidCore
00245             inline scalar liquidCore() const;
00246 
00247             //- Return the injector from which is injected
00248             inline scalar& injector();
00249 
00250             //- Return the injector from which is injected
00251             inline scalar injector() const;
00252 
00253             //- Return velocity of parcel
00254             inline const vector& U() const;
00255 
00256             //- Return velocity of parcel
00257             inline vector& U();
00258 
00259             //- Return turbulent velocity fluctuation
00260             inline const vector& Uturb() const;
00261 
00262             //- Return turbulent velocity fluctuation
00263             inline vector& Uturb();
00264 
00265             //- Return the normal used for 2D purposes
00266             inline const vector& n() const;
00267 
00268             //- Return the normal used for 2D purposes
00269             inline vector& n();
00270 
00271             //- Return the liquid components molar fractions
00272             inline const scalarField& X() const;
00273 
00274             //- Return the liquid components molar fractions
00275             inline scalarField& X();
00276 
00277             //- Return the momentum relaxation time of droplets in parcel
00278             inline scalar& tMom();
00279 
00280             //- Return the momentum relaxation time of droplets in parcel
00281             inline scalar tMom() const;
00282 
00283 
00284         // Derived information
00285 
00286             //- Return statistical number of drops in parcel
00287             scalar N(const scalar rho) const;
00288 
00289             //- Return relative velocity between given vector and parcel
00290             inline vector Urel(const vector&) const;
00291 
00292 
00293         // Dimensionless Numbers
00294 
00295             //- Reynolds number based on rho an dynamic viscosity
00296             scalar Re
00297             (
00298                 const scalar rho,
00299                 const vector& U,
00300                 const scalar mu
00301             ) const;
00302 
00303             //- Reynolds number based on kinematic viscosity
00304             scalar Re
00305             (
00306                 const vector& U,
00307                 const scalar nu
00308             ) const;
00309 
00310             //- Weber number
00311             scalar We
00312             (
00313                 const vector& U,
00314                 const scalar rho,
00315                 const scalar sigma
00316             ) const;
00317 
00318             //- Schmidt number based on dynamic viscosity and rho
00319             scalar Sc
00320             (
00321                 const scalar mu,
00322                 const scalar rho,
00323                 const scalar massDiffusion
00324             ) const;
00325 
00326             //- Schmidt number based on kinematic viscosity
00327             scalar Sc
00328             (
00329                 const scalar nu,
00330                 const scalar massDiffusion
00331             ) const;
00332 
00333             //- Prandtl number
00334             scalar Pr
00335             (
00336                 const scalar cp,
00337                 const scalar mu,
00338                 const scalar kappa
00339             ) const;
00340 
00341             //- Volume of one droplet in the parcel
00342             scalar Vd() const;
00343 
00344             //- Volume of all droplets in parcel
00345             scalar V(const scalar rho) const;
00346 
00347 
00348         // Parcel operations
00349 
00350             bool move(spray& sprayData);
00351 
00352             //- Transform the position and physical properties of the particle
00353             //  according to the given transformation tensor
00354             void transformProperties(const tensor& T);
00355 
00356             //- Transform the position and physical properties of the particle
00357             //  according to the given separation vector
00358             void transformProperties(const vector& separation);
00359 
00360             //- fix the 2D plane normal,
00361             // when particle hits a face it is slightly perturbed
00362             // towards the face centre and n_ will no longer be valid
00363             inline void correctNormal(const vector& sym);
00364 
00365 
00366     // I/O
00367 
00368             static void readFields(Cloud<parcel>& c);
00369 
00370             static void writeFields(const Cloud<parcel>& c);
00371 
00372 
00373     // Ostream Operator
00374 
00375         friend Ostream& operator<<(Ostream&, const parcel&);
00376 };
00377 
00378 
00379 template<>
00380 inline bool contiguous<parcel>()
00381 {
00382     return true;
00383 }
00384 
00385 
00386 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00387 
00388 } // End namespace Foam
00389 
00390 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00391 
00392 #include "parcelI.H"
00393 
00394 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00395 
00396 #endif
00397 
00398 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd