#!/bin/bash
## exemple donne par L. Wallian
#SBATCH --job-name=test-openfoam
#SBATCH --ntasks-per-node=4
#SBATCH --nodes=1
#SBATCH -p q-irstea
#SBATCH -A u_recover
#SBATCH --mail-type=ALL
#SBATCH --mail-user=gerard.henry@irstea.fr
#SBATCH -o /scratch/gerard.henry/%j.out
#SBATCH -e /scratch/gerard.henry/%j.err
#SBATCH --mem=3000
#SBATCH --time=0-90:0:0

module purge
module load gcc/5.2.0
module load openmpi/gcc/64/2.1.5
source /nfs/home/commun/src/OpenFOAM/OpenFOAM-6/etc/bashrc

cd $FOAM_RUN
cd test_simpleFoam_25blocs_parallel

blockMesh
decomposePar -force -constant -cellDist -latestTime
mpirun -np 4 simpleFoam -parallel