FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

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-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 \*---------------------------------------------------------------------------*/
00025 
00026 #include "LiquidEvaporation.H"
00027 #include <specie/specie.H>
00028 #include <OpenFOAM/mathematicalConstants.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     forAll(Xc, i)
00041     {
00042         Xc[i] =
00043             this->owner().mcCarrierThermo().Y()[i][cellI]
00044            /this->owner().mcCarrierThermo().speciesData()[i].W();
00045     }
00046 
00047     return Xc/sum(Xc);
00048 }
00049 
00050 
00051 template <class CloudType>
00052 Foam::scalar Foam::LiquidEvaporation<CloudType>::Sh
00053 (
00054     const scalar Re,
00055     const scalar Sc
00056 ) const
00057 {
00058     return 2.0 + 0.6*Foam::sqrt(Re)*cbrt(Sc);
00059 }
00060 
00061 
00062 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00063 
00064 template <class CloudType>
00065 Foam::LiquidEvaporation<CloudType>::LiquidEvaporation
00066 (
00067     const dictionary& dict,
00068     CloudType& owner
00069 )
00070 :
00071     PhaseChangeModel<CloudType>(dict, owner, typeName),
00072     liquids_
00073     (
00074         liquidMixture::New
00075         (
00076             owner.mesh().objectRegistry::lookupObject<dictionary>
00077             (
00078                 owner.carrierThermo().name()
00079             )
00080         )
00081     ),
00082     activeLiquids_(this->coeffDict().lookup("activeLiquids")),
00083     liqToCarrierMap_(activeLiquids_.size(), -1),
00084     liqToLiqMap_(activeLiquids_.size(), -1)
00085 {
00086     if (activeLiquids_.size() == 0)
00087     {
00088         WarningIn
00089         (
00090             "Foam::LiquidEvaporation<CloudType>::LiquidEvaporation"
00091             "("
00092                 "const dictionary& dict, "
00093                 "CloudType& owner"
00094             ")"
00095         )   << "Evaporation model selected, but no active liquids defined"
00096             << nl << endl;
00097     }
00098 
00099     // Determine mapping between liquid and carrier phase species
00100     forAll(activeLiquids_, i)
00101     {
00102         liqToCarrierMap_[i] =
00103             owner.composition().globalCarrierId(activeLiquids_[i]);
00104     }
00105 
00106     // Determine mapping between model active liquids and global liquids
00107     label idLiquid = owner.composition().idLiquid();
00108     forAll(activeLiquids_, i)
00109     {
00110         liqToLiqMap_[i] =
00111             owner.composition().localId(idLiquid, activeLiquids_[i]);
00112     }
00113 }
00114 
00115 
00116 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
00117 
00118 template <class CloudType>
00119 Foam::LiquidEvaporation<CloudType>::~LiquidEvaporation()
00120 {}
00121 
00122 
00123 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00124 
00125 template<class CloudType>
00126 bool Foam::LiquidEvaporation<CloudType>::active() const
00127 {
00128     return true;
00129 }
00130 
00131 
00132 template<class CloudType>
00133 void Foam::LiquidEvaporation<CloudType>::calculate
00134 (
00135     const scalar dt,
00136     const label cellI,
00137     const scalar Re,
00138     const scalar d,
00139     const scalar nu,
00140     const scalar T,
00141     const scalar Ts,
00142     const scalar pc,
00143     scalarField& dMassPC
00144 ) const
00145 {
00146     // construct carrier phase species volume fractions for cell, cellI
00147     scalarField Xc = calcXc(cellI);
00148 
00149     // droplet surface area
00150     scalar A = mathematicalConstant::pi*sqr(d);
00151 
00152     // calculate mass transfer of each specie in liquid
00153     forAll(activeLiquids_, i)
00154     {
00155         label gid = liqToCarrierMap_[i];
00156         label lid = liqToLiqMap_[i];
00157 
00158         // vapour diffusivity [m2/s]
00159         scalar Dab = liquids_->properties()[lid].D(pc, Ts);
00160 
00161         // saturation pressure for species i [pa]
00162         // - carrier phase pressure assumed equal to the liquid vapour pressure
00163         //   close to the surface
00164         // NOTE: if pSat > pc then particle is superheated
00165         // calculated evaporation rate will be greater than that of a particle
00166         // at boiling point, but this is not a boiling model
00167         scalar pSat = liquids_->properties()[lid].pv(pc, T);
00168 
00169         // Schmidt number
00170         scalar Sc = nu/(Dab + ROOTVSMALL);
00171 
00172         // Sherwood number
00173         scalar Sh = this->Sh(Re, Sc);
00174 
00175         // mass transfer coefficient [m/s]
00176         scalar kc = Sh*Dab/(d + ROOTVSMALL);
00177 
00178         // vapour concentration at droplet surface [kmol/m3] at film temperature
00179         scalar Cs = pSat/(specie::RR*Ts);
00180 
00181         // vapour concentration in bulk gas [kmol/m3] at film temperature
00182         scalar Cinf = Xc[gid]*pc/(specie::RR*Ts);
00183 
00184         // molar flux of vapour [kmol/m2/s]
00185         scalar Ni = max(kc*(Cs - Cinf), 0.0);
00186 
00187         // mass transfer [kg]
00188         dMassPC[lid] += Ni*A*liquids_->properties()[lid].W()*dt;
00189     }
00190 }
00191 
00192 
00193 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines