TUT: adjust tutorials for test loop

This commit is contained in:
Mark Olesen 2020-12-22 12:16:50 +01:00
parent e58b59ed6f
commit 7bdb509494
11 changed files with 49 additions and 22 deletions

View File

@ -1,6 +1,7 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions # Tutorial run functions
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
# Run serial
(cd left && runApplication blockMesh)

View File

@ -1,6 +1,5 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
#------------------------------------------------------------------------------
(cd precursor && ./Allclean)

View File

@ -1,6 +1,5 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
# Run a precursor init case

View File

@ -7,6 +7,6 @@ vibroAcousticCase="../main"
cleanCase0
rm -rf $vibroAcousticCase/constant/boundaryData
rm -rf "$vibroAcousticCase"/constant/boundaryData
# -----------------------------------------------------------------------------

View File

@ -3,7 +3,8 @@ cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
[[ -d constant/polyMesh ]] || runApplication ./Allrun.pre
# Generate mesh if required
[ -d constant/polyMesh ] || ./Allrun.pre
restore0Dir
@ -14,7 +15,7 @@ runParallel $(getApplication)
vibroAcousticCase="../main"
dataDir="postProcessing/surfaces/window"
mkdir -p "$vibroAcousticCase/constant/boundaryData"
cp -rf "$dataDir" "$vibroAcousticCase/constant/boundaryData/window"
mkdir -p "$vibroAcousticCase"/constant/boundaryData
cp -rf "$dataDir" "$vibroAcousticCase"/constant/boundaryData/window
# -----------------------------------------------------------------------------

View File

@ -1,6 +1,5 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
(cd steady && ./Allrun-parallel)

View File

@ -3,7 +3,8 @@ cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
[[ -d constant/polyMesh ]] || runApplication ./Allrun.pre
# Generate mesh if required
[ -d constant/polyMesh ] || ./Allrun.pre
runApplication decomposePar
@ -11,4 +12,4 @@ runParallel $(getApplication)
runApplication reconstructPar -latestTime
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------

View File

@ -16,4 +16,4 @@ runApplication surfaceFeatureExtract
runApplication snappyHexMesh -overwrite
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------

View File

@ -3,14 +3,26 @@ cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
[[ -d constant/polyMesh ]] || rm -rf constant/polyMesh
parent="../steady"
latestTime=$(foamListTimes -case "$parent" -noZero -latestTime)
cp -rf ../steady/constant/polyMesh constant
if [ -z "$latestTime" ]
then
echo "FatalError: no latestTime found for $PWD/$parent"
exit 1
fi
# Replace mesh unconditionally
rm -rf constant/polyMesh
cp -rf "$parent"/constant/polyMesh constant
restore0Dir
cp -f ../steady/500/U 0/
cp -f ../steady/500/p 0/
# Restart from steady
cp -f \
"$parent/$latestTime"/U \
"$parent/$latestTime"/p \
0/
runApplication $(getApplication)

View File

@ -3,14 +3,26 @@ cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
[[ -d constant/polyMesh ]] || rm -rf constant/polyMesh
parent="../steady"
latestTime=$(foamListTimes -case "$parent" -noZero -latestTime)
cp -rf ../steady/constant/polyMesh constant
if [ -z "$latestTime" ]
then
echo "FatalError: no latestTime found for $PWD/$parent"
exit 1
fi
# Replace mesh unconditionally
rm -rf constant/polyMesh
cp -rf "$parent"/constant/polyMesh constant
restore0Dir
cp -f ../steady/500/U 0/
cp -f ../steady/500/p 0/
# Restart from steady
cp -f \
"$parent/$latestTime"/U \
"$parent/$latestTime"/p \
0/
runApplication decomposePar

View File

@ -1,6 +1,7 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions # Tutorial run functions
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
(cd fluid && ./Allrun.pre)
(cd solid && runApplication blockMesh)
@ -11,9 +12,11 @@ mpirun -app ./mpirun.schema
# Run parallel
(cd fluid && runApplication decomposePar)
(cd solid && runApplication decomposePar)
#mpirun -app ./mpirun.schema_parallel
# The problem is keeping the log files separate so use the openmpi
# mpirun option to keep the separate outputs in the logs/ directory
mpirun \
--output-filename logs \
-np 3 compressibleInterFoam -case fluid -world fluid -parallel : \