#!/bin/sh
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions        # Tutorial run functions
#------------------------------------------------------------------------------

printf 'This case file supports two modes: a coarse mesh that runs efficiently on 2 cores and a fine mesh with 41 million cells, used to process the results in this study, requiring substantial computational resources. Please confirm if you want to proceed with the coarse or fine mesh. (coarse/fine)'
read meshDensity

if [ "$meshDensity" == "fine" ] ;then 
    echo "Continue with the fine mesh..."
    echo "
NCellsR 120; 
ascRatio 10;" > meshParams

else
    echo "Continue with the coarse mesh..."
    echo "
NCellsR 16;
ascRatio 2;" > meshParams

fi

cp -r 0.atmospheric 0

runApplication blockMesh

runApplication decomposePar

runParallel TEHDBoussinesqPimpleFoam


