This project implements a solver based on finite differences for the Navier-Stokes equations. The solver is designed to handle multiple physics problems, with the final goal of solving Brinkman flow for a generic geometry. It allows computations on a default cubic domain as well as on an input mesh using the Brinkman penalization method.
Our multiphysics solver is capable of solving a variety of problems, including Navier-Stokes and parabolic problems. This flexibility enables a broad range of simulations in fluid dynamics.
To compile and run the project, make sure you have the following tools and libraries installed and configured:
- Compiler: GCC with C++20 support
- Libraries:
- PETSc
- VTK
- Eigen
-
Load the required modules:
Before compiling or running the program, load the necessary modules. Ensure that your environment is correctly set up by running:source /u/sw/etc/bash.bashrc module load gcc-glibc module load eigen module load vtk module load petsc
-
Compile the project: After loading the modules, compile the project according to the chosen by running:
make clean make FILES="navier_stokes.cpp" #for Navier-Stokes and Brinkman problem make FILES="stokes.cpp" #for Navier-Stokes and Brinkman problem make FILES="inviscid_euler.cpp" #for Navier-Stokes and Brinkman problem make FILES="advection_diffusion.cpp" #for Navier-Stokes and Brinkman problem make FILES="parabolic.cpp" #for parabolic problems
-
Usage To run the solver, execute the following command:
./bin/main
For the Brinkman solver, the name of the
.stl
file must be specified. An example mesh is provided. To run the solver on the example mesh, execute the following command:./bin/main caroitd.stl
The program will compute the solution and store the results in the
results
directory.
Velocity Magnitude for Navier-Stokes incompressible flow at Re=1![]() |
Velocity Magnitude for Navier-Stokes incompressible flow at Re=2000![]() |
Parabolic Flow with μ=10![]() |
Brinkman Flow Simulation Re=200![]() |
These examples showcase the solver's ability to handle various flow regimes and conditions.
Developed by Davide Galbiati and Alessandra Gotti