From 9143885631db7601565733b0693bff4d53244fd4 Mon Sep 17 00:00:00 2001 From: Alexander Jaust <alexander.jaust@ipvs.uni-stuttgart.de> Date: Sat, 21 Dec 2019 13:49:11 +0100 Subject: [PATCH] scripts for running tests --- .../fvca-monolithic-base.input | 30 +++++++ .../run-monolithic-simulations.sh | 79 +++++++++++++++++++ 2 files changed, 109 insertions(+) create mode 100644 appl/coupling-ff-pm/fvca-monolithic-reversed/fvca-monolithic-base.input create mode 100755 appl/coupling-ff-pm/fvca-monolithic-reversed/run-monolithic-simulations.sh diff --git a/appl/coupling-ff-pm/fvca-monolithic-reversed/fvca-monolithic-base.input b/appl/coupling-ff-pm/fvca-monolithic-reversed/fvca-monolithic-base.input new file mode 100644 index 0000000..fe61db4 --- /dev/null +++ b/appl/coupling-ff-pm/fvca-monolithic-reversed/fvca-monolithic-base.input @@ -0,0 +1,30 @@ +[Darcy.Grid] +UpperRight = 1 1 +Cells = MESHSIZE MESHSIZE + +[Stokes.Grid] +LowerLeft = 0 1 +UpperRight = 1 2 +Cells = MESHSIZE MESHSIZE + +[Stokes.Problem] +Name = FLOWPROBLEMNAME +PressureDifference = PRESSUREDIFF + +[Darcy.Problem] +Name = darcy + +[Darcy.SpatialParams] +Permeability = PERM # m^2 +AlphaBeaversJoseph = ALPHA + +[Vtk] +OutputName = CASENAME + +[Problem] +Name = "fvca-monolithic" +EnableGravity = false +EnableInertiaTerms = HASINERTIATERMS + +[Vtk] +AddVelocity = 1 diff --git a/appl/coupling-ff-pm/fvca-monolithic-reversed/run-monolithic-simulations.sh b/appl/coupling-ff-pm/fvca-monolithic-reversed/run-monolithic-simulations.sh new file mode 100755 index 0000000..929628b --- /dev/null +++ b/appl/coupling-ff-pm/fvca-monolithic-reversed/run-monolithic-simulations.sh @@ -0,0 +1,79 @@ +#! /usr/bin/env bash + +#testcase="VerticalFlow" + +pressureDifferences=("1e-9") +permeabilities=("1e-6") +alphaBeaversJoseph=("1.0") +meshSizes=("20" "40" "80") +hasInertiaTerms=("true" "false") + +#interpolation=("nearest-neighbor" "nearest-projection") + + + + +i=0 + +#mkdir -p ${testcase} +#cd ${testcase} + +solver="fvca-monolithic-reversed" +inputTemplate="fvca-monolithic-base.input" + +#cp ../${geomtemplate} . + +#configurations="configs-${testcase}.txt" + +#echo "" > ${configurations} +basedir="${PWD}" +for hasInertiaTerms in "${hasInertiaTerms[@]}"; do + for dp in "${pressureDifferences[@]}"; do + for permeability in "${permeabilities[@]}"; do + for alpha in "${alphaBeaversJoseph[@]}"; do + for mesh in "${meshSizes[@]}"; do + i=$((i+1)) + + # Check if Stokes or Navier-Stokes + flowProblemName="stokes" +# echo ${hasInertiaTerms} + if [[ "${hasInertiaTerms}" == "true" ]]; then + flowProblemName="navier-stokes" + fi + + # Generate name of test case and create directories + casename="${flowProblemName}-${mesh}-${alpha}-${permeability}-${dp}" + echo "${casename}" + mkdir -p "${casename}" + cd ${casename} +# ln -s "../${solver}" "${solver}" + cp "../${solver}" . + + # Setting up input file + inputFile="${casename}.input" + sed -e s/MESHSIZE/"${mesh}"/g \ + -e "s/FLOWPROBLEMNAME/${flowProblemName}/g" \ + -e "s/PRESSUREDIFF/${dp}/g" \ + -e "s/PERM/${permeability}/g" \ + -e "s/ALPHA/${alpha}/g" \ + -e "s/HASINERTIATERMS/${hasInertiaTerms}/g" \ + -e "s/CASENAME/${casename}/g" \ + "../${inputTemplate}" > ${inputFile} + + # Running simulation + solverCmd="./${solver} ${inputFile}" + #echo "$solverCmd" + +# $(${solverCmd} > solver.log) + $(time ./${solver} "${inputFile}" > solver.log) +# $(./${solverCmd} ${inputFile} > solver.log) + + # Go back to root dir + cd "${basedir}" + done + done + done + done +done + +echo "In total ${i} cases were run" -- GitLab