This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
howto:palabos [2022/05/13 09:45] ccrosby |
howto:palabos [2022/05/13 14:59] (current) ccrosby [Instructions] |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== | + | ====== |
| + | The following instructions are courtesy of Dr. Muaaz Bhamjee of the University of Johannesburg. | ||
| + | ===== Introduction ===== | ||
| + | |||
| + | Palabos is an open source CFD package based on the Lattice Boltzmann Method (LBM). Palabos is effectively a C++ library that can be used to develop CFD applications. More information can be obtained at the [[https:// | ||
| + | |||
| + | Refer to the following book for an introduction to the LBM: | ||
| + | M. C. Sukop and J. D. T. Thorne, Lattice Boltzmann Modelling: An Introduction for Geoscientists and Engineers, 2nd ed. Miami. FL: Springer-Verlag, | ||
| + | |||
| + | |||
| + | ==== Instructions ==== | ||
| + | |||
| + | To use Palabos on the CHPC you must first install the libraries to your user directory. To do so, go to the [[https:// | ||
| + | |||
| + | Assuming you have downloaded the file to your user directory, and you have logged onto the Lengau cluster | ||
| + | |||
| + | < | ||
| + | cd / | ||
| + | tar -xzvf palabos-master.tar.gz | ||
| + | //This is the optional step of renaming the palabos folder// | ||
| + | mv palabos-master palabos | ||
| + | </ | ||
| + | |||
| + | The next step is to load the cmake module | ||
| + | |||
| + | < | ||
| + | module load chpc/ | ||
| + | </ | ||
| + | |||
| + | To demonstrate how to compile and run a Palabos simulation, I will provide the scripts and instructions for the aneurysm example included in the palabos library. First change to the example build directory (assuming the Palabos install was renamed to palabos): | ||
| + | |||
| + | < | ||
| + | cd / | ||
| + | </ | ||
| + | |||
| + | The next step is to compile the code. This can be run as a job with the script given below, or in an [[https:// | ||
| + | - Get into the right directory | ||
| + | - Source the OpenFOAM environment | ||
| + | - Load the cmake module | ||
| + | - Run '' | ||
| + | - Run '' | ||
| + | |||
| + | === Compile script === | ||
| + | <file bash PalabosCompile.pbs> | ||
| + | # | ||
| + | #PBS -P projectcode | ||
| + | #PBS -l select=1: | ||
| + | #PBS -q smp | ||
| + | #PBS -l walltime=01: | ||
| + | #PBS -o / | ||
| + | #PBS -e / | ||
| + | #PBS -m abe | ||
| + | #PBS -M username@email.com | ||
| + | ### Source the openFOAM environment (palabos needs this for the dependencies): | ||
| + | . / | ||
| + | ### load the cmake module | ||
| + | module add chpc/ | ||
| + | ##### Running commands | ||
| + | # Set this environment variable explicitly. | ||
| + | export PBS_JOBDIR=/ | ||
| + | # Explicitly change to the job directory | ||
| + | cd $PBS_JOBDIR | ||
| + | cmake .. > cmake.out | ||
| + | make > make.out | ||
| + | </ | ||
| + | |||
| + | === Running the example case === | ||
| + | To run the example you must change back one directory level to this directory: < | ||
| + | |||
| + | If you have not run this example before, first uncompress the geometry file: | ||
| + | < | ||
| + | If your OpenFOAM environment is still valid, you can run your aneurysm example on a single node with the following instruction: | ||
| + | |||
| + | < | ||
| + | |||
| + | To run the code as a PBS batch job over several nodes, you can use this script: | ||
| + | |||
| + | <file bash runPalabos.qsub> | ||
| + | # | ||
| + | #PBS -P projectcode | ||
| + | #PBS -l select=5: | ||
| + | #PBS -q normal | ||
| + | #PBS -l walltime=4: | ||
| + | #PBS -o / | ||
| + | #PBS -e / | ||
| + | #PBS -m abe | ||
| + | #PBS -M username@email.com | ||
| + | ### Source the openFOAM environment (palabos needs this for the dependencies): | ||
| + | . / | ||
| + | ### load the cmake module | ||
| + | module add chpc/ | ||
| + | ##### Running commands | ||
| + | # Set this environment variable explicitly. | ||
| + | export PBS_JOBDIR=/ | ||
| + | # Explicitly change to the job directory | ||
| + | cd $PBS_JOBDIR | ||
| + | nproc=`cat $PBS_NODEFILE | wc -l` | ||
| + | ###Run the code using MPI | ||
| + | exe=aneurysm | ||
| + | mpirun -iface ib0 -np $nproc $exe param.xml > run.out | ||
| + | </ | ||
| + | |||
| + | === Post-processing === | ||
| + | Palabos does not come with built-in post-processing tools. | ||
| + | < | ||
| + | chpc/ | ||
| + | chpc/ | ||
| + | </ | ||
| + | |||
| + | Load one of these modules if you need ImageMagick. | ||
| + | |||
| + | VTK files can be displayed with [[https:// | ||