OpenFOAM logo
Open Source CFD Toolkit

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