OpenFOAM logo
The Open Source CFD Toolbox
  Programmer’s C++ Doxygen 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-2007 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     parcel
00027 
00028 Description
00029 
00030 \*---------------------------------------------------------------------------*/
00031 
00032 #ifndef parcel_H
00033 #define parcel_H
00034 
00035 #include "particle.H"
00036 #include "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> fuelNames_;
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 fuel 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>& fuelNames
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 fuel components
00185             inline const List<word>& fuelNames() const;
00186 
00187             //- Return diameter of droplets in parcel
00188             inline scalar d() const;
00189 
00190             //- Return diameter of droplets in parcel
00191             inline scalar& d();
00192 
00193             //- Return temperature of droplets in parcel
00194             inline scalar T() const;
00195 
00196             //- Return temperature of droplets in parcel
00197             inline scalar& T();
00198 
00199             //- Return total parcel mass
00200             inline scalar m() const;
00201 
00202             //- Return total parcel mass
00203             inline scalar& m();
00204 
00205             //- Return spherical deviation of droplets in parcel
00206             inline scalar dev() const;
00207 
00208             //- Return spherical deviation of droplets in parcel
00209             inline scalar& dev();
00210 
00211             //- Return rate of change of spherical deviation of
00212             //  droplets in parcel
00213             inline scalar ddev() const;
00214 
00215             //- Return rate of change of spherical deviation of
00216             //  droplets in parcel
00217             inline scalar& ddev();
00218 
00219             //- Return characteristic time of droplets in parcel
00220             inline scalar ct() const;
00221 
00222             //- Return characteristic time of droplets in parcel
00223             inline scalar& ct();
00224 
00225             //- Return stripped mass of droplets in parcel
00226             inline scalar& ms();
00227 
00228             //- Return stripped mass of droplets in parcel
00229             inline scalar ms() const;
00230 
00231             //- Return time spent in turbulent eddy
00232             inline scalar& tTurb();
00233 
00234             //- Return time spent in turbulent eddy
00235             inline scalar tTurb() const;
00236 
00237             //- Return part of liquid liquidCore
00238             inline scalar& liquidCore();
00239 
00240             //- Return part of liquid liquidCore
00241             inline scalar liquidCore() const;
00242 
00243             //- Return the injector from which is injected
00244             inline scalar& injector();
00245 
00246             //- Return the injector from which is injected
00247             inline scalar injector() const;
00248 
00249             //- Return velocity of parcel
00250             inline const vector& U() const;
00251 
00252             //- Return velocity of parcel
00253             inline vector& U();
00254 
00255             //- Return turbulent velocity fluctuation
00256             inline const vector& Uturb() const;
00257 
00258             //- Return turbulent velocity fluctuation
00259             inline vector& Uturb();
00260 
00261             //- Return the normal used for 2D purposes
00262             inline const vector& n() const;
00263 
00264             //- Return the normal used for 2D purposes
00265             inline vector& n();
00266 
00267             //- Return the liquid fuel molar fractions
00268             inline const scalarField& X() const;
00269 
00270             //- Return the liquid fuel molar fractions
00271             inline scalarField& X();
00272 
00273             //- Return the momentum relaxation time of droplets in parcel
00274             inline scalar& tMom();
00275 
00276             //- Return the momentum relaxation time of droplets in parcel
00277             inline scalar tMom() const;
00278 
00279 
00280         // Derived information
00281 
00282             //- Return statistical number of drops in parcel
00283             scalar N(const scalar rho) const;
00284 
00285             //- Return relative velocity between given vector and parcel
00286             inline vector Urel(const vector&) const;
00287 
00288 
00289         // Dimensionless Numbers
00290 
00291             //- Reynolds number based on rho an dynamic viscosity
00292             scalar Re
00293             (
00294                 const scalar rho,
00295                 const vector& U,
00296                 const scalar mu
00297             ) const;
00298 
00299             //- Reynolds number based on kinematic viscosity
00300             scalar Re
00301             (
00302                 const vector& U,
00303                 const scalar nu
00304             ) const;
00305 
00306             //- Weber number
00307             scalar We
00308             (
00309                 const vector& U,
00310                 const scalar rho,
00311                 const scalar sigma
00312             ) const;
00313 
00314             //- Schmidt number based on dynamic viscosity and rho
00315             scalar Sc
00316             (
00317                 const scalar mu,
00318                 const scalar rho,
00319                 const scalar massDiffusion
00320             ) const;
00321 
00322             //- Schmidt number based on kinematic viscosity
00323             scalar Sc
00324             (
00325                 const scalar nu,
00326                 const scalar massDiffusion
00327             ) const;
00328 
00329             //- Prandtl number
00330             scalar Pr
00331             (
00332                 const scalar cp,
00333                 const scalar mu,
00334                 const scalar kappa
00335             ) const;
00336 
00337             //- Volume of one droplet in the parcel
00338             scalar Vd() const;
00339 
00340             //- Volume of all droplets in parcel
00341             scalar V(const scalar rho) const;
00342 
00343 
00344         // Parcel operations
00345 
00346             bool move(spray& sprayData);
00347 
00348             //- Transform the position and physical properties of the particle
00349             //  according to the given transformation tensor
00350             void transformProperties(const tensor& T);
00351 
00352             //- Transform the position and physical properties of the particle
00353             //  according to the given separation vector
00354             void transformProperties(const vector& separation);
00355 
00356             //- fix the 2D plane normal,
00357             // when particle hits a face it is slightly perturbed 
00358             // towards the face centre and n_ will no longer be valid
00359             inline void correctNormal(const vector& sym);
00360 
00361 
00362     // Ostream Operator
00363 
00364         friend Ostream& operator<<(Ostream&, const parcel&);
00365 };
00366 
00367 
00368 template<>
00369 inline bool contiguous<parcel>()
00370 {
00371     return true;
00372 }
00373 
00374 
00375 template<>
00376 void Cloud<parcel>::readFields();
00377 
00378 
00379 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00380 
00381 } // End namespace Foam
00382 
00383 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00384 
00385 #include "parcelI.H"
00386 
00387 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00388 
00389 #endif
00390 
00391 // ************************************************************************* //
Copyright © 2000-2007 OpenCFD Ltd