diff --git a/applications/utilities/surface/surfaceFeatureExtract/surfaceFeatureExtract.C b/applications/utilities/surface/surfaceFeatureExtract/surfaceFeatureExtract.C index 1376525577f327e0226aaa1e95cf0ace648ccccc..e298b1a12e82766513880ea9fe1109204b732ce1 100644 --- a/applications/utilities/surface/surfaceFeatureExtract/surfaceFeatureExtract.C +++ b/applications/utilities/surface/surfaceFeatureExtract/surfaceFeatureExtract.C @@ -337,9 +337,8 @@ int main(int argc, char *argv[]) surfaceFeatures newSet(surf); newSet.setFromStatus(edgeStat); - Info<< endl << "Writing trimmed features to " - << runTime.constant()/"featureEdgeMesh"/outFileName << endl; - newSet.write(runTime.constant()/"featureEdgeMesh"/outFileName); + Info<< endl << "Writing trimmed features to " << outFileName << endl; + newSet.write(outFileName); // Info<< endl << "Writing edge objs." << endl; // newSet.writeObj("final"); diff --git a/src/lagrangian/basic/particle/particle.C b/src/lagrangian/basic/particle/particle.C index 38c45bf57f933a9e55f7fb72dd849603389f2e3a..f3566c93e65f0bde14ee3757aad7f5bcae61d1de 100644 --- a/src/lagrangian/basic/particle/particle.C +++ b/src/lagrangian/basic/particle/particle.C @@ -32,6 +32,8 @@ Foam::label Foam::particle::particleCount_ = 0; const Foam::scalar Foam::particle::trackingCorrectionTol = 1e-5; +const Foam::scalar Foam::particle::lambdaDistanceToleranceCoeff = 1e3*SMALL; + namespace Foam { defineTypeNameAndDebug(particle, 0); diff --git a/src/lagrangian/basic/particle/particle.H b/src/lagrangian/basic/particle/particle.H index df64e7b9e7a9ea4b969f4f3b66970e068fe5abaf..06d32c321c220be200d76952d4310815bdf003e0 100644 --- a/src/lagrangian/basic/particle/particle.H +++ b/src/lagrangian/basic/particle/particle.H @@ -164,7 +164,8 @@ protected: DynamicList<label>& faceList, const tetPointRef& tet, const FixedList<vector, 4>& tetAreas, - const FixedList<label, 4>& tetPlaneBasePtIs + const FixedList<label, 4>& tetPlaneBasePtIs, + const scalar tol ) const; //- Find the lambda value for the line to-from across the @@ -178,7 +179,8 @@ protected: const label tetPlaneBasePtI, const label cellI, const label tetFaceI, - const label tetPtI + const label tetPtI, + const scalar tol ) const; //- Find the lambda value for a moving tri face @@ -191,7 +193,8 @@ protected: const label tetPlaneBasePtI, const label cellI, const label tetFaceI, - const label tetPtI + const label tetPtI, + const scalar tol ) const; //- Modify the tet owner data by crossing triI @@ -291,6 +294,10 @@ public: // 'rescue' it from a tracking problem static const scalar trackingCorrectionTol; + //- Fraction of the cell volume to use in determining tolerance values + // for the denominator and numerator of lambda + static const scalar lambdaDistanceToleranceCoeff; + // Constructors diff --git a/src/lagrangian/basic/particle/particleI.H b/src/lagrangian/basic/particle/particleI.H index a11018a5d5a5d3544251f0428f44a8da3c1b2714..6107df0c4ef9c23bb2d5d5dc6c862d659f1255fd 100644 --- a/src/lagrangian/basic/particle/particleI.H +++ b/src/lagrangian/basic/particle/particleI.H @@ -34,7 +34,8 @@ inline void Foam::particle::findTris DynamicList<label>& faceList, const tetPointRef& tet, const FixedList<vector, 4>& tetAreas, - const FixedList<label, 4>& tetPlaneBasePtIs + const FixedList<label, 4>& tetPlaneBasePtIs, + const scalar tol ) const { faceList.clear(); @@ -52,7 +53,8 @@ inline void Foam::particle::findTris tetPlaneBasePtIs[i], cellI_, tetFaceI_, - tetPtI_ + tetPtI_, + tol ); if ((lambda > 0.0) && (lambda < 1.0)) @@ -72,7 +74,8 @@ inline Foam::scalar Foam::particle::tetLambda const label tetPlaneBasePtI, const label cellI, const label tetFaceI, - const label tetPtI + const label tetPtI, + const scalar tol ) const { const pointField& pPts = mesh_.points(); @@ -88,7 +91,8 @@ inline Foam::scalar Foam::particle::tetLambda tetPlaneBasePtI, cellI, tetFaceI, - tetPtI + tetPtI, + tol ); } @@ -102,8 +106,6 @@ inline Foam::scalar Foam::particle::tetLambda // delta-length in the direction of n times the face area to a fraction of // the cell volume. - scalar tol = 1e3*SMALL*mesh_.cellVolumes()[cellI]; - if (mag(lambdaDenominator) < tol) { if (mag(lambdaNumerator) < tol) @@ -147,7 +149,8 @@ inline Foam::scalar Foam::particle::movingTetLambda const label tetPlaneBasePtI, const label cellI, const label tetFaceI, - const label tetPtI + const label tetPtI, + const scalar tol ) const { const pointField& pPts = mesh_.points(); @@ -299,8 +302,6 @@ inline Foam::scalar Foam::particle::movingTetLambda } - scalar tol = 1e3*SMALL*mesh_.cellVolumes()[cellI]; - if (mag(lambdaDenominator) < tol) { if (mag(lambdaNumerator) < tol) diff --git a/src/lagrangian/basic/particle/particleTemplates.C b/src/lagrangian/basic/particle/particleTemplates.C index e77376150a06172ced1300a96ccbb54e29d9039a..cb58c21653256ec63a58a5857fc147637d7ec1b3 100644 --- a/src/lagrangian/basic/particle/particleTemplates.C +++ b/src/lagrangian/basic/particle/particleTemplates.C @@ -286,6 +286,11 @@ Foam::scalar Foam::particle::trackToFace // be a different tet to the one that the particle occupies. tetIndices faceHitTetIs; + // What tolerance is appropriate the minimum lambda numerator and + // denominator for tracking in this cell. + scalar lambdaDistanceTolerance = + lambdaDistanceToleranceCoeff*mesh_.cellVolumes()[cellI_]; + do { if (triI != -1) @@ -371,7 +376,15 @@ Foam::scalar Foam::particle::trackToFace tetPlaneBasePtIs[2] = basePtI; tetPlaneBasePtIs[3] = basePtI; - findTris(endPosition, tris, tet, tetAreas, tetPlaneBasePtIs); + findTris + ( + endPosition, + tris, + tet, + tetAreas, + tetPlaneBasePtIs, + lambdaDistanceTolerance + ); // Reset variables for new track triI = -1; @@ -415,7 +428,8 @@ Foam::scalar Foam::particle::trackToFace tetPlaneBasePtIs[tI], cellI_, tetFaceI_, - tetPtI_ + tetPtI_, + lambdaDistanceTolerance ); if (lam < lambdaMin) @@ -704,6 +718,9 @@ void Foam::particle::hitWallFaces const Foam::cell& thisCell = mesh_.cells()[cellI_]; + scalar lambdaDistanceTolerance = + lambdaDistanceToleranceCoeff*mesh_.cellVolumes()[cellI_]; + const polyBoundaryMesh& patches = mesh_.boundaryMesh(); forAll(thisCell, cFI) @@ -755,7 +772,8 @@ void Foam::particle::hitWallFaces f[tetIs.faceBasePt()], cellI_, fI, - tetIs.tetPt() + tetIs.tetPt(), + lambdaDistanceTolerance ); if ((tetClambda <= 0.0) || (tetClambda >= 1.0)) @@ -781,7 +799,8 @@ void Foam::particle::hitWallFaces f[tetIs.faceBasePt()], cellI_, fI, - tetIs.tetPt() + tetIs.tetPt(), + lambdaDistanceTolerance ); pointHit hitInfo(vector::zero);