#!/bin/bash
cd "${0%/*}" || exit 1    # Run from this directory

# Source tutorial run functions
. "$WM_PROJECT_SITE/$WM_PROJECT_VERSION/bin/tools/RunFunctions"

touch "$(pwd | xargs basename)".foam

# Create the mesh
runApplication blockMesh
runApplication surfaceFeatures
runApplication decomposePar -copyZero
runParallel    snappyHexMesh -overwrite
runApplication reconstructPar
runApplication checkMesh

# Run the simulation
runApplication  -a decomposePar -force
runParallel     "$(getApplication)"
runApplication  -a reconstructPar

# Create plots
(cd validation && ./createGraphs)

#------------------------------------------------------------------------------
