diff --git a/bin/tools/RunFunctions b/bin/tools/RunFunctions index 407800e791718f91d82157382a080c6162e29c59..8bd7b2f5d1a2bb8f8b4e0486ad89a736275916ee 100755 --- a/bin/tools/RunFunctions +++ b/bin/tools/RunFunctions @@ -41,7 +41,7 @@ isTest() getNumberOfProcessors() { - if [ -f $1 ] + if [ -f "$1" ] then expandDictionary $1 | sed -ne 's/^numberOfSubdomains\s*\(.*\);/\1/p' fi @@ -166,7 +166,7 @@ compileApplication() cloneCase() { - if [ -d $2 ] + if [ -d "$2" ] then echo "Case already cloned: remove case directory $2 to clone" else @@ -175,9 +175,22 @@ cloneCase() cpfiles="0 system constant" for f in $cpfiles do - cp -r $1/$f $2 + \cp -r $1/$f $2 done fi } +# Overwrite 0/ with the contents of 0.org/ if it exists +restore0Dir() +{ + echo "Restore 0/ from 0.org/" + if [ -d 0.org ] + then + \rm -rf 0 + \cp -r 0.org 0 > /dev/null 2>&1 + else + echo " Warning: no 0.org/ found" + fi +} + #------------------------------------------------------------------------------ diff --git a/tutorials/basic/potentialFoam/cylinder/Allrun b/tutorials/basic/potentialFoam/cylinder/Allrun index d8a1591738f2fa09a5413049a8b7d28190e12119..d078c47a0e8ff0e37c2e1162096770baf889a40e 100755 --- a/tutorials/basic/potentialFoam/cylinder/Allrun +++ b/tutorials/basic/potentialFoam/cylinder/Allrun @@ -6,7 +6,7 @@ cd ${0%/*} || exit 1 # Run from this directory application=`getApplication` -cp -r 0.org 0 > /dev/null 2>&1 +restore0Dir runApplication blockMesh runApplication $application -withFunctionObjects -writePhi -writep runApplication streamFunction diff --git a/tutorials/basic/potentialFoam/pitzDaily/Allrun b/tutorials/basic/potentialFoam/pitzDaily/Allrun index 3383ef1dad75f515d9f84bf358665b43d3efcd4e..d74cf54ec0b0fd76be9b34a2e93087ff713fab91 100755 --- a/tutorials/basic/potentialFoam/pitzDaily/Allrun +++ b/tutorials/basic/potentialFoam/pitzDaily/Allrun @@ -6,7 +6,7 @@ cd ${0%/*} || exit 1 # Run from this directory application=`getApplication` -cp -r 0.org 0 > /dev/null 2>&1 +restore0Dir runApplication blockMesh runApplication $application -writePhi -writep runApplication streamFunction diff --git a/tutorials/combustion/PDRFoam/flamePropagationWithObstacles/Allrun b/tutorials/combustion/PDRFoam/flamePropagationWithObstacles/Allrun index e00af435e67ec22103c9afd04b6c2f0308f84673..5c5ee5cabff494542f1c53f6fe23b763576ec65f 100755 --- a/tutorials/combustion/PDRFoam/flamePropagationWithObstacles/Allrun +++ b/tutorials/combustion/PDRFoam/flamePropagationWithObstacles/Allrun @@ -5,8 +5,7 @@ cd ${0%/*} || exit 1 # Run from this directory # Source tutorial run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions -rm -rf 0 -cp -r 0.org 0 +restore0Dir runApplication blockMesh runApplication changeDictionary runApplication topoSet diff --git a/tutorials/combustion/XiDyMFoam/annularCombustorTurbine/Allrun b/tutorials/combustion/XiDyMFoam/annularCombustorTurbine/Allrun index 595770a6d1448cf428f609ff87b6bf002b9547de..d79a59a4f59e8ef02bd59f191e78813ec1261ace 100755 --- a/tutorials/combustion/XiDyMFoam/annularCombustorTurbine/Allrun +++ b/tutorials/combustion/XiDyMFoam/annularCombustorTurbine/Allrun @@ -6,12 +6,12 @@ cd ${0%/*} || exit 1 ./Allrun.mesh -rm -rf 0 && cp -r 0.org 0 +restore0Dir runApplication decomposePar -force runParallel potentialFoam -pName pPotential -initialiseUBCs -rm -f processor*/0/phi +\rm -f processor*/0/phi runParallel XiDyMFoam diff --git a/tutorials/compressible/rhoCentralFoam/shockTube/Allclean b/tutorials/compressible/rhoCentralFoam/shockTube/Allclean index 416eb9a89d9725fbe8eb68042225b95bf4c2bc5e..a52c67d9c53448c54fbf547d0fe8d569aabace28 100755 --- a/tutorials/compressible/rhoCentralFoam/shockTube/Allclean +++ b/tutorials/compressible/rhoCentralFoam/shockTube/Allclean @@ -4,8 +4,8 @@ cd ${0%/*} || exit 1 # Run from this directory # Source tutorial clean functions . $WM_PROJECT_DIR/bin/tools/CleanFunctions -rm -rf 0 -cp -r 0.org 0 +\rm -rf 0 +\cp -r 0.org 0 cleanCase cleanSamples diff --git a/tutorials/compressible/rhoPimpleDyMFoam/annularThermalMixer/Allrun b/tutorials/compressible/rhoPimpleDyMFoam/annularThermalMixer/Allrun index 24b623744936ea2729177eb4c60d5568a7e0b1cb..07492af16c318fe77cfd5ce17b8ea6e3741df09d 100755 --- a/tutorials/compressible/rhoPimpleDyMFoam/annularThermalMixer/Allrun +++ b/tutorials/compressible/rhoPimpleDyMFoam/annularThermalMixer/Allrun @@ -9,14 +9,12 @@ runApplication surfaceFeatureExtract runApplication blockMesh runApplication snappyHexMesh -overwrite -if [ -d 0 ] ; then - rm -rf 0 -fi +\rm -rf 0 runApplication createBaffles -overwrite runApplication mergeOrSplitBaffles -split -overwrite -cp -r 0.org 0 +restore0Dir runApplication $(getApplication) diff --git a/tutorials/compressible/sonicFoam/laminar/shockTube/Allclean b/tutorials/compressible/sonicFoam/laminar/shockTube/Allclean index a0d99d7592b95b40323d2be71a2c72b161434323..298f96e2992aa4cc27649416fcb19daf416361d6 100755 --- a/tutorials/compressible/sonicFoam/laminar/shockTube/Allclean +++ b/tutorials/compressible/sonicFoam/laminar/shockTube/Allclean @@ -5,8 +5,8 @@ cd ${0%/*} || exit 1 # Run from this directory . $WM_PROJECT_DIR/bin/tools/CleanFunctions cleanCase -rm -rf 0 -cp -r 0.org 0 +\rm -rf 0 +\cp -r 0.org 0 cleanSamples #------------------------------------------------------------------------------ diff --git a/tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/hotRoom/Allrun b/tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/hotRoom/Allrun index 0ecf4b2d131e04439b920ab89e582a41b75ef79b..d0075b1529e0f70ceebc642f890adae0004e8906 100755 --- a/tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/hotRoom/Allrun +++ b/tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/hotRoom/Allrun @@ -7,7 +7,7 @@ cd ${0%/*} || exit 1 # Run from this directory application=`getApplication` runApplication blockMesh -cp 0/T.org 0/T +\cp 0/T.org 0/T runApplication setFields runApplication $application diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/Allrun b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/Allrun index 0ecf4b2d131e04439b920ab89e582a41b75ef79b..d0075b1529e0f70ceebc642f890adae0004e8906 100755 --- a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/Allrun +++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/Allrun @@ -7,7 +7,7 @@ cd ${0%/*} || exit 1 # Run from this directory application=`getApplication` runApplication blockMesh -cp 0/T.org 0/T +\cp 0/T.org 0/T runApplication setFields runApplication $application diff --git a/tutorials/heatTransfer/buoyantPimpleFoam/hotRoom/Allclean b/tutorials/heatTransfer/buoyantPimpleFoam/hotRoom/Allclean index 6fe57d72bb88c7736433c3c3f301d03fd4930d17..c61a79c8105c65174ff51ea0774bde748d3fad15 100755 --- a/tutorials/heatTransfer/buoyantPimpleFoam/hotRoom/Allclean +++ b/tutorials/heatTransfer/buoyantPimpleFoam/hotRoom/Allclean @@ -5,6 +5,6 @@ cd ${0%/*} || exit 1 # Run from this directory . $WM_PROJECT_DIR/bin/tools/CleanFunctions cleanCase -cp 0/T.org 0/T +\cp 0/T.org 0/T #------------------------------------------------------------------------------ diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/Allrun b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/Allrun index e60b87bdff8224623c169366f20e327989a4e867..152d9d9187075c317f842c5cfbc458aba7e2f854 100755 --- a/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/Allrun +++ b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/Allrun @@ -6,7 +6,7 @@ application=`getApplication` runApplication blockMesh -cp -r 0.org 0 +restore0Dir # Create 1D and 3D baffles runApplication createBaffles -overwrite diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/windshieldCondensation/Allrun b/tutorials/heatTransfer/chtMultiRegionFoam/windshieldCondensation/Allrun index 0330f6a530dd38e970d6ebf0873b22443bd11a53..b75fde5c9ae8f36318c4379bf242a02aa14b428f 100755 --- a/tutorials/heatTransfer/chtMultiRegionFoam/windshieldCondensation/Allrun +++ b/tutorials/heatTransfer/chtMultiRegionFoam/windshieldCondensation/Allrun @@ -21,7 +21,6 @@ rm log.topoSet runApplication topoSet -region cabin -dict system/topoSetDictRegister # set the initial fields -rm -rf 0 -cp -rf 0.org 0 +restore0Dir runApplication $(getApplication) diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/windshieldDefrost/Allrun.pre b/tutorials/heatTransfer/chtMultiRegionFoam/windshieldDefrost/Allrun.pre index f22237bf9d32d1eb9d350251e6e9877b4824c03f..0818ebd1a40260e62abc584c3d06d02b8eeaa0d3 100755 --- a/tutorials/heatTransfer/chtMultiRegionFoam/windshieldDefrost/Allrun.pre +++ b/tutorials/heatTransfer/chtMultiRegionFoam/windshieldDefrost/Allrun.pre @@ -17,5 +17,4 @@ runApplication subsetMesh c0 -patch walls -overwrite runApplication splitMeshRegions -cellZones -overwrite # set the initial fields -rm -rf 0 -cp -rf 0.org 0 +restore0Dir diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/Allrun.pre b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/Allrun.pre index 020b201778e407bdb250930be2a642fec4faffec..9780d15756a99cbd58fa55ac1c5c307225c28f93 100755 --- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/Allrun.pre +++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/Allrun.pre @@ -1,5 +1,4 @@ #!/bin/sh - cd ${0%/*} || exit 1 # Run from this directory # Source tutorial run functions @@ -25,5 +24,4 @@ rm -rf constant/air/polyMesh/sets paraFoam -touch -region porous paraFoam -touch -region air - -cp -rf 0.org 0 +restore0Dir diff --git a/tutorials/incompressible/pimpleDyMFoam/oscillatingInletACMI2D/Allrun.pre b/tutorials/incompressible/pimpleDyMFoam/oscillatingInletACMI2D/Allrun.pre index db20559080d46c1eb5389c8ddd1ffbcb3a8c0c36..c18efa4cc95375c8a4a5ca98b190ad4c02c4b803 100755 --- a/tutorials/incompressible/pimpleDyMFoam/oscillatingInletACMI2D/Allrun.pre +++ b/tutorials/incompressible/pimpleDyMFoam/oscillatingInletACMI2D/Allrun.pre @@ -14,4 +14,4 @@ runApplication createBaffles -overwrite # remove zero-sized patches runApplication createPatch -overwrite -cp -rf 0.org 0 +restore0Dir diff --git a/tutorials/incompressible/pimpleDyMFoam/propeller/Allrun.pre b/tutorials/incompressible/pimpleDyMFoam/propeller/Allrun.pre index e35686cce40151eb195724c43f0096d44e2a53b8..15491d569a9a750b15559cafc559e5775159516e 100755 --- a/tutorials/incompressible/pimpleDyMFoam/propeller/Allrun.pre +++ b/tutorials/incompressible/pimpleDyMFoam/propeller/Allrun.pre @@ -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 diff --git a/tutorials/incompressible/pimpleDyMFoam/wingMotion/Allclean b/tutorials/incompressible/pimpleDyMFoam/wingMotion/Allclean index f7d6ef5a87a7ae4ecf367325d09b64bda498246a..d01b222a10e303146c99367a82f47526ffaed6e7 100755 --- a/tutorials/incompressible/pimpleDyMFoam/wingMotion/Allclean +++ b/tutorials/incompressible/pimpleDyMFoam/wingMotion/Allclean @@ -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 +) diff --git a/tutorials/incompressible/pimpleDyMFoam/wingMotion/Allrun b/tutorials/incompressible/pimpleDyMFoam/wingMotion/Allrun index 997bdd6cfb8e308c6c960552cef3909f00713369..0b5930fddc5c651b82ca29b0f99359baa3948b52 100755 --- a/tutorials/incompressible/pimpleDyMFoam/wingMotion/Allrun +++ b/tutorials/incompressible/pimpleDyMFoam/wingMotion/Allrun @@ -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 - -# 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 +( + cd wingMotion2D_simpleFoam || exit 1 + + 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 +) #------------------------------------------------------------------------------ diff --git a/tutorials/incompressible/pimpleFoam/TJunctionFan/Allrun b/tutorials/incompressible/pimpleFoam/TJunctionFan/Allrun index 628bd511a9424eac90f7addd67860d518b258814..2a4548eb724e3135ee58207dc304b959dbbb9436 100755 --- a/tutorials/incompressible/pimpleFoam/TJunctionFan/Allrun +++ b/tutorials/incompressible/pimpleFoam/TJunctionFan/Allrun @@ -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 diff --git a/tutorials/incompressible/pisoFoam/les/motorBike/Allrun b/tutorials/incompressible/pisoFoam/les/motorBike/Allrun index 15e3932e9e01c5ce530208c23cc3acca4ef67ccf..6c45de5d8740220319be6578e7662c9c584eb552 100755 --- a/tutorials/incompressible/pisoFoam/les/motorBike/Allrun +++ b/tutorials/incompressible/pisoFoam/les/motorBike/Allrun @@ -31,7 +31,7 @@ then cloneParallelCase motorBike motorBikeLES # Do the LES case - cp lesFiles/Allrun motorBikeLES/ + \cp lesFiles/Allrun motorBikeLES/ (cd motorBikeLES && foamRunTutorials) fi diff --git a/tutorials/incompressible/pisoFoam/les/motorBike/lesFiles/Allrun b/tutorials/incompressible/pisoFoam/les/motorBike/lesFiles/Allrun index be0ad68bf8d0eeedf28a164a183ebcc1d08c9fcf..eb23f3566e0a555844d786820c761bc32dd5cb82 100755 --- a/tutorials/incompressible/pisoFoam/les/motorBike/lesFiles/Allrun +++ b/tutorials/incompressible/pisoFoam/les/motorBike/lesFiles/Allrun @@ -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 diff --git a/tutorials/incompressible/pisoFoam/les/motorBike/motorBike/Allrun b/tutorials/incompressible/pisoFoam/les/motorBike/motorBike/Allrun index 3aa5f32e812cf1197f75c618c713ca043f140014..9d825fda1823d2dcbc2a91f59af8cccf98205e26 100755 --- a/tutorials/incompressible/pisoFoam/les/motorBike/motorBike/Allrun +++ b/tutorials/incompressible/pisoFoam/les/motorBike/motorBike/Allrun @@ -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) #------------------------------------------------------------------------------ diff --git a/tutorials/incompressible/simpleFoam/motorBike/Allrun b/tutorials/incompressible/simpleFoam/motorBike/Allrun index 39b3f3785b7003711d021432eb89281e5582f37a..7400dfe8c1d16959ab6a4cf839780d1c77b618b9 100755 --- a/tutorials/incompressible/simpleFoam/motorBike/Allrun +++ b/tutorials/incompressible/simpleFoam/motorBike/Allrun @@ -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 diff --git a/tutorials/incompressible/simpleFoam/pipeCyclic/Allrun b/tutorials/incompressible/simpleFoam/pipeCyclic/Allrun index 8d9f834d23ca2bf9b18061d35c71787dd7cc86a8..2276ebb55f88048640e9aec4450977a04c2d75cf 100755 --- a/tutorials/incompressible/simpleFoam/pipeCyclic/Allrun +++ b/tutorials/incompressible/simpleFoam/pipeCyclic/Allrun @@ -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 diff --git a/tutorials/incompressible/simpleFoam/turbineSiting/Allrun b/tutorials/incompressible/simpleFoam/turbineSiting/Allrun index c8ff7fbe9db40baba8d57759e10e0f6f8772ddf4..47f3b9caf34ccb3a4a1186f0440ab2e7e21afac0 100755 --- a/tutorials/incompressible/simpleFoam/turbineSiting/Allrun +++ b/tutorials/incompressible/simpleFoam/turbineSiting/Allrun @@ -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` diff --git a/tutorials/lagrangian/icoUncoupledKinematicParcelFoam/hopper/Allclean b/tutorials/lagrangian/icoUncoupledKinematicParcelFoam/hopper/Allclean index 7e6645913764bac716ad9e5ef6a80da9b096aaee..85527724bf1755a5b4ddb251062932f53faba38f 100755 --- a/tutorials/lagrangian/icoUncoupledKinematicParcelFoam/hopper/Allclean +++ b/tutorials/lagrangian/icoUncoupledKinematicParcelFoam/hopper/Allclean @@ -4,11 +4,17 @@ cd ${0%/*} || exit 1 # Run from this directory # Source tutorial run functions . $WM_PROJECT_DIR/bin/tools/CleanFunctions -cd hopperInitialState -cleanCase +( + cd hopperInitialState || exit 1 -cd ../hopperEmptying -cleanCase -rm -rf 0 + cleanCase +) + +( + cd hopperEmptying || exit 1 + + cleanCase + rm -rf 0 +) #------------------------------------------------------------------------------ diff --git a/tutorials/lagrangian/icoUncoupledKinematicParcelFoam/hopper/Allrun b/tutorials/lagrangian/icoUncoupledKinematicParcelFoam/hopper/Allrun index 6a0667ccb8449a8adcaedfef8319a6ecb176a017..2beb0f035509562c26da5d2964da525345acd898 100755 --- a/tutorials/lagrangian/icoUncoupledKinematicParcelFoam/hopper/Allrun +++ b/tutorials/lagrangian/icoUncoupledKinematicParcelFoam/hopper/Allrun @@ -4,20 +4,24 @@ cd ${0%/*} || exit 1 # Run from this directory # Source tutorial run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions -cd hopperInitialState -runApplication blockMesh -runApplication decomposePar -runParallel `getApplication` -runApplication reconstructPar -latestTime -cd .. +( + cd hopperInitialState || exit 1 -cd hopperEmptying -rm -rf 0 -cp -r 0.org 0 -runApplication blockMesh -runApplication mapFields ../hopperInitialState -sourceTime latestTime -runApplication decomposePar -runParallel `getApplication` -runApplication reconstructPar + runApplication blockMesh + runApplication decomposePar + runParallel $(getApplication) + runApplication reconstructPar -latestTime +) + +( + cd hopperEmptying || exit 1 + + restore0Dir + runApplication blockMesh + runApplication mapFields ../hopperInitialState -sourceTime latestTime + runApplication decomposePar + runParallel $(getApplication) + runApplication reconstructPar +) #------------------------------------------------------------------------------ diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/cylinder/Allrun.pre b/tutorials/lagrangian/reactingParcelFilmFoam/cylinder/Allrun.pre index ae65df0e2591de6620bef310130590ead5e4e323..e4d467e68eef7219e9d33d3b22a4b5a4adb8e7c6 100755 --- a/tutorials/lagrangian/reactingParcelFilmFoam/cylinder/Allrun.pre +++ b/tutorials/lagrangian/reactingParcelFilmFoam/cylinder/Allrun.pre @@ -1,7 +1,7 @@ #!/bin/sh . $WM_PROJECT_DIR/bin/tools/RunFunctions -cp -rf 0.org 0 +restore0Dir runApplication blockMesh #runApplication setSet -batch wallFilmRegion.setSet diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/Allrun.pre b/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/Allrun.pre index 784b007b2c128a47398e9bb2266add5f8495ab93..ab63cbf9b3afd05b9472fc6bbda7f45e8dce04b5 100755 --- a/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/Allrun.pre +++ b/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/Allrun.pre @@ -4,7 +4,7 @@ cd ${0%/*} || exit 1 # Run from this directory # Source tutorial run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions -cp -rf 0.org 0 +restore0Dir # create the underlying block mesh runApplication blockMesh diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/rivuletPanel/Allrun.pre b/tutorials/lagrangian/reactingParcelFilmFoam/rivuletPanel/Allrun.pre index d00e6b23ff0cb06a855c516123420d3a01d0639d..c82f75cd2dda061eb12b224966dc1ba98d153bba 100755 --- a/tutorials/lagrangian/reactingParcelFilmFoam/rivuletPanel/Allrun.pre +++ b/tutorials/lagrangian/reactingParcelFilmFoam/rivuletPanel/Allrun.pre @@ -1,7 +1,7 @@ #!/bin/sh . $WM_PROJECT_DIR/bin/tools/RunFunctions -cp -rf 0.org 0 +restore0Dir runApplication blockMesh diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/splashPanel/Allrun.pre b/tutorials/lagrangian/reactingParcelFilmFoam/splashPanel/Allrun.pre index 512715678f49206e4727aeef3f39ecf25a1114de..9292f83031bdfea5e212528f1373fe8e61042382 100755 --- a/tutorials/lagrangian/reactingParcelFilmFoam/splashPanel/Allrun.pre +++ b/tutorials/lagrangian/reactingParcelFilmFoam/splashPanel/Allrun.pre @@ -1,7 +1,7 @@ #!/bin/sh . $WM_PROJECT_DIR/bin/tools/RunFunctions -cp -rf 0.org 0 +restore0Dir runApplication blockMesh diff --git a/tutorials/lagrangian/reactingParcelFoam/filter/Allclean b/tutorials/lagrangian/reactingParcelFoam/filter/Allclean index a298a17347fb11180b118d58176da9d590322bea..0949f3df045e220253ba42afe4f160611201b401 100755 --- a/tutorials/lagrangian/reactingParcelFoam/filter/Allclean +++ b/tutorials/lagrangian/reactingParcelFoam/filter/Allclean @@ -6,13 +6,10 @@ cd ${0%/*} || exit 1 # Run from this directory cleanCase -# remove 0 directory -rm -rf 0 +# remove 0 directory and post-processing directories +\rm -rf 0 postProcessing -# remove post-processing directory -rm -rf postProcessing - -# copy 0.org to 0 -cp -r 0.org 0 +# restore 0/ directory from 0.org/ +\cp -r 0.org 0 #------------------------------------------------------------------------------ diff --git a/tutorials/lagrangian/reactingParcelFoam/verticalChannel/Allrun b/tutorials/lagrangian/reactingParcelFoam/verticalChannel/Allrun index 35dc16c075d91d91b244bc9bb9b426964f569404..a2fca0a807926872c2a96c80e2db8033da34e0bd 100755 --- a/tutorials/lagrangian/reactingParcelFoam/verticalChannel/Allrun +++ b/tutorials/lagrangian/reactingParcelFoam/verticalChannel/Allrun @@ -7,12 +7,12 @@ cd ${0%/*} || exit 1 # Run from this directory # create mesh runApplication blockMesh -cp -r 0.org 0 +restore0Dir # initialise with potentialFoam solution runApplication potentialFoam -rm -f 0/phi +\rm -f 0/phi # run the solver runApplication `getApplication` diff --git a/tutorials/lagrangian/reactingParcelFoam/verticalChannelLTS/Allrun b/tutorials/lagrangian/reactingParcelFoam/verticalChannelLTS/Allrun index 35dc16c075d91d91b244bc9bb9b426964f569404..a2fca0a807926872c2a96c80e2db8033da34e0bd 100755 --- a/tutorials/lagrangian/reactingParcelFoam/verticalChannelLTS/Allrun +++ b/tutorials/lagrangian/reactingParcelFoam/verticalChannelLTS/Allrun @@ -7,12 +7,12 @@ cd ${0%/*} || exit 1 # Run from this directory # create mesh runApplication blockMesh -cp -r 0.org 0 +restore0Dir # initialise with potentialFoam solution runApplication potentialFoam -rm -f 0/phi +\rm -f 0/phi # run the solver runApplication `getApplication` diff --git a/tutorials/lagrangian/simpleReactingParcelFoam/verticalChannel/Allclean b/tutorials/lagrangian/simpleReactingParcelFoam/verticalChannel/Allclean index fa0d0929d9603d7d2e4b639d9255e7d07fe0545d..dae58cf5bc5cb8c37554502912f5c358637aa863 100755 --- a/tutorials/lagrangian/simpleReactingParcelFoam/verticalChannel/Allclean +++ b/tutorials/lagrangian/simpleReactingParcelFoam/verticalChannel/Allclean @@ -5,10 +5,10 @@ cd ${0%/*} || exit 1 # Run from this directory . $WM_PROJECT_DIR/bin/tools/CleanFunctions # remove old time and post-processing directories -rm -rf 0 *[1-9]* processor* postProcessing +\rm -rf 0 *[1-9]* processor* postProcessing -# copy 0.org to 0 -cp -r 0.org 0 +# restore 0/ directory from 0.org/ +\cp -r 0.org 0 cleanCase diff --git a/tutorials/lagrangian/simpleReactingParcelFoam/verticalChannel/Allrun b/tutorials/lagrangian/simpleReactingParcelFoam/verticalChannel/Allrun index 94c17f61f5b8f414e5cd35b0e1812125168bdba8..a4698df1e26e7f0f62dc322d80187bd491337d14 100755 --- a/tutorials/lagrangian/simpleReactingParcelFoam/verticalChannel/Allrun +++ b/tutorials/lagrangian/simpleReactingParcelFoam/verticalChannel/Allrun @@ -4,15 +4,14 @@ cd ${0%/*} || exit 1 # Run from this directory # Source tutorial run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions -rm -rf 0 -cp -rf 0.org 0 +restore0Dir runApplication blockMesh runApplication potentialFoam # remove incompatible (volumetric) flux field -rm -f 0/phi +\rm -f 0/phi 2>/dev/null runApplication $(getApplication) diff --git a/tutorials/mesh/foamyHexMesh/mixerVessel/Allrun-simulation b/tutorials/mesh/foamyHexMesh/mixerVessel/Allrun-simulation index 6d2f7197876afc0a9f174885ccb8e903546effea..5041d32a5589d8d2b21c64e8fbfb9bb5d3830003 100755 --- a/tutorials/mesh/foamyHexMesh/mixerVessel/Allrun-simulation +++ b/tutorials/mesh/foamyHexMesh/mixerVessel/Allrun-simulation @@ -18,7 +18,7 @@ runApplication mergeOrSplitBaffles -split -overwrite runApplication createPatch -overwrite # Copy fields after meshing to avoind the generation of unnecessary patch fields -\cp -r 0.org 0 +restore0Dir # Initialize alpha runApplication setFields diff --git a/tutorials/mesh/foamyQuadMesh/OpenCFD/Allrun-rhoCentralFoam b/tutorials/mesh/foamyQuadMesh/OpenCFD/Allrun-rhoCentralFoam index 8ab7ec82512e37c4c62a8512aaa8647065541121..266fee9c0b4af31482c6c6f707c4c4c51f9b9882 100755 --- a/tutorials/mesh/foamyQuadMesh/OpenCFD/Allrun-rhoCentralFoam +++ b/tutorials/mesh/foamyQuadMesh/OpenCFD/Allrun-rhoCentralFoam @@ -4,8 +4,8 @@ cd ${0%/*} || exit 1 # Run from this directory # Source tutorial run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions -cp system/controlDict.rhoCentralFoam system/controlDict -cp -r 0.org 0 +\cp system/controlDict.rhoCentralFoam system/controlDict +restore0Dir runApplication decomposePar runParallel rhoCentralFoam diff --git a/tutorials/mesh/parallel/filter/Allrun b/tutorials/mesh/parallel/filter/Allrun index 9dabedb155fce0535a3214c27dfa6fc4d3d1e938..e1c37c3dd1e0479f0bc8b20b4e0a4ab5125857db 100755 --- a/tutorials/mesh/parallel/filter/Allrun +++ b/tutorials/mesh/parallel/filter/Allrun @@ -10,7 +10,7 @@ application=$(getApplication) runApplication blockMesh # Copy 0.org to 0 -cp -r 0.org 0 +restore0Dir # Create sets runApplication topoSet diff --git a/tutorials/multiphase/MPPICInterFoam/twoPhasePachuka/Allrun b/tutorials/multiphase/MPPICInterFoam/twoPhasePachuka/Allrun index deec9791eac01497cb8186f83b9d4a1eb2f01df8..30113dd833489a4f855da3bd223d95bc6166f6e5 100755 --- a/tutorials/multiphase/MPPICInterFoam/twoPhasePachuka/Allrun +++ b/tutorials/multiphase/MPPICInterFoam/twoPhasePachuka/Allrun @@ -13,7 +13,7 @@ m4 system/pachuka.m4 > system/blockMeshDict runApplication blockMesh -cp 0/alpha.water.org 0/alpha.water +\cp 0/alpha.water.org 0/alpha.water # create faceSet for burner inlet and faceZone for coupled wall runApplication topoSet @@ -33,4 +33,4 @@ runParallel `getApplication` # Reconstruct case runApplication reconstructPar -# ----------------------------------------------------------------- end-of-file \ No newline at end of file +# ----------------------------------------------------------------- end-of-file diff --git a/tutorials/multiphase/cavitatingFoam/les/throttle3D/Allrun b/tutorials/multiphase/cavitatingFoam/les/throttle3D/Allrun index fb55f327c68bf87cf5926194b5206b66e61254c6..af67433fb29fcf28c68be2159f438fbfaea7b3df 100755 --- a/tutorials/multiphase/cavitatingFoam/les/throttle3D/Allrun +++ b/tutorials/multiphase/cavitatingFoam/les/throttle3D/Allrun @@ -25,7 +25,7 @@ refineMeshByCellSet() done } -cp -r 0.org 0 +restore0Dir runApplication blockMesh refineMeshByCellSet 1 2 3 diff --git a/tutorials/multiphase/compressibleInterDyMFoam/ras/sloshingTank2D/Allrun b/tutorials/multiphase/compressibleInterDyMFoam/ras/sloshingTank2D/Allrun index d527e2ed86fb56c72f30dfd65beafa4b3a53a6d2..188d7f9d74b5de17c8181ad0dde5be870cd664f5 100755 --- a/tutorials/multiphase/compressibleInterDyMFoam/ras/sloshingTank2D/Allrun +++ b/tutorials/multiphase/compressibleInterDyMFoam/ras/sloshingTank2D/Allrun @@ -6,7 +6,7 @@ cd ${0%/*} || exit 1 # Run from this directory m4 system/blockMeshDict.m4 > system/blockMeshDict runApplication blockMesh -cp 0/alpha.water.org 0/alpha.water +\cp 0/alpha.water.org 0/alpha.water runApplication setFields runApplication `getApplication` diff --git a/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/Allrun b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/Allrun index 5040c29590b4a24cc09981728ae2030dc774724f..fd07af1d46bcabef45db9aad9d1c153f0f39becb 100755 --- a/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/Allrun +++ b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/Allrun @@ -5,7 +5,7 @@ cd ${0%/*} || exit 1 # Run from this directory . $WM_PROJECT_DIR/bin/tools/RunFunctions runApplication blockMesh -cp -r 0.org 0 +restore0Dir runApplication setFields runApplication $(getApplication) diff --git a/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/Allrun b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/Allrun index 4e091494f626320faf86d48b07c6e4af2b19229b..6c6dafdea44eef1c91b654482bf3be033f59bc45 100755 --- a/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/Allrun +++ b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/Allrun @@ -5,7 +5,7 @@ cd ${0%/*} || exit 1 # Run from this directory . $WM_PROJECT_DIR/bin/tools/RunFunctions runApplication blockMesh -cp -r 0.org 0 +restore0Dir runApplication setFields runApplication decomposePar runParallel $(getApplication) diff --git a/tutorials/multiphase/compressibleMultiphaseInterFoam/laminar/damBreak4phase/Allrun b/tutorials/multiphase/compressibleMultiphaseInterFoam/laminar/damBreak4phase/Allrun index b275240a50dde518b78c9e66ba0b8f558c962907..c1e4f90ab10960373faf5b63c69a9a77ce24704b 100755 --- a/tutorials/multiphase/compressibleMultiphaseInterFoam/laminar/damBreak4phase/Allrun +++ b/tutorials/multiphase/compressibleMultiphaseInterFoam/laminar/damBreak4phase/Allrun @@ -7,8 +7,7 @@ cd ${0%/*} || exit 1 # Run from this directory # Set application name application=`getApplication` -\rm -rf 0 -cp -r 0.org 0 +restore0Dir runApplication blockMesh runApplication setFields diff --git a/tutorials/multiphase/interDyMFoam/laminar/sloshingTank2D/Allrun b/tutorials/multiphase/interDyMFoam/laminar/sloshingTank2D/Allrun index d527e2ed86fb56c72f30dfd65beafa4b3a53a6d2..188d7f9d74b5de17c8181ad0dde5be870cd664f5 100755 --- a/tutorials/multiphase/interDyMFoam/laminar/sloshingTank2D/Allrun +++ b/tutorials/multiphase/interDyMFoam/laminar/sloshingTank2D/Allrun @@ -6,7 +6,7 @@ cd ${0%/*} || exit 1 # Run from this directory m4 system/blockMeshDict.m4 > system/blockMeshDict runApplication blockMesh -cp 0/alpha.water.org 0/alpha.water +\cp 0/alpha.water.org 0/alpha.water runApplication setFields runApplication `getApplication` diff --git a/tutorials/multiphase/interDyMFoam/laminar/sloshingTank2D3DoF/Allrun b/tutorials/multiphase/interDyMFoam/laminar/sloshingTank2D3DoF/Allrun index d527e2ed86fb56c72f30dfd65beafa4b3a53a6d2..188d7f9d74b5de17c8181ad0dde5be870cd664f5 100755 --- a/tutorials/multiphase/interDyMFoam/laminar/sloshingTank2D3DoF/Allrun +++ b/tutorials/multiphase/interDyMFoam/laminar/sloshingTank2D3DoF/Allrun @@ -6,7 +6,7 @@ cd ${0%/*} || exit 1 # Run from this directory m4 system/blockMeshDict.m4 > system/blockMeshDict runApplication blockMesh -cp 0/alpha.water.org 0/alpha.water +\cp 0/alpha.water.org 0/alpha.water runApplication setFields runApplication `getApplication` diff --git a/tutorials/multiphase/interDyMFoam/laminar/sloshingTank3D/Allrun b/tutorials/multiphase/interDyMFoam/laminar/sloshingTank3D/Allrun index d527e2ed86fb56c72f30dfd65beafa4b3a53a6d2..188d7f9d74b5de17c8181ad0dde5be870cd664f5 100755 --- a/tutorials/multiphase/interDyMFoam/laminar/sloshingTank3D/Allrun +++ b/tutorials/multiphase/interDyMFoam/laminar/sloshingTank3D/Allrun @@ -6,7 +6,7 @@ cd ${0%/*} || exit 1 # Run from this directory m4 system/blockMeshDict.m4 > system/blockMeshDict runApplication blockMesh -cp 0/alpha.water.org 0/alpha.water +\cp 0/alpha.water.org 0/alpha.water runApplication setFields runApplication `getApplication` diff --git a/tutorials/multiphase/interDyMFoam/laminar/sloshingTank3D3DoF/Allrun b/tutorials/multiphase/interDyMFoam/laminar/sloshingTank3D3DoF/Allrun index d527e2ed86fb56c72f30dfd65beafa4b3a53a6d2..188d7f9d74b5de17c8181ad0dde5be870cd664f5 100755 --- a/tutorials/multiphase/interDyMFoam/laminar/sloshingTank3D3DoF/Allrun +++ b/tutorials/multiphase/interDyMFoam/laminar/sloshingTank3D3DoF/Allrun @@ -6,7 +6,7 @@ cd ${0%/*} || exit 1 # Run from this directory m4 system/blockMeshDict.m4 > system/blockMeshDict runApplication blockMesh -cp 0/alpha.water.org 0/alpha.water +\cp 0/alpha.water.org 0/alpha.water runApplication setFields runApplication `getApplication` diff --git a/tutorials/multiphase/interDyMFoam/laminar/sloshingTank3D6DoF/Allrun b/tutorials/multiphase/interDyMFoam/laminar/sloshingTank3D6DoF/Allrun index d527e2ed86fb56c72f30dfd65beafa4b3a53a6d2..188d7f9d74b5de17c8181ad0dde5be870cd664f5 100755 --- a/tutorials/multiphase/interDyMFoam/laminar/sloshingTank3D6DoF/Allrun +++ b/tutorials/multiphase/interDyMFoam/laminar/sloshingTank3D6DoF/Allrun @@ -6,7 +6,7 @@ cd ${0%/*} || exit 1 # Run from this directory m4 system/blockMeshDict.m4 > system/blockMeshDict runApplication blockMesh -cp 0/alpha.water.org 0/alpha.water +\cp 0/alpha.water.org 0/alpha.water runApplication setFields runApplication `getApplication` diff --git a/tutorials/multiphase/interDyMFoam/laminar/testTubeMixer/Allrun b/tutorials/multiphase/interDyMFoam/laminar/testTubeMixer/Allrun index f49fa8dbc487057f01108bfe25b2504f8a0e3f32..44e088cf91868526a521af6fb3541ac10c1bca83 100755 --- a/tutorials/multiphase/interDyMFoam/laminar/testTubeMixer/Allrun +++ b/tutorials/multiphase/interDyMFoam/laminar/testTubeMixer/Allrun @@ -5,7 +5,7 @@ cd ${0%/*} || exit 1 # Run from this directory . $WM_PROJECT_DIR/bin/tools/RunFunctions runApplication blockMesh -cp 0/alpha.water.org 0/alpha.water +\cp 0/alpha.water.org 0/alpha.water runApplication setFields runApplication `getApplication` diff --git a/tutorials/multiphase/interDyMFoam/ras/DTCHull/Allrun b/tutorials/multiphase/interDyMFoam/ras/DTCHull/Allrun index 49e618ecd4306a7f4a56bd195335249ab87a3f1e..3eddb17d71b5821e9b7a7c99afc39b37f5a06e8f 100755 --- a/tutorials/multiphase/interDyMFoam/ras/DTCHull/Allrun +++ b/tutorials/multiphase/interDyMFoam/ras/DTCHull/Allrun @@ -5,10 +5,9 @@ cd ${0%/*} || exit 1 # Run from this directory . $WM_PROJECT_DIR/bin/tools/RunFunctions # copy DTC hull surface from resources folder -cp $FOAM_TUTORIALS/resources/geometry/DTC-scaled.stl.gz constant/triSurface/ +\cp $FOAM_TUTORIALS/resources/geometry/DTC-scaled.stl.gz constant/triSurface/ runApplication surfaceFeatureExtract - runApplication blockMesh for i in 1 2 3 4 5 6 @@ -21,18 +20,11 @@ do done runApplication snappyHexMesh -overwrite - -\rm -rf 0 -\cp -r 0.org 0 - +restore0Dir runApplication setFields - runApplication decomposePar - runParallel renumberMesh -overwrite - runParallel $(getApplication) - runApplication reconstructPar #------------------------------------------------------------------------------ diff --git a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/Allrun b/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/Allrun index 0424df0e63df09cb7456ad5b0e4333c7fe7292b8..e181b72ab5783907e4de1a8de5cdbb83431d6ddb 100755 --- a/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/Allrun +++ b/tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle/Allrun @@ -4,7 +4,7 @@ cd ${0%/*} || exit 1 # Run from this directory # Source tutorial run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions -cp -r 0.org 0 > /dev/null 2>&1 +restore0Dir runApplication blockMesh #runApplication setSet -batch createObstacle.setSet runApplication topoSet diff --git a/tutorials/multiphase/interDyMFoam/ras/floatingObject/Allrun b/tutorials/multiphase/interDyMFoam/ras/floatingObject/Allrun index 62915ff2cf574a9e8c8f52942d41a3b189d05ecf..64732439fc731e9960f93167c1bffc0f4661a6bf 100755 --- a/tutorials/multiphase/interDyMFoam/ras/floatingObject/Allrun +++ b/tutorials/multiphase/interDyMFoam/ras/floatingObject/Allrun @@ -10,7 +10,7 @@ application=`getApplication` runApplication blockMesh runApplication topoSet runApplication subsetMesh -overwrite c0 -patch floatingObject -cp -r 0.org 0 > /dev/null 2>&1 +restore0Dir runApplication setFields runApplication $application diff --git a/tutorials/multiphase/interDyMFoam/ras/mixerVesselAMI/Allrun.pre b/tutorials/multiphase/interDyMFoam/ras/mixerVesselAMI/Allrun.pre index a491c1ae2e7aad1f1e3657cd5d6b51916b1f5f1d..6cc353f74f50f6841be86fb952b5bd9c18e98f93 100755 --- a/tutorials/multiphase/interDyMFoam/ras/mixerVesselAMI/Allrun.pre +++ b/tutorials/multiphase/interDyMFoam/ras/mixerVesselAMI/Allrun.pre @@ -16,8 +16,8 @@ runApplication snappyHexMesh -overwrite runApplication createBaffles -overwrite runApplication mergeOrSplitBaffles -split -overwrite -# Copy fields after meshing to avoind the generation of unnecessary patch fields -\cp -r 0.org 0 +# Copy fields after meshing to avoid the generation of unnecessary patch fields +restore0Dir # Initialize alpha runApplication setFields diff --git a/tutorials/multiphase/interDyMFoam/ras/motorBike/Allrun.pre b/tutorials/multiphase/interDyMFoam/ras/motorBike/Allrun.pre index 2a010de9b4a2bc29be44414963548cbf4e9b3d25..5a68a5bd0c8e0a2d9f06a42916322da55de27e07 100755 --- a/tutorials/multiphase/interDyMFoam/ras/motorBike/Allrun.pre +++ b/tutorials/multiphase/interDyMFoam/ras/motorBike/Allrun.pre @@ -5,23 +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/ runApplication surfaceFeatureExtract runApplication blockMesh +# Serial +# ------ #runApplication snappyHexMesh -overwrite #\rm -f constant/polyMesh/refinementHistory* # - set the initial fields -#cp -rf 0.org 0 +# restore0Dir #runApplication setFields +# Parallel +# -------- runApplication decomposePar -force runParallel snappyHexMesh -overwrite -ls -d processor* | xargs -I {} rm -f ./{}/constant/polyMesh/refinementHistory +\ls -d processor* | xargs -I {} rm -f ./{}/constant/polyMesh/refinementHistory # - set the initial fields -ls -d processor* | xargs -I {} rm -rf ./{}/0 -ls -d processor* | xargs -I {} cp -r 0.org ./{}/0 +\ls -d processor* | xargs -I {} \rm -rf ./{}/0 +\ls -d processor* | xargs -I {} \cp -r 0.org ./{}/0 runParallel setFields diff --git a/tutorials/multiphase/interFoam/laminar/capillaryRise/Allrun b/tutorials/multiphase/interFoam/laminar/capillaryRise/Allrun index 9a17d2d52519c474cb7af67d727fc6efdf054ed6..069d98ad5d5f2519be0737652b4cd09e0c63310e 100755 --- a/tutorials/multiphase/interFoam/laminar/capillaryRise/Allrun +++ b/tutorials/multiphase/interFoam/laminar/capillaryRise/Allrun @@ -7,7 +7,7 @@ cd ${0%/*} || exit 1 # Run from this directory application=`getApplication` runApplication blockMesh -cp 0/alpha.water.org 0/alpha.water +\cp 0/alpha.water.org 0/alpha.water runApplication setFields runApplication $application diff --git a/tutorials/multiphase/interFoam/laminar/damBreak/Allrun b/tutorials/multiphase/interFoam/laminar/damBreak/Allrun index 125f1aa53b0124fd912c1d8bfd388e8d5587fdd3..7bacb7fc1fa82d9453e89f19fff263ce60537547 100755 --- a/tutorials/multiphase/interFoam/laminar/damBreak/Allrun +++ b/tutorials/multiphase/interFoam/laminar/damBreak/Allrun @@ -34,7 +34,7 @@ cloneCase damBreak damBreakFine # Modify case setDamBreakFine - cp ../damBreak/0/alpha.water.org 0/alpha.water + \cp ../damBreak/0/alpha.water.org 0/alpha.water # And execute runApplication blockMesh runApplication setFields diff --git a/tutorials/multiphase/interFoam/laminar/damBreak/damBreak/Allclean b/tutorials/multiphase/interFoam/laminar/damBreak/damBreak/Allclean index 901c358b375a0720811db9110c71c506e1c4136d..f1696e1017ae333fb1843d5776c5bfe6916e9b50 100755 --- a/tutorials/multiphase/interFoam/laminar/damBreak/damBreak/Allclean +++ b/tutorials/multiphase/interFoam/laminar/damBreak/damBreak/Allclean @@ -5,6 +5,6 @@ cd ${0%/*} || exit 1 # Run from this directory . $WM_PROJECT_DIR/bin/tools/CleanFunctions cleanCase -cp 0/alpha.water.org 0/alpha.water +\cp 0/alpha.water.org 0/alpha.water #------------------------------------------------------------------------------ diff --git a/tutorials/multiphase/interFoam/laminar/mixerVessel2D/Allrun b/tutorials/multiphase/interFoam/laminar/mixerVessel2D/Allrun index c0a3a7154e782f3688f3ea8b21143319e16bb73b..0017d885162246edcad532b084cff9346d778a2c 100755 --- a/tutorials/multiphase/interFoam/laminar/mixerVessel2D/Allrun +++ b/tutorials/multiphase/interFoam/laminar/mixerVessel2D/Allrun @@ -7,7 +7,7 @@ cd ${0%/*} || exit 1 # Run from this directory application=`getApplication` runApplication ./makeMesh -cp 0/alpha.water.org 0/alpha.water +\cp 0/alpha.water.org 0/alpha.water runApplication setFields runApplication $application diff --git a/tutorials/multiphase/interFoam/ras/DTCHull/Allrun b/tutorials/multiphase/interFoam/ras/DTCHull/Allrun index 49e618ecd4306a7f4a56bd195335249ab87a3f1e..99249befa72e6cfcedcc2409fea6a25830f49e38 100755 --- a/tutorials/multiphase/interFoam/ras/DTCHull/Allrun +++ b/tutorials/multiphase/interFoam/ras/DTCHull/Allrun @@ -22,8 +22,7 @@ done runApplication snappyHexMesh -overwrite -\rm -rf 0 -\cp -r 0.org 0 +restore0Dir runApplication setFields diff --git a/tutorials/multiphase/interFoam/ras/damBreak/Allrun b/tutorials/multiphase/interFoam/ras/damBreak/Allrun index 125f1aa53b0124fd912c1d8bfd388e8d5587fdd3..7bacb7fc1fa82d9453e89f19fff263ce60537547 100755 --- a/tutorials/multiphase/interFoam/ras/damBreak/Allrun +++ b/tutorials/multiphase/interFoam/ras/damBreak/Allrun @@ -34,7 +34,7 @@ cloneCase damBreak damBreakFine # Modify case setDamBreakFine - cp ../damBreak/0/alpha.water.org 0/alpha.water + \cp ../damBreak/0/alpha.water.org 0/alpha.water # And execute runApplication blockMesh runApplication setFields diff --git a/tutorials/multiphase/interFoam/ras/damBreak/damBreak/Allclean b/tutorials/multiphase/interFoam/ras/damBreak/damBreak/Allclean index 901c358b375a0720811db9110c71c506e1c4136d..f1696e1017ae333fb1843d5776c5bfe6916e9b50 100755 --- a/tutorials/multiphase/interFoam/ras/damBreak/damBreak/Allclean +++ b/tutorials/multiphase/interFoam/ras/damBreak/damBreak/Allclean @@ -5,6 +5,6 @@ cd ${0%/*} || exit 1 # Run from this directory . $WM_PROJECT_DIR/bin/tools/CleanFunctions cleanCase -cp 0/alpha.water.org 0/alpha.water +\cp 0/alpha.water.org 0/alpha.water #------------------------------------------------------------------------------ diff --git a/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/Allclean b/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/Allclean index 901c358b375a0720811db9110c71c506e1c4136d..f1696e1017ae333fb1843d5776c5bfe6916e9b50 100755 --- a/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/Allclean +++ b/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/Allclean @@ -5,6 +5,6 @@ cd ${0%/*} || exit 1 # Run from this directory . $WM_PROJECT_DIR/bin/tools/CleanFunctions cleanCase -cp 0/alpha.water.org 0/alpha.water +\cp 0/alpha.water.org 0/alpha.water #------------------------------------------------------------------------------ diff --git a/tutorials/multiphase/interFoam/ras/weirOverflow/Allrun b/tutorials/multiphase/interFoam/ras/weirOverflow/Allrun index 95936e3073ebb2052013c58cccbe2932e0cdc3b9..1143e7ca7356b8e73e0273144b98745ffdce78dd 100755 --- a/tutorials/multiphase/interFoam/ras/weirOverflow/Allrun +++ b/tutorials/multiphase/interFoam/ras/weirOverflow/Allrun @@ -3,11 +3,11 @@ # Source tutorial run functions . $WM_PROJECT_DIR/bin/tools/RunFunctions -cp -r 0.org 0 > /dev/null 2>&1 +restore0Dir runApplication blockMesh -cp 0/alpha.water.org 0/alpha.water +\cp 0/alpha.water.org 0/alpha.water runApplication setFields diff --git a/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/Allrun.pre b/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/Allrun.pre index 40f5f5f1d4d88fc0f5b8a8a11173db2fa3cdae9c..0fb9f454674959f517591d165b83ab2526880ba8 100755 --- a/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/Allrun.pre +++ b/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/Allrun.pre @@ -5,17 +5,14 @@ cd ${0%/*} || exit 1 # Run from this directory . $WM_PROJECT_DIR/bin/tools/RunFunctions # copy propeller surface from resources directory -cp $FOAM_TUTORIALS/resources/geometry/propellerTip.obj.gz constant/triSurface/ +\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 @@ -27,7 +24,6 @@ runApplication renumberMesh -overwrite #runApplication setSet -batch createInletOutletSets.setSet runApplication topoSet -dict system/createInletOutletSets.topoSetDict - # - create the inlet/outlet and AMI patches runApplication createPatch -overwrite @@ -39,4 +35,4 @@ runApplication createPatch -overwrite # - apply the initial fields -cp -rf 0.org 0 +restore0Dir diff --git a/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/Allrun b/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/Allrun index dc6051766587ccb1378268930cc04cdc14e38ef9..a47054a55e31f86d01c88a91584401523d78197b 100755 --- a/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/Allrun +++ b/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/Allrun @@ -13,7 +13,7 @@ runApplication blockMesh # Generate the snappy mesh runApplication snappyHexMesh -overwrite -cp -r 0.org 0 +restore0Dir # Initialise with potentialFoam solution runApplication potentialFoam -pName p_rgh diff --git a/tutorials/multiphase/multiphaseEulerFoam/damBreak4phase/Allrun b/tutorials/multiphase/multiphaseEulerFoam/damBreak4phase/Allrun index b275240a50dde518b78c9e66ba0b8f558c962907..c1e4f90ab10960373faf5b63c69a9a77ce24704b 100755 --- a/tutorials/multiphase/multiphaseEulerFoam/damBreak4phase/Allrun +++ b/tutorials/multiphase/multiphaseEulerFoam/damBreak4phase/Allrun @@ -7,8 +7,7 @@ cd ${0%/*} || exit 1 # Run from this directory # Set application name application=`getApplication` -\rm -rf 0 -cp -r 0.org 0 +restore0Dir runApplication blockMesh runApplication setFields diff --git a/tutorials/multiphase/multiphaseEulerFoam/damBreak4phaseFine/Allrun b/tutorials/multiphase/multiphaseEulerFoam/damBreak4phaseFine/Allrun index 6103dad6287cebe2c7122d06af8103e8e117ae83..6557a49b3a661a0efccf8e779cf605881c676301 100755 --- a/tutorials/multiphase/multiphaseEulerFoam/damBreak4phaseFine/Allrun +++ b/tutorials/multiphase/multiphaseEulerFoam/damBreak4phaseFine/Allrun @@ -7,8 +7,7 @@ cd ${0%/*} || exit 1 # Run from this directory # Set application name application=`getApplication` -\rm -rf 0 -cp -r 0.org 0 +restore0Dir runApplication blockMesh runApplication setFields diff --git a/tutorials/multiphase/multiphaseInterDyMFoam/laminar/mixerVesselAMI2D/Allrun b/tutorials/multiphase/multiphaseInterDyMFoam/laminar/mixerVesselAMI2D/Allrun index d7ecd3dbdcec19d32458b234b7a967823bc895ad..e83b55a035457fd8486d475e65d1327e7e4f7ade 100755 --- a/tutorials/multiphase/multiphaseInterDyMFoam/laminar/mixerVesselAMI2D/Allrun +++ b/tutorials/multiphase/multiphaseInterDyMFoam/laminar/mixerVesselAMI2D/Allrun @@ -8,8 +8,7 @@ application=`getApplication` ./makeMesh -rm -rf 0 -cp -r 0.org 0 +restore0Dir runApplication setFields #runApplication $application diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/Allrun b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/Allrun index b275240a50dde518b78c9e66ba0b8f558c962907..c1e4f90ab10960373faf5b63c69a9a77ce24704b 100755 --- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/Allrun +++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/Allrun @@ -7,8 +7,7 @@ cd ${0%/*} || exit 1 # Run from this directory # Set application name application=`getApplication` -\rm -rf 0 -cp -r 0.org 0 +restore0Dir runApplication blockMesh runApplication setFields diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/Allrun b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/Allrun index b92d6cc19a89c59b5a27fe480f3134e4f3be27ca..6557a49b3a661a0efccf8e779cf605881c676301 100755 --- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/Allrun +++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/Allrun @@ -7,7 +7,7 @@ cd ${0%/*} || exit 1 # Run from this directory # Set application name application=`getApplication` -cp -r 0.org 0 +restore0Dir runApplication blockMesh runApplication setFields diff --git a/tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/Allrun b/tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/Allrun index 4358c300592a56d0349c1c70cbe6e687820cc130..558156dcd8c8b62e03ab2a9aec94197f210e8e17 100755 --- a/tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/Allrun +++ b/tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/Allrun @@ -18,7 +18,7 @@ runApplication -s selectBottom \ runApplication createPatch -overwrite -cp -r 0.org 0 > /dev/null 2>&1 +restore0Dir runApplication $application diff --git a/tutorials/multiphase/potentialFreeSurfaceFoam/oscillatingBox/Allrun b/tutorials/multiphase/potentialFreeSurfaceFoam/oscillatingBox/Allrun index 6514e8598bb611041d2692fa18a1e8691ac851bc..eb74ad45a9fc034baa61b2b6e713a387938122b1 100755 --- a/tutorials/multiphase/potentialFreeSurfaceFoam/oscillatingBox/Allrun +++ b/tutorials/multiphase/potentialFreeSurfaceFoam/oscillatingBox/Allrun @@ -10,7 +10,8 @@ application=`getApplication` runApplication blockMesh runApplication topoSet runApplication subsetMesh -overwrite c0 -patch floatingObject -cp -r 0.org 0 > /dev/null 2>&1 + +restore0Dir runApplication $application diff --git a/tutorials/multiphase/twoLiquidMixingFoam/lockExchange/Allrun b/tutorials/multiphase/twoLiquidMixingFoam/lockExchange/Allrun index b275240a50dde518b78c9e66ba0b8f558c962907..c1e4f90ab10960373faf5b63c69a9a77ce24704b 100755 --- a/tutorials/multiphase/twoLiquidMixingFoam/lockExchange/Allrun +++ b/tutorials/multiphase/twoLiquidMixingFoam/lockExchange/Allrun @@ -7,8 +7,7 @@ cd ${0%/*} || exit 1 # Run from this directory # Set application name application=`getApplication` -\rm -rf 0 -cp -r 0.org 0 +restore0Dir runApplication blockMesh runApplication setFields