PICurv 0.1.0
A Parallel Particle-In-Cell Solver for Curvilinear LES
|
This guide provides step-by-step instructions for setting up your environment, installing dependencies, cloning the source code, and compiling the PICurv solver.
Before you begin, ensure you have the following software installed on your system. These are essential for building and running the solver.
This section describes how to install the required dependencies.
On most Linux distributions, you can install the compiler, Make, and an MPI library using the system's package manager.
For Debian/Ubuntu:
For CentOS/RHEL/Fedora:
For macOS (using Homebrew):
Installing PETSc correctly is the most critical step. We recommend building it from source to ensure all required components are enabled.
bash git clone -b v3.20.3 https://gitlab.com/petsc/petsc.git cd petsc
Configure PETSc: The PICurv solver specifically requires DMSwarm
. We recommend a configuration like the one below. Run this from the petsc
directory.
For a debugging build (recommended for development):
bash ./configure --with-cc=mpicc --with-cxx=mpicxx --with-fc=mpif90 \ --download-fblaslapack --download-metis --download-parmetis \ --with-dmswarm=1 \ --with-debugging=1
For an optimized build (recommended for production runs):
bash ./configure --with-cc=mpicc --with-cxx=mpicxx --with-fc=mpif90 \ --download-fblaslapack --download-metis --download-parmetis \ --with-dmswarm=1 \ --with-debugging=0 --COPTFLAGS='-O3 -march=native' --CXXOPTFLAGS='-O3 -march=native' --FOPTFLAGS='-O3 -march=native'
Build and Test PETSc: After configuration is complete, follow the instructions printed to the screen.
```bash make all make check
```
Once PETSc is built, you must set two environment variables so that other applications (like PICurv) can find it.
Set Environment Variables: Add the following lines to your shell startup file (e.g., ~/.bashrc
, ~/.zshrc
). bash export PETSC_DIR=/path/to/your/petsc export PETSC_ARCH=arch-linux-c-debug # Or whatever arch was created during configure export PATH="${PETSC_DIR}/${PETSC_ARCH}/bin:${PATH}"
Replace /path/to/your/petsc
with the actual path.
Now, source your startup file or open a new terminal:
bash source ~/.bashrc
echo $PETSC_DIR
and echo $PETSC_ARCH
. They should print the paths you just set.With all prerequisites in place, you can now clone the PICurv repository.
The provided Makefile
is designed to automatically find your PETSc installation using the environment variables you set.
PICurv/
directory.Clean Previous Builds (Optional but Recommended): It's good practice to start with a clean slate.
bash make clean_all
Build the Solver and Postprocessor: The Makefile
has targets for the main executables.
bash make picsolver # Builds the main CFD/particle solver make postprocessor # Builds the data postprocessor utility
If the compilation is successful, you will find the executables picsolver
and postprocessor
in the bin/
directory.
Congratulations, you have successfully built the PICurv solver!
You are now ready to run your first simulation. Please proceed to the User Guide for instructions on setting up and running a test case.
```