mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
TUT: mesh: clean up tutorials
This commit is contained in:
committed by
Andrew Heather
parent
6120e13d29
commit
3a858ac682
86
tutorials/mesh/foamyHexMesh/mixerVessel/Allrun.pre
Executable file
86
tutorials/mesh/foamyHexMesh/mixerVessel/Allrun.pre
Executable file
@ -0,0 +1,86 @@
|
||||
#!/bin/sh
|
||||
cd "${0%/*}" || exit # Run from this directory
|
||||
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
intersectSurfaces()
|
||||
{
|
||||
outputName1=$(basename $1)
|
||||
outputName1=${outputName1%.*}
|
||||
|
||||
outputName2=$(basename $2)
|
||||
outputName2=${outputName2%.*}
|
||||
|
||||
runApplication -s $outputName1:$outputName2 \
|
||||
surfaceBooleanFeatures intersection "$@"
|
||||
}
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
cp -rf \
|
||||
"$FOAM_TUTORIALS"/resources/geometry/mixerVessel \
|
||||
constant/triSurface/rawSurfaces
|
||||
|
||||
rm -rf 0
|
||||
|
||||
# Run the surface preparation script
|
||||
./constant/triSurface/surfaceProcess.sh > log.surfaceProcess 2>&1
|
||||
|
||||
# Surface intersections
|
||||
intersectSurfaces vessel.stl spargerShaft.stl -perturb
|
||||
|
||||
intersectSurfaces vessel.stl shaft.stl -perturb
|
||||
|
||||
intersectSurfaces spargerShaft.stl spargerInlet.stl -perturb
|
||||
|
||||
intersectSurfaces stirrer.stl shaftRotating.stl -perturb
|
||||
|
||||
intersectSurfaces stirrer_baffles.stl stirrer.stl -surf1Baffle -perturb
|
||||
|
||||
intersectSurfaces rotating.stl shaft.stl -surf1Baffle -perturb
|
||||
|
||||
# Intersect blades with the plate
|
||||
for bladeI in $(seq 1 6)
|
||||
do
|
||||
intersectSurfaces \
|
||||
stirrer_baffles_"$bladeI".obj \
|
||||
stirrer_baffles_plate.obj \
|
||||
-surf1Baffle -surf2Baffle
|
||||
done
|
||||
|
||||
# Meshing
|
||||
cp -f system/controlDict.mesh system/controlDict
|
||||
|
||||
runApplication blockMesh -region backgroundMeshDecomposition
|
||||
|
||||
runApplication -s backgroundMeshDecomposition \
|
||||
decomposePar -region backgroundMeshDecomposition
|
||||
|
||||
runApplication surfaceFeatureExtract
|
||||
|
||||
runParallel foamyHexMesh
|
||||
|
||||
runParallel -s faces \
|
||||
collapseEdges -collapseFaces -latestTime \
|
||||
-dict system/collapseDict.collapseFaces
|
||||
|
||||
#runParallel -s faceSet \
|
||||
# collapseEdges -collapseFaceSet indirectPatchFaces -latestTime \
|
||||
# -dict system/collapseDict.indirectPatchFaces
|
||||
|
||||
runParallel checkMesh -allTopology -allGeometry -latestTime
|
||||
|
||||
# Copy the mesh from the latest time folder into polyMesh and delete that
|
||||
# latest time folder
|
||||
latestTime=$(foamListTimes -latestTime -processor)
|
||||
if [ "$latestTime" != "constant" ] && [ -d processor0/"$latestTime"/polyMesh ]
|
||||
then
|
||||
runApplication reconstructParMesh -latestTime
|
||||
|
||||
cp -rf "$latestTime"/polyMesh constant
|
||||
rm -rf "$latestTime"
|
||||
fi
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
Reference in New Issue
Block a user