OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

RutlandFlashBoil.C

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-2009 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 \*---------------------------------------------------------------------------*/
00026 
00027 #include "error.H"
00028 
00029 #include "RutlandFlashBoil.H"
00030 #include "addToRunTimeSelectionTable.H"
00031 #include "mathematicalConstants.H"
00032 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00033 
00034 namespace Foam
00035 {
00036 
00037 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
00038 
00039 defineTypeNameAndDebug(RutlandFlashBoil, 0);
00040 
00041 addToRunTimeSelectionTable
00042 (
00043     evaporationModel,
00044     RutlandFlashBoil,
00045     dictionary
00046 );
00047 
00048 
00049 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00050 
00051 // Construct from dictionary
00052 RutlandFlashBoil::RutlandFlashBoil
00053 (
00054     const dictionary& dict
00055 )
00056 :
00057     evaporationModel(dict),
00058     evapDict_(dict.subDict(typeName + "Coeffs")),
00059     preReScFactor_(readScalar(evapDict_.lookup("preReScFactor"))),
00060     ReExponent_(readScalar(evapDict_.lookup("ReExponent"))),
00061     ScExponent_(readScalar(evapDict_.lookup("ScExponent"))),
00062     evaporationScheme_(evapDict_.lookup("evaporationScheme")),
00063     nEvapIter_(0)
00064 {
00065     if (evaporationScheme_ == "implicit") 
00066     {
00067         nEvapIter_ = 2;
00068     }
00069     else if (evaporationScheme_ == "explicit") 
00070     {
00071         nEvapIter_ = 1;
00072     }
00073     else 
00074     {
00075         FatalError
00076             << "evaporationScheme type " << evaporationScheme_
00077             << " unknown.\n"
00078             << "Use implicit or explicit."
00079             << abort(FatalError);
00080     }
00081 }
00082 
00083 
00084 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
00085 
00086 RutlandFlashBoil::~RutlandFlashBoil()
00087 {}
00088 
00089 
00090 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00091 
00092 bool RutlandFlashBoil::evaporation() const
00093 {
00094     return true;
00095 }
00096 
00097 // Correlation for the Sherwood Number
00098 scalar RutlandFlashBoil::Sh
00099 (
00100     const scalar ReynoldsNumber,
00101     const scalar SchmidtNumber
00102 ) const
00103 {
00104     return 2.0 + preReScFactor_*pow(ReynoldsNumber,ReExponent_)*pow(SchmidtNumber,ScExponent_);
00105 }
00106 
00107 scalar RutlandFlashBoil::relaxationTime
00108 (
00109     const scalar diameter,
00110     const scalar liquidDensity,
00111     const scalar rhoFuelVapor,
00112     const scalar massDiffusionCoefficient,
00113     const scalar ReynoldsNumber,
00114     const scalar SchmidtNumber,
00115     const scalar Xs,
00116     const scalar Xf,
00117     const scalar m0,
00118     const scalar dm,
00119     const scalar dt
00120 ) const
00121 {
00122     scalar time = GREAT;
00123     scalar lgExpr = 0.0;
00124 
00125     /*
00126         (pressure - partialFuelVaporPressure)/
00127         (pressure - pressureAtSurface)
00128       = 1 + Xratio
00129 
00130         if the pressure @ Surface > pressure
00131         this lead to boiling
00132         and Xratio -> infinity (as it should)
00133         ... this is numerically nasty
00134 
00135     NB! by N. Nordin
00136         X_v,s = (p_v,s/p) X_v,d
00137         where X_v,d = 1 for single component fuel
00138         according to eq (3.136)
00139         in D. Clerides Thesis
00140     */
00141 
00142     scalar Xratio = (Xs - Xf)/max(SMALL, 1.0 - Xs);
00143 
00144     if (Xratio > 0.0)
00145     {
00146         lgExpr = log(1.0 + Xratio);
00147     }
00148 
00149     // From Equation (3.79) in C. Kralj's Thesis:
00150     // Note that the 2.0 (instead of 6.0) below is correct, since evaporation
00151     // is d(diameter)/dt and not d(mass)/dt
00152     
00153     scalar Sherwood = Sh(ReynoldsNumber, SchmidtNumber);
00154     
00155     scalar FbExp = 0.7;
00156     
00157     scalar logXratio = log(1.0+Xratio);
00158     scalar Fb = 1.0;
00159     
00160     if(logXratio > SMALL)
00161     {
00162         Fb = pow((1.0 + Xratio),FbExp) * log(1.0+Xratio)/Xratio;
00163     }
00164 
00165 //  TL: proposed correction to sherwood number, implemented
00166 
00167     Sherwood = 2.0 + (Sherwood - 2.0)/Fb;
00168 
00169     scalar denominator =
00170         6.0 * massDiffusionCoefficient
00171       * Sherwood
00172       * rhoFuelVapor * lgExpr;
00173 
00174     if (denominator > SMALL)
00175     {
00176         time = max(VSMALL, liquidDensity * pow(diameter, 2.0)/denominator);
00177     }
00178 
00179     return time;
00180 }
00181 
00182 
00183 scalar RutlandFlashBoil::boilingTime
00184 (
00185     const scalar liquidDensity,
00186     const scalar cpFuel,
00187     const scalar heatOfVapour,
00188     const scalar kappa,
00189     const scalar Nusselt,
00190     const scalar deltaTemp,
00191     const scalar diameter,
00192     const scalar liquidCore,
00193     const scalar ct,
00194     const scalar tDrop,
00195     const scalar tBoilingSurface,
00196     const scalar vapourSurfaceEnthalpy,
00197     const scalar vapourFarEnthalpy,
00198     const scalar cpGas,
00199     const scalar temperature,
00200     const scalar kLiq
00201 ) const
00202 {
00203 
00204     scalar time = GREAT;
00205 
00206     // the deltaTemperature is limited to not go below .5 deg K
00207     // for numerical reasons.
00208     // This is probably not important, since it results in an upper
00209     // limit for the boiling time... which we have anyway.
00210 
00211     //  TL kSet to the k value at the droplet temperature, not as in the Rutland Paper
00212     
00213     if(liquidCore > 0.5)
00214     {
00215         if(tDrop > tBoilingSurface)
00216         {               
00217             //  Evaporation of the liquid sheet      
00218            
00219             scalar psi = 2.72;
00220             scalar kIncreased = psi * kLiq;
00221             scalar alfa = psi * kIncreased/(liquidDensity * cpFuel);
00222             scalar F = alfa * ct/sqr(0.5 * diameter);
00223     
00224             scalar expSum = 0.0;
00225             scalar expSumOld = expSum;
00226         
00227             label Niter = 200;
00228                 
00229             for(label k=0; k < Niter ; k++)
00230             {
00231                 expSum += exp(sqr(-k*mathematicalConstant::pi*sqrt(F)/2.0));
00232                 if(mag(expSum-expSumOld)/expSum < 1.0e-3)
00233                 {
00234                     break;    
00235                 }
00236                 expSumOld = expSum;
00237             }
00238         }
00239     }
00240     else
00241     {
00242         scalar dTLB = min(0.5, tDrop -  tBoilingSurface);
00243         scalar alfaS = 0.0;
00244 
00245         if(dTLB >= 0.0 &&  dTLB < 5.0)
00246         {
00247             alfaS = 0.76 * pow(dTLB, 0.26);
00248         } 
00249         if(dTLB >= 5.0 &&  dTLB < 25.0)
00250         {
00251             alfaS = 0.027 * pow(dTLB, 2.33);
00252         }
00253         if(dTLB >= 25.0)
00254         {
00255             alfaS = 13.8 * pow(dTLB, 0.39);
00256         } 
00257         
00258         scalar Gf = 
00259         (
00260             4.0 * alfaS * dTLB * mathematicalConstant::pi * sqr(diameter/2.0)
00261         ) 
00262         / 
00263         heatOfVapour; 
00264         
00265         //  calculation of the heat transfer vapourization at superheated conditions (temperature>tBoilingSurface)
00266         scalar G = 0.0;
00267         if(temperature > tBoilingSurface)
00268         {
00269             scalar NusseltCorr = Nusselt ;
00270             scalar A = mag((vapourFarEnthalpy-vapourSurfaceEnthalpy)/heatOfVapour);
00271 
00272             // TL : 2.0? or 1.0? try 1!
00273             scalar B = 1.0*mathematicalConstant::pi*kappa/cpGas*diameter*NusseltCorr;
00274             scalar nPos = B * log(1.0 + A)/Gf + 1.0;  
00275             scalar nNeg = (1.0/A)*(exp(Gf/B) - 1.0 - A) + 1.0;
00276         
00277             scalar Gpos = Gf*nPos;
00278             scalar Gneg = Gf/nNeg;
00279             
00280             //scalar FgPos = Gpos + Gf - B * log( 1.0 + ( 1.0 + Gf/Gpos ) * A);
00281             scalar FgNeg = Gneg + Gf - B * log( 1.0 + ( 1.0 + Gf/Gneg ) * A);
00282             
00283             if(FgNeg > 0.0)
00284             {
00285                 for(label j = 0; j < 20; j++)
00286                 {
00287                     Gneg = Gneg/10.0;
00288                     Gneg = max(Gneg, VSMALL);
00289                     FgNeg = Gneg + Gf - B * log( 1.0 + ( 1.0 + Gf/Gneg ) * A);
00290                     if(FgNeg < 0.0)
00291                     {
00292                         break;
00293                     }            
00294                 }
00295             }        
00296             
00297             FgNeg = Gneg + Gf - B * log( 1.0 + ( 1.0 + Gf/Gneg ) * A);                
00298             
00299             G = 0.5*(Gpos+Gneg);
00300             scalar Gold = -100;
00301         
00302             label Niter = 200;
00303             label k=0;
00304             
00305             if(FgNeg > 0.0)
00306             {
00307                 Info << "no convergence" << endl;   
00308             }
00309             
00310             
00311             if(FgNeg < 0.0)
00312             {
00313             
00314                 for(k=0; k<Niter ; k++)
00315                 {
00316 
00317                     scalar Fg = G + Gf - B * log( 1.0 + ( 1.0 + Gf/G ) * A);
00318 
00319                     if(Fg > 0)
00320                     {
00321                         Gpos = G;
00322                         G = 0.5*(Gpos+Gneg);
00323                     }
00324                     else
00325                     {
00326                         Gneg = G;
00327                         G = 0.5*(Gpos+Gneg);
00328                     } 
00329             
00330                     Gold = G;
00331                     if(mag(G-Gold)/Gold < 1.0e-3)
00332                     {
00333                         break;
00334                     }
00335                 }
00336         
00337                 if(k >= Niter - 1)
00338                 {
00339                     Info << " No convergence for G " << endl;
00340                 }
00341             }
00342             else
00343             {
00344                 G = 0.0;
00345             }
00346         }
00347         
00348         time = ((4.0/3.0)*mathematicalConstant::pi*pow(diameter/2.0,3.0))*liquidDensity/(G+Gf);
00349         time = max(VSMALL, time);
00350     }
00351 
00352     return time;
00353 }
00354 
00355 inline label RutlandFlashBoil::nEvapIter() const
00356 {
00357     return nEvapIter_;
00358 }
00359 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00360 
00361 } // End namespace Foam
00362 
00363 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd