FreeFOAM The Cross-Platform CFD Toolkit
LiquidEvaporation.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
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
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "LiquidEvaporation.H"
27 #include <specie/specie.H>
29 
30 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
31 
32 template<class CloudType>
34 (
35  const label cellI
36 ) const
37 {
38  scalarField Xc(this->owner().mcCarrierThermo().Y().size());
39 
40  forAll(Xc, i)
41  {
42  Xc[i] =
43  this->owner().mcCarrierThermo().Y()[i][cellI]
44  /this->owner().mcCarrierThermo().speciesData()[i].W();
45  }
46 
47  return Xc/sum(Xc);
48 }
49 
50 
51 template <class CloudType>
53 (
54  const scalar Re,
55  const scalar Sc
56 ) const
57 {
58  return 2.0 + 0.6*Foam::sqrt(Re)*cbrt(Sc);
59 }
60 
61 
62 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
63 
64 template <class CloudType>
66 (
67  const dictionary& dict,
68  CloudType& owner
69 )
70 :
71  PhaseChangeModel<CloudType>(dict, owner, typeName),
72  liquids_
73  (
74  liquidMixture::New
75  (
76  owner.mesh().objectRegistry::lookupObject<dictionary>
77  (
78  owner.carrierThermo().name()
79  )
80  )
81  ),
82  activeLiquids_(this->coeffDict().lookup("activeLiquids")),
83  liqToCarrierMap_(activeLiquids_.size(), -1),
84  liqToLiqMap_(activeLiquids_.size(), -1)
85 {
86  if (activeLiquids_.size() == 0)
87  {
88  WarningIn
89  (
90  "Foam::LiquidEvaporation<CloudType>::LiquidEvaporation"
91  "("
92  "const dictionary& dict, "
93  "CloudType& owner"
94  ")"
95  ) << "Evaporation model selected, but no active liquids defined"
96  << nl << endl;
97  }
98 
99  // Determine mapping between liquid and carrier phase species
100  forAll(activeLiquids_, i)
101  {
102  liqToCarrierMap_[i] =
103  owner.composition().globalCarrierId(activeLiquids_[i]);
104  }
105 
106  // Determine mapping between model active liquids and global liquids
107  label idLiquid = owner.composition().idLiquid();
108  forAll(activeLiquids_, i)
109  {
110  liqToLiqMap_[i] =
111  owner.composition().localId(idLiquid, activeLiquids_[i]);
112  }
113 }
114 
115 
116 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
117 
118 template <class CloudType>
120 {}
121 
122 
123 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
124 
125 template<class CloudType>
127 {
128  return true;
129 }
130 
131 
132 template<class CloudType>
134 (
135  const scalar dt,
136  const label cellI,
137  const scalar Re,
138  const scalar d,
139  const scalar nu,
140  const scalar T,
141  const scalar Ts,
142  const scalar pc,
143  scalarField& dMassPC
144 ) const
145 {
146  // construct carrier phase species volume fractions for cell, cellI
147  scalarField Xc = calcXc(cellI);
148 
149  // droplet surface area
150  scalar A = mathematicalConstant::pi*sqr(d);
151 
152  // calculate mass transfer of each specie in liquid
153  forAll(activeLiquids_, i)
154  {
155  label gid = liqToCarrierMap_[i];
156  label lid = liqToLiqMap_[i];
157 
158  // vapour diffusivity [m2/s]
159  scalar Dab = liquids_->properties()[lid].D(pc, Ts);
160 
161  // saturation pressure for species i [pa]
162  // - carrier phase pressure assumed equal to the liquid vapour pressure
163  // close to the surface
164  // NOTE: if pSat > pc then particle is superheated
165  // calculated evaporation rate will be greater than that of a particle
166  // at boiling point, but this is not a boiling model
167  scalar pSat = liquids_->properties()[lid].pv(pc, T);
168 
169  // Schmidt number
170  scalar Sc = nu/(Dab + ROOTVSMALL);
171 
172  // Sherwood number
173  scalar Sh = this->Sh(Re, Sc);
174 
175  // mass transfer coefficient [m/s]
176  scalar kc = Sh*Dab/(d + ROOTVSMALL);
177 
178  // vapour concentration at droplet surface [kmol/m3] at film temperature
179  scalar Cs = pSat/(specie::RR*Ts);
180 
181  // vapour concentration in bulk gas [kmol/m3] at film temperature
182  scalar Cinf = Xc[gid]*pc/(specie::RR*Ts);
183 
184  // molar flux of vapour [kmol/m2/s]
185  scalar Ni = max(kc*(Cs - Cinf), 0.0);
186 
187  // mass transfer [kg]
188  dMassPC[lid] += Ni*A*liquids_->properties()[lid].W()*dt;
189  }
190 }
191 
192 
193 // ************************ vim: set sw=4 sts=4 et: ************************ //