ENH: using constant pressure approx for particle cell source update

This commit is contained in:
andy
2011-01-27 18:16:27 +00:00
parent 07e356574d
commit eb013de3f2
2 changed files with 77 additions and 69 deletions

View File

@ -49,6 +49,8 @@ void Foam::ReactingParcel<ParcelType>::setCellValues
);
if (pc_ < td.cloud().constProps().pMin())
{
if (debug)
{
WarningIn
(
@ -60,6 +62,7 @@ void Foam::ReactingParcel<ParcelType>::setCellValues
")"
) << "Limiting observed pressure in cell " << cellI << " to "
<< td.cloud().constProps().pMin() << nl << endl;
}
pc_ = td.cloud().constProps().pMin();
}
@ -86,42 +89,36 @@ void Foam::ReactingParcel<ParcelType>::cellValueSourceCorrection
return;
}
scalar massCell = this->massCell(cellI);
const scalar massCell = this->massCell(cellI);
const scalar V = td.cloud().pMesh().cellVolumes()[cellI];
this->rhoc_ += addedMass/V;
this->rhoc_ += addedMass/td.cloud().pMesh().cellVolumes()[cellI];
scalar massCellNew = massCell + addedMass;
const scalar massCellNew = massCell + addedMass;
this->Uc_ += td.cloud().UTrans()[cellI]/massCellNew;
scalar CpEff = 0.0;
scalar CsEff = 0.0;
scalar Csc = 0.0;
if (addedMass > ROOTVSMALL)
{
forAll(td.cloud().rhoTrans(), i)
{
scalar Y = td.cloud().rhoTrans(i)[cellI]/addedMass;
CpEff += Y*td.cloud().composition().carrier().Cp(i, this->Tc_);
scalar W = td.cloud().composition().carrier().W(i);
CsEff += td.cloud().rhoTrans(i)[cellI]/V*Y/W;
scalar Yc = td.cloud().composition().carrier().Y(i)[cellI];
Csc += massCell/V*Yc/W;
}
}
CsEff = (massCell*Csc + addedMass*CsEff)/massCellNew;
const scalar Cpc = td.CpInterp().psi()[cellI];
this->Cpc_ = (massCell*Cpc + addedMass*CpEff)/massCellNew;
this->Tc_ += td.cloud().hsTrans()[cellI]/(this->Cpc_*massCellNew);
if (this->Tc_ < td.cloud().constProps().TMin())
if (debug && (this->Tc_ < td.cloud().constProps().TMin()))
{
if (debug)
{
WarningIn
(
"void Foam::ReactingParcel<ParcelType>::cellValueSourceCorrection"
"void Foam::ReactingParcel<ParcelType>::"
"cellValueSourceCorrection"
"("
"TrackData&, "
"const scalar, "
@ -129,11 +126,13 @@ void Foam::ReactingParcel<ParcelType>::cellValueSourceCorrection
")"
) << "Limiting observed temperature in cell " << cellI << " to "
<< td.cloud().constProps().TMin() << nl << endl;
}
this->Tc_ = td.cloud().constProps().TMin();
}
this->pc_ = CsEff*specie::RR*this->Tc_;
// constant pressure
// this->pc_ = this->pc_;
}

View File

@ -48,6 +48,8 @@ void Foam::ThermoParcel<ParcelType>::setCellValues
Tc_ = td.TInterp().interpolate(this->position(), tetIs);
if (Tc_ < td.cloud().constProps().TMin())
{
if (debug)
{
WarningIn
(
@ -59,6 +61,7 @@ void Foam::ThermoParcel<ParcelType>::setCellValues
")"
) << "Limiting observed temperature in cell " << cellI << " to "
<< td.cloud().constProps().TMin() << nl << endl;
}
Tc_ = td.cloud().constProps().TMin();
}
@ -80,6 +83,8 @@ void Foam::ThermoParcel<ParcelType>::cellValueSourceCorrection
Tc_ += td.cloud().hsTrans()[cellI]/(CpMean*this->massCell(cellI));
if (Tc_ < td.cloud().constProps().TMin())
{
if (debug)
{
WarningIn
(
@ -91,6 +96,7 @@ void Foam::ThermoParcel<ParcelType>::cellValueSourceCorrection
")"
) << "Limiting observed temperature in cell " << cellI << " to "
<< td.cloud().constProps().TMin() << nl << endl;
}
Tc_ = td.cloud().constProps().TMin();
}
@ -115,6 +121,8 @@ void Foam::ThermoParcel<ParcelType>::calcSurfaceValues
Ts = (2.0*T + Tc_)/3.0;
if (Ts < td.cloud().constProps().TMin())
{
if (debug)
{
WarningIn
(
@ -131,6 +139,7 @@ void Foam::ThermoParcel<ParcelType>::calcSurfaceValues
") const"
) << "Limiting parcel surface temperature to "
<< td.cloud().constProps().TMin() << nl << endl;
}
Ts = td.cloud().constProps().TMin();
}