ENH: Adding temporary fix for patchInjectionBase to find cellId where parcel is injected.

In ReactingMultiphaseParcel.C changing in calc function the  mass update due to phase change.
This commit is contained in:
sergio
2015-12-10 13:11:48 -08:00
parent 84602ec507
commit 2fee35e7fe
2 changed files with 27 additions and 18 deletions

View File

@ -175,7 +175,6 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
const CompositionModel<reactingCloudType>& composition =
td.cloud().composition();
// Define local properties at beginning of timestep
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -291,7 +290,6 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
Cs
);
// Surface reactions
// ~~~~~~~~~~~~~~~~~
@ -324,27 +322,14 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
dhsTrans
);
// 2. Update the parcel properties due to change in mass
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
scalarField dMassGas(dMassDV + dMassSRGas);
scalarField dMassLiquid(dMassPC + dMassSRLiquid);
scalarField dMassSolid(dMassSRSolid);
scalar mass1 =
updateMassFractions(mass0, dMassGas, dMassLiquid, dMassSolid);
this->Cp_ = CpEff(td, pc, T0, idG, idL, idS);
// Update particle density or diameter
if (td.cloud().constProps().constantVolume())
{
this->rho_ = mass1/this->volume();
}
else
{
this->d_ = cbrt(mass1/this->rho_*6.0/pi);
}
scalar mass1 = mass0 - sum(dMassGas) - sum(dMassLiquid) - sum(dMassSolid);
// Remove the particle when mass falls below minimum threshold
if (np0*mass1 < td.cloud().constProps().minParcelMass())
@ -386,6 +371,18 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
return;
}
(void)updateMassFractions(mass0, dMassGas, dMassLiquid, dMassSolid);
// Update particle density or diameter
if (td.cloud().constProps().constantVolume())
{
this->rho_ = mass1/this->volume();
}
else
{
this->d_ = cbrt(mass1/this->rho_*6.0/pi);
}
// Correct surface values due to emitted species
this->correctSurfaceValues(td, cellI, Ts, Cs, rhos, mus, Prs, kappas);
Res = this->Re(U0, this->d_, rhos, mus);

View File

@ -215,8 +215,20 @@ void Foam::patchInjectionBase::setPositionAndCell
// first face of the cell as the tetFace and the first point after
// the base point on the face as the tetPt. The tracking will pick
// the cell consistent with the motion in the first tracking step
tetFaceI = mesh.cells()[cellOwner][0];
tetPtI = 1;
//tetFaceI = mesh.cells()[cellOwner][0];
//tetPtI = 1;
//SAF: temporary fix for patchInjection.
// This function finds both cellOwner and tetFaceI. The particle
// was injected in a non-boundary cell and the tracking function
// could not find the cellOwner
mesh.findCellFacePt
(
position,
cellOwner,
tetFaceI,
tetPtI
);
}
else
{