mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
FIX: provide restore0Dir function to fix issue #159
- makes it easier to ensure the correct behaviour, consistently
This commit is contained in:
@ -14,4 +14,4 @@ runApplication createBaffles -overwrite
|
||||
# remove zero-sized patches
|
||||
runApplication createPatch -overwrite
|
||||
|
||||
cp -rf 0.org 0
|
||||
restore0Dir
|
||||
|
||||
@ -11,11 +11,8 @@ cp $FOAM_TUTORIALS/resources/geometry/propellerTip.obj.gz constant/triSurface/
|
||||
# - meshing
|
||||
|
||||
runApplication blockMesh
|
||||
|
||||
runApplication surfaceFeatureExtract
|
||||
|
||||
runApplication snappyHexMesh -overwrite
|
||||
|
||||
runApplication renumberMesh -overwrite
|
||||
|
||||
# force removal of fields generated by snappy
|
||||
@ -31,4 +28,4 @@ runApplication createPatch -overwrite
|
||||
#runApplication moveDynamicMesh -checkAMI
|
||||
|
||||
# - set the initial fields
|
||||
cp -rf 0.org 0
|
||||
restore0Dir
|
||||
|
||||
@ -4,14 +4,19 @@ cd ${0%/*} || exit 1 # Run from this directory
|
||||
# Source tutorial run functions
|
||||
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
|
||||
|
||||
cd wingMotion_snappyHexMesh
|
||||
cleanCase
|
||||
(
|
||||
cd wingMotion_snappyHexMesh || exit 1
|
||||
cleanCase
|
||||
)
|
||||
|
||||
cd ../wingMotion2D_simpleFoam
|
||||
cleanCase
|
||||
rm -rf 0
|
||||
|
||||
cd ../wingMotion2D_pimpleDyMFoam
|
||||
cleanCase
|
||||
rm -rf 0
|
||||
(
|
||||
cd wingMotion2D_simpleFoam || exit 1
|
||||
cleanCase
|
||||
rm -rf 0
|
||||
)
|
||||
|
||||
(
|
||||
cd wingMotion2D_pimpleDyMFoam || exit 1
|
||||
cleanCase
|
||||
rm -rf 0
|
||||
)
|
||||
|
||||
@ -5,26 +5,36 @@ cd ${0%/*} || exit 1 # Run from this directory
|
||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||
|
||||
# Make 3D mesh in slab of cells.
|
||||
cd wingMotion_snappyHexMesh
|
||||
runApplication blockMesh
|
||||
runApplication snappyHexMesh -overwrite
|
||||
(
|
||||
cd wingMotion_snappyHexMesh || exit 1
|
||||
|
||||
runApplication blockMesh
|
||||
runApplication snappyHexMesh -overwrite
|
||||
)
|
||||
|
||||
# Make a 2D mesh by extruding a patch and solve to steady state.
|
||||
cd ../wingMotion2D_simpleFoam
|
||||
runApplication extrudeMesh
|
||||
runApplication createPatch -overwrite
|
||||
cp -r 0.org 0
|
||||
runApplication simpleFoam
|
||||
(
|
||||
cd wingMotion2D_simpleFoam || exit 1
|
||||
|
||||
# Copy the mesh from the steady state case and map the results to a
|
||||
# mesh motion case, then solve transient.
|
||||
cd ../wingMotion2D_pimpleDyMFoam
|
||||
cp -r ../wingMotion2D_simpleFoam/constant/polyMesh constant
|
||||
cp -r 0.org 0
|
||||
runApplication mapFields ../wingMotion2D_simpleFoam -sourceTime latestTime -consistent
|
||||
mv 0/pointDisplacement.unmapped 0/pointDisplacement
|
||||
runApplication decomposePar
|
||||
runParallel `getApplication`
|
||||
runApplication reconstructPar
|
||||
runApplication extrudeMesh
|
||||
runApplication createPatch -overwrite
|
||||
restore0Dir
|
||||
runApplication simpleFoam
|
||||
)
|
||||
|
||||
# Copy mesh from the steady state case, map the results to a mesh motion case,
|
||||
# then solve transient.
|
||||
(
|
||||
cd wingMotion2D_pimpleDyMFoam || exit 1
|
||||
|
||||
\rm -rf constant/polyMesh
|
||||
\cp -r ../wingMotion2D_simpleFoam/constant/polyMesh constant
|
||||
restore0Dir
|
||||
runApplication mapFields ../wingMotion2D_simpleFoam -sourceTime latestTime -consistent
|
||||
\mv 0/pointDisplacement.unmapped 0/pointDisplacement
|
||||
runApplication decomposePar
|
||||
runParallel $(getApplication)
|
||||
runApplication reconstructPar
|
||||
)
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -11,7 +11,7 @@ runApplication blockMesh
|
||||
# Create faceZones for baffles and fan
|
||||
runApplication topoSet
|
||||
|
||||
cp -r 0.org 0
|
||||
restore0Dir
|
||||
|
||||
# Create wall and cyclic baffles and the fields on them
|
||||
runApplication createBaffles -overwrite
|
||||
|
||||
@ -31,7 +31,7 @@ then
|
||||
cloneParallelCase motorBike motorBikeLES
|
||||
|
||||
# Do the LES case
|
||||
cp lesFiles/Allrun motorBikeLES/
|
||||
\cp lesFiles/Allrun motorBikeLES/
|
||||
(cd motorBikeLES && foamRunTutorials)
|
||||
fi
|
||||
|
||||
|
||||
@ -4,12 +4,13 @@
|
||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||
|
||||
# Set-up the LES case
|
||||
cp ../lesFiles/fvS* ../lesFiles/controlDict system/
|
||||
cp ../lesFiles/turbulenceProperties constant/
|
||||
\cp ../lesFiles/fvS* ../lesFiles/controlDict system/
|
||||
\cp ../lesFiles/turbulenceProperties constant/
|
||||
|
||||
ls -d processor* | xargs -I {} rm -rf ./{}/0 $1
|
||||
ls -d processor* | xargs -I {} mv ./{}/500 ./{}/0 $1
|
||||
ls -d processor* | xargs -I {} rm -rf ./{}/0/uniform $1
|
||||
# $1 for special test cases?
|
||||
\ls -d processor* | xargs -I {} \rm -rf ./{}/0 $1
|
||||
\ls -d processor* | xargs -I {} \mv ./{}/500 ./{}/0 $1
|
||||
\ls -d processor* | xargs -I {} \rm -rf ./{}/0/uniform $1
|
||||
|
||||
runParallel pisoFoam
|
||||
|
||||
|
||||
@ -5,26 +5,27 @@ cd ${0%/*} || exit 1 # Run from this directory
|
||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||
|
||||
# copy motorbike surface from resources directory
|
||||
cp $FOAM_TUTORIALS/resources/geometry/motorBike.obj.gz constant/triSurface/
|
||||
\cp $FOAM_TUTORIALS/resources/geometry/motorBike.obj.gz constant/triSurface/
|
||||
|
||||
# Make dummy 0 directory
|
||||
mkdir 0
|
||||
|
||||
runApplication blockMesh
|
||||
# cp system/decomposeParDict.hierarchical system/decomposeParDict
|
||||
# \cp system/decomposeParDict.hierarchical system/decomposeParDict
|
||||
runApplication decomposePar -decomposeParDict system/decomposeParDict.hierarchical
|
||||
|
||||
# cp system/decomposeParDict.ptscotch system/decomposeParDict
|
||||
# \cp system/decomposeParDict.ptscotch system/decomposeParDict
|
||||
runParallel snappyHexMesh -decomposeParDict system/decomposeParDict.ptscotch -profiling -overwrite -parallel
|
||||
|
||||
find . -type f -iname "*level*" -exec rm {} \;
|
||||
|
||||
ls -d processor* | xargs -I {} cp -r 0.org ./{}/0 $1
|
||||
#- set the initial fields
|
||||
# $1 for special test cases?
|
||||
\ls -d processor* | xargs -I {} \rm -rf ./{}/0 $1
|
||||
\ls -d processor* | xargs -I {} \cp -r 0.org ./{}/0 $1
|
||||
|
||||
runParallel renumberMesh -overwrite
|
||||
|
||||
runParallel potentialFoam -initialiseUBCs
|
||||
|
||||
runParallel `getApplication`
|
||||
runParallel $(getApplication)
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@ -5,7 +5,7 @@ cd ${0%/*} || exit 1 # Run from this directory
|
||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||
|
||||
# copy motorbike surface from resources directory
|
||||
cp $FOAM_TUTORIALS/resources/geometry/motorBike.obj.gz constant/triSurface/
|
||||
\cp $FOAM_TUTORIALS/resources/geometry/motorBike.obj.gz constant/triSurface/
|
||||
runApplication surfaceFeatureExtract
|
||||
|
||||
runApplication blockMesh
|
||||
@ -13,12 +13,12 @@ runApplication blockMesh
|
||||
runApplication decomposePar
|
||||
runParallel snappyHexMesh -overwrite
|
||||
|
||||
#- For non-parallel running
|
||||
#cp -r 0.org 0 > /dev/null 2>&1
|
||||
#- For non-parallel running: - set the initial fields
|
||||
# restore0Dir
|
||||
|
||||
#- For parallel running
|
||||
ls -d processor* | xargs -I {} rm -rf ./{}/0
|
||||
ls -d processor* | xargs -I {} cp -r 0.org ./{}/0
|
||||
#- For parallel running: set the initial fields
|
||||
\ls -d processor* | xargs -I {} \rm -rf ./{}/0
|
||||
\ls -d processor* | xargs -I {} \cp -r 0.org ./{}/0
|
||||
|
||||
runParallel patchSummary
|
||||
runParallel potentialFoam
|
||||
|
||||
@ -10,7 +10,8 @@ application=`getApplication`
|
||||
runApplication blockMesh
|
||||
runApplication topoSet
|
||||
runApplication refineHexMesh c0 -overwrite
|
||||
cp -r 0.org 0
|
||||
|
||||
restore0Dir
|
||||
|
||||
#runApplication $application
|
||||
runApplication decomposePar -cellDist
|
||||
|
||||
@ -16,7 +16,9 @@ runParallel snappyHexMesh -overwrite
|
||||
|
||||
find . -type f -iname "*level*" -exec rm {} \;
|
||||
|
||||
ls -d processor* | xargs -I {} cp -r 0.org ./{}/0
|
||||
# - set the initial fields
|
||||
\ls -d processor* | xargs -I {} \rm -rf ./{}/0
|
||||
\ls -d processor* | xargs -I {} \cp -r 0.org ./{}/0
|
||||
|
||||
runParallel topoSet
|
||||
runParallel `getApplication`
|
||||
|
||||
Reference in New Issue
Block a user