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

@ -50,16 +50,19 @@ void Foam::ReactingParcel<ParcelType>::setCellValues
if (pc_ < td.cloud().constProps().pMin()) if (pc_ < td.cloud().constProps().pMin())
{ {
WarningIn if (debug)
( {
"void Foam::ReactingParcel<ParcelType>::setCellValues" WarningIn
"(" (
"TrackData&, " "void Foam::ReactingParcel<ParcelType>::setCellValues"
"const scalar, " "("
"const label" "TrackData&, "
")" "const scalar, "
) << "Limiting observed pressure in cell " << cellI << " to " "const label"
<< td.cloud().constProps().pMin() << nl << endl; ")"
) << "Limiting observed pressure in cell " << cellI << " to "
<< td.cloud().constProps().pMin() << nl << endl;
}
pc_ = td.cloud().constProps().pMin(); pc_ = td.cloud().constProps().pMin();
} }
@ -86,54 +89,50 @@ void Foam::ReactingParcel<ParcelType>::cellValueSourceCorrection
return; return;
} }
scalar massCell = this->massCell(cellI); const scalar massCell = this->massCell(cellI);
const scalar V = td.cloud().pMesh().cellVolumes()[cellI]; this->rhoc_ += addedMass/td.cloud().pMesh().cellVolumes()[cellI];
this->rhoc_ += addedMass/V;
scalar massCellNew = massCell + addedMass; const scalar massCellNew = massCell + addedMass;
this->Uc_ += td.cloud().UTrans()[cellI]/massCellNew; this->Uc_ += td.cloud().UTrans()[cellI]/massCellNew;
scalar CpEff = 0.0; scalar CpEff = 0.0;
scalar CsEff = 0.0;
scalar Csc = 0.0;
if (addedMass > ROOTVSMALL) if (addedMass > ROOTVSMALL)
{ {
forAll(td.cloud().rhoTrans(), i) forAll(td.cloud().rhoTrans(), i)
{ {
scalar Y = td.cloud().rhoTrans(i)[cellI]/addedMass; scalar Y = td.cloud().rhoTrans(i)[cellI]/addedMass;
CpEff += Y*td.cloud().composition().carrier().Cp(i, this->Tc_); 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]; const scalar Cpc = td.CpInterp().psi()[cellI];
this->Cpc_ = (massCell*Cpc + addedMass*CpEff)/massCellNew; this->Cpc_ = (massCell*Cpc + addedMass*CpEff)/massCellNew;
this->Tc_ += td.cloud().hsTrans()[cellI]/(this->Cpc_*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()))
{ {
WarningIn if (debug)
( {
"void Foam::ReactingParcel<ParcelType>::cellValueSourceCorrection" WarningIn
"(" (
"TrackData&, " "void Foam::ReactingParcel<ParcelType>::"
"const scalar, " "cellValueSourceCorrection"
"const label" "("
")" "TrackData&, "
) << "Limiting observed temperature in cell " << cellI << " to " "const scalar, "
<< td.cloud().constProps().TMin() << nl << endl; "const label"
")"
) << "Limiting observed temperature in cell " << cellI << " to "
<< td.cloud().constProps().TMin() << nl << endl;
}
this->Tc_ = td.cloud().constProps().TMin(); this->Tc_ = td.cloud().constProps().TMin();
} }
this->pc_ = CsEff*specie::RR*this->Tc_; // constant pressure
// this->pc_ = this->pc_;
} }

View File

@ -49,16 +49,19 @@ void Foam::ThermoParcel<ParcelType>::setCellValues
if (Tc_ < td.cloud().constProps().TMin()) if (Tc_ < td.cloud().constProps().TMin())
{ {
WarningIn if (debug)
( {
"void Foam::ThermoParcel<ParcelType>::setCellValues" WarningIn
"(" (
"TrackData&, " "void Foam::ThermoParcel<ParcelType>::setCellValues"
"const scalar, " "("
"const label" "TrackData&, "
")" "const scalar, "
) << "Limiting observed temperature in cell " << cellI << " to " "const label"
<< td.cloud().constProps().TMin() << nl << endl; ")"
) << "Limiting observed temperature in cell " << cellI << " to "
<< td.cloud().constProps().TMin() << nl << endl;
}
Tc_ = td.cloud().constProps().TMin(); Tc_ = td.cloud().constProps().TMin();
} }
@ -81,16 +84,19 @@ void Foam::ThermoParcel<ParcelType>::cellValueSourceCorrection
if (Tc_ < td.cloud().constProps().TMin()) if (Tc_ < td.cloud().constProps().TMin())
{ {
WarningIn if (debug)
( {
"void Foam::ThermoParcel<ParcelType>::cellValueSourceCorrection" WarningIn
"(" (
"TrackData&, " "void Foam::ThermoParcel<ParcelType>::cellValueSourceCorrection"
"const scalar, " "("
"const label" "TrackData&, "
")" "const scalar, "
) << "Limiting observed temperature in cell " << cellI << " to " "const label"
<< td.cloud().constProps().TMin() << nl << endl; ")"
) << "Limiting observed temperature in cell " << cellI << " to "
<< td.cloud().constProps().TMin() << nl << endl;
}
Tc_ = td.cloud().constProps().TMin(); Tc_ = td.cloud().constProps().TMin();
} }
@ -116,21 +122,24 @@ void Foam::ThermoParcel<ParcelType>::calcSurfaceValues
if (Ts < td.cloud().constProps().TMin()) if (Ts < td.cloud().constProps().TMin())
{ {
WarningIn if (debug)
( {
"void Foam::ThermoParcel<ParcelType>::calcSurfaceValues" WarningIn
"(" (
"TrackData&, " "void Foam::ThermoParcel<ParcelType>::calcSurfaceValues"
"const label, " "("
"const scalar, " "TrackData&, "
"scalar&, " "const label, "
"scalar&, " "const scalar, "
"scalar&, " "scalar&, "
"scalar&, " "scalar&, "
"scalar&" "scalar&, "
") const" "scalar&, "
) << "Limiting parcel surface temperature to " "scalar&"
<< td.cloud().constProps().TMin() << nl << endl; ") const"
) << "Limiting parcel surface temperature to "
<< td.cloud().constProps().TMin() << nl << endl;
}
Ts = td.cloud().constProps().TMin(); Ts = td.cloud().constProps().TMin();
} }