#!/bin/csh
#PBS -l ncpus=16
#PBS -l walltime=30:00
#PBS -q debug
#PBS -o cavity.log
#PBS -j oe
date
set echo
### Set up the OpenFOAM enviroment
source /usr/share/modules/init/csh
module load openfoam/1.7.1
source ${FOAM_INST_DIR}/OpenFOAM-1.7.1/etc/cshrc
### Set up a work directory in scratch space as output may be too big for $HOME
set WORKDIR=${SCRATCH}/OpenFOAM/cavity
mkdir -p $WORKDIR
#copy over all the required input files to your work directory
# here they are in a subdirectory of the user's home directory
cp -r ~/cavity/* $WORKDIR
# move to the work directory
cd $WORKDIR
### Create mesh (optional if mesh exists)
blockMesh -case .
### Run simulation
icoFoam -case .
date