#!/bin/sh
cd ${0%/*} || exit 1                        # Run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions    # Tutorial run functions

# Pre-processing (Mesh, etc.)
./Allrun.pre

# 1. Decompose the domain
# This requires a system/decomposeParDict to exist
runApplication decomposePar

# 2. Run the solver in parallel
# runParallel is a built-in OpenFOAM function that handles mpirun
runParallel $(getApplication)

# 3. Reconstruct the results
# Combines processor* folders back into time directories
runApplication reconstructPar