diff --git a/applications/utilities/mesh/manipulation/checkMesh/checkGeometry.C b/applications/utilities/mesh/manipulation/checkMesh/checkGeometry.C index 8677f08c6..987e26d2e 100644 --- a/applications/utilities/mesh/manipulation/checkMesh/checkGeometry.C +++ b/applications/utilities/mesh/manipulation/checkMesh/checkGeometry.C @@ -136,7 +136,7 @@ bool Foam::checkWedges const point& pt = p[pp.meshPoints()[i]]; scalar d = mag((pt - p0) & pp.n()); - if (d > sqrt(SMALL)) + if (d > ROOTSMALL) { if (report) { diff --git a/src/OpenFOAM/primitives/Scalar/doubleScalar/doubleScalar.H b/src/OpenFOAM/primitives/Scalar/doubleScalar/doubleScalar.H index 2498f5f9c..308994785 100644 --- a/src/OpenFOAM/primitives/Scalar/doubleScalar/doubleScalar.H +++ b/src/OpenFOAM/primitives/Scalar/doubleScalar/doubleScalar.H @@ -55,6 +55,7 @@ static const doubleScalar doubleScalarGREAT = 1.0e+15; static const doubleScalar doubleScalarVGREAT = 1.0e+300; static const doubleScalar doubleScalarROOTVGREAT = 1.0e+150; static const doubleScalar doubleScalarSMALL = 1.0e-15; +static const doubleScalar doubleScalarROOTSMALL = 3.0e-8; static const doubleScalar doubleScalarVSMALL = 1.0e-300; static const doubleScalar doubleScalarROOTVSMALL = 1.0e-150; diff --git a/src/OpenFOAM/primitives/Scalar/floatScalar/floatScalar.H b/src/OpenFOAM/primitives/Scalar/floatScalar/floatScalar.H index 31ae9891d..1cfb728a2 100644 --- a/src/OpenFOAM/primitives/Scalar/floatScalar/floatScalar.H +++ b/src/OpenFOAM/primitives/Scalar/floatScalar/floatScalar.H @@ -55,6 +55,7 @@ static const floatScalar floatScalarGREAT = 1.0e+6; static const floatScalar floatScalarVGREAT = 1.0e+37; static const floatScalar floatScalarROOTVGREAT = 1.0e+18; static const floatScalar floatScalarSMALL = 1.0e-6; +static const floatScalar floatScalarROOTSMALL = 1.0e-3; static const floatScalar floatScalarVSMALL = 1.0e-37; static const floatScalar floatScalarROOTVSMALL = 1.0e-18; diff --git a/src/OpenFOAM/primitives/Scalar/scalar/scalar.H b/src/OpenFOAM/primitives/Scalar/scalar/scalar.H index cb5496a65..8f9c1c561 100644 --- a/src/OpenFOAM/primitives/Scalar/scalar/scalar.H +++ b/src/OpenFOAM/primitives/Scalar/scalar/scalar.H @@ -53,6 +53,7 @@ namespace Foam static const scalar VGREAT = floatScalarVGREAT; static const scalar ROOTVGREAT = floatScalarROOTVGREAT; static const scalar SMALL = floatScalarSMALL; + static const scalar ROOTSMALL = floatScalarROOTSMALL; static const scalar VSMALL = floatScalarVSMALL; static const scalar ROOTVSMALL = floatScalarROOTVSMALL; @@ -71,6 +72,7 @@ namespace Foam static const scalar VGREAT = doubleScalarVGREAT; static const scalar ROOTVGREAT = doubleScalarROOTVGREAT; static const scalar SMALL = doubleScalarSMALL; + static const scalar ROOTSMALL = doubleScalarROOTSMALL; static const scalar VSMALL = doubleScalarVSMALL; static const scalar ROOTVSMALL = doubleScalarROOTVSMALL; diff --git a/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinement.C b/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinement.C index 5d96aafca..12e94465f 100644 --- a/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinement.C +++ b/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinement.C @@ -272,7 +272,7 @@ void Foam::meshRefinement::updateIntersections(const labelList& changedFaces) // Extend segments a bit { - const vectorField smallVec(Foam::sqrt(SMALL)*(end-start)); + const vectorField smallVec(ROOTSMALL*(end-start)); start -= smallVec; end += smallVec; } @@ -483,7 +483,7 @@ void Foam::meshRefinement::checkData() // Extend segments a bit { - const vectorField smallVec(Foam::sqrt(SMALL)*(end-start)); + const vectorField smallVec(ROOTSMALL*(end-start)); start -= smallVec; end += smallVec; } @@ -2897,7 +2897,7 @@ void Foam::meshRefinement::dumpIntersections(const fileName& prefix) const // Extend segments a bit { - const vectorField smallVec(Foam::sqrt(SMALL)*(end-start)); + const vectorField smallVec(ROOTSMALL*(end-start)); start -= smallVec; end += smallVec; } diff --git a/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C b/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C index 8cf215729..bbbe08c35 100644 --- a/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C +++ b/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C @@ -243,7 +243,7 @@ void Foam::meshRefinement::getBafflePatches // Extend segments a bit { - const vectorField smallVec(Foam::sqrt(SMALL)*(end-start)); + const vectorField smallVec(ROOTSMALL*(end-start)); start -= smallVec; end += smallVec; } @@ -830,7 +830,7 @@ Foam::List Foam::meshRefinement::freeStandingBaffles // Extend segments a bit { - const vectorField smallVec(Foam::sqrt(SMALL)*(end-start)); + const vectorField smallVec(ROOTSMALL*(end-start)); start -= smallVec; end += smallVec; } @@ -2967,7 +2967,7 @@ Foam::autoPtr Foam::meshRefinement::zonify // Extend segments a bit { - const vectorField smallVec(Foam::sqrt(SMALL)*(end-start)); + const vectorField smallVec(ROOTSMALL*(end-start)); start -= smallVec; end += smallVec; } diff --git a/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementRefine.C b/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementRefine.C index 3ccaa7283..e2224f7cd 100644 --- a/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementRefine.C +++ b/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementRefine.C @@ -967,7 +967,7 @@ Foam::label Foam::meshRefinement::markSurfaceRefinement // Extend segments a bit { - const vectorField smallVec(Foam::sqrt(SMALL)*(end-start)); + const vectorField smallVec(ROOTSMALL*(end-start)); start -= smallVec; end += smallVec; } @@ -1161,7 +1161,7 @@ Foam::label Foam::meshRefinement::markSurfaceCurvatureRefinement // Extend segments a bit { - const vectorField smallVec(Foam::sqrt(SMALL)*(end-start)); + const vectorField smallVec(ROOTSMALL*(end-start)); start -= smallVec; end += smallVec; } @@ -1764,7 +1764,7 @@ Foam::label Foam::meshRefinement::markProximityRefinement // Extend segments a bit { - const vectorField smallVec(Foam::sqrt(SMALL)*(end-start)); + const vectorField smallVec(ROOTSMALL*(end-start)); start -= smallVec; end += smallVec; } diff --git a/src/meshTools/searchableSurface/searchableBox.C b/src/meshTools/searchableSurface/searchableBox.C index 5970e8257..f20b808e8 100644 --- a/src/meshTools/searchableSurface/searchableBox.C +++ b/src/meshTools/searchableSurface/searchableBox.C @@ -531,7 +531,7 @@ void Foam::searchableBox::findLineAll const scalarField magSqrDirVec(magSqr(dirVec)); const vectorField smallVec ( - Foam::sqrt(SMALL)*dirVec + ROOTSMALL*dirVec + vector(ROOTVSMALL,ROOTVSMALL,ROOTVSMALL) ); diff --git a/src/parallel/distributed/distributedTriSurfaceMesh/distributedTriSurfaceMesh.C b/src/parallel/distributed/distributedTriSurfaceMesh/distributedTriSurfaceMesh.C index 1a636b1ca..80e3943cd 100644 --- a/src/parallel/distributed/distributedTriSurfaceMesh/distributedTriSurfaceMesh.C +++ b/src/parallel/distributed/distributedTriSurfaceMesh/distributedTriSurfaceMesh.C @@ -1752,7 +1752,7 @@ void Foam::distributedTriSurfaceMesh::findLineAll const scalarField magSqrDirVec(magSqr(dirVec)); const vectorField smallVec ( - Foam::sqrt(SMALL)*dirVec + ROOTSMALL*dirVec + vector(ROOTVSMALL,ROOTVSMALL,ROOTVSMALL) );