OpenFOAM
OpenFOAM is a C++ free software toolkit for numerical calculation of continuum mechanics problems, with code compliant with the GNU General Public License. It supports data preprocessing, post-processing, and custom solvers, and is commonly used in the field of computational fluid dynamics (CFD). The software is maintained by the OpenFOAM Foundation.**
1. Script Template
submit.sh
#!/bin/bash
#SBATCH --nodes=1 # Number of nodes
#SBATCH --ntasks-per-node=56 # Number of cores per node
#SBATCH --ntasks=56 # Total number of cores
#SBATCH --partition=g1_share # Queue partition; must specify the correct partition
#SBATCH --job-name=hello # Job name
#SBATCH --output=hello.%j.out # Normal log output (%j parameter value is jobId)
#SBATCH --error=hello.%j.err # Error log output (%j parameter value is jobId)
##############################################
# Software Envrironment #
##############################################
unset I_MPI_PMI_LIBRARY # Unset default MPI library, use Intel's built-in
export I_MPI_JOB_RESPECT_PROCESS_PLACEMENT=0 # Parameter modification required for Intel multi-node jobs
module load intel/2022 intelmpi/2022 # Load Intel environment
moudle load openfoam # Load software (refer to module usage instructions to select the specific version)
##############################################
# Run job #
##############################################
# Mesh the geometry
blockMesh
# Decompose the mesh for parallel run
decomposePar
# Run the solver
mpiexec simpleFoam -parallel
# Reconstruct the parallel results
reconstructPar