Clean-up: diesel spray evaporation

This commit is contained in:
Hrvoje Jasak 2011-05-27 11:40:48 +01:00
parent c056979017
commit a79d34de50
8 changed files with 131 additions and 76 deletions

View file

@ -96,7 +96,7 @@ Foam::unitInjector::unitInjector
} }
// convert CA to real time // convert CA to real time
forAll(massFlowRateProfile_, i) forAll (massFlowRateProfile_, i)
{ {
massFlowRateProfile_[i][0] = massFlowRateProfile_[i][0] =
t.userTimeToTime(massFlowRateProfile_[i][0]); t.userTimeToTime(massFlowRateProfile_[i][0]);
@ -104,14 +104,14 @@ Foam::unitInjector::unitInjector
injectionPressureProfile_[i][0] = massFlowRateProfile_[i][0]; injectionPressureProfile_[i][0] = massFlowRateProfile_[i][0];
} }
forAll(TProfile_, i) forAll (TProfile_, i)
{ {
TProfile_[i][0] = t.userTimeToTime(TProfile_[i][0]); TProfile_[i][0] = t.userTimeToTime(TProfile_[i][0]);
} }
scalar integratedMFR = integrateTable(massFlowRateProfile_); scalar integratedMFR = integrateTable(massFlowRateProfile_);
forAll(massFlowRateProfile_, i) forAll (massFlowRateProfile_, i)
{ {
// correct the massFlowRateProfile to match the injected mass // correct the massFlowRateProfile to match the injected mass
massFlowRateProfile_[i][1] *= mass_/integratedMFR; massFlowRateProfile_[i][1] *= mass_/integratedMFR;
@ -125,9 +125,9 @@ Foam::unitInjector::unitInjector
setTangentialVectors(); setTangentialVectors();
// check molar fractions // Check molar fractions
scalar Xsum = 0.0; scalar Xsum = 0.0;
forAll(X_, i) forAll (X_, i)
{ {
Xsum += X_[i]; Xsum += X_[i];
} }
@ -137,7 +137,7 @@ Foam::unitInjector::unitInjector
WarningIn("unitInjector::unitInjector(const time& t, Istream& is)") WarningIn("unitInjector::unitInjector(const time& t, Istream& is)")
<< "X does not sum to 1.0, correcting molar fractions." << "X does not sum to 1.0, correcting molar fractions."
<< nl << endl; << nl << endl;
forAll(X_, i) forAll (X_, i)
{ {
X_[i] /= Xsum; X_[i] /= Xsum;
} }
@ -179,8 +179,14 @@ Foam::label Foam::unitInjector::nParcelsToInject
const scalar time1 const scalar time1
) const ) const
{ {
scalar mInj = mass_*(fractionOfInjection(time1)-fractionOfInjection(time0)); scalar mInj = mass_*
(
fractionOfInjection(time1)
- fractionOfInjection(time0)
);
label nParcels = label(mInj/averageParcelMass_ + 0.49); label nParcels = label(mInj/averageParcelMass_ + 0.49);
return nParcels; return nParcels;
} }
@ -366,7 +372,7 @@ void Foam::unitInjector::correctProfiles
scalar A = 0.25*mathematicalConstant::pi*pow(d_, 2.0); scalar A = 0.25*mathematicalConstant::pi*pow(d_, 2.0);
scalar pDummy = 1.0e+5; scalar pDummy = 1.0e+5;
forAll(velocityProfile_, i) forAll (velocityProfile_, i)
{ {
scalar time = velocityProfile_[i][0]; scalar time = velocityProfile_[i][0];
scalar rho = fuel.rho(pDummy, T(time), X_); scalar rho = fuel.rho(pDummy, T(time), X_);

View file

@ -61,14 +61,27 @@ private:
// Private data // Private data
//- Injector properties dictionary
dictionary propsDict_; dictionary propsDict_;
//- Injector position
vector position_; vector position_;
//- Injector direction
vector direction_; vector direction_;
//- Injector diameter
scalar d_; scalar d_;
//- Cd
scalar Cd_; scalar Cd_;
//- Parcel mass
scalar mass_; scalar mass_;
//- Number of parcels
label nParcels_; label nParcels_;
scalarField X_; scalarField X_;
List<pair> massFlowRateProfile_; List<pair> massFlowRateProfile_;
List<pair> velocityProfile_; List<pair> velocityProfile_;

View file

@ -126,12 +126,14 @@ bool Foam::parcel::move(spray& sDB)
cpMixture += Yi[cell()]*sDB.gasProperties()[i].Cp(Tg); cpMixture += Yi[cell()]*sDB.gasProperties()[i].Cp(Tg);
} }
// correct the gaseous temperature for evaporated fuel // Correct the gaseous temperature for evaporated fuel
scalar cellV = sDB.mesh().V()[cell()]; scalar cellV = sDB.mesh().V()[cell()];
scalar cellMass = rhog*cellV; scalar cellMass = rhog*cellV;
Tg += sDB.shs()[cell()]/(cpMixture*cellMass); Tg += sDB.shs()[cell()]/(cpMixture*cellMass);
Tg = max(200.0, Tg);
// Changed cut-off temperature for evaporation. HJ, 27/Apr/2011
Tg = max(273, Tg);
scalar tauMomentum = GREAT; scalar tauMomentum = GREAT;
scalar tauHeatTransfer = GREAT; scalar tauHeatTransfer = GREAT;
@ -212,7 +214,8 @@ bool Foam::parcel::move(spray& sDB)
// track parcel to face, or end of trajectory // track parcel to face, or end of trajectory
if (keepParcel) if (keepParcel)
{ {
// Track and adjust the time step if the trajectory is not completed // Track and adjust the time step if the trajectory
// is not completed
dt *= trackToFace(position() + dt*U_, sDB); dt *= trackToFace(position() + dt*U_, sDB);
// Decrement the end-time acording to how much time the track took // Decrement the end-time acording to how much time the track took
@ -231,6 +234,7 @@ bool Foam::parcel::move(spray& sDB)
{ {
scalar z = position() & sDB.axisOfSymmetry(); scalar z = position() & sDB.axisOfSymmetry();
vector r = position() - z*sDB.axisOfSymmetry(); vector r = position() - z*sDB.axisOfSymmetry();
if (mag(r) > SMALL) if (mag(r) > SMALL)
{ {
correctNormal(sDB.axisOfSymmetry()); correctNormal(sDB.axisOfSymmetry());
@ -299,7 +303,7 @@ bool Foam::parcel::move(spray& sDB)
sDB.shs()[celli] += oTotMass*(oH + oPE) - m()*(nH + nPE + nKE); sDB.shs()[celli] += oTotMass*(oH + oPE) - m()*(nH + nPE + nKE);
// Remove evaporated mass from stripped mass // Remove evaporated mass from stripped mass
ms() -= ms()*(oTotMass-m())/oTotMass; ms() -= ms()*(oTotMass - m())/oTotMass;
// Remove parcel if it is 'small' // Remove parcel if it is 'small'
@ -350,7 +354,7 @@ void Foam::parcel::updateParcelProperties
// calculate mean molecular weight // calculate mean molecular weight
scalar W = 0.0; scalar W = 0.0;
for(label i=0; i<Ns; i++) for(label i = 0; i < Ns; i++)
{ {
W += sDB.composition().Y()[i][celli]/sDB.gasProperties()[i].W(); W += sDB.composition().Y()[i][celli]/sDB.gasProperties()[i].W();
@ -366,15 +370,15 @@ void Foam::parcel::updateParcelProperties
// correct the gaseous temperature for evaporated fuel // correct the gaseous temperature for evaporated fuel
scalar cpMix = 0.0; scalar cpMix = 0.0;
for(label i=0; i<Ns; i++) for (label i = 0; i < Ns; i++)
{ {
cpMix += sDB.composition().Y()[i][celli] cpMix += sDB.composition().Y()[i][celli]
*sDB.gasProperties()[i].Cp(T()); *sDB.gasProperties()[i].Cp(T());
} }
scalar cellV = sDB.mesh().V()[celli]; scalar cellV = sDB.mesh().V()[celli];
scalar rho = sDB.rho()[celli]; scalar rho = sDB.rho()[celli];
scalar cellMass = rho*cellV; scalar cellMass = rho*cellV;
scalar dh = sDB.shs()[celli]; scalar dh = sDB.shs()[celli];
scalarField addedMass(Nf, 0.0); scalarField addedMass(Nf, 0.0);
forAll(addedMass, i) forAll(addedMass, i)
@ -383,7 +387,9 @@ void Foam::parcel::updateParcelProperties
} }
scalar Tg = Tg0 + dh/(cpMix*cellMass); scalar Tg = Tg0 + dh/(cpMix*cellMass);
Tg = max(200.0, Tg);
// Changed cut-off temperature for evaporation. HJ, 27/Apr/2011
Tg = max(273.0, Tg);
scalarField Yfg(Nf, 0.0); scalarField Yfg(Nf, 0.0);
forAll(Yfg, i) forAll(Yfg, i)
@ -494,26 +500,31 @@ void Foam::parcel::updateParcelProperties
newMass = m(); newMass = m();
newhg = 0.0; newhg = 0.0;
scalarField Ynew(fuels.Y(X())); scalarField Ynew(fuels.Y(X()));
for(label i=0; i<Nf; i++)
for(label i = 0; i < Nf; i++)
{ {
label j = sDB.liquidToGasIndex()[i]; label j = sDB.liquidToGasIndex()[i];
newhg += Ynew[i]*sDB.gasProperties()[j].Hs(Tnew); newhg += Ynew[i]*sDB.gasProperties()[j].Hs(Tnew);
} }
newhv = fuels.hl(pg, Tnew, X()); newhv = fuels.hl(pg, Tnew, X());
scalar dm = oldMass - newMass; scalar dm = oldMass - newMass;
scalar dhNew = oldMass*(oldhg-oldhv) - newMass*(newhg-newhv); scalar dhNew = oldMass*(oldhg - oldhv) - newMass*(newhg - newhv);
// Prediction of new gaseous temperature and fuel mass fraction // Prediction of new gaseous temperature and fuel mass fraction
Tg = Tg0 + (dh+dhNew)/(cpMix*cellMass); Tg = Tg0 + (dh + dhNew)/(cpMix*cellMass);
Tg = max(200.0, Tg);
forAll(Yfg, i) // Changed cut-off temperature for evaporation. HJ, 27/Apr/2011
Tg = max(273.0, Tg);
forAll (Yfg, i)
{ {
label j = sDB.liquidToGasIndex()[i]; label j = sDB.liquidToGasIndex()[i];
const volScalarField& Yj = sDB.composition().Y()[j]; const volScalarField& Yj = sDB.composition().Y()[j];
scalar Yfg0 = Yj[celli]; scalar Yfg0 = Yj[celli];
Yfg[i] = Yfg[i] =
(Yfg0*cellMass + addedMass[i] + dm)/ (Yfg0*cellMass + addedMass[i] + dm)/
(addedMass[i] + cellMass + dm); (addedMass[i] + cellMass + dm);
@ -543,7 +554,7 @@ void Foam::parcel::updateParcelProperties
scalar liquidcL = sDB.fuels().cp(pg, TDroplet, X()); scalar liquidcL = sDB.fuels().cp(pg, TDroplet, X());
cpMix = 0.0; cpMix = 0.0;
for(label i=0; i<Ns; i++) for (label i = 0; i < Ns; i++)
{ {
if (sDB.isLiquidFuel()[i]) if (sDB.isLiquidFuel()[i])
{ {
@ -553,6 +564,7 @@ void Foam::parcel::updateParcelProperties
else else
{ {
scalar Y = sDB.composition().Y()[i][celli]; scalar Y = sDB.composition().Y()[i][celli];
cpMix += Y*sDB.gasProperties()[i].Cp(Taverage); cpMix += Y*sDB.gasProperties()[i].Cp(Taverage);
} }
} }
@ -561,7 +573,7 @@ void Foam::parcel::updateParcelProperties
scalar z = 0.0; scalar z = 0.0;
scalar tauEvap = 0.0; scalar tauEvap = 0.0;
for(label i=0; i<Nf; i++) for (label i =0 ; i < Nf; i++)
{ {
tauEvap += X()[i]*fuels.properties()[i].W()/tauEvaporation[i]; tauEvap += X()[i]*fuels.properties()[i].W()/tauEvaporation[i];
} }
@ -571,8 +583,7 @@ void Foam::parcel::updateParcelProperties
if (sDB.evaporation().evaporation()) if (sDB.evaporation().evaporation())
{ {
scalar hv = fuels.hl(pg, TDroplet, X()); scalar hv = fuels.hl(pg, TDroplet, X());
evaporationSource = evaporationSource = hv/liquidcL/tauEvap;
hv/liquidcL/tauEvap;
z = cpMix*tauHeatTransfer/liquidcL/tauEvap; z = cpMix*tauHeatTransfer/liquidcL/tauEvap;
} }
@ -582,8 +593,7 @@ void Foam::parcel::updateParcelProperties
scalar fCorrect = scalar fCorrect =
sDB.heatTransfer().fCorrection(z)/tauHeatTransfer; sDB.heatTransfer().fCorrection(z)/tauHeatTransfer;
Tnew = Tnew = (TDroplet + dt*(fCorrect*Tg - evaporationSource))
(TDroplet + dt*(fCorrect * Tg - evaporationSource))
/(1.0 + dt*fCorrect); /(1.0 + dt*fCorrect);
// Prevent droplet temperature to go above critial value // Prevent droplet temperature to go above critial value
@ -591,19 +601,23 @@ void Foam::parcel::updateParcelProperties
// Prevent droplet temperature to go too low // Prevent droplet temperature to go too low
// Mainly a numerical stability issue // Mainly a numerical stability issue
Tnew = max(200.0, Tnew);
// Changed cut-off temperature for evaporation. HJ, 27/Apr/2011
Tnew = max(273.0, Tnew);
scalar Td = Tnew; scalar Td = Tnew;
scalar pAtSurface = fuels.pv(pg, Td, X()); scalar pAtSurface = fuels.pv(pg, Td, X());
scalar pCompare = 0.999*pg; scalar pCompare = 0.999*pg;
scalar boiling = pAtSurface >= pCompare; scalar boiling = pAtSurface >= pCompare;
if (boiling) if (boiling)
{ {
// can not go above boiling temperature // can not go above boiling temperature
scalar Terr = 1.0e-3; scalar Terr = 1.0e-3;
label n=0; label n = 0;
scalar dT = 1.0; scalar dT = 1.0;
scalar pOld = pAtSurface; scalar pOld = pAtSurface;
while (dT > Terr) while (dT > Terr)
{ {
n++; n++;
@ -631,10 +645,12 @@ void Foam::parcel::updateParcelProperties
} }
} }
} }
pOld = pAtSurface; pOld = pAtSurface;
if (debug)
// if (debug)
{ {
if (n>100) if (n > 100)
{ {
Info << "n = " << n << ", T = " << Td << ", pv = " << pAtSurface << endl; Info << "n = " << n << ", T = " << Td << ", pv = " << pAtSurface << endl;
} }
@ -648,7 +664,7 @@ void Foam::parcel::updateParcelProperties
// if the droplet is NOT boiling use implicit scheme. // if the droplet is NOT boiling use implicit scheme.
if (sDB.evaporation().evaporation()) if (sDB.evaporation().evaporation())
{ {
for(label i=0; i<Nf; i++) for (label i = 0; i < Nf; i++)
{ {
// Immediately evaporate mass that has reached // Immediately evaporate mass that has reached
// critical condition // critical condition
@ -678,6 +694,7 @@ void Foam::parcel::updateParcelProperties
} }
scalar mTot = sum(mi); scalar mTot = sum(mi);
if (mTot > VSMALL) if (mTot > VSMALL)
{ {
scalarField Ynew(mi/mTot); scalarField Ynew(mi/mTot);
@ -696,14 +713,9 @@ void Foam::parcel::updateParcelProperties
// FPK changes: avoid temperature-out-of-range errors // FPK changes: avoid temperature-out-of-range errors
// in spray tracking. HJ, 13/Oct/2007 // in spray tracking. HJ, 13/Oct/2007
scalar temprhod;
const scalar relaxfac = sDB.sprayRelaxFactor(); const scalar relaxfac = sDB.sprayRelaxFactor();
if (debug)
{
temprhod = fuels.rho(pg,T(),X());
}
convergedT = mag(Tnew-T()) < 0.1 || n > sDB.sprayIterate(); convergedT = mag(Tnew - T()) < 0.1 || n > sDB.sprayIterate();
// FPK version, 13/Oct/2007 // FPK version, 13/Oct/2007
T() = T()*(1 - relaxfac) + Tnew*relaxfac; T() = T()*(1 - relaxfac) + Tnew*relaxfac;

View file

@ -180,7 +180,9 @@ void parcel::setRelaxationTimes
for(label i=0; i<Nf; i++) for(label i=0; i<Nf; i++)
{ {
scalar Td = min(T(), 0.999*fuels.properties()[i].Tc()); scalar Td = min(T(), 0.999*fuels.properties()[i].Tc());
bool boiling = fuels.properties()[i].pv(pressure, Td) >= 0.999*pressure; bool boiling = fuels.properties()[i].pv(pressure, Td)
>= 0.999*pressure;
scalar Di = fuels.properties()[i].D(pressure, Td); scalar Di = fuels.properties()[i].D(pressure, Td);
scalar Schmidt = Sc(nuf, Di); scalar Schmidt = Sc(nuf, Di);
@ -196,7 +198,8 @@ void parcel::setRelaxationTimes
{ {
if (!boiling) if (!boiling)
{ {
// for saturation evaporation, only use 99.99% for numerical robustness // For saturation evaporation, only use 99.99% for
// numerical robustness
scalar dm = max(SMALL, 0.9999*msat[i] - mfg[i]); scalar dm = max(SMALL, 0.9999*msat[i] - mfg[i]);
tauEvaporation[i] = sDB.evaporation().relaxationTime tauEvaporation[i] = sDB.evaporation().relaxationTime

View file

@ -185,7 +185,10 @@ Foam::spray::spray
sprayIteration_(sprayProperties_.subDict("sprayIteration")), sprayIteration_(sprayProperties_.subDict("sprayIteration")),
sprayIterate_(readLabel(sprayIteration_.lookup("sprayIterate"))), sprayIterate_(readLabel(sprayIteration_.lookup("sprayIterate"))),
sprayRelaxFactor_(readScalar(sprayIteration_.lookup("sprayRelaxFactor"))), sprayRelaxFactor_(readScalar(sprayIteration_.lookup("sprayRelaxFactor"))),
minimumParcelMass_(readScalar(sprayIteration_.lookup("minimumParcelMass"))), minimumParcelMass_
(
readScalar(sprayIteration_.lookup("minimumParcelMass"))
),
subCycles_(readLabel(sprayProperties_.lookup("subCycles"))), subCycles_(readLabel(sprayProperties_.lookup("subCycles"))),

View file

@ -119,11 +119,20 @@ class spray
autoPtr<liquidMixture> fuels_; autoPtr<liquidMixture> fuels_;
autoPtr<injectorModel> injectorModel_; autoPtr<injectorModel> injectorModel_;
// Iterations to avoid errors due to too small parcels causing temperature out of range
// Iterations to avoid errors due to too small parcels
// causing temperature out of range
//- Spray iteration dictionary
dictionary sprayIteration_; dictionary sprayIteration_;
//- Number of spray iterations
const label sprayIterate_; const label sprayIterate_;
//- Spray relaxation factor
const scalar sprayRelaxFactor_; const scalar sprayRelaxFactor_;
//- Minimum parcel mass
const scalar minimumParcelMass_; const scalar minimumParcelMass_;

View file

@ -94,6 +94,7 @@ bool standardEvaporationModel::evaporation() const
return true; return true;
} }
// Correlation for the Sherwood Number // Correlation for the Sherwood Number
scalar standardEvaporationModel::Sh scalar standardEvaporationModel::Sh
( (
@ -101,9 +102,11 @@ scalar standardEvaporationModel::Sh
const scalar SchmidtNumber const scalar SchmidtNumber
) const ) const
{ {
return 2.0 + preReScFactor_*pow(ReynoldsNumber,ReExponent_)*pow(SchmidtNumber,ScExponent_); return 2.0 + preReScFactor_*pow(ReynoldsNumber,ReExponent_)*
pow(SchmidtNumber,ScExponent_);
} }
scalar standardEvaporationModel::relaxationTime scalar standardEvaporationModel::relaxationTime
( (
const scalar diameter, const scalar diameter,
@ -194,7 +197,10 @@ scalar standardEvaporationModel::boilingTime
time = liquidDensity*cpFuel*sqr(diameter)/ time = liquidDensity*cpFuel*sqr(diameter)/
( (
6.0 * kappa * Nusselt * log(1.0 + cpFuel * deltaT/max(SMALL, heatOfVapour)) 6.0*kappa*Nusselt*log
(
1.0 + cpFuel * deltaT/max(SMALL, heatOfVapour)
)
); );
time = max(VSMALL, time); time = max(VSMALL, time);
@ -202,10 +208,13 @@ scalar standardEvaporationModel::boilingTime
return time; return time;
} }
inline label standardEvaporationModel::nEvapIter() const inline label standardEvaporationModel::nEvapIter() const
{ {
return nEvapIter_; return nEvapIter_;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam } // End namespace Foam

View file

@ -42,7 +42,7 @@ namespace Foam
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class standardEvaporationModel Declaration Class standardEvaporationModel Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class standardEvaporationModel class standardEvaporationModel