OpenFOAM logo
Open Source CFD Toolkit

spray.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     spray
00027 
00028 Description
00029 
00030 \*---------------------------------------------------------------------------*/
00031 
00032 #ifndef spray_H
00033 #define spray_H
00034 
00035 #include "Random.H"
00036 
00037 #include "parcel.H"
00038 #include "injector.H"
00039 #include "IOPtrList.H"
00040 #include "volPointInterpolation.H"
00041 #include "interpolation.H"
00042 #include "liquid.H"
00043 #include "sprayThermoTypes.H"
00044 #include "autoPtr.H"
00045 #include "liquidMixture.H"
00046 
00047 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00048 
00049 namespace Foam
00050 {
00051 
00052 class atomizationModel;
00053 class breakupModel;
00054 class collisionModel;
00055 class dispersionModel;
00056 class dragModel;
00057 class evaporationModel;
00058 class injectorModel;
00059 class heatTransferModel;
00060 class wallModel;
00061 
00062 class combustionMixture;
00063 
00064 /*---------------------------------------------------------------------------*\
00065                         Class spray Declaration
00066 \*---------------------------------------------------------------------------*/
00067 
00068 class spray
00069 :
00070     public Cloud<parcel>
00071 {
00072     // Private data
00073 
00074         // References to the database and meshes
00075 
00076             const Time& runTime_;
00077             scalar time0_;
00078             const fvMesh& mesh_;
00079             volPointInterpolation volPointInterpolation_;
00080 
00081             //- Random number generator
00082             Random rndGen_;
00083 
00084 
00085         // References to the physical fields
00086 
00087             const volVectorField& U_;
00088             const volScalarField& rho_;
00089             const volScalarField& p_;
00090             const volScalarField& T_;
00091 
00092 
00093         // The sprays
00094 
00095             IOdictionary sprayProperties_;
00096 
00097 
00098         // The injectors
00099 
00100             IOPtrList<injector> injectors_;
00101 
00102 
00103         // References to the spray sub-models
00104 
00105             autoPtr<atomizationModel> atomization_;
00106             autoPtr<dragModel> drag_;
00107             autoPtr<evaporationModel> evaporation_;
00108             autoPtr<heatTransferModel> heatTransfer_;
00109             autoPtr<wallModel> wall_;
00110             autoPtr<breakupModel> breakupModel_;
00111             autoPtr<collisionModel> collisionModel_;
00112             autoPtr<dispersionModel> dispersionModel_;
00113             autoPtr<liquidMixture> fuels_;
00114             autoPtr<injectorModel> injectorModel_;
00115     
00116         //- Minimum number of lagrangian subcycles
00117         const label subCycles_;
00118 
00119         //- Acceleration due to gravity
00120         vector g_;
00121 
00122 
00123         // Composition properties
00124 
00125             const PtrList<specieProperties>& gasProperties_;
00126             const combustionMixture& composition_;
00127 
00128             List<label> liquidToGasIndex_;
00129             List<label> gasToLiquidIndex_;
00130             List<bool> isLiquidFuel_;
00131 
00132         // Necessary 2D-information
00133 
00134             bool twoD_;
00135             vector axisOfSymmetry_;
00136             vector axisOfWedge_;
00137             vector axisOfWedgeNormal_;
00138             scalar angleOfWedge_;
00139 
00140 
00141         // Interpolation
00142 
00143             dictionary interpolationSchemes_;
00144 
00145             autoPtr<interpolation<vector> > UInterpolator_;
00146             autoPtr<interpolation<scalar> > rhoInterpolator_;
00147             autoPtr<interpolation<scalar> > pInterpolator_;
00148             autoPtr<interpolation<scalar> > TInterpolator_;
00149 
00150 
00151         // Spray Source Terms
00152 
00153             //- Momentum
00154             vectorField sms_;
00155 
00156             //- Enthalpy
00157             scalarField shs_;
00158 
00159             //- Mass
00160             PtrList<scalarField> srhos_;
00161 
00162             //- The total mass of the injected liquid
00163             scalar totalInjectedLiquidMass_;
00164 
00165             //- The (total added) injected kinetic energy of the liquid
00166             scalar injectedLiquidKE_;
00167         
00168         //  Ambient Pressure
00169             
00170             scalar ambientPressure_;
00171         
00172         //  Ambient Temperature
00173         
00174             scalar ambientTemperature_;
00175         
00176 
00177 
00178     // Private Member Functions
00179 
00180         //- Disallow default bitwise copy construct
00181         spray(const spray&);
00182 
00183         //- Disallow default bitwise assignment
00184         void operator=(const spray&);
00185 
00186 
00187 public:
00188 
00189     // Constructors
00190 
00191         //- Construct from components
00192         spray
00193         (
00194             const volPointInterpolation& vpi,
00195             const volVectorField& U,
00196             const volScalarField& rho,
00197             const volScalarField& p,
00198             const volScalarField& T,
00199             const combustionMixture& composition,
00200             const PtrList<specieProperties>& gasProperties,
00201             const dictionary& thermophysicalProperties,
00202             const dictionary& environmentalProperties
00203         );
00204 
00205 
00206     // Destructor
00207 
00208         ~spray();
00209 
00210 
00211     // Member Functions
00212 
00213         // Spray tracking and evolution functions
00214 
00215             //- Evolve the spray (move, inject and breakup)
00216             void evolve();
00217 
00218             //- Track the spray parcels
00219             void track();
00220 
00221             //- Inject more parcels
00222             void inject();
00223 
00224             //- Primary breakup droplets
00225             void atomizationLoop();
00226 
00227 
00228             //- Secondary breakup droplets
00229             void breakupLoop();
00230 
00231 
00232         // Access
00233 
00234             inline const Time& runTime() const;
00235             inline const fvMesh& mesh() const;
00236 
00237             inline const volVectorField& U() const;
00238             inline const volScalarField& rho() const;
00239             inline const volScalarField& p() const;
00240             inline const volScalarField& T() const;
00241 
00242             inline PtrList<injector>& injectors();
00243             inline const PtrList<injector>& injectors() const;
00244 
00245             inline const atomizationModel& atomization() const;
00246             inline const breakupModel& breakup() const;
00247             inline const collisionModel& collisions() const;
00248             inline const dispersionModel& dispersion() const;
00249             inline const dragModel& drag() const;
00250             inline const evaporationModel& evaporation() const;
00251             inline const heatTransferModel& heatTransfer() const;
00252             inline const injectorModel& injection() const;
00253             inline const wallModel& wall() const;
00254 
00255             inline tmp<volVectorField> momentumSource() const;
00256             inline tmp<volScalarField> evaporationSource(const label i) const;
00257             inline tmp<volScalarField> heatTransferSource() const;
00258 
00259             inline Random& rndGen();
00260             inline label subCycles() const;
00261             inline const vector& g() const;
00262 
00263             inline const liquidMixture& fuels() const;
00264             inline const PtrList<specieProperties>& gasProperties() const;
00265             inline const combustionMixture& composition() const;
00266 
00267             inline const List<label>& liquidToGasIndex() const;
00268             inline const List<label>& gasToLiquidIndex() const;
00269             inline const List<bool>& isLiquidFuel() const;
00270 
00271             inline const bool& twoD() const;
00272             inline const vector& axisOfSymmetry() const;
00273             inline const vector& axisOfWedge() const;
00274             inline const vector& axisOfWedgeNormal() const;
00275             inline const scalar& angleOfWedge() const;
00276 
00277             inline const interpolation<vector>& UInterpolator() const;
00278             inline const interpolation<scalar>& rhoInterpolator() const;
00279             inline const interpolation<scalar>& pInterpolator() const;
00280             inline const interpolation<scalar>& TInterpolator() const;
00281 
00282             inline vectorField& sms();
00283             inline const vectorField& sms() const;
00284 
00285             inline scalarField& shs();
00286             inline const scalarField& shs() const;
00287 
00288             inline PtrList<scalarField>& srhos();
00289             inline const PtrList<scalarField>& srhos() const;
00290 
00291             inline const scalar& ambientPressure() const;
00292             
00293             inline const scalar& ambientTemperature() const;
00294 
00295         // Check
00296 
00297             //- Returns the liquid mass that has been injected
00298             scalar injectedMass(const scalar t) const;
00299 
00300            //- Returns the liquid mass that will be injected by the injectors
00301             scalar totalMassToInject() const;
00302 
00303             //- Returns the injected enthalpy
00304             scalar injectedEnthalpy(const scalar t) const;
00305 
00306             //- Returns current total liquid mass in the domain
00307             scalar liquidMass() const;
00308 
00309             //- Returns the enthalpy of all the liquid in the domain
00310             // Hdrop = Hgas - Hlat
00311             scalar liquidEnthalpy() const;
00312 
00313             //- Returns the enthalpy (total) of all the liquid in the domain
00314             // Hdrop = Hgas - Hlat + (P-Psat)/rhoDrop;
00315             scalar liquidTotalEnthalpy() const;
00316 
00317             //- Returns the kinetic energy of the liquid phase
00318             scalar liquidKineticEnergy() const;
00319 
00320             //- Returns the injected kinetic energy of the liquid phase
00321             scalar injectedLiquidKineticEnergy() const;
00322 
00323             //- Returns the droplet penetration for 'prc' percent of the
00324             //  liquid from nozzle 'nozzlei'
00325             scalar liquidPenetration
00326             (
00327                 const label nozzlei,
00328                 const scalar prc
00329             ) const;
00330 
00331             //- Returns the droplet penetration for 'prc' percent of the
00332             //  liquid from nozzle 0
00333             scalar liquidPenetration(const scalar prc) const;
00334 
00335             //- Return Sauter Mean Diameter
00336             scalar smd() const;
00337 
00338             //- Return Maximum Diameter
00339             scalar maxD() const;
00340             
00341             //- Return Ambient Pressure
00342             void calculateAmbientPressure();
00343             
00344             //- Return Ambient Temperature
00345             void calculateAmbientTemperature();
00346 
00347 };
00348 
00349 
00350 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00351 
00352 } // End namespace Foam
00353 
00354 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00355 
00356 #include "sprayI.H"
00357 
00358 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00359 
00360 #endif
00361 
00362 // ************************************************************************* //
For further information go to www.openfoam.org