Skip to content
Snippets Groups Projects

CONFIG: add settings for Cray compiler and cray mpich

Merged Mark OLESEN requested to merge feature-config-cray into develop
Viewing commit 8da213f5
Show latest version
2 files
+ 28
7
Preferences
Compare changes
Files
2
  • 8da213f5
    lagrangian: Fixed infinite loops · 8da213f5
    Will Bainbridge authored
    Tracking through an inverted region of the mesh happens in a reversed
    direction relative to a non-inverted region. Usually, this allows the
    tracking to propagate normally, regardless of the sign of the space.
    However, in rare cases, it is possible for a straight trajectory to form
    a closed loop through both positive and negative regions. This causes
    the tracking to loop indefinitely.
    
    To fix this, the displacement through inverted regions has been
    artifically increased by a small amount (1% at the moment). This has the
    effect that the change in track fraction over the negative part of the
    loop no longer exactly cancels the change over the positive part, and
    the track therefore terminates.
@@ -30,6 +30,8 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
const Foam::scalar Foam::particle::negativeSpaceDisplacementFactor = 1.01;
Foam::label Foam::particle::particleCount_ = 0;
namespace Foam
@@ -685,8 +687,11 @@ Foam::scalar Foam::particle::trackToStationaryTri
<< "Start local coordinates = " << y0 << endl;
}
// Get the factor by which the displacement is increased
const scalar f = detA >= 0 ? 1 : negativeSpaceDisplacementFactor;
// Calculate the local tracking displacement
barycentric Tx1(x1 & T);
barycentric Tx1(f*x1 & T);
if (debug)
{
@@ -783,16 +788,22 @@ Foam::scalar Foam::particle::trackToMovingTri
FixedList<barycentricTensor, 3> T;
movingTetReverseTransform(fraction, centre, detA, T);
// Get the factor by which the displacement is increased
const scalar f = detA[0] >= 0 ? 1 : negativeSpaceDisplacementFactor;
// Get the relative global position
const vector x0Rel = x0 - centre[0];
const vector x1Rel = x1 - centre[1];
const vector x1Rel = f*x1 - centre[1];
// Form the determinant and hit equations
cubicEqn detAEqn(sqr(detA[0])*detA[3], detA[0]*detA[2], detA[1], 1);
const barycentric yC(1, 0, 0, 0);
const barycentric hitEqnA = ((x1Rel & T[2]) + detA[3]*yC)*sqr(detA[0]);
const barycentric hitEqnA =
((x1Rel & T[2]) + detA[3]*yC)*sqr(detA[0]);
const barycentric hitEqnB =
((x1Rel & T[1]) + (x0Rel & T[2]) + detA[2]*yC)*detA[0];
const barycentric hitEqnC = (x1Rel & T[0]) + (x0Rel & T[1]) + detA[1]*yC;
const barycentric hitEqnC =
((x1Rel & T[0]) + (x0Rel & T[1]) + detA[1]*yC);
const barycentric hitEqnD = y0;
FixedList<cubicEqn, 4> hitEqn;
forAll(hitEqn, i)