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

LiquidEvaporation.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) 2009-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 "LiquidEvaporation.H"
00028 #include "specie.H"
00029 
00030 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
00031 
00032 template<class CloudType>
00033 Foam::scalarField Foam::LiquidEvaporation<CloudType>::calcXc
00034 (
00035     const label cellI
00036 ) const
00037 {
00038     scalarField Xc(this->owner().mcCarrierThermo().Y().size());
00039 
00040     scalar Winv = 0.0;
00041     forAll(Xc, i)
00042     {
00043         scalar Y = this->owner().mcCarrierThermo().Y()[i][cellI];
00044         Winv += Y/this->owner().mcCarrierThermo().speciesData()[i].W();
00045         Xc[i] = Y/this->owner().mcCarrierThermo().speciesData()[i].W();
00046     }
00047 
00048     return Xc/Winv;
00049 }
00050 
00051 
00052 template <class CloudType>
00053 Foam::scalar Foam::LiquidEvaporation<CloudType>::Sh
00054 (
00055     const scalar Re,
00056     const scalar Sc
00057 ) const
00058 {
00059     return 2.0 + 0.6*Foam::sqrt(Re)*pow(Sc, 0.333);
00060 }
00061 
00062 
00063 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00064 
00065 template <class CloudType>
00066 Foam::LiquidEvaporation<CloudType>::LiquidEvaporation
00067 (
00068     const dictionary& dict,
00069     CloudType& owner
00070 )
00071 :
00072     PhaseChangeModel<CloudType>(dict, owner, typeName),
00073     liquids_
00074     (
00075         liquidMixture::New
00076         (
00077             owner.mesh().objectRegistry::lookupObject<dictionary>
00078             (
00079                 owner.carrierThermo().name()
00080             )
00081         )
00082     ),
00083     activeLiquids_(this->coeffDict().lookup("activeLiquids")),
00084     liqToCarrierMap_(activeLiquids_.size(), -1),
00085     liqToLiqMap_(activeLiquids_.size(), -1)
00086 {
00087     if (activeLiquids_.size() == 0)
00088     {
00089         WarningIn
00090         (
00091             "Foam::LiquidEvaporation<CloudType>::LiquidEvaporation"
00092             "("
00093                 "const dictionary& dict, "
00094                 "CloudType& owner"
00095             ")"
00096         )   << "Evaporation model selected, but no active liquids defined"
00097             << nl << endl;
00098     }
00099 
00100     // Determine mapping between liquid and carrier phase species
00101     forAll(activeLiquids_, i)
00102     {
00103         liqToCarrierMap_[i] =
00104             owner.composition().globalCarrierId(activeLiquids_[i]);
00105     }
00106 
00107     // Determine mapping between model active liquids and global liquids
00108     label idLiquid = owner.composition().idLiquid();
00109     forAll(activeLiquids_, i)
00110     {
00111         liqToLiqMap_[i] =
00112             owner.composition().localId(idLiquid, activeLiquids_[i]);
00113     }
00114 }
00115 
00116 
00117 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
00118 
00119 template <class CloudType>
00120 Foam::LiquidEvaporation<CloudType>::~LiquidEvaporation()
00121 {}
00122 
00123 
00124 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00125 
00126 template<class CloudType>
00127 bool Foam::LiquidEvaporation<CloudType>::active() const
00128 {
00129     return true;
00130 }
00131 
00132 
00133 template<class CloudType>
00134 void Foam::LiquidEvaporation<CloudType>::calculate
00135 (
00136     const scalar dt,
00137     const label cellI,
00138     const scalar d,
00139     const scalar T,
00140     const scalar pc,
00141     const scalar Tc,
00142     const scalar nuc,
00143     const vector& Ur,
00144     scalarField& dMassPC
00145 ) const
00146 {
00147     // construct carrier phase species volume fractions for cell, cellI
00148     scalarField Xc = calcXc(cellI);
00149 
00150     // droplet surface area
00151     scalar A = mathematicalConstant::pi*sqr(d);
00152 
00153     // Reynolds number
00154     scalar Re = mag(Ur)*d/(nuc + ROOTVSMALL);
00155 
00156     // film temperature evaluated using the 2/3 rule
00157     scalar Tf = (2.0*T + Tc)/3.0;
00158 
00159     // calculate mass transfer of each specie in liquid
00160     forAll(activeLiquids_, i)
00161     {
00162         label gid = liqToCarrierMap_[i];
00163         label lid = liqToLiqMap_[i];
00164 
00165         // vapour diffusivity at film temperature and cell pressure [m2/s]
00166         scalar Dab = liquids_->properties()[lid].D(pc, Tf);
00167 
00168         // saturation pressure for species i at film temperature and cell
00169         // pressure [pa] - carrier phase pressure assumed equal to the liquid
00170         // vapour pressure close to the surface
00171         // - limited to pc if pSat > pc
00172         scalar pSat = min(liquids_->properties()[lid].pv(pc, Tf), pc);
00173 
00174         // Schmidt number
00175         scalar Sc = nuc/(Dab + ROOTVSMALL);
00176 
00177         // Sherwood number
00178         scalar Sh = this->Sh(Re, Sc);
00179 
00180         // mass transfer coefficient [m/s]
00181         scalar kc = Sh*Dab/(d + ROOTVSMALL);
00182 
00183         // vapour concentration at droplet surface at film temperature [kmol/m3]
00184         scalar Cs = pSat/(specie::RR*Tf);
00185 
00186         // vapour concentration in bulk gas at film temperature [kmol/m3]
00187         scalar Cinf = Xc[gid]*pc/(specie::RR*Tf);
00188 
00189         // molar flux of vapour [kmol/m2/s]
00190         scalar Ni = max(kc*(Cs - Cinf), 0.0);
00191 
00192         // mass transfer [kg]
00193         dMassPC[lid] += Ni*A*liquids_->properties()[lid].W()*dt;
00194     }
00195 }
00196 
00197 
00198 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd