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

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

runApplication blockMesh
runApplication foamRun

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

# Compare to reference solution
case=$(basename "$PWD")
runCommand --suffix "${case}.aggregate" -- diff -bs \
    postProcessing/probes/0/alpha.aggregate validation/probes/0/alpha.aggregate
runCommand --suffix "${case}.particle" -- diff -bs \
    postProcessing/probes/0/alpha.particle validation/probes/0/alpha.particle
runCommand --suffix "${case}.water" -- diff -bs \
    postProcessing/probes/0/alpha.water validation/probes/0/alpha.water

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