diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C index 2f050e26ae5f2fa35dddde19d3290b070aaae51a..5516e7c9476bf3f946865b0fd0f9aef62b678572 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C @@ -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); diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/patchInjectionBase.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/patchInjectionBase.C index 0d070691f01d851aef6cee897c64493957ab5494..6e52a06dba25d9a62aad70715e60a9aecc04ce95 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/patchInjectionBase.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/PatchInjection/patchInjectionBase.C @@ -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 {