mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: snappyHexMesh: early exit of leak detection. See #2403
Changed behaviour to make it the default
This commit is contained in:
@ -487,8 +487,8 @@ castellatedMeshControls
|
|||||||
// Optional: same but in absolute number of cells. Default is 0.
|
// Optional: same but in absolute number of cells. Default is 0.
|
||||||
//nMinCells 100;
|
//nMinCells 100;
|
||||||
|
|
||||||
// Optional: disable of automatic leak closure and exit immediately
|
// Optional: enable automatic leak closure (default is exit immediately)
|
||||||
//useLeakClosure false;
|
//useLeakClosure true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Settings for the snapping.
|
// Settings for the snapping.
|
||||||
|
|||||||
@ -74,7 +74,7 @@ Foam::refinementParameters::refinementParameters
|
|||||||
pointField(0)
|
pointField(0)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
useLeakClosure_(dict.getOrDefault<bool>("useLeakClosure", true)),
|
useLeakClosure_(dict.getOrDefault<bool>("useLeakClosure", false)),
|
||||||
faceZoneControls_(dict.subOrEmptyDict("faceZoneControls")),
|
faceZoneControls_(dict.subOrEmptyDict("faceZoneControls")),
|
||||||
allowFreeStandingZoneFaces_
|
allowFreeStandingZoneFaces_
|
||||||
(
|
(
|
||||||
|
|||||||
@ -199,8 +199,8 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
//- Whether to attempt to close any 'leak' between
|
//- Whether to attempt to close any 'leak' between
|
||||||
// locationsInsideMesh and locationsOutsideMesh or exit with
|
// locationsInsideMesh and locationsOutsideMesh. Default is
|
||||||
// error. Default is true.
|
// false (dump path and exit with error)
|
||||||
// (see also refinementSurfaces::leakLevel to force surfaces to
|
// (see also refinementSurfaces::leakLevel to force surfaces to
|
||||||
// be checked for leaks early-on in the refinement)
|
// be checked for leaks early-on in the refinement)
|
||||||
bool useLeakClosure() const
|
bool useLeakClosure() const
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
cd "${0%/*}" || exit # Run from this directory
|
cd "${0%/*}" || exit # Run from this directory
|
||||||
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
|
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
|
||||||
|
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
mkdir -p constant
|
mkdir -p constant
|
||||||
@ -9,26 +10,23 @@ cp -rf \
|
|||||||
"$FOAM_TUTORIALS"/resources/geometry/motorBike_leakDetection \
|
"$FOAM_TUTORIALS"/resources/geometry/motorBike_leakDetection \
|
||||||
constant/triSurface
|
constant/triSurface
|
||||||
|
|
||||||
# Alternative decomposeParDict name:
|
|
||||||
decompDict="-decomposeParDict system/decomposeParDict.6"
|
|
||||||
## Standard decomposeParDict name:
|
|
||||||
# unset decompDict
|
|
||||||
|
|
||||||
runApplication surfaceFeatureExtract
|
runApplication surfaceFeatureExtract
|
||||||
|
|
||||||
runApplication blockMesh
|
runApplication blockMesh
|
||||||
|
|
||||||
runApplication $decompDict decomposePar
|
runApplication decomposePar
|
||||||
|
|
||||||
# Using distributedTriSurfaceMesh?
|
#- Run with leak-detection (writes postProcessing/leakPath) but no closure
|
||||||
if foamDictionary -entry geometry -value system/snappyHexMeshDict | \
|
foamDictionary system/snappyHexMeshDict \
|
||||||
grep -q distributedTriSurfaceMesh
|
-entry castellatedMeshControls.useLeakClosure -set false
|
||||||
then
|
runParallel -s leak snappyHexMesh
|
||||||
runParallel $decompDict surfaceRedistributePar motorBike.obj independent
|
runParallel -s leak checkMesh
|
||||||
fi
|
cleanTimeDirectories
|
||||||
|
|
||||||
runParallel $decompDict snappyHexMesh -overwrite
|
#- Run with leak-detection (writes postProcessing/leakPath) and closure
|
||||||
|
foamDictionary system/snappyHexMeshDict \
|
||||||
runParallel $decompDict checkMesh -writeFields '(nonOrthoAngle)' -constant
|
-entry castellatedMeshControls.useLeakClosure -set true
|
||||||
|
runParallel -s leak_and_closure snappyHexMesh
|
||||||
|
runParallel -s leak_and_closure checkMesh
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
@ -175,6 +175,10 @@ castellatedMeshControls
|
|||||||
// are only on the boundary of corresponding cellZones or also allow
|
// are only on the boundary of corresponding cellZones or also allow
|
||||||
// free-standing zone faces. Not used if there are no faceZones.
|
// free-standing zone faces. Not used if there are no faceZones.
|
||||||
allowFreeStandingZoneFaces true;
|
allowFreeStandingZoneFaces true;
|
||||||
|
|
||||||
|
|
||||||
|
// Enable automatic leak closure (default is exit immediately)
|
||||||
|
useLeakClosure true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user