TUT: simplify setups.orig cases
DOC: Curle: fix typo in header file (fixes #2498) TUT: airfoil2D: apply standard freestream conditions for nuTilda and nut
This commit is contained in:
parent
9cf6ac4145
commit
408e6b55e9
@ -75,17 +75,17 @@ Usage
|
|||||||
c0 330;
|
c0 330;
|
||||||
|
|
||||||
|
|
||||||
// Input - either points or surface
|
// Input - either point or surface
|
||||||
|
|
||||||
input points;
|
input point;
|
||||||
observerPositions ((0 0 0)(1 0 0));
|
observerPositions ((0 0 0)(1 0 0));
|
||||||
|
|
||||||
//input surface;
|
//input surface;
|
||||||
//surface "inputSurface.obj"
|
//surface "inputSurface.obj"
|
||||||
|
|
||||||
|
|
||||||
// Output - either points or surface
|
// Output - either point or surface
|
||||||
output points;
|
output point;
|
||||||
|
|
||||||
//output surface;
|
//output surface;
|
||||||
//surfaceType ensight;
|
//surfaceType ensight;
|
||||||
|
@ -3,12 +3,9 @@ cd "${0%/*}" || exit # Run from this directory
|
|||||||
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
|
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
cleanCase0
|
rm -rf setups
|
||||||
|
|
||||||
rm -rf 0.orig
|
|
||||||
rm -rf system
|
|
||||||
rm -rf constant
|
|
||||||
rm -rf results
|
rm -rf results
|
||||||
rm -rf plots
|
rm -rf plots
|
||||||
|
rm -f setups.orig/common/constant/transportProperties
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
cd "${0%/*}" || exit # Run from this directory
|
cd "${0%/*}" || exit # Run from this directory
|
||||||
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
|
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
|
||||||
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
# setups
|
# settings
|
||||||
|
|
||||||
# operand setups
|
# operand setups
|
||||||
setups="
|
setups="
|
||||||
@ -12,6 +11,18 @@ cd "${0%/*}" || exit # Run from this directory
|
|||||||
LaunderSharmaKE-nutkWallFunction
|
LaunderSharmaKE-nutkWallFunction
|
||||||
"
|
"
|
||||||
|
|
||||||
|
# flag to enable computations
|
||||||
|
run=true
|
||||||
|
|
||||||
|
# flag to enable computations in parallel mode
|
||||||
|
parallel=false
|
||||||
|
|
||||||
|
# flag to enable to use a common mesh
|
||||||
|
common_mesh=true
|
||||||
|
|
||||||
|
# flag to enable to use a common dynamic code
|
||||||
|
common_dynamic_code=true
|
||||||
|
|
||||||
# operand exponents of kinematic viscosity values
|
# operand exponents of kinematic viscosity values
|
||||||
nuExponents="2 3 4 5 6 7 8"
|
nuExponents="2 3 4 5 6 7 8"
|
||||||
|
|
||||||
@ -19,107 +30,163 @@ cd "${0%/*}" || exit # Run from this directory
|
|||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
#######################################
|
#######################################
|
||||||
# Collect results into a given path
|
# Create the given setup
|
||||||
# and clean the case for the next run
|
|
||||||
# Arguments:
|
# Arguments:
|
||||||
# $1 = Path to move results
|
# $1 = Path to create the setup
|
||||||
# Outputs:
|
# Outputs:
|
||||||
# Writes info to stdout
|
# Writes info to stdout
|
||||||
#######################################
|
#######################################
|
||||||
collect() {
|
dry_run_setup() {
|
||||||
|
|
||||||
[ $# -eq 0 ] && { echo "Usage: $0 dir-model"; exit 1; }
|
[ $# -eq 0 ] && { echo "Usage error: $0"; exit 1; }
|
||||||
|
|
||||||
collection="$1"
|
setup="$1"
|
||||||
|
exponent="$2"
|
||||||
|
dirSetup="setups/$setup/$exponent"
|
||||||
|
dirSetupOrig="setups.orig/$setup"
|
||||||
|
dirOrig="$dirSetupOrig/0.orig"
|
||||||
|
dirConstant="$dirSetupOrig/constant"
|
||||||
|
dirSystem="$dirSetupOrig/system"
|
||||||
|
|
||||||
dirResult=results/"$collection"
|
printf "\n# Create the setup: %s %s\n" "$setup" nu=1e-"$exponent"
|
||||||
dirSettings="$dirResult"/settings
|
|
||||||
|
if [ ! -d "$dirSetup" ]
|
||||||
|
then
|
||||||
|
mkdir -p "$dirSetup"
|
||||||
|
|
||||||
|
cp -aRfL "setups.orig/common/." "$dirSetup"
|
||||||
|
cp -afL "$dirSetupOrig"/All* "$dirSetup" 2>/dev/null || :
|
||||||
|
[ -d "$dirOrig" ] && cp -aRfL "$dirOrig/." "$dirSetup/0.orig"
|
||||||
|
[ -d "$dirConstant" ] && cp -aRfL "$dirConstant/." "$dirSetup/constant"
|
||||||
|
[ -d "$dirSystem" ] && cp -aRfL "$dirSystem/." "$dirSetup/system"
|
||||||
|
else
|
||||||
|
printf "\n # Directory %s already exists\n" "$dirSetup"
|
||||||
|
printf " # Skipping the creation of a new setup\n"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#######################################
|
||||||
|
# Run the given setup
|
||||||
|
# Arguments:
|
||||||
|
# $1 = Path to the setup to run
|
||||||
|
# Outputs:
|
||||||
|
# Writes info to stdout
|
||||||
|
#######################################
|
||||||
|
run_setup() {
|
||||||
|
|
||||||
|
[ $# -eq 0 ] && { echo "Usage error: $0"; exit 1; }
|
||||||
|
|
||||||
|
setup="$1"
|
||||||
|
exponent="$2"
|
||||||
|
dirSetup="setups/$setup/$exponent"
|
||||||
|
dirResult="results/$setup/$exponent"
|
||||||
|
|
||||||
|
dry_run_setup "$setup" "$exponent"
|
||||||
|
[ -d results ] || mkdir -p results
|
||||||
|
[ -d results/"$setup" ] || mkdir -p results/"$setup"
|
||||||
|
|
||||||
|
printf "\n# Run the setup: %s %s\n\n" "$setup" nu=1e-"$exponent"
|
||||||
|
|
||||||
if [ ! -d "$dirResult" ]
|
if [ ! -d "$dirResult" ]
|
||||||
then
|
then
|
||||||
|
cp -Rf "$dirSetup" "$dirResult"
|
||||||
|
|
||||||
echo " # Collecting results and settings into $dirResult"
|
if [ "$common_mesh" = true ]
|
||||||
|
then
|
||||||
|
if [ -d results/mesh ]
|
||||||
|
then
|
||||||
|
printf "## Copy the common mesh to the setup: %s\n\n" "$setup"
|
||||||
|
cp -Rf results/mesh/polyMesh "$dirResult"/constant/.
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
mkdir -p "$dirResult"
|
if [ "$common_dynamic_code" = true ]
|
||||||
mkdir -p "$dirSettings"
|
then
|
||||||
|
if [ -d results/dynamicCode ]
|
||||||
|
then
|
||||||
|
printf "## Copy the common dynamic code to the setup: %s\n\n" "$setup"
|
||||||
|
cp -Rf results/dynamicCode "$dirResult"/.
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
mv -f $(foamListTimes) "$dirResult"
|
|
||||||
[ -d postProcessing ] && mv -f postProcessing "$dirResult"
|
|
||||||
mv -f log.* "$dirResult"
|
|
||||||
mv -f graphs/ "$dirResult"
|
|
||||||
mv -f logs/ "$dirResult"
|
|
||||||
cp -f system/{fv*,controlDict} constant/*Properties "$dirSettings"
|
|
||||||
mv -f 0/ "$dirSettings"
|
|
||||||
|
|
||||||
echo " # Cleaning up the case"
|
if [ "$parallel" = true ]
|
||||||
|
then
|
||||||
|
( cd "$dirResult" && ./Allrun-parallel )
|
||||||
|
else
|
||||||
|
( cd "$dirResult" && ./Allrun )
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
if [ "$common_mesh" = true ]
|
||||||
|
then
|
||||||
|
if [ ! -d results/mesh ]
|
||||||
|
then
|
||||||
|
printf "\n## Store the mesh of %s as the common mesh\n\n" "$setup"
|
||||||
|
mkdir -p results/mesh
|
||||||
|
cp -Rf "$dirResult"/constant/polyMesh results/mesh/.
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$common_dynamic_code" = true ]
|
||||||
|
then
|
||||||
|
if [ ! -d results/dynamicCode ] && [ -d "$dirResult"/dynamicCode ]
|
||||||
|
then
|
||||||
|
printf "\n## Store the dynamic code of %s as the common dynamic code\n\n" "$setup"
|
||||||
|
cp -Rf "$dirResult"/dynamicCode results/.
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
cleanTimeDirectories
|
|
||||||
cleanAuxiliary
|
|
||||||
cleanPostProcessing
|
|
||||||
|
|
||||||
else
|
else
|
||||||
|
printf " # Directory %s already exists\n" "$dirResult"
|
||||||
echo " # Directory $dirResult already exists"
|
printf " # Skipping the computation of the given setup\n"
|
||||||
echo " # Skipping the computation"
|
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
for setup in $setups
|
[ "$parallel" = true ] && {
|
||||||
do
|
echo "boundaryFoam has no parallel option - skipping the execution" 1>&2
|
||||||
|
exit 1
|
||||||
echo ""
|
}
|
||||||
echo "# Computations for the setup: $setup"
|
|
||||||
echo ""
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
dirSetup="setups.orig/$setup"
|
|
||||||
cp -rfL "$dirSetup/0.orig" .
|
for exponent in $nuExponents
|
||||||
cp -rfL "$dirSetup/constant" .
|
do
|
||||||
cp -rfL "$dirSetup/system" .
|
sed "s|EXPONENT|$exponent|g" \
|
||||||
cp -rf 0.orig/ 0/
|
setups.orig/common/constant/transportProperties.template > \
|
||||||
|
setups.orig/common/constant/transportProperties
|
||||||
if [ ! -d constant/polyMesh ]
|
|
||||||
then
|
for setup in $setups
|
||||||
runApplication blockMesh
|
do
|
||||||
runApplication renumberMesh -overwrite -constant
|
dirSetupOrig="setups.orig/$setup"
|
||||||
runApplication checkMesh -allTopology -allGeometry -constant
|
|
||||||
fi
|
if [ ! -d "$dirSetupOrig" ]
|
||||||
|
then
|
||||||
echo "# yPlus vs uPlus" > yPlus_vs_uPlus.xy
|
echo "Setup directory: $dirSetupOrig" \
|
||||||
|
"could not be found - skipping execution" 1>&2
|
||||||
for exponent in $nuExponents
|
continue
|
||||||
do
|
fi
|
||||||
|
|
||||||
echo " Setting nu to 1e-$exponent"
|
if [ "$run" = true ]
|
||||||
|
then
|
||||||
sed "s|EXPONENT|$exponent|g" constant/transportProperties.template \
|
run_setup "$setup" "$exponent"
|
||||||
> constant/transportProperties
|
else
|
||||||
|
dry_run_setup "$setup" "$exponent"
|
||||||
[ -d 0 ] || restore0Dir
|
fi
|
||||||
|
done
|
||||||
runApplication $(getApplication)
|
done
|
||||||
|
|
||||||
runApplication foamLog log.boundaryFoam
|
|
||||||
|
if notTest "$@" && [ "$run" = true ]
|
||||||
if [ -e logs/yPlus_0 ]
|
then
|
||||||
then
|
./plot
|
||||||
yPlus=$(awk < logs/yPlus_0 'END{print $2}')
|
fi
|
||||||
uPlus=$(awk < logs/uPlus_0 'END{print $2}')
|
|
||||||
|
|
||||||
echo "$yPlus $uPlus" >> yPlus_vs_uPlus.xy
|
|
||||||
fi
|
|
||||||
|
|
||||||
collect "$setup/$exponent"
|
|
||||||
|
|
||||||
done
|
|
||||||
|
|
||||||
mv -f yPlus_vs_uPlus.xy results/"$setup"/
|
|
||||||
|
|
||||||
done
|
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
@ -10,4 +10,4 @@ Usage:
|
|||||||
|
|
||||||
- run test using Allrun script
|
- run test using Allrun script
|
||||||
- uses foamLog to generate u+ and y+ values
|
- uses foamLog to generate u+ and y+ values
|
||||||
- postscript (.eps) plot generated using gnuplot, OF_vs_ANALYTICAL.eps
|
- plots are generated using gnuplot, and can be found under plots directory
|
||||||
|
@ -72,16 +72,19 @@ command -v gnuplot >/dev/null || {
|
|||||||
|
|
||||||
for setup in $setups
|
for setup in $setups
|
||||||
do
|
do
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "# Plots for the setup: $setup"
|
echo "# Plots for the setup: $setup"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
|
[ -d "results/$setup" ] || {
|
||||||
|
echo "No results/$setup directory found - skipping graph creation" 1>&2
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
dirPlots="plots/$setup"
|
dirPlots="plots/$setup"
|
||||||
[ -d "$dirPlots" ] || mkdir -p "$dirPlots"
|
[ -d "$dirPlots" ] || mkdir -p "$dirPlots"
|
||||||
|
|
||||||
plot_yPlus_vs_uPlus "$setup"
|
plot_yPlus_vs_uPlus "$setup"
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
|
@ -1 +0,0 @@
|
|||||||
../../common/0.orig/U
|
|
@ -1 +0,0 @@
|
|||||||
../../common/0.orig/epsilon
|
|
@ -1 +0,0 @@
|
|||||||
../../common/0.orig/k
|
|
@ -1 +0,0 @@
|
|||||||
../../common/constant/transportProperties.template
|
|
@ -1 +0,0 @@
|
|||||||
../common/system/
|
|
@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
cd "${0%/*}" || exit # Run from this directory
|
||||||
|
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
cleanCase0
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
@ -0,0 +1,20 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
cd "${0%/*}" || exit # Run from this directory
|
||||||
|
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
./Allrun.pre
|
||||||
|
|
||||||
|
runApplication $(getApplication)
|
||||||
|
|
||||||
|
runApplication foamLog log.boundaryFoam
|
||||||
|
|
||||||
|
if [ -e logs/yPlus_0 ]
|
||||||
|
then
|
||||||
|
yPlus=$(awk < logs/yPlus_0 'END{print $2}')
|
||||||
|
uPlus=$(awk < logs/uPlus_0 'END{print $2}')
|
||||||
|
|
||||||
|
echo "$yPlus $uPlus" >> ../yPlus_vs_uPlus.xy
|
||||||
|
fi
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
@ -0,0 +1,19 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
cd "${0%/*}" || exit # Run from this directory
|
||||||
|
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
canCompile || exit 0 # Dynamic code
|
||||||
|
|
||||||
|
restore0Dir
|
||||||
|
|
||||||
|
if [ ! -d constant/polyMesh ]
|
||||||
|
then
|
||||||
|
runApplication blockMesh
|
||||||
|
|
||||||
|
runApplication renumberMesh -overwrite -constant
|
||||||
|
|
||||||
|
runApplication checkMesh -allTopology -allGeometry -constant
|
||||||
|
fi
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
@ -1 +0,0 @@
|
|||||||
../../common/0.orig/U
|
|
@ -1 +0,0 @@
|
|||||||
../../common/0.orig/epsilon
|
|
@ -1 +0,0 @@
|
|||||||
../../common/0.orig/k
|
|
@ -1 +0,0 @@
|
|||||||
../../common/constant/transportProperties.template
|
|
@ -1 +0,0 @@
|
|||||||
../common/system/
|
|
@ -3,14 +3,9 @@ cd "${0%/*}" || exit # Run from this directory
|
|||||||
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
|
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
cleanCase0
|
rm -rf setups
|
||||||
|
|
||||||
rm -rf 0.orig
|
|
||||||
rm -rf system
|
|
||||||
rm -rf constant
|
|
||||||
rm -rf results
|
rm -rf results
|
||||||
rm -rf plots
|
rm -rf plots
|
||||||
rm -f *.dat
|
|
||||||
|
|
||||||
( cd validation/WatersKing && wclean WatersKing )
|
( cd validation/WatersKing && wclean WatersKing )
|
||||||
|
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
cd "${0%/*}" || exit # Run from this directory
|
cd "${0%/*}" || exit # Run from this directory
|
||||||
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
|
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
|
||||||
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
# setups
|
# settings
|
||||||
|
|
||||||
# operand setups
|
# operand setups
|
||||||
setups="
|
setups="
|
||||||
@ -12,124 +11,161 @@ cd "${0%/*}" || exit # Run from this directory
|
|||||||
Stokes
|
Stokes
|
||||||
"
|
"
|
||||||
|
|
||||||
|
# flag to enable computations
|
||||||
|
run=true
|
||||||
|
|
||||||
# flag to enable computations in parallel mode
|
# flag to enable computations in parallel mode
|
||||||
parallel=true
|
parallel=true
|
||||||
|
|
||||||
|
# flag to enable to use a common mesh
|
||||||
|
common_mesh=true
|
||||||
|
|
||||||
|
# flag to enable to use a common dynamic code
|
||||||
|
common_dynamic_code=true
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
#######################################
|
#######################################
|
||||||
# Collect results into a given path
|
# Create the given setup
|
||||||
# and clean the case for the next run
|
|
||||||
# Arguments:
|
# Arguments:
|
||||||
# $1 = Path to move results
|
# $1 = Path to create the setup
|
||||||
# Outputs:
|
# Outputs:
|
||||||
# Writes info to stdout
|
# Writes info to stdout
|
||||||
#######################################
|
#######################################
|
||||||
collect() {
|
dry_run_setup() {
|
||||||
|
|
||||||
[ $# -eq 0 ] && { echo "Usage: $0 dir-model"; exit 1; }
|
[ $# -eq 0 ] && { echo "Usage error: $0"; exit 1; }
|
||||||
|
|
||||||
collection="$1"
|
setup="$1"
|
||||||
|
dirSetup="setups/$setup"
|
||||||
|
dirSetupOrig="setups.orig/$setup"
|
||||||
|
dirOrig="$dirSetupOrig/0.orig"
|
||||||
|
dirConstant="$dirSetupOrig/constant"
|
||||||
|
dirSystem="$dirSetupOrig/system"
|
||||||
|
|
||||||
dirResult=results/"$collection"
|
printf "\n# Create the setup: %s\n" "$setup"
|
||||||
dirSettings="$dirResult"/settings
|
|
||||||
|
|
||||||
if [ ! -d "$dirResult" ]
|
if [ ! -d "$dirSetup" ]
|
||||||
then
|
then
|
||||||
|
mkdir -p "$dirSetup"
|
||||||
|
|
||||||
echo " # Collecting results and settings into $dirResult"
|
cp -aRfL "setups.orig/common/." "$dirSetup"
|
||||||
|
cp -afL "$dirSetupOrig"/All* "$dirSetup" 2>/dev/null || :
|
||||||
mkdir -p "$dirResult"
|
[ -d "$dirOrig" ] && cp -aRfL "$dirOrig/." "$dirSetup/0.orig"
|
||||||
mkdir -p "$dirSettings"
|
[ -d "$dirConstant" ] && cp -aRfL "$dirConstant/." "$dirSetup/constant"
|
||||||
|
[ -d "$dirSystem" ] && cp -aRfL "$dirSystem/." "$dirSetup/system"
|
||||||
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
|
else
|
||||||
|
printf "\n # Directory %s already exists\n" "$dirSetup"
|
||||||
echo " # Directory $dirResult already exists"
|
printf " # Skipping the creation of a new setup\n"
|
||||||
echo " # Skipping the computation"
|
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#######################################
|
||||||
|
# Run the given setup
|
||||||
|
# Arguments:
|
||||||
|
# $1 = Path to the setup to run
|
||||||
|
# Outputs:
|
||||||
|
# Writes info to stdout
|
||||||
|
#######################################
|
||||||
|
run_setup() {
|
||||||
|
|
||||||
if ! canCompile
|
[ $# -eq 0 ] && { echo "Usage error: $0"; exit 1; }
|
||||||
then
|
|
||||||
echo "skipping tutorial $PWD"
|
setup="$1"
|
||||||
exit 0
|
dirSetup="setups/$setup"
|
||||||
fi
|
dirResult="results/$setup"
|
||||||
|
|
||||||
|
dry_run_setup "$setup"
|
||||||
|
[ -d results ] || mkdir -p results
|
||||||
|
|
||||||
|
printf "\n# Run the setup: %s\n\n" "$setup"
|
||||||
|
|
||||||
|
if [ ! -d "$dirResult" ]
|
||||||
|
then
|
||||||
|
cp -Rf "$dirSetup" "$dirResult"
|
||||||
|
|
||||||
|
if [ "$common_mesh" = true ]
|
||||||
|
then
|
||||||
|
if [ -d results/mesh ]
|
||||||
|
then
|
||||||
|
printf "## Copy the common mesh to the setup: %s\n\n" "$setup"
|
||||||
|
cp -Rf results/mesh/polyMesh "$dirResult"/constant/.
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$common_dynamic_code" = true ]
|
||||||
|
then
|
||||||
|
if [ -d results/dynamicCode ]
|
||||||
|
then
|
||||||
|
printf "## Copy the common dynamic code to the setup: %s\n\n" "$setup"
|
||||||
|
cp -Rf results/dynamicCode "$dirResult"/.
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
if [ "$parallel" = true ]
|
||||||
|
then
|
||||||
|
( cd "$dirResult" && ./Allrun-parallel )
|
||||||
|
else
|
||||||
|
( cd "$dirResult" && ./Allrun )
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
if [ "$common_mesh" = true ]
|
||||||
|
then
|
||||||
|
if [ ! -d results/mesh ]
|
||||||
|
then
|
||||||
|
printf "\n## Store the mesh of %s as the common mesh\n\n" "$setup"
|
||||||
|
mkdir -p results/mesh
|
||||||
|
cp -Rf "$dirResult"/constant/polyMesh results/mesh/.
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$common_dynamic_code" = true ]
|
||||||
|
then
|
||||||
|
if [ ! -d results/dynamicCode ] && [ -d "$dirResult"/dynamicCode ]
|
||||||
|
then
|
||||||
|
printf "\n## Store the dynamic code of %s as the common dynamic code\n\n" "$setup"
|
||||||
|
cp -Rf "$dirResult"/dynamicCode results/.
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
else
|
||||||
|
printf " # Directory %s already exists\n" "$dirResult"
|
||||||
|
printf " # Skipping the computation of the given setup\n"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
for setup in $setups
|
for setup in $setups
|
||||||
do
|
do
|
||||||
|
dirSetupOrig="setups.orig/$setup"
|
||||||
|
|
||||||
echo ""
|
if [ ! -d "$dirSetupOrig" ]
|
||||||
echo "# Computations for the setup: $setup"
|
|
||||||
echo ""
|
|
||||||
|
|
||||||
dirSetup="setups.orig/$setup"
|
|
||||||
cp -rfL "$dirSetup/0.orig" .
|
|
||||||
cp -rfL "$dirSetup/constant" .
|
|
||||||
cp -rfL "$dirSetup/system" .
|
|
||||||
cp -rf 0.orig/ 0/
|
|
||||||
|
|
||||||
if [ ! -d constant/polyMesh ]
|
|
||||||
then
|
then
|
||||||
|
echo "Setup directory: $dirSetupOrig" \
|
||||||
runApplication blockMesh
|
"could not be found - skipping execution" 1>&2
|
||||||
|
continue
|
||||||
runApplication renumberMesh -overwrite -constant
|
|
||||||
|
|
||||||
runApplication checkMesh -allTopology -allGeometry -constant
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$parallel" = true ]
|
if [ "$run" = true ]
|
||||||
then
|
then
|
||||||
|
run_setup "$setup"
|
||||||
runApplication decomposePar
|
|
||||||
|
|
||||||
runParallel $(getApplication)
|
|
||||||
|
|
||||||
runApplication reconstructPar
|
|
||||||
|
|
||||||
else
|
else
|
||||||
|
dry_run_setup "$setup"
|
||||||
runApplication $(getApplication)
|
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if notTest "$@"
|
|
||||||
then
|
|
||||||
# postprocessing
|
|
||||||
tail -n +4 postProcessing/probes/0/U | \
|
|
||||||
tr -s " " | tr -d '(' | cut -d " " -f2-3 > \
|
|
||||||
postProcessing/probes/0/Unp
|
|
||||||
fi
|
|
||||||
|
|
||||||
collect "$setup"
|
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
||||||
( cd validation/WatersKing && wmake )
|
|
||||||
|
|
||||||
runApplication WatersKing
|
if notTest "$@" && [ "$run" = true ]
|
||||||
|
then
|
||||||
|
./plot
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
@ -12,37 +12,21 @@ cd "${0%/*}" || exit # Run from this directory
|
|||||||
"
|
"
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
# Requires gnuplot
|
|
||||||
command -v gnuplot >/dev/null || {
|
|
||||||
echo "FOAM FATAL ERROR: gnuplot not found - skipping graph creation" 1>&2
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
# Check "results" directory
|
|
||||||
[ -d "results" ] || {
|
|
||||||
echo "FOAM FATAL ERROR: No results directory found - skipping graph creation" 1>&2
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
plot_t_vs_Ux() {
|
plot_t_vs_Ux() {
|
||||||
|
|
||||||
setups=$@
|
setups=$@
|
||||||
|
|
||||||
benchmarkFile="WatersKing.dat"
|
|
||||||
|
|
||||||
n=0
|
n=0
|
||||||
for setup in $setups
|
for setup in $setups
|
||||||
do
|
do
|
||||||
|
benchmarkFile="results/$setup/WatersKing.dat"
|
||||||
sampleFiles[$n]="results/$setup/postProcessing/probes/0/Unp"
|
sampleFiles[$n]="results/$setup/postProcessing/probes/0/Unp"
|
||||||
n=$(($n+1))
|
n=$(($n+1))
|
||||||
done
|
done
|
||||||
|
|
||||||
endTime=$(foamDictionary system/controlDict -entry endTime -value)
|
endTime=$(foamDictionary results/$setup/system/controlDict -entry endTime -value)
|
||||||
image="plots/planarPoiseuille.png"
|
image="plots/planarPoiseuille.png"
|
||||||
|
|
||||||
gnuplot<<PLT
|
gnuplot<<PLT
|
||||||
@ -70,6 +54,21 @@ PLT
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Requires gnuplot
|
||||||
|
command -v gnuplot >/dev/null || {
|
||||||
|
echo "gnuplot not found - skipping graph creation" 1>&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# Check "results" directory
|
||||||
|
[ -d "results" ] || {
|
||||||
|
echo "No results directory found - skipping graph creation" 1>&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
|
@ -1 +0,0 @@
|
|||||||
../common/0.orig/
|
|
@ -1 +0,0 @@
|
|||||||
../../common/constant/fvOptions
|
|
@ -1 +0,0 @@
|
|||||||
../../common/constant/transportProperties
|
|
@ -1 +0,0 @@
|
|||||||
../common/system/
|
|
@ -1 +0,0 @@
|
|||||||
../common/0.orig/
|
|
@ -1 +0,0 @@
|
|||||||
../../common/constant/fvOptions
|
|
@ -1 +0,0 @@
|
|||||||
../../common/constant/transportProperties
|
|
@ -1 +0,0 @@
|
|||||||
../common/system/
|
|
@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
cd "${0%/*}" || exit # Run from this directory
|
||||||
|
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
cleanCase0
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
cd "${0%/*}" || exit # Run from this directory
|
||||||
|
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
./Allrun.pre
|
||||||
|
|
||||||
|
runApplication $(getApplication)
|
||||||
|
|
||||||
|
|
||||||
|
if notTest "$@"
|
||||||
|
then
|
||||||
|
# postprocessing
|
||||||
|
tail -n +4 postProcessing/probes/0/U | \
|
||||||
|
tr -s " " | tr -d '(' | cut -d " " -f2-3 > \
|
||||||
|
postProcessing/probes/0/Unp
|
||||||
|
|
||||||
|
( cd ../../validation/WatersKing && wmake )
|
||||||
|
runApplication WatersKing
|
||||||
|
fi
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
@ -0,0 +1,26 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
cd "${0%/*}" || exit # Run from this directory
|
||||||
|
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
./Allrun.pre
|
||||||
|
|
||||||
|
runApplication decomposePar
|
||||||
|
|
||||||
|
runParallel $(getApplication)
|
||||||
|
|
||||||
|
runApplication reconstructPar
|
||||||
|
|
||||||
|
|
||||||
|
if notTest "$@"
|
||||||
|
then
|
||||||
|
# postprocessing
|
||||||
|
tail -n +4 postProcessing/probes/0/U | \
|
||||||
|
tr -s " " | tr -d '(' | cut -d " " -f2-3 > \
|
||||||
|
postProcessing/probes/0/Unp
|
||||||
|
|
||||||
|
( cd ../../validation/WatersKing && wmake )
|
||||||
|
runApplication WatersKing
|
||||||
|
fi
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
@ -0,0 +1,19 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
cd "${0%/*}" || exit # Run from this directory
|
||||||
|
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
canCompile || exit 0 # Dynamic code
|
||||||
|
|
||||||
|
restore0Dir
|
||||||
|
|
||||||
|
if [ ! -d constant/polyMesh ]
|
||||||
|
then
|
||||||
|
runApplication blockMesh
|
||||||
|
|
||||||
|
runApplication renumberMesh -overwrite -constant
|
||||||
|
|
||||||
|
runApplication checkMesh -allTopology -allGeometry -constant
|
||||||
|
fi
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
@ -16,20 +16,20 @@ FoamFile
|
|||||||
|
|
||||||
dimensions [0 2 -1 0 0 0 0];
|
dimensions [0 2 -1 0 0 0 0];
|
||||||
|
|
||||||
internalField uniform 0.14;
|
internalField uniform 4e-05;
|
||||||
|
|
||||||
boundaryField
|
boundaryField
|
||||||
{
|
{
|
||||||
inlet
|
inlet
|
||||||
{
|
{
|
||||||
type freestream;
|
type freestream;
|
||||||
freestreamValue uniform 0.14;
|
freestreamValue $internalField;
|
||||||
}
|
}
|
||||||
|
|
||||||
outlet
|
outlet
|
||||||
{
|
{
|
||||||
type freestream;
|
type freestream;
|
||||||
freestreamValue uniform 0.14;
|
freestreamValue $internalField;
|
||||||
}
|
}
|
||||||
|
|
||||||
walls
|
walls
|
||||||
|
@ -16,20 +16,20 @@ FoamFile
|
|||||||
|
|
||||||
dimensions [0 2 -1 0 0 0 0];
|
dimensions [0 2 -1 0 0 0 0];
|
||||||
|
|
||||||
internalField uniform 0.14;
|
internalField uniform 1e-05;
|
||||||
|
|
||||||
boundaryField
|
boundaryField
|
||||||
{
|
{
|
||||||
inlet
|
inlet
|
||||||
{
|
{
|
||||||
type freestream;
|
type freestream;
|
||||||
freestreamValue uniform 0.14;
|
freestreamValue $internalField;
|
||||||
}
|
}
|
||||||
|
|
||||||
outlet
|
outlet
|
||||||
{
|
{
|
||||||
type freestream;
|
type freestream;
|
||||||
freestreamValue uniform 0.14;
|
freestreamValue $internalField;
|
||||||
}
|
}
|
||||||
|
|
||||||
walls
|
walls
|
||||||
|
@ -3,8 +3,8 @@ cd "${0%/*}" || exit # Run from this directory
|
|||||||
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
|
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
cleanCase0
|
rm -rf setups
|
||||||
|
rm -rf results
|
||||||
rm -rf *.png
|
rm -rf plots
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
cd "${0%/*}" || exit # Run from this directory
|
cd "${0%/*}" || exit # Run from this directory
|
||||||
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
|
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
|
||||||
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
# settings
|
# settings
|
||||||
@ -13,106 +12,132 @@ cd "${0%/*}" || exit # Run from this directory
|
|||||||
kEpsilonPhitF
|
kEpsilonPhitF
|
||||||
"
|
"
|
||||||
|
|
||||||
|
# flag to enable computations
|
||||||
|
run=true
|
||||||
|
|
||||||
# flag to enable computations in parallel mode
|
# flag to enable computations in parallel mode
|
||||||
parallel=true
|
parallel=true
|
||||||
|
|
||||||
|
# flag to enable to use a common mesh
|
||||||
|
common_mesh=true
|
||||||
|
|
||||||
|
# flag to enable to use a common dynamic code
|
||||||
|
common_dynamic_code=true
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
#######################################
|
#######################################
|
||||||
# Extract a value (Eg, from boundaryField/bump/value)
|
# Create the given setup
|
||||||
# Arguments:
|
# Arguments:
|
||||||
# $1 = dictEntry
|
# $1 = Path to create the setup
|
||||||
# $2 = inputFile
|
|
||||||
# $3 = outputFile
|
|
||||||
# Outputs:
|
# Outputs:
|
||||||
# Writes to 'outputFile'
|
# Writes info to stdout
|
||||||
# Notes:
|
|
||||||
# Only retains values between, but not including the ( ) delimiters.
|
|
||||||
# For example,
|
|
||||||
#----
|
|
||||||
# value nonuniform List<scalar>
|
|
||||||
# 110
|
|
||||||
# (
|
|
||||||
# 0.0041520092
|
|
||||||
# 0.012577691
|
|
||||||
# 0.021250264
|
|
||||||
# 0.030176962
|
|
||||||
# )
|
|
||||||
# ;
|
|
||||||
#######################################
|
#######################################
|
||||||
extractVal()
|
dry_run_setup() {
|
||||||
{
|
|
||||||
if [ -f "$2" ]
|
[ $# -eq 0 ] && { echo "Usage error: $0"; exit 1; }
|
||||||
|
|
||||||
|
setup="$1"
|
||||||
|
dirSetup="setups/$setup"
|
||||||
|
dirSetupOrig="setups.orig/$setup"
|
||||||
|
dirOrig="$dirSetupOrig/0.orig"
|
||||||
|
dirConstant="$dirSetupOrig/constant"
|
||||||
|
dirSystem="$dirSetupOrig/system"
|
||||||
|
|
||||||
|
printf "\n# Create the setup: %s\n" "$setup"
|
||||||
|
|
||||||
|
if [ ! -d "$dirSetup" ]
|
||||||
then
|
then
|
||||||
foamDictionary -entry "$1" -value "$2" | \
|
mkdir -p "$dirSetup"
|
||||||
sed -n '/(/,/)/{ s/[()]//g; /^ *$/d; p}' \
|
|
||||||
> "$3"
|
cp -aRfL "setups.orig/common/." "$dirSetup"
|
||||||
|
cp -afL "$dirSetupOrig"/All* "$dirSetup" 2>/dev/null || :
|
||||||
|
[ -d "$dirOrig" ] && cp -aRfL "$dirOrig/." "$dirSetup/0.orig"
|
||||||
|
[ -d "$dirConstant" ] && cp -aRfL "$dirConstant/." "$dirSetup/constant"
|
||||||
|
[ -d "$dirSystem" ] && cp -aRfL "$dirSystem/." "$dirSetup/system"
|
||||||
else
|
else
|
||||||
# Or some other tag?
|
printf "\n # Directory %s already exists\n" "$dirSetup"
|
||||||
echo "Not such file: $2" 1>&2
|
printf " # Skipping the creation of a new setup\n"
|
||||||
echo "0" > "$3"
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#######################################
|
#######################################
|
||||||
# Collect results into a given path
|
# Run the given setup
|
||||||
# and clean the case for the next run
|
|
||||||
# Arguments:
|
# Arguments:
|
||||||
# $1 = Path to move results
|
# $1 = Path to the setup to run
|
||||||
# Outputs:
|
# Outputs:
|
||||||
# Writes info to stdout
|
# Writes info to stdout
|
||||||
#######################################
|
#######################################
|
||||||
collect() {
|
run_setup() {
|
||||||
|
|
||||||
[ $# -eq 0 ] && { echo "Usage: $0 dir-model"; exit 1; }
|
[ $# -eq 0 ] && { echo "Usage error: $0"; exit 1; }
|
||||||
|
|
||||||
collection="$1"
|
setup="$1"
|
||||||
|
dirSetup="setups/$setup"
|
||||||
|
dirResult="results/$setup"
|
||||||
|
|
||||||
dirResult=results/"$collection"
|
dry_run_setup "$setup"
|
||||||
dirSettings="$dirResult"/settings
|
[ -d results ] || mkdir -p results
|
||||||
|
|
||||||
|
printf "\n# Run the setup: %s\n\n" "$setup"
|
||||||
|
|
||||||
if [ ! -d "$dirResult" ]
|
if [ ! -d "$dirResult" ]
|
||||||
then
|
then
|
||||||
|
cp -Rf "$dirSetup" "$dirResult"
|
||||||
|
|
||||||
echo " # Collecting results and settings into $dirResult"
|
if [ "$common_mesh" = true ]
|
||||||
|
then
|
||||||
|
if [ -d results/mesh ]
|
||||||
|
then
|
||||||
|
printf "## Copy the common mesh to the setup: %s\n\n" "$setup"
|
||||||
|
cp -Rf results/mesh/polyMesh "$dirResult"/constant/.
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
mkdir -p "$dirResult"
|
if [ "$common_dynamic_code" = true ]
|
||||||
mkdir -p "$dirSettings"
|
then
|
||||||
|
if [ -d results/dynamicCode ]
|
||||||
|
then
|
||||||
|
printf "## Copy the common dynamic code to the setup: %s\n\n" "$setup"
|
||||||
|
cp -Rf results/dynamicCode "$dirResult"/.
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
endTime=$(foamListTimes -latestTime)
|
|
||||||
|
|
||||||
# Create datasets for benchmark comparisons
|
if [ "$parallel" = true ]
|
||||||
extractVal boundaryField.bump.value "$endTime/Cx" Cx.$$
|
then
|
||||||
extractVal boundaryField.bump.value "$endTime/wallShearStress" tau.$$
|
( cd "$dirResult" && ./Allrun-parallel )
|
||||||
extractVal boundaryField.bump.value "$endTime/Cp" cp.$$
|
else
|
||||||
|
( cd "$dirResult" && ./Allrun )
|
||||||
|
fi
|
||||||
|
|
||||||
echo "# ccx tau_xx tau_yy tau_zz cp" > profiles.dat
|
|
||||||
paste -d ' ' Cx.$$ tau.$$ cp.$$ >> profiles.dat
|
|
||||||
rm -f Cx.$$ tau.$$ cp.$$
|
|
||||||
|
|
||||||
mv -f $(foamListTimes) "$dirResult"
|
if [ "$common_mesh" = true ]
|
||||||
[ -d postProcessing ] && mv -f postProcessing "$dirResult"
|
then
|
||||||
[ -d processor0 ] && mv -f processor* "$dirResult"
|
if [ ! -d results/mesh ]
|
||||||
mv -f log.* "$dirResult"
|
then
|
||||||
mv -f profiles.dat "$dirResult"
|
printf "\n## Store the mesh of %s as the common mesh\n\n" "$setup"
|
||||||
cp -f system/{fv*,controlDict} constant/*Properties "$dirSettings"
|
mkdir -p results/mesh
|
||||||
mv -f 0/ "$dirSettings"
|
cp -Rf "$dirResult"/constant/polyMesh results/mesh/.
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
echo " # Cleaning up the case"
|
if [ "$common_dynamic_code" = true ]
|
||||||
|
then
|
||||||
|
if [ ! -d results/dynamicCode ] && [ -d "$dirResult"/dynamicCode ]
|
||||||
|
then
|
||||||
|
printf "\n## Store the dynamic code of %s as the common dynamic code\n\n" "$setup"
|
||||||
|
cp -Rf "$dirResult"/dynamicCode results/.
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
cleanTimeDirectories
|
|
||||||
cleanAuxiliary
|
|
||||||
cleanPostProcessing
|
|
||||||
|
|
||||||
else
|
else
|
||||||
|
printf " # Directory %s already exists\n" "$dirResult"
|
||||||
echo " # Directory $dirResult already exists"
|
printf " # Skipping the computation of the given setup\n"
|
||||||
echo " # Skipping the computation"
|
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -120,58 +145,28 @@ collect() {
|
|||||||
|
|
||||||
for setup in $setups
|
for setup in $setups
|
||||||
do
|
do
|
||||||
|
dirSetupOrig="setups.orig/$setup"
|
||||||
|
|
||||||
echo ""
|
if [ ! -d "$dirSetupOrig" ]
|
||||||
echo "# Computations for the setup: $setup"
|
|
||||||
echo ""
|
|
||||||
|
|
||||||
dirSetup="setups.orig/$setup"
|
|
||||||
|
|
||||||
if [ ! -d "$dirSetup" ]
|
|
||||||
then
|
then
|
||||||
echo "Setup directory: $dirSetup" \
|
echo "Setup directory: $dirSetupOrig" \
|
||||||
"could not be found - skipping execution" 1>&2
|
"could not be found - skipping execution" 1>&2
|
||||||
exit 1
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cp -rfL "$dirSetup/0.orig" .
|
if [ "$run" = true ]
|
||||||
cp -rfL "$dirSetup/constant" .
|
|
||||||
cp -rfL "$dirSetup/system" .
|
|
||||||
cp -rf 0.orig/ 0/
|
|
||||||
|
|
||||||
canCompile || exit 0 # Dynamic code
|
|
||||||
|
|
||||||
if [ ! -d constant/polyMesh ]
|
|
||||||
then
|
then
|
||||||
|
run_setup "$setup"
|
||||||
runApplication blockMesh
|
|
||||||
|
|
||||||
runApplication renumberMesh -overwrite -constant
|
|
||||||
|
|
||||||
runApplication checkMesh -allTopology -allGeometry -constant
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$parallel" = true ]
|
|
||||||
then
|
|
||||||
|
|
||||||
runApplication decomposePar
|
|
||||||
|
|
||||||
runParallel -s parallel renumberMesh -overwrite
|
|
||||||
|
|
||||||
runParallel $(getApplication)
|
|
||||||
|
|
||||||
runApplication reconstructPar
|
|
||||||
|
|
||||||
else
|
else
|
||||||
|
dry_run_setup "$setup"
|
||||||
runApplication $(getApplication)
|
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
collect "$setup"
|
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
|
if notTest "$@" && [ "$run" = true ]
|
||||||
|
then
|
||||||
|
./plot
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
@ -122,44 +122,39 @@ PLT_X_CP
|
|||||||
|
|
||||||
# Requires gnuplot
|
# Requires gnuplot
|
||||||
command -v gnuplot >/dev/null || {
|
command -v gnuplot >/dev/null || {
|
||||||
echo "FOAM FATAL ERROR: gnuplot not found - skipping graph creation" 1>&2
|
echo "gnuplot not found - skipping graph creation" 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
# Requires awk
|
# Requires awk
|
||||||
command -v awk >/dev/null || {
|
command -v awk >/dev/null || {
|
||||||
echo "FOAM FATAL ERROR: awk not found - skipping graph creation" 1>&2
|
echo "awk not found - skipping graph creation" 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
# Check "results" directory
|
# Check "results" directory
|
||||||
[ -d "results" ] || {
|
[ -d "results" ] || {
|
||||||
echo "FOAM FATAL ERROR: No results directory found - skipping graph creation" 1>&2
|
echo "No results directory found - skipping graph creation" 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
if notTest "$@"
|
dirPlots="plots"
|
||||||
then
|
[ -d "$dirPlots" ] || mkdir -p "$dirPlots"
|
||||||
|
|
||||||
dirPlots="plots/$setup"
|
echo ""
|
||||||
[ -d "$dirPlots" ] || mkdir -p "$dirPlots"
|
echo "# Plots for the skin friction coefficient"
|
||||||
|
echo ""
|
||||||
|
|
||||||
echo ""
|
plot_x_vs_Cf "$Uref" $setups
|
||||||
echo "# Plots for the skin friction coefficient"
|
|
||||||
echo ""
|
|
||||||
|
|
||||||
plot_x_vs_Cf "$Uref" $setups
|
echo ""
|
||||||
|
echo "# Plots for the pressure coefficient"
|
||||||
|
echo ""
|
||||||
|
|
||||||
echo ""
|
plot_x_vs_Cp "$Uref" $setups
|
||||||
echo "# Plots for the pressure coefficient"
|
|
||||||
echo ""
|
|
||||||
|
|
||||||
plot_x_vs_Cp "$Uref" $setups
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
@ -1 +0,0 @@
|
|||||||
../../common/0.orig/U
|
|
@ -1 +0,0 @@
|
|||||||
../../common/0.orig/nut
|
|
@ -1 +0,0 @@
|
|||||||
../../common/0.orig/p
|
|
@ -1 +0,0 @@
|
|||||||
../../common/constant/transportProperties
|
|
@ -1 +0,0 @@
|
|||||||
../common/system/
|
|
8
tutorials/incompressible/simpleFoam/bump2D/setups.orig/common/Allclean
Executable file
8
tutorials/incompressible/simpleFoam/bump2D/setups.orig/common/Allclean
Executable file
@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
cd "${0%/*}" || exit # Run from this directory
|
||||||
|
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
cleanCase0
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
61
tutorials/incompressible/simpleFoam/bump2D/setups.orig/common/Allrun
Executable file
61
tutorials/incompressible/simpleFoam/bump2D/setups.orig/common/Allrun
Executable file
@ -0,0 +1,61 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
cd "${0%/*}" || exit # Run from this directory
|
||||||
|
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#######################################
|
||||||
|
# Extract a value (Eg, from boundaryField/bump/value)
|
||||||
|
# Arguments:
|
||||||
|
# $1 = dictEntry
|
||||||
|
# $2 = inputFile
|
||||||
|
# $3 = outputFile
|
||||||
|
# Outputs:
|
||||||
|
# Writes to 'outputFile'
|
||||||
|
# Notes:
|
||||||
|
# Only retains values between, but not including the ( ) delimiters.
|
||||||
|
# For example,
|
||||||
|
#----
|
||||||
|
# value nonuniform List<scalar>
|
||||||
|
# 110
|
||||||
|
# (
|
||||||
|
# 0.0041520092
|
||||||
|
# 0.012577691
|
||||||
|
# 0.021250264
|
||||||
|
# 0.030176962
|
||||||
|
# )
|
||||||
|
# ;
|
||||||
|
#######################################
|
||||||
|
extractVal()
|
||||||
|
{
|
||||||
|
if [ -f "$2" ]
|
||||||
|
then
|
||||||
|
foamDictionary -entry "$1" -value "$2" | \
|
||||||
|
sed -n '/(/,/)/{ s/[()]//g; /^ *$/d; p}' \
|
||||||
|
> "$3"
|
||||||
|
else
|
||||||
|
# Or some other tag?
|
||||||
|
echo "Not such file: $2" 1>&2
|
||||||
|
echo "0" > "$3"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
./Allrun.pre
|
||||||
|
|
||||||
|
runApplication $(getApplication)
|
||||||
|
|
||||||
|
|
||||||
|
endTime=$(foamListTimes -latestTime)
|
||||||
|
|
||||||
|
# Create datasets for benchmark comparisons
|
||||||
|
extractVal boundaryField.bump.value "$endTime/Cx" Cx.$$
|
||||||
|
extractVal boundaryField.bump.value "$endTime/wallShearStress" tau.$$
|
||||||
|
extractVal boundaryField.bump.value "$endTime/Cp" cp.$$
|
||||||
|
|
||||||
|
echo "# ccx tau_xx tau_yy tau_zz cp" > profiles.dat
|
||||||
|
paste -d ' ' Cx.$$ tau.$$ cp.$$ >> profiles.dat
|
||||||
|
rm -f Cx.$$ tau.$$ cp.$$
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
@ -0,0 +1,65 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
cd "${0%/*}" || exit # Run from this directory
|
||||||
|
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#######################################
|
||||||
|
# Extract a value (Eg, from boundaryField/bump/value)
|
||||||
|
# Arguments:
|
||||||
|
# $1 = dictEntry
|
||||||
|
# $2 = inputFile
|
||||||
|
# $3 = outputFile
|
||||||
|
# Outputs:
|
||||||
|
# Writes to 'outputFile'
|
||||||
|
# Notes:
|
||||||
|
# Only retains values between, but not including the ( ) delimiters.
|
||||||
|
# For example,
|
||||||
|
#----
|
||||||
|
# value nonuniform List<scalar>
|
||||||
|
# 110
|
||||||
|
# (
|
||||||
|
# 0.0041520092
|
||||||
|
# 0.012577691
|
||||||
|
# 0.021250264
|
||||||
|
# 0.030176962
|
||||||
|
# )
|
||||||
|
# ;
|
||||||
|
#######################################
|
||||||
|
extractVal()
|
||||||
|
{
|
||||||
|
if [ -f "$2" ]
|
||||||
|
then
|
||||||
|
foamDictionary -entry "$1" -value "$2" | \
|
||||||
|
sed -n '/(/,/)/{ s/[()]//g; /^ *$/d; p}' \
|
||||||
|
> "$3"
|
||||||
|
else
|
||||||
|
# Or some other tag?
|
||||||
|
echo "Not such file: $2" 1>&2
|
||||||
|
echo "0" > "$3"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
./Allrun.pre
|
||||||
|
|
||||||
|
runApplication decomposePar
|
||||||
|
|
||||||
|
runParallel $(getApplication)
|
||||||
|
|
||||||
|
runApplication reconstructPar
|
||||||
|
|
||||||
|
|
||||||
|
endTime=$(foamListTimes -latestTime)
|
||||||
|
|
||||||
|
# Create datasets for benchmark comparisons
|
||||||
|
extractVal boundaryField.bump.value "$endTime/Cx" Cx.$$
|
||||||
|
extractVal boundaryField.bump.value "$endTime/wallShearStress" tau.$$
|
||||||
|
extractVal boundaryField.bump.value "$endTime/Cp" cp.$$
|
||||||
|
|
||||||
|
echo "# ccx tau_xx tau_yy tau_zz cp" > profiles.dat
|
||||||
|
paste -d ' ' Cx.$$ tau.$$ cp.$$ >> profiles.dat
|
||||||
|
rm -f Cx.$$ tau.$$ cp.$$
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
19
tutorials/incompressible/simpleFoam/bump2D/setups.orig/common/Allrun.pre
Executable file
19
tutorials/incompressible/simpleFoam/bump2D/setups.orig/common/Allrun.pre
Executable file
@ -0,0 +1,19 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
cd "${0%/*}" || exit # Run from this directory
|
||||||
|
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
canCompile || exit 0 # Dynamic code
|
||||||
|
|
||||||
|
restore0Dir
|
||||||
|
|
||||||
|
if [ ! -d constant/polyMesh ]
|
||||||
|
then
|
||||||
|
runApplication blockMesh
|
||||||
|
|
||||||
|
runApplication renumberMesh -overwrite -constant
|
||||||
|
|
||||||
|
runApplication checkMesh -allTopology -allGeometry -constant
|
||||||
|
fi
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
@ -1 +0,0 @@
|
|||||||
../../common/0.orig/U
|
|
@ -1 +0,0 @@
|
|||||||
../../common/0.orig/nut
|
|
@ -1 +0,0 @@
|
|||||||
../../common/0.orig/p
|
|
@ -1 +0,0 @@
|
|||||||
../../common/constant/transportProperties
|
|
@ -1 +0,0 @@
|
|||||||
../common/system/
|
|
@ -1 +0,0 @@
|
|||||||
../../common/0.orig/U
|
|
@ -1 +0,0 @@
|
|||||||
../../common/0.orig/nut
|
|
@ -1 +0,0 @@
|
|||||||
../../common/0.orig/p
|
|
@ -1 +0,0 @@
|
|||||||
../../common/constant/transportProperties
|
|
@ -1 +0,0 @@
|
|||||||
../common/system
|
|
@ -3,11 +3,7 @@ cd "${0%/*}" || exit # Run from this directory
|
|||||||
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
|
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
cleanCase0
|
rm -rf setups
|
||||||
|
|
||||||
rm -rf 0.orig
|
|
||||||
rm -rf system
|
|
||||||
rm -rf constant
|
|
||||||
rm -rf results
|
rm -rf results
|
||||||
rm -rf plots
|
rm -rf plots
|
||||||
rm -f setups.orig/common/system/blockMeshDict
|
rm -f setups.orig/common/system/blockMeshDict
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
cd "${0%/*}" || exit # Run from this directory
|
cd "${0%/*}" || exit # Run from this directory
|
||||||
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
|
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
|
||||||
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
# settings
|
# settings
|
||||||
@ -12,9 +11,18 @@ cd "${0%/*}" || exit # Run from this directory
|
|||||||
kEpsilon
|
kEpsilon
|
||||||
"
|
"
|
||||||
|
|
||||||
|
# flag to enable computations
|
||||||
|
run=true
|
||||||
|
|
||||||
# flag to enable computations in parallel mode
|
# flag to enable computations in parallel mode
|
||||||
parallel=true
|
parallel=true
|
||||||
|
|
||||||
|
# flag to enable to use a common mesh
|
||||||
|
common_mesh=true
|
||||||
|
|
||||||
|
# flag to enable to use a common dynamic code
|
||||||
|
common_dynamic_code=true
|
||||||
|
|
||||||
# operand setups for the wall-normal height of the first-cell centre
|
# operand setups for the wall-normal height of the first-cell centre
|
||||||
declare -A grading_vs_yp
|
declare -A grading_vs_yp
|
||||||
#level 5 gradings
|
#level 5 gradings
|
||||||
@ -40,99 +48,119 @@ cd "${0%/*}" || exit # Run from this directory
|
|||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
#######################################
|
#######################################
|
||||||
# Extract a value (Eg, from boundaryField/bump/value)
|
# Create the given setup
|
||||||
# Arguments:
|
# Arguments:
|
||||||
# $1 = dictEntry
|
# $1 = Path to create the setup
|
||||||
# $2 = inputFile
|
|
||||||
# $3 = outputFile
|
|
||||||
# Outputs:
|
# Outputs:
|
||||||
# Writes to 'outputFile'
|
# Writes info to stdout
|
||||||
# Notes:
|
|
||||||
# Only retains values between, but not including the ( ) delimiters.
|
|
||||||
# For example,
|
|
||||||
#----
|
|
||||||
# value nonuniform List<scalar>
|
|
||||||
# 110
|
|
||||||
# (
|
|
||||||
# 0.0041520092
|
|
||||||
# 0.012577691
|
|
||||||
# 0.021250264
|
|
||||||
# 0.030176962
|
|
||||||
# )
|
|
||||||
# ;
|
|
||||||
#######################################
|
#######################################
|
||||||
extractVal()
|
dry_run_setup() {
|
||||||
{
|
|
||||||
if [ -f "$2" ]
|
[ $# -eq 0 ] && { echo "Usage error: $0"; exit 1; }
|
||||||
|
|
||||||
|
setup="$1"
|
||||||
|
yp="$2"
|
||||||
|
dirSetup="setups/$setup/$yp"
|
||||||
|
dirSetupOrig="setups.orig/$setup"
|
||||||
|
dirOrig="$dirSetupOrig/0.orig"
|
||||||
|
dirConstant="$dirSetupOrig/constant"
|
||||||
|
dirSystem="$dirSetupOrig/system"
|
||||||
|
|
||||||
|
printf "\n# Create the setup: %s %s\n" "$setup" yPlus-"$yp"
|
||||||
|
|
||||||
|
if [ ! -d "$dirSetup" ]
|
||||||
then
|
then
|
||||||
foamDictionary -entry "$1" -value "$2" | \
|
mkdir -p "$dirSetup"
|
||||||
sed -n '/(/,/)/{ s/[()]//g; /^ *$/d; p}' \
|
|
||||||
> "$3"
|
cp -aRfL "setups.orig/common/." "$dirSetup"
|
||||||
|
cp -afL "$dirSetupOrig"/All* "$dirSetup" 2>/dev/null || :
|
||||||
|
[ -d "$dirOrig" ] && cp -aRfL "$dirOrig/." "$dirSetup/0.orig"
|
||||||
|
[ -d "$dirConstant" ] && cp -aRfL "$dirConstant/." "$dirSetup/constant"
|
||||||
|
[ -d "$dirSystem" ] && cp -aRfL "$dirSystem/." "$dirSetup/system"
|
||||||
else
|
else
|
||||||
# Or some other tag?
|
printf "\n # Directory %s already exists\n" "$dirSetup"
|
||||||
echo "Not such file: $2" 1>&2
|
printf " # Skipping the creation of a new setup\n"
|
||||||
echo "0" > "$3"
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#######################################
|
#######################################
|
||||||
# Collect results into a given path
|
# Run the given setup
|
||||||
# and clean the case for the next run
|
|
||||||
# Arguments:
|
# Arguments:
|
||||||
# $1 = Path to move results
|
# $1 = Path to the setup to run
|
||||||
# Outputs:
|
# Outputs:
|
||||||
# Writes info to stdout
|
# Writes info to stdout
|
||||||
#######################################
|
#######################################
|
||||||
collect() {
|
run_setup() {
|
||||||
|
|
||||||
[ $# -eq 0 ] && { echo "Usage: $0 dir-model"; exit 1; }
|
[ $# -eq 0 ] && { echo "Usage error: $0"; exit 1; }
|
||||||
|
|
||||||
collection="$1"
|
setup="$1"
|
||||||
|
yp="$2"
|
||||||
|
dirSetup="setups/$setup/$yp"
|
||||||
|
dirResult="results/$setup/$yp"
|
||||||
|
|
||||||
dirResult=results/"$collection"
|
dry_run_setup "$setup" "$yp"
|
||||||
dirSettings="$dirResult"/settings
|
[ -d results ] || mkdir -p results
|
||||||
|
[ -d results/"$setup" ] || mkdir -p results/"$setup"
|
||||||
|
|
||||||
|
printf "\n# Run the setup: %s %s\n\n" "$setup" yPlus-"$yp"
|
||||||
|
|
||||||
if [ ! -d "$dirResult" ]
|
if [ ! -d "$dirResult" ]
|
||||||
then
|
then
|
||||||
|
cp -Rf "$dirSetup" "$dirResult"
|
||||||
|
|
||||||
echo " # Collecting results and settings into $dirResult"
|
if [ "$common_mesh" = true ]
|
||||||
|
then
|
||||||
|
if [ -d results/mesh ]
|
||||||
|
then
|
||||||
|
printf "## Copy the common mesh to the setup: %s\n\n" "$setup"
|
||||||
|
cp -Rf results/mesh/polyMesh "$dirResult"/constant/.
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
mkdir -p "$dirResult"
|
if [ "$common_dynamic_code" = true ]
|
||||||
mkdir -p "$dirSettings"
|
then
|
||||||
|
if [ -d results/dynamicCode ]
|
||||||
|
then
|
||||||
|
printf "## Copy the common dynamic code to the setup: %s\n\n" "$setup"
|
||||||
|
cp -Rf results/dynamicCode "$dirResult"/.
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
endTime=$(foamListTimes -latestTime)
|
|
||||||
|
|
||||||
# Create datasets for benchmark comparisons
|
if [ "$parallel" = true ]
|
||||||
extractVal boundaryField.bottomWall.value "$endTime/Cx" Cx.$$
|
then
|
||||||
extractVal boundaryField.bottomWall.value "$endTime/wallShearStress" tau.$$
|
( cd "$dirResult" && ./Allrun-parallel )
|
||||||
extractVal boundaryField.bottomWall.value "$endTime/yPlus" yPlus.$$
|
else
|
||||||
|
( cd "$dirResult" && ./Allrun )
|
||||||
|
fi
|
||||||
|
|
||||||
echo "# ccx tau_xx tau_yy tau_zz y+" > profiles.dat
|
|
||||||
paste -d ' ' Cx.$$ tau.$$ yPlus.$$ >> profiles.dat
|
|
||||||
rm -f Cx.$$ tau.$$ yPlus.$$
|
|
||||||
|
|
||||||
mv -f $(foamListTimes) "$dirResult"
|
if [ "$common_mesh" = true ]
|
||||||
[ -d postProcessing ] && mv -f postProcessing "$dirResult"
|
then
|
||||||
[ -d processor0 ] && mv -f processor* "$dirResult"
|
if [ ! -d results/mesh ]
|
||||||
mv -f log.* "$dirResult"
|
then
|
||||||
mv -f profiles.dat "$dirResult"
|
printf "\n## Store the mesh of %s as the common mesh\n\n" "$setup"
|
||||||
cp -f system/{fv*,controlDict} constant/*Properties "$dirSettings"
|
mkdir -p results/mesh
|
||||||
mv -f 0/ "$dirSettings"
|
cp -Rf "$dirResult"/constant/polyMesh results/mesh/.
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
echo " # Cleaning up the case"
|
if [ "$common_dynamic_code" = true ]
|
||||||
|
then
|
||||||
|
if [ ! -d results/dynamicCode ] && [ -d "$dirResult"/dynamicCode ]
|
||||||
|
then
|
||||||
|
printf "\n## Store the dynamic code of %s as the common dynamic code\n\n" "$setup"
|
||||||
|
cp -Rf "$dirResult"/dynamicCode results/.
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
cleanTimeDirectories
|
|
||||||
cleanAuxiliary
|
|
||||||
cleanPostProcessing
|
|
||||||
|
|
||||||
else
|
else
|
||||||
|
printf " # Directory %s already exists\n" "$dirResult"
|
||||||
echo " # Directory $dirResult already exists"
|
printf " # Skipping the computation of the given setup\n"
|
||||||
echo " # Skipping the computation"
|
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -140,7 +168,6 @@ collect() {
|
|||||||
|
|
||||||
for i in "${!grading_vs_yp[@]}"
|
for i in "${!grading_vs_yp[@]}"
|
||||||
do
|
do
|
||||||
|
|
||||||
yp=$i
|
yp=$i
|
||||||
grading=${grading_vs_yp[$yp]}
|
grading=${grading_vs_yp[$yp]}
|
||||||
|
|
||||||
@ -150,60 +177,31 @@ do
|
|||||||
|
|
||||||
for setup in $setups
|
for setup in $setups
|
||||||
do
|
do
|
||||||
|
dirSetupOrig="setups.orig/$setup"
|
||||||
|
|
||||||
echo ""
|
if [ ! -d "$dirSetupOrig" ]
|
||||||
echo "# Computations for the setup and y+: $setup - $yp"
|
|
||||||
echo ""
|
|
||||||
|
|
||||||
dirSetup="setups.orig/$setup"
|
|
||||||
|
|
||||||
if [ ! -d "$dirSetup" ]
|
|
||||||
then
|
then
|
||||||
echo "Setup directory: $dirSetup" \
|
echo "Setup directory: $dirSetupOrig" \
|
||||||
"could not be found - skipping execution" 1>&2
|
"could not be found - skipping execution" 1>&2
|
||||||
exit 1
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cp -rfL "$dirSetup/0.orig" .
|
if [ "$run" = true ]
|
||||||
cp -rfL "$dirSetup/constant" .
|
|
||||||
cp -rfL "$dirSetup/system" .
|
|
||||||
cp -rf 0.orig/ 0/
|
|
||||||
|
|
||||||
if [ ! -d constant/polyMesh ]
|
|
||||||
then
|
then
|
||||||
|
run_setup "$setup" "$yp"
|
||||||
runApplication blockMesh
|
|
||||||
|
|
||||||
runApplication renumberMesh -overwrite -constant
|
|
||||||
|
|
||||||
runApplication checkMesh -allTopology -allGeometry -constant
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$parallel" = true ]
|
|
||||||
then
|
|
||||||
|
|
||||||
runApplication decomposePar
|
|
||||||
|
|
||||||
runParallel $(getApplication)
|
|
||||||
|
|
||||||
runApplication reconstructPar
|
|
||||||
|
|
||||||
else
|
else
|
||||||
|
dry_run_setup "$setup" "$yp"
|
||||||
runApplication $(getApplication)
|
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
collect "$setup/$yp"
|
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
||||||
rm -rf 0.orig
|
rm -Rf results/mesh
|
||||||
rm -rf constant
|
|
||||||
rm -rf system
|
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
if notTest "$@" && [ "$run" = true ]
|
||||||
|
then
|
||||||
|
./plot
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
@ -63,7 +63,7 @@ plot_Rex_vs_Cf() {
|
|||||||
|
|
||||||
plot \
|
plot \
|
||||||
weighardt(x) t "Weighardt" w lines lc "red" lw 2, \
|
weighardt(x) t "Weighardt" w lines lc "red" lw 2, \
|
||||||
samples u (\$1 - X0)*Uref/nu:(sqrt(\$2*\$2 + \$3*\$3 + \$4*\$4)/(0.5*Uref*Uref)) \
|
samples u (\$1 - x0)*Uref/nu:(sqrt(\$2*\$2 + \$3*\$3 + \$4*\$4)/(0.5*Uref*Uref)) \
|
||||||
t "$setup y^+ ${yp}" w l lc "black" lw 2
|
t "$setup y^+ ${yp}" w l lc "black" lw 2
|
||||||
PLT_REX_VS_CF
|
PLT_REX_VS_CF
|
||||||
}
|
}
|
||||||
@ -73,19 +73,19 @@ PLT_REX_VS_CF
|
|||||||
|
|
||||||
# Requires gnuplot
|
# Requires gnuplot
|
||||||
command -v gnuplot >/dev/null || {
|
command -v gnuplot >/dev/null || {
|
||||||
echo "FOAM FATAL ERROR: gnuplot not found - skipping graph creation" 1>&2
|
echo "gnuplot not found - skipping graph creation" 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
# Requires awk
|
# Requires awk
|
||||||
command -v awk >/dev/null || {
|
command -v awk >/dev/null || {
|
||||||
echo "FOAM FATAL ERROR: awk not found - skipping graph creation" 1>&2
|
echo "awk not found - skipping graph creation" 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
# Check "results" directory
|
# Check "results" directory
|
||||||
[ -d "results" ] || {
|
[ -d "results" ] || {
|
||||||
echo "FOAM FATAL ERROR: No results directory found - skipping graph creation" 1>&2
|
echo "No results directory found - skipping graph creation" 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -94,26 +94,26 @@ command -v awk >/dev/null || {
|
|||||||
|
|
||||||
for setup in $setups
|
for setup in $setups
|
||||||
do
|
do
|
||||||
|
|
||||||
for yp in $yps
|
for yp in $yps
|
||||||
do
|
do
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "# Plots for the setup and y+: $setup - $yp"
|
echo "# Plots for the setup and y+: $setup - $yp"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
dirPlots="plots/$setup/$yp"
|
resultsDir="results/$setup/$yp"
|
||||||
|
[ -d "$resultsDir" ] || {
|
||||||
|
echo "No $resultsDir directory found - skipping graph creation" 1>&2
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
dirPlots="plots/$setup"
|
||||||
[ -d "$dirPlots" ] || mkdir -p "$dirPlots"
|
[ -d "$dirPlots" ] || mkdir -p "$dirPlots"
|
||||||
|
|
||||||
# few manipulations
|
|
||||||
resultsDir="results/$setup/$yp"
|
|
||||||
Uref=$(foamDictionary $resultsDir/0/U -entry internalField | sed 's/^.*(\s*\([^ ]*\).*/\1/g')
|
Uref=$(foamDictionary $resultsDir/0/U -entry internalField | sed 's/^.*(\s*\([^ ]*\).*/\1/g')
|
||||||
nu=$(foamDictionary $resultsDir/settings/transportProperties -entry nu | sed 's|^.*\s\(.*\);|\1|g')
|
nu=$(foamDictionary $resultsDir/constant/transportProperties -entry nu | sed 's|^.*\s\(.*\);|\1|g')
|
||||||
|
|
||||||
plot_Rex_vs_Cf "$setup" "$yp" "$Uref" "$nu"
|
plot_Rex_vs_Cf "$setup" "$yp" "$Uref" "$nu"
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
|
@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
cd "${0%/*}" || exit # Run from this directory
|
||||||
|
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
cleanCase0
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
@ -0,0 +1,61 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
cd "${0%/*}" || exit # Run from this directory
|
||||||
|
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#######################################
|
||||||
|
# Extract a value (Eg, from boundaryField/bump/value)
|
||||||
|
# Arguments:
|
||||||
|
# $1 = dictEntry
|
||||||
|
# $2 = inputFile
|
||||||
|
# $3 = outputFile
|
||||||
|
# Outputs:
|
||||||
|
# Writes to 'outputFile'
|
||||||
|
# Notes:
|
||||||
|
# Only retains values between, but not including the ( ) delimiters.
|
||||||
|
# For example,
|
||||||
|
#----
|
||||||
|
# value nonuniform List<scalar>
|
||||||
|
# 110
|
||||||
|
# (
|
||||||
|
# 0.0041520092
|
||||||
|
# 0.012577691
|
||||||
|
# 0.021250264
|
||||||
|
# 0.030176962
|
||||||
|
# )
|
||||||
|
# ;
|
||||||
|
#######################################
|
||||||
|
extractVal()
|
||||||
|
{
|
||||||
|
if [ -f "$2" ]
|
||||||
|
then
|
||||||
|
foamDictionary -entry "$1" -value "$2" | \
|
||||||
|
sed -n '/(/,/)/{ s/[()]//g; /^ *$/d; p}' \
|
||||||
|
> "$3"
|
||||||
|
else
|
||||||
|
# Or some other tag?
|
||||||
|
echo "Not such file: $2" 1>&2
|
||||||
|
echo "0" > "$3"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
./Allrun.pre
|
||||||
|
|
||||||
|
runApplication $(getApplication)
|
||||||
|
|
||||||
|
|
||||||
|
endTime=$(foamListTimes -latestTime)
|
||||||
|
|
||||||
|
# Create datasets for benchmark comparisons
|
||||||
|
extractVal boundaryField.bottomWall.value "$endTime/Cx" Cx.$$
|
||||||
|
extractVal boundaryField.bottomWall.value "$endTime/wallShearStress" tau.$$
|
||||||
|
extractVal boundaryField.bottomWall.value "$endTime/yPlus" yPlus.$$
|
||||||
|
|
||||||
|
echo "# ccx tau_xx tau_yy tau_zz y+" > profiles.dat
|
||||||
|
paste -d ' ' Cx.$$ tau.$$ yPlus.$$ >> profiles.dat
|
||||||
|
rm -f Cx.$$ tau.$$ yPlus.$$
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
@ -0,0 +1,65 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
cd "${0%/*}" || exit # Run from this directory
|
||||||
|
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
#######################################
|
||||||
|
# Extract a value (Eg, from boundaryField/bump/value)
|
||||||
|
# Arguments:
|
||||||
|
# $1 = dictEntry
|
||||||
|
# $2 = inputFile
|
||||||
|
# $3 = outputFile
|
||||||
|
# Outputs:
|
||||||
|
# Writes to 'outputFile'
|
||||||
|
# Notes:
|
||||||
|
# Only retains values between, but not including the ( ) delimiters.
|
||||||
|
# For example,
|
||||||
|
#----
|
||||||
|
# value nonuniform List<scalar>
|
||||||
|
# 110
|
||||||
|
# (
|
||||||
|
# 0.0041520092
|
||||||
|
# 0.012577691
|
||||||
|
# 0.021250264
|
||||||
|
# 0.030176962
|
||||||
|
# )
|
||||||
|
# ;
|
||||||
|
#######################################
|
||||||
|
extractVal()
|
||||||
|
{
|
||||||
|
if [ -f "$2" ]
|
||||||
|
then
|
||||||
|
foamDictionary -entry "$1" -value "$2" | \
|
||||||
|
sed -n '/(/,/)/{ s/[()]//g; /^ *$/d; p}' \
|
||||||
|
> "$3"
|
||||||
|
else
|
||||||
|
# Or some other tag?
|
||||||
|
echo "Not such file: $2" 1>&2
|
||||||
|
echo "0" > "$3"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
./Allrun.pre
|
||||||
|
|
||||||
|
runApplication decomposePar
|
||||||
|
|
||||||
|
runParallel $(getApplication)
|
||||||
|
|
||||||
|
runApplication reconstructPar
|
||||||
|
|
||||||
|
|
||||||
|
endTime=$(foamListTimes -latestTime)
|
||||||
|
|
||||||
|
# Create datasets for benchmark comparisons
|
||||||
|
extractVal boundaryField.bottomWall.value "$endTime/Cx" Cx.$$
|
||||||
|
extractVal boundaryField.bottomWall.value "$endTime/wallShearStress" tau.$$
|
||||||
|
extractVal boundaryField.bottomWall.value "$endTime/yPlus" yPlus.$$
|
||||||
|
|
||||||
|
echo "# ccx tau_xx tau_yy tau_zz y+" > profiles.dat
|
||||||
|
paste -d ' ' Cx.$$ tau.$$ yPlus.$$ >> profiles.dat
|
||||||
|
rm -f Cx.$$ tau.$$ yPlus.$$
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
@ -0,0 +1,19 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
cd "${0%/*}" || exit # Run from this directory
|
||||||
|
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
canCompile || exit 0 # Dynamic code
|
||||||
|
|
||||||
|
restore0Dir
|
||||||
|
|
||||||
|
if [ ! -d constant/polyMesh ]
|
||||||
|
then
|
||||||
|
runApplication blockMesh
|
||||||
|
|
||||||
|
runApplication renumberMesh -overwrite -constant
|
||||||
|
|
||||||
|
runApplication checkMesh -allTopology -allGeometry -constant
|
||||||
|
fi
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
@ -1 +0,0 @@
|
|||||||
../../common/0.orig/U
|
|
@ -1 +0,0 @@
|
|||||||
../../common/0.orig/p
|
|
@ -1 +0,0 @@
|
|||||||
../../common/constant/transportProperties
|
|
@ -1 +0,0 @@
|
|||||||
../common/system/
|
|
@ -1 +0,0 @@
|
|||||||
../../common/0.orig/U
|
|
@ -1 +0,0 @@
|
|||||||
../../common/0.orig/p
|
|
@ -1 +0,0 @@
|
|||||||
../../common/constant/transportProperties
|
|
@ -1 +0,0 @@
|
|||||||
../common/system/
|
|
@ -3,11 +3,7 @@ cd "${0%/*}" || exit # Run from this directory
|
|||||||
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
|
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
cleanCase0
|
rm -rf setups
|
||||||
|
|
||||||
rm -rf 0.orig
|
|
||||||
rm -rf system
|
|
||||||
rm -rf constant
|
|
||||||
rm -rf results
|
rm -rf results
|
||||||
rm -rf plots
|
rm -rf plots
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
cd "${0%/*}" || exit # Run from this directory
|
cd "${0%/*}" || exit # Run from this directory
|
||||||
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
|
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
|
||||||
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
# settings
|
# settings
|
||||||
@ -12,54 +11,131 @@ cd "${0%/*}" || exit # Run from this directory
|
|||||||
kOmegaSST
|
kOmegaSST
|
||||||
"
|
"
|
||||||
|
|
||||||
|
# flag to enable computations
|
||||||
|
run=true
|
||||||
|
|
||||||
# flag to enable computations in parallel mode
|
# flag to enable computations in parallel mode
|
||||||
parallel=true
|
parallel=true
|
||||||
|
|
||||||
|
# flag to enable to use a common mesh
|
||||||
|
common_mesh=true
|
||||||
|
|
||||||
|
# flag to enable to use a common dynamic code
|
||||||
|
common_dynamic_code=false
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
#######################################
|
#######################################
|
||||||
# Collect results into a given path
|
# Create the given setup
|
||||||
# and clean the case for the next run
|
|
||||||
# Arguments:
|
# Arguments:
|
||||||
# $1 = Path to move results
|
# $1 = Path to create the setup
|
||||||
# Outputs:
|
# Outputs:
|
||||||
# Writes info to stdout
|
# Writes info to stdout
|
||||||
#######################################
|
#######################################
|
||||||
collect() {
|
dry_run_setup() {
|
||||||
|
|
||||||
[ $# -eq 0 ] && { echo "Usage: $0 dir-model"; exit 1; }
|
[ $# -eq 0 ] && { echo "Usage error: $0"; exit 1; }
|
||||||
|
|
||||||
collection="$1"
|
setup="$1"
|
||||||
|
dirSetup="setups/$setup"
|
||||||
|
dirSetupOrig="setups.orig/$setup"
|
||||||
|
dirOrig="$dirSetupOrig/0.orig"
|
||||||
|
dirConstant="$dirSetupOrig/constant"
|
||||||
|
dirSystem="$dirSetupOrig/system"
|
||||||
|
|
||||||
dirResult=results/"$collection"
|
printf "\n# Create the setup: %s\n" "$setup"
|
||||||
dirSettings="$dirResult"/settings
|
|
||||||
|
if [ ! -d "$dirSetup" ]
|
||||||
|
then
|
||||||
|
mkdir -p "$dirSetup"
|
||||||
|
|
||||||
|
cp -aRfL "setups.orig/common/." "$dirSetup"
|
||||||
|
cp -afL "$dirSetupOrig"/All* "$dirSetup" 2>/dev/null || :
|
||||||
|
[ -d "$dirOrig" ] && cp -aRfL "$dirOrig/." "$dirSetup/0.orig"
|
||||||
|
[ -d "$dirConstant" ] && cp -aRfL "$dirConstant/." "$dirSetup/constant"
|
||||||
|
[ -d "$dirSystem" ] && cp -aRfL "$dirSystem/." "$dirSetup/system"
|
||||||
|
else
|
||||||
|
printf "\n # Directory %s already exists\n" "$dirSetup"
|
||||||
|
printf " # Skipping the creation of a new setup\n"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#######################################
|
||||||
|
# Run the given setup
|
||||||
|
# Arguments:
|
||||||
|
# $1 = Path to the setup to run
|
||||||
|
# Outputs:
|
||||||
|
# Writes info to stdout
|
||||||
|
#######################################
|
||||||
|
run_setup() {
|
||||||
|
|
||||||
|
[ $# -eq 0 ] && { echo "Usage error: $0"; exit 1; }
|
||||||
|
|
||||||
|
setup="$1"
|
||||||
|
dirSetup="setups/$setup"
|
||||||
|
dirResult="results/$setup"
|
||||||
|
|
||||||
|
dry_run_setup "$setup"
|
||||||
|
[ -d results ] || mkdir -p results
|
||||||
|
|
||||||
|
printf "\n# Run the setup: %s\n\n" "$setup"
|
||||||
|
|
||||||
if [ ! -d "$dirResult" ]
|
if [ ! -d "$dirResult" ]
|
||||||
then
|
then
|
||||||
|
cp -Rf "$dirSetup" "$dirResult"
|
||||||
|
|
||||||
echo " # Collecting results and settings into $dirResult"
|
if [ "$common_mesh" = true ]
|
||||||
|
then
|
||||||
|
if [ -d results/mesh ]
|
||||||
|
then
|
||||||
|
printf "## Copy the common mesh to the setup: %s\n\n" "$setup"
|
||||||
|
cp -Rf results/mesh/polyMesh "$dirResult"/constant/.
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
mkdir -p "$dirResult"
|
if [ "$common_dynamic_code" = true ]
|
||||||
mkdir -p "$dirSettings"
|
then
|
||||||
|
if [ -d results/dynamicCode ]
|
||||||
|
then
|
||||||
|
printf "## Copy the common dynamic code to the setup: %s\n\n" "$setup"
|
||||||
|
cp -Rf results/dynamicCode "$dirResult"/.
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
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"
|
if [ "$parallel" = true ]
|
||||||
|
then
|
||||||
|
( cd "$dirResult" && ./Allrun-parallel )
|
||||||
|
else
|
||||||
|
( cd "$dirResult" && ./Allrun )
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
if [ "$common_mesh" = true ]
|
||||||
|
then
|
||||||
|
if [ ! -d results/mesh ]
|
||||||
|
then
|
||||||
|
printf "\n## Store the mesh of %s as the common mesh\n\n" "$setup"
|
||||||
|
mkdir -p results/mesh
|
||||||
|
cp -Rf "$dirResult"/constant/polyMesh results/mesh/.
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$common_dynamic_code" = true ]
|
||||||
|
then
|
||||||
|
if [ ! -d results/dynamicCode ] && [ -d "$dirResult"/dynamicCode ]
|
||||||
|
then
|
||||||
|
printf "\n## Store the dynamic code of %s as the common dynamic code\n\n" "$setup"
|
||||||
|
cp -Rf "$dirResult"/dynamicCode results/.
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
cleanTimeDirectories
|
|
||||||
cleanAuxiliary
|
|
||||||
cleanPostProcessing
|
|
||||||
|
|
||||||
else
|
else
|
||||||
|
printf " # Directory %s already exists\n" "$dirResult"
|
||||||
echo " # Directory $dirResult already exists"
|
printf " # Skipping the computation of the given setup\n"
|
||||||
echo " # Skipping the computation"
|
|
||||||
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -68,54 +144,28 @@ collect() {
|
|||||||
|
|
||||||
for setup in $setups
|
for setup in $setups
|
||||||
do
|
do
|
||||||
|
dirSetupOrig="setups.orig/$setup"
|
||||||
|
|
||||||
echo ""
|
if [ ! -d "$dirSetupOrig" ]
|
||||||
echo "# Computations for the setup: $setup"
|
|
||||||
echo ""
|
|
||||||
|
|
||||||
dirSetup="setups.orig/$setup"
|
|
||||||
|
|
||||||
if [ ! -d "$dirSetup" ]
|
|
||||||
then
|
then
|
||||||
echo "Setup directory: $dirSetup" \
|
echo "Setup directory: $dirSetupOrig" \
|
||||||
"could not be found - skipping execution" 1>&2
|
"could not be found - skipping execution" 1>&2
|
||||||
exit 1
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cp -rfL "$dirSetup/0.orig" .
|
if [ "$run" = true ]
|
||||||
cp -rfL "$dirSetup/constant" .
|
|
||||||
cp -rfL "$dirSetup/system" .
|
|
||||||
cp -rf 0.orig/ 0/
|
|
||||||
|
|
||||||
if [ ! -d constant/polyMesh ]
|
|
||||||
then
|
then
|
||||||
|
run_setup "$setup"
|
||||||
runApplication blockMesh
|
|
||||||
|
|
||||||
runApplication renumberMesh -overwrite -constant
|
|
||||||
|
|
||||||
runApplication checkMesh -allTopology -allGeometry -constant
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$parallel" = true ]
|
|
||||||
then
|
|
||||||
|
|
||||||
runApplication decomposePar
|
|
||||||
|
|
||||||
runParallel $(getApplication)
|
|
||||||
|
|
||||||
runApplication reconstructPar
|
|
||||||
|
|
||||||
else
|
else
|
||||||
|
dry_run_setup "$setup"
|
||||||
runApplication $(getApplication)
|
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
collect "$setup"
|
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
|
if notTest "$@" && [ "$run" = true ]
|
||||||
|
then
|
||||||
|
./plot
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
@ -31,7 +31,7 @@ plot_ux_vs_znorm_upstream() {
|
|||||||
endTime="$1"
|
endTime="$1"
|
||||||
zMin="$2"
|
zMin="$2"
|
||||||
|
|
||||||
benchmarkFile="$FOAM_TUTORIALS/resources/dataset/atm-HargreavesWright-2007/Ux-HW-RH-Fig6a"
|
benchmarkFile="resources/dataset/Ux-HW-RH-Fig6a"
|
||||||
sampleFile="results/$setup/postProcessing/samples_u/$endTime"
|
sampleFile="results/$setup/postProcessing/samples_u/$endTime"
|
||||||
image="plots/$setup/ux_vs_znorm_upstream.png"
|
image="plots/$setup/ux_vs_znorm_upstream.png"
|
||||||
|
|
||||||
@ -72,7 +72,7 @@ plot_ux_vs_znorm_middle() {
|
|||||||
endTime="$1"
|
endTime="$1"
|
||||||
zMin="$2"
|
zMin="$2"
|
||||||
|
|
||||||
benchmarkFile="$FOAM_TUTORIALS/resources/dataset/atm-HargreavesWright-2007/Ux-HW-RH-Fig6a"
|
benchmarkFile="resources/dataset/Ux-HW-RH-Fig6a"
|
||||||
sampleFile="results/$setup/postProcessing/samples_u/$endTime"
|
sampleFile="results/$setup/postProcessing/samples_u/$endTime"
|
||||||
image="plots/$setup/ux_vs_znorm_middle.png"
|
image="plots/$setup/ux_vs_znorm_middle.png"
|
||||||
|
|
||||||
@ -113,7 +113,7 @@ plot_ux_vs_znorm_downstream() {
|
|||||||
endTime="$1"
|
endTime="$1"
|
||||||
zMin="$2"
|
zMin="$2"
|
||||||
|
|
||||||
benchmarkFile="$FOAM_TUTORIALS/resources/dataset/atm-HargreavesWright-2007/Ux-HW-RH-Fig6a"
|
benchmarkFile="resources/dataset/Ux-HW-RH-Fig6a"
|
||||||
sampleFile="results/$setup/postProcessing/samples_u/$endTime"
|
sampleFile="results/$setup/postProcessing/samples_u/$endTime"
|
||||||
image="plots/$setup/ux_vs_znorm_downstream.png"
|
image="plots/$setup/ux_vs_znorm_downstream.png"
|
||||||
|
|
||||||
@ -154,7 +154,7 @@ plot_k_vs_znorm() {
|
|||||||
endTime="$1"
|
endTime="$1"
|
||||||
zMin="$2"
|
zMin="$2"
|
||||||
|
|
||||||
benchmarkFile="$FOAM_TUTORIALS/resources/dataset/atm-HargreavesWright-2007"
|
benchmarkFile="resources/dataset"
|
||||||
sampleFile="results/$setup/postProcessing/samples_k/$endTime"
|
sampleFile="results/$setup/postProcessing/samples_k/$endTime"
|
||||||
image="plots/$setup/k_vs_znorm.png"
|
image="plots/$setup/k_vs_znorm.png"
|
||||||
|
|
||||||
@ -205,7 +205,7 @@ plot_epsilon_vs_znorm() {
|
|||||||
endTime="$1"
|
endTime="$1"
|
||||||
zMin="$2"
|
zMin="$2"
|
||||||
|
|
||||||
benchmarkFile="$FOAM_TUTORIALS/resources/dataset/atm-HargreavesWright-2007/epsilon-HW-RH-Fig6c"
|
benchmarkFile="resources/dataset/epsilon-HW-RH-Fig6c"
|
||||||
sampleFile="results/$setup/postProcessing/samples_epsilon/$endTime"
|
sampleFile="results/$setup/postProcessing/samples_epsilon/$endTime"
|
||||||
image="plots/$setup/epsilon_vs_znorm.png"
|
image="plots/$setup/epsilon_vs_znorm.png"
|
||||||
|
|
||||||
@ -299,7 +299,7 @@ plot_nut_vs_znorm() {
|
|||||||
endTime="$1"
|
endTime="$1"
|
||||||
zMin="$2"
|
zMin="$2"
|
||||||
|
|
||||||
benchmarkFile="$FOAM_TUTORIALS/resources/dataset/atm-HargreavesWright-2007/"
|
benchmarkFile="resources/dataset"
|
||||||
sampleFile="results/$setup/postProcessing/samples_nut/$endTime"
|
sampleFile="results/$setup/postProcessing/samples_nut/$endTime"
|
||||||
image="plots/$setup/nut_vs_znorm.png"
|
image="plots/$setup/nut_vs_znorm.png"
|
||||||
|
|
||||||
@ -361,16 +361,20 @@ command -v gnuplot >/dev/null || {
|
|||||||
|
|
||||||
for setup in $setups
|
for setup in $setups
|
||||||
do
|
do
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "# Plots for the setup: $setup"
|
echo "# Plots for the setup: $setup"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
|
[ -d "results/$setup" ] || {
|
||||||
|
echo "No results/$setup directory found - skipping graph creation" 1>&2
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
dirPlots="plots/$setup"
|
dirPlots="plots/$setup"
|
||||||
[ -d "$dirPlots" ] || mkdir -p "$dirPlots"
|
[ -d "$dirPlots" ] || mkdir -p "$dirPlots"
|
||||||
|
|
||||||
endTime=$( \
|
endTime=$( \
|
||||||
foamDictionary results/$setup/settings/controlDict \
|
foamDictionary results/$setup/system/controlDict \
|
||||||
-disableFunctionEntries -entry endTime -value \
|
-disableFunctionEntries -entry endTime -value \
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -383,32 +387,23 @@ do
|
|||||||
|
|
||||||
if [ -d "results/$setup/postProcessing/samples_k" ]
|
if [ -d "results/$setup/postProcessing/samples_k" ]
|
||||||
then
|
then
|
||||||
|
|
||||||
plot_k_vs_znorm "$endTime" "$zMin"
|
plot_k_vs_znorm "$endTime" "$zMin"
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -d "results/$setup/postProcessing/samples_epsilon" ]
|
if [ -d "results/$setup/postProcessing/samples_epsilon" ]
|
||||||
then
|
then
|
||||||
|
|
||||||
plot_epsilon_vs_znorm "$endTime" "$zMin"
|
plot_epsilon_vs_znorm "$endTime" "$zMin"
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -d "results/$setup/postProcessing/samples_omega" ]
|
if [ -d "results/$setup/postProcessing/samples_omega" ]
|
||||||
then
|
then
|
||||||
|
|
||||||
plot_omega_vs_znorm "$endTime" "$zMin"
|
plot_omega_vs_znorm "$endTime" "$zMin"
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -d "results/$setup/postProcessing/samples_nut" ]
|
if [ -d "results/$setup/postProcessing/samples_nut" ]
|
||||||
then
|
then
|
||||||
|
|
||||||
plot_nut_vs_znorm "$endTime" "$zMin"
|
plot_nut_vs_znorm "$endTime" "$zMin"
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
|
@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
cd "${0%/*}" || exit # Run from this directory
|
||||||
|
. ${WM_PROJECT_DIR:?}/bin/tools/CleanFunctions # Tutorial clean functions
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
cleanCase0
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
cd "${0%/*}" || exit # Run from this directory
|
||||||
|
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
./Allrun.pre
|
||||||
|
|
||||||
|
runApplication $(getApplication)
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
cd "${0%/*}" || exit # Run from this directory
|
||||||
|
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
./Allrun.pre
|
||||||
|
|
||||||
|
runApplication decomposePar
|
||||||
|
|
||||||
|
runParallel $(getApplication)
|
||||||
|
|
||||||
|
runApplication reconstructPar
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
@ -0,0 +1,17 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
cd "${0%/*}" || exit # Run from this directory
|
||||||
|
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
restore0Dir
|
||||||
|
|
||||||
|
if [ ! -d constant/polyMesh ]
|
||||||
|
then
|
||||||
|
runApplication blockMesh
|
||||||
|
|
||||||
|
runApplication renumberMesh -overwrite -constant
|
||||||
|
|
||||||
|
runApplication checkMesh -allTopology -allGeometry -constant
|
||||||
|
fi
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
@ -1 +0,0 @@
|
|||||||
../../common/0.orig/U
|
|
@ -1 +0,0 @@
|
|||||||
../../common/0.orig/include
|
|
@ -1 +0,0 @@
|
|||||||
../../common/0.orig/k
|
|
@ -1 +0,0 @@
|
|||||||
../../common/0.orig/nut
|
|
@ -1 +0,0 @@
|
|||||||
../../common/0.orig/p
|
|
@ -1 +0,0 @@
|
|||||||
../../common/constant/transportProperties
|
|
@ -1 +0,0 @@
|
|||||||
../common/system/
|
|
@ -1 +0,0 @@
|
|||||||
../../common/0.orig/U
|
|
@ -1 +0,0 @@
|
|||||||
../../common/0.orig/include
|
|
@ -1 +0,0 @@
|
|||||||
../../common/0.orig/k
|
|
@ -1 +0,0 @@
|
|||||||
../../common/0.orig/nut
|
|
@ -1 +0,0 @@
|
|||||||
../../common/0.orig/p
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user