Skip to content
Snippets Groups Projects
Commit 5eb66135 authored by Jan Siwiec's avatar Jan Siwiec
Browse files

Update openfoam.md

parent a05ed7f5
No related branches found
No related tags found
No related merge requests found
Pipeline #39705 failed
!!!warning
This page has not been updated yet. The page does not reflect the transition from PBS to Slurm.
# OpenFOAM
OpenFOAM is a free, open source CFD software package.
......@@ -108,7 +105,7 @@ runApplication icoFoam
Job submission (example for Karolina):
```console
$ qsub -A OPEN-0-0 -q qprod -l select=1:ncpus=128,walltime=03:00:00 test.sh
$ sbatch -A PROJECT_ID -p qcpu --nodes=1 --ntasks=128 --time=03:00:00 test.sh
```
For information about job submission, look [here][2].
......@@ -140,21 +137,22 @@ runApplication decomposePar
Job submission
```console
$ qsub -A OPEN-0-0 -q qprod -l select=1:ncpus=16,walltime=03:00:00 test.sh
$ sbatch -A PROJECT_ID -p qcpu --nodes=1 --ntasks=16 --time=03:00:00 test.sh
```
This job creates a simple block mesh and domain decomposition. Check your decomposition and submit parallel computation:
!!! note
Create a testParallel.pbs PBS script:
Create a testParallel.slurm script:
```bash
#!/bin/bash
#PBS -N motorBike
#PBS -l select=2:ncpus=16
#PBS -l walltime=01:00:00
#PBS -q qprod
#PBS -A OPEN-0-0
#SBATCH --job-name=motorBike
#SBATCH --nodes=2
#SBATCH --ntasks-per-node=16
#SBATCH --time=01:00:00
#SBATCH --partition=qcpu
#SBATCH --account=ACCOUNT_ID
ml openfoam/2.2.1-icc-openmpi1.6.5-DP
source $FOAM_BASHRC
......@@ -163,11 +161,11 @@ cd $FOAM_RUN/tutorials/incompressible/simpleFoam/motorBike
nproc = 32
mpirun -hostfile ${PBS_NODEFILE} -np $nproc snappyHexMesh -overwrite -parallel | tee snappyHexMesh.log
mpirun -hostfile ${$SLURM_JOB_NODELIST} -np $nproc snappyHexMesh -overwrite -parallel | tee snappyHexMesh.log
mpirun -hostfile ${PBS_NODEFILE} -np $nproc potentialFoam -noFunctionObject-writep -parallel | tee potentialFoam.log
mpirun -hostfile ${$SLURM_JOB_NODELIST} -np $nproc potentialFoam -noFunctionObject-writep -parallel | tee potentialFoam.log
mpirun -hostfile ${PBS_NODEFILE} -np $nproc simpleFoam -parallel | tee simpleFoam.log
mpirun -hostfile ${$SLURM_JOB_NODELIST} -np $nproc simpleFoam -parallel | tee simpleFoam.log
```
`nproc` – the number of subdomains
......@@ -175,7 +173,7 @@ mpirun -hostfile ${PBS_NODEFILE} -np $nproc simpleFoam -parallel | tee simpleFoa
Job submission
```console
$ qsub testParallel.pbs
$ srun testParallel.slurm
```
## Compile Your Own Solver
......@@ -198,7 +196,7 @@ $ cd applications/solvers
Copy icoFoam solver’s source files:
```console
$ cp -r $FOAM_SOLVERS/incompressible/icoFoam/ My_icoFoam
$ cp -r $FOAM_SOLVERS/incompressible/icoFoam/My_icoFoam
$ cd My_icoFoam
```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment