Skip to content
Snippets Groups Projects
Commit 2fee35e7 authored by sergio's avatar sergio
Browse files

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.
parent 84602ec5
No related branches found
No related tags found
No related merge requests found
...@@ -175,7 +175,6 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc ...@@ -175,7 +175,6 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
const CompositionModel<reactingCloudType>& composition = const CompositionModel<reactingCloudType>& composition =
td.cloud().composition(); td.cloud().composition();
// Define local properties at beginning of timestep // Define local properties at beginning of timestep
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...@@ -291,7 +290,6 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc ...@@ -291,7 +290,6 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
Cs Cs
); );
// Surface reactions // Surface reactions
// ~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~
...@@ -324,27 +322,14 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc ...@@ -324,27 +322,14 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
dhsTrans dhsTrans
); );
// 2. Update the parcel properties due to change in mass // 2. Update the parcel properties due to change in mass
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
scalarField dMassGas(dMassDV + dMassSRGas); scalarField dMassGas(dMassDV + dMassSRGas);
scalarField dMassLiquid(dMassPC + dMassSRLiquid); scalarField dMassLiquid(dMassPC + dMassSRLiquid);
scalarField dMassSolid(dMassSRSolid); scalarField dMassSolid(dMassSRSolid);
scalar mass1 =
updateMassFractions(mass0, dMassGas, dMassLiquid, dMassSolid);
this->Cp_ = CpEff(td, pc, T0, idG, idL, idS); scalar mass1 = mass0 - sum(dMassGas) - sum(dMassLiquid) - sum(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);
}
// Remove the particle when mass falls below minimum threshold // Remove the particle when mass falls below minimum threshold
if (np0*mass1 < td.cloud().constProps().minParcelMass()) if (np0*mass1 < td.cloud().constProps().minParcelMass())
...@@ -386,6 +371,18 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc ...@@ -386,6 +371,18 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
return; 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 // Correct surface values due to emitted species
this->correctSurfaceValues(td, cellI, Ts, Cs, rhos, mus, Prs, kappas); this->correctSurfaceValues(td, cellI, Ts, Cs, rhos, mus, Prs, kappas);
Res = this->Re(U0, this->d_, rhos, mus); Res = this->Re(U0, this->d_, rhos, mus);
......
...@@ -215,8 +215,20 @@ void Foam::patchInjectionBase::setPositionAndCell ...@@ -215,8 +215,20 @@ void Foam::patchInjectionBase::setPositionAndCell
// first face of the cell as the tetFace and the first point after // 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 base point on the face as the tetPt. The tracking will pick
// the cell consistent with the motion in the first tracking step // the cell consistent with the motion in the first tracking step
tetFaceI = mesh.cells()[cellOwner][0]; //tetFaceI = mesh.cells()[cellOwner][0];
tetPtI = 1; //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 else
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment