diff --git a/src/lagrangian/dsmc/Make/options b/src/lagrangian/dsmc/Make/options index 15874b7b55..55865dfabc 100644 --- a/src/lagrangian/dsmc/Make/options +++ b/src/lagrangian/dsmc/Make/options @@ -1,7 +1,9 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/lagrangian/basic/lnInclude + -I$(LIB_SRC)/lagrangian/basic/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude LIB_LIBS = \ -llagrangian \ - -lfiniteVolume + -lfiniteVolume \ + -lmeshTools diff --git a/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.C b/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.C index ffd7c67d42..9e1c10f51b 100644 --- a/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.C +++ b/src/lagrangian/dsmc/parcels/Templates/DsmcParcel/DsmcParcel.C @@ -25,6 +25,7 @@ License \*---------------------------------------------------------------------------*/ #include "DsmcParcel.H" +#include "meshTools.H" // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // @@ -47,12 +48,27 @@ bool Foam::DsmcParcel::move scalar tEnd = (1.0 - p.stepFraction())*deltaT; const scalar dtMax = tEnd; + // For reduced-D cases, the velocity used to track needs to be + // constrained, but the actual U_ of the parcel must not be + // altered or used, as it is altered by patch interactions an + // needs to retain its 3D value for collision purposes. + vector Utracking = U_; + while (td.keepParticle && !td.switchProcessor && tEnd > ROOTVSMALL) { + // Apply correction to position for reduced-D cases + meshTools::constrainToMeshCentre(mesh, p.position()); + + Utracking = U_; + + // Apply correction to velocity to constrain tracking for + // reduced-D cases + meshTools::constrainDirection(mesh, mesh.solutionD(), Utracking); + // Set the Lagrangian time-step scalar dt = min(dtMax, tEnd); - dt *= p.trackToFace(p.position() + dt*U_, td); + dt *= p.trackToFace(p.position() + dt*Utracking, td); tEnd -= dt; @@ -256,4 +272,3 @@ void Foam::DsmcParcel::transformProperties #include "DsmcParcelIO.C" // ************************************************************************* // -