mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
TUT: discInConstantPorousFlow/porousDamBreak: new tutorials for interIsoFoam
TUT: create verificationAndValidation/multiphase
directory and migrate StefanProblem into this
This commit is contained in:
committed by
Andrew Heather
parent
b7af3ff891
commit
5fa2bc030d
143
tutorials/verificationAndValidation/multiphase/StefanProblem/Allrun
Executable file
143
tutorials/verificationAndValidation/multiphase/StefanProblem/Allrun
Executable file
@ -0,0 +1,143 @@
|
||||
#!/bin/sh
|
||||
cd "${0%/*}" || exit # Run from this directory
|
||||
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
|
||||
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# settings
|
||||
|
||||
# operand setups
|
||||
setups="
|
||||
icoReactingMultiphaseInterFoam
|
||||
interCondensatingEvaporatingFoam
|
||||
"
|
||||
|
||||
# flag to enable computations in parallel mode
|
||||
parallel=true
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
#######################################
|
||||
# Collect results into a given path
|
||||
# and clean the case for the next run
|
||||
# Arguments:
|
||||
# $1 = Path to move results
|
||||
# Outputs:
|
||||
# Writes info to stdout
|
||||
#######################################
|
||||
collect() {
|
||||
|
||||
[ $# -eq 0 ] && { echo "Usage: $0 dir-model"; exit 1; }
|
||||
|
||||
collection="$1"
|
||||
|
||||
dirResult=results/"$collection"
|
||||
dirSettings="$dirResult"/settings
|
||||
|
||||
if [ ! -d "$dirResult" ]
|
||||
then
|
||||
|
||||
echo " # Collecting results and settings into $dirResult"
|
||||
|
||||
mkdir -p "$dirResult"
|
||||
mkdir -p "$dirSettings"
|
||||
|
||||
mv -f $(foamListTimes) "$dirResult"
|
||||
[ -d postProcessing ] && mv -f postProcessing "$dirResult"
|
||||
[ -d processor0 ] && mv -f processor* "$dirResult"
|
||||
mv -f log.* "$dirResult"
|
||||
cp -f system/{fv*,controlDict} constant/*Properties "$dirSettings"
|
||||
mv -f 0/ "$dirSettings"
|
||||
|
||||
echo " # Cleaning up the case"
|
||||
|
||||
cleanTimeDirectories
|
||||
cleanAuxiliary
|
||||
cleanPostProcessing
|
||||
|
||||
else
|
||||
|
||||
echo " # Directory $dirResult already exists"
|
||||
echo " # Skipping the computation"
|
||||
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
for setup in $setups
|
||||
do
|
||||
|
||||
echo ""
|
||||
echo "# Computations for the setup: $setup"
|
||||
echo ""
|
||||
|
||||
dirSetup="setups.orig/$setup"
|
||||
|
||||
if [ ! -d "$dirSetup" ]
|
||||
then
|
||||
echo "Setup directory: $dirSetup" \
|
||||
"could not be found - skipping execution" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cp -rfL "$dirSetup/0.orig" .
|
||||
cp -rfL "$dirSetup/constant" .
|
||||
cp -rfL "$dirSetup/system" .
|
||||
cp -rf 0.orig/ 0/
|
||||
cp -rf 0/ 1.36/
|
||||
|
||||
if [ ! -d constant/polyMesh ]
|
||||
then
|
||||
|
||||
runApplication blockMesh
|
||||
|
||||
runApplication renumberMesh -overwrite -constant
|
||||
|
||||
runApplication checkMesh -allTopology -allGeometry -constant
|
||||
|
||||
if [ ! -f "system/setAlphaFieldDict" ]
|
||||
then
|
||||
if [ -f "system/setAlphaFieldDict.liquid" ]
|
||||
then
|
||||
runApplication -s liquid \
|
||||
setAlphaField -dict system/setAlphaFieldDict.liquid
|
||||
fi
|
||||
|
||||
if [ -f "system/setAlphaFieldDict.gas" ]
|
||||
then
|
||||
runApplication -s gas \
|
||||
setAlphaField -dict system/setAlphaFieldDict.gas
|
||||
fi
|
||||
else
|
||||
runApplication setAlphaField
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
if [ "$parallel" = true ]
|
||||
then
|
||||
|
||||
runApplication decomposePar
|
||||
|
||||
runParallel -s parallel renumberMesh -overwrite
|
||||
|
||||
runParallel $(getApplication)
|
||||
|
||||
runApplication reconstructPar
|
||||
|
||||
else
|
||||
|
||||
runApplication $(getApplication)
|
||||
|
||||
fi
|
||||
|
||||
collect "$setup"
|
||||
|
||||
done
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
Reference in New Issue
Block a user