#!/bin/sh
# Felipe Huerta - January 2021
# Script to execute OpenFOAM-v2006 overBuoyantPimpleDyMFoam
# for the isobaric evaporation of pure cryogens stored
# in cylindrical tanks
cd ${0%/*} || exit 1

# Create / update mesh
./update_mesh

DIR_proc = "processor0"
# Decompose the domain if it hasn't been decomposed previously
if [ ! -e "$DIR_proc" ]; then
        decomposePar
fi

# Run OpenFOAM compressible solver in the case directory
mpirun -np 4 overBuoyantPimpleDyMFoam -parallel > cryogen_evaporation.log
# Reconstruct the decomposed solution
reconstructPar