LiquidEvaporation.C
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include "LiquidEvaporation.H"
00028 #include "specie.H"
00029
00030
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
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
00101 forAll(activeLiquids_, i)
00102 {
00103 liqToCarrierMap_[i] =
00104 owner.composition().globalCarrierId(activeLiquids_[i]);
00105 }
00106
00107
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
00118
00119 template <class CloudType>
00120 Foam::LiquidEvaporation<CloudType>::~LiquidEvaporation()
00121 {}
00122
00123
00124
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
00148 scalarField Xc = calcXc(cellI);
00149
00150
00151 scalar A = mathematicalConstant::pi*sqr(d);
00152
00153
00154 scalar Re = mag(Ur)*d/(nuc + ROOTVSMALL);
00155
00156
00157 scalar Tf = (2.0*T + Tc)/3.0;
00158
00159
00160 forAll(activeLiquids_, i)
00161 {
00162 label gid = liqToCarrierMap_[i];
00163 label lid = liqToLiqMap_[i];
00164
00165
00166 scalar Dab = liquids_->properties()[lid].D(pc, Tf);
00167
00168
00169
00170
00171
00172 scalar pSat = min(liquids_->properties()[lid].pv(pc, Tf), pc);
00173
00174
00175 scalar Sc = nuc/(Dab + ROOTVSMALL);
00176
00177
00178 scalar Sh = this->Sh(Re, Sc);
00179
00180
00181 scalar kc = Sh*Dab/(d + ROOTVSMALL);
00182
00183
00184 scalar Cs = pSat/(specie::RR*Tf);
00185
00186
00187 scalar Cinf = Xc[gid]*pc/(specie::RR*Tf);
00188
00189
00190 scalar Ni = max(kc*(Cs - Cinf), 0.0);
00191
00192
00193 dMassPC[lid] += Ni*A*liquids_->properties()[lid].W()*dt;
00194 }
00195 }
00196
00197
00198
Copyright © 2000-2009 OpenCFD Ltd