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