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 #include "LiquidEvaporation.H"
00027 #include <specie/specie.H>
00028 #include <OpenFOAM/mathematicalConstants.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 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
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
00100 forAll(activeLiquids_, i)
00101 {
00102 liqToCarrierMap_[i] =
00103 owner.composition().globalCarrierId(activeLiquids_[i]);
00104 }
00105
00106
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
00117
00118 template <class CloudType>
00119 Foam::LiquidEvaporation<CloudType>::~LiquidEvaporation()
00120 {}
00121
00122
00123
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
00147 scalarField Xc = calcXc(cellI);
00148
00149
00150 scalar A = mathematicalConstant::pi*sqr(d);
00151
00152
00153 forAll(activeLiquids_, i)
00154 {
00155 label gid = liqToCarrierMap_[i];
00156 label lid = liqToLiqMap_[i];
00157
00158
00159 scalar Dab = liquids_->properties()[lid].D(pc, Ts);
00160
00161
00162
00163
00164
00165
00166
00167 scalar pSat = liquids_->properties()[lid].pv(pc, T);
00168
00169
00170 scalar Sc = nu/(Dab + ROOTVSMALL);
00171
00172
00173 scalar Sh = this->Sh(Re, Sc);
00174
00175
00176 scalar kc = Sh*Dab/(d + ROOTVSMALL);
00177
00178
00179 scalar Cs = pSat/(specie::RR*Ts);
00180
00181
00182 scalar Cinf = Xc[gid]*pc/(specie::RR*Ts);
00183
00184
00185 scalar Ni = max(kc*(Cs - Cinf), 0.0);
00186
00187
00188 dMassPC[lid] += Ni*A*liquids_->properties()[lid].W()*dt;
00189 }
00190 }
00191
00192
00193