1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software; you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 \*---------------------------------------------------------------------------*/
27 #include "LiquidEvaporation.H"
29 #include "mathematicalConstants.H"
31 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
33 template<class CloudType>
34 Foam::scalarField Foam::LiquidEvaporation<CloudType>::calcXc
39 scalarField Xc(this->owner().mcCarrierThermo().Y().size());
44 this->owner().mcCarrierThermo().Y()[i][cellI]
45 /this->owner().mcCarrierThermo().speciesData()[i].W();
52 template <class CloudType>
53 Foam::scalar Foam::LiquidEvaporation<CloudType>::Sh
59 return 2.0 + 0.6*Foam::sqrt(Re)*cbrt(Sc);
63 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
65 template <class CloudType>
66 Foam::LiquidEvaporation<CloudType>::LiquidEvaporation
68 const dictionary& dict,
72 PhaseChangeModel<CloudType>(dict, owner, typeName),
77 owner.mesh().objectRegistry::lookupObject<dictionary>
79 owner.carrierThermo().name()
83 activeLiquids_(this->coeffDict().lookup("activeLiquids")),
84 liqToCarrierMap_(activeLiquids_.size(), -1),
85 liqToLiqMap_(activeLiquids_.size(), -1)
87 if (activeLiquids_.size() == 0)
91 "Foam::LiquidEvaporation<CloudType>::LiquidEvaporation"
93 "const dictionary& dict, "
96 ) << "Evaporation model selected, but no active liquids defined"
100 // Determine mapping between liquid and carrier phase species
101 forAll(activeLiquids_, i)
103 liqToCarrierMap_[i] =
104 owner.composition().globalCarrierId(activeLiquids_[i]);
107 // Determine mapping between model active liquids and global liquids
108 label idLiquid = owner.composition().idLiquid();
109 forAll(activeLiquids_, i)
112 owner.composition().localId(idLiquid, activeLiquids_[i]);
117 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
119 template <class CloudType>
120 Foam::LiquidEvaporation<CloudType>::~LiquidEvaporation()
124 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
126 template<class CloudType>
127 bool Foam::LiquidEvaporation<CloudType>::active() const
133 template<class CloudType>
134 void Foam::LiquidEvaporation<CloudType>::calculate
147 // construct carrier phase species volume fractions for cell, cellI
148 scalarField Xc = calcXc(cellI);
150 // droplet surface area
151 scalar A = mathematicalConstant::pi*sqr(d);
153 // calculate mass transfer of each specie in liquid
154 forAll(activeLiquids_, i)
156 label gid = liqToCarrierMap_[i];
157 label lid = liqToLiqMap_[i];
159 // vapour diffusivity [m2/s]
160 scalar Dab = liquids_->properties()[lid].D(pc, Ts);
162 // saturation pressure for species i [pa]
163 // - carrier phase pressure assumed equal to the liquid vapour pressure
164 // close to the surface
165 // NOTE: if pSat > pc then particle is superheated
166 // calculated evaporation rate will be greater than that of a particle
167 // at boiling point, but this is not a boiling model
168 scalar pSat = liquids_->properties()[lid].pv(pc, T);
171 scalar Sc = nu/(Dab + ROOTVSMALL);
174 scalar Sh = this->Sh(Re, Sc);
176 // mass transfer coefficient [m/s]
177 scalar kc = Sh*Dab/(d + ROOTVSMALL);
179 // vapour concentration at droplet surface [kmol/m3] at film temperature
180 scalar Cs = pSat/(specie::RR*Ts);
182 // vapour concentration in bulk gas [kmol/m3] at film temperature
183 scalar Cinf = Xc[gid]*pc/(specie::RR*Ts);
185 // molar flux of vapour [kmol/m2/s]
186 scalar Ni = max(kc*(Cs - Cinf), 0.0);
188 // mass transfer [kg]
189 dMassPC[lid] += Ni*A*liquids_->properties()[lid].W()*dt;
194 // ************************************************************************* //