Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Introduction

OpenFOAM is a framework for developing application executables that use packaged functionality contained within a collection of approximately 100 C+ libraries. OpenFOAM is shipped with approximately 250 pre-built applications that fall into two categories: solvers, that are each designed to solve a specific problem in fluid (or continuum) mechanics; and utilities, that are designed to perform tasks that involve data manipulation.

Source: https://cfd.direct/openfoam/user-guide/

...

No Format
source /usr/local/bin/s3proxy.sh
mkdir -p  $HOME/sw/Containers/openfoam8/
cd  $HOME/sw/Containers/openfoam8/
singularity pull  docker://public.docker.itc.griffith.edu.au/openfoam/openfoam8-paraview56


mkdir -p $HOME/OpenFOAM/${USER}-8
cd $HOME/OpenFOAM/${USER}-8
singularity  shell -B /export/home/${USER}:/home --pwd /export/home/${USER}:/home --pwd $HOME/OpenFOAM/${USER}-8 $HOME/sw/Containers/openfoam8/openfoam8-paraview56_latest.sif

Once inside the shell:

source /opt/openfoam8/etc/bashrc
mkdir -p $FOAM_RUN
#echo $FOAM_RUN
#/export/home/s5072653/run

cd $FOAM_RUN
cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily .
cd pitzDaily
blockMesh
simpleFoam
paraFoam

To run it as a batch job, create a launcher script:
1. Launcher Script
>>>>>>>
vi ~/pbs/openfoam8Launcher.sh
#!/bin/bash 
source /opt/openfoam8/etc/bashrc
mkdir -p $FOAM_RUN
cd $FOAM_RUN
cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily .
cd pitzDaily
blockMesh
>>>>>>>>
#make it executable
chmod +7 ~/pbs/openfoam8Launcher.sh

2. pbs script

vi ~/pbs/openfoam8.pbs01
>>>>>
!/bin/bash
#PBS -m abe
#PBS -M shusen.chen@griffithuni.edu.au
#PBS -N TestOpenFoam8
#PBS -q workq
#PBS -l select=1:ncpus=8:mem=2gb,walltime=3:00:00
cd  $PBS_O_WORKDIR
#An example is as below. Modify accordingly to suit your needs
!/bin/bash
#PBS -m abe
#PBS -M shusen.chen@griffithuni.edu.au
#PBS -N TestOpenFoam8
#PBS -q workq
#PBS -l select=1:ncpus=8:mem=2gb,walltime=3:00:00
cd  $PBS_O_WORKDIR
#An example is as below. Modify accordingly to suit your needs
singularity  exec -B ~:/home --pwd ~:/home --pwd /home  $HOME/sw/Containers/openfoam8/openfoam8-paraview56_latest.sif "/home/pbs/openfoamLauncher8.sh"
exit
sleep 2
>>>>>>>






Reference

  1. https://openfoamwiki.net/index.php/Installation/Linux/OpenFOAM-4.0/CentOS_SL_RHEL
  2. https://openfoamwiki.net/index.php/Installation/Linux/OpenFOAM-4.0
  3. https://openfoamwiki.net/index.php/Main_Page
  4. https://cfd.direct/openfoam/user-guide/