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

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