Presentation of the computational code

This code, that I developed during my PhD in collaboration with Loïc Gouarin and Bertrand Maury, is written in C++ and uses the library PETSc. It works with the 4Q1/Q1 finite element to simulate the motion of immersed rigid bodies with the smooth extension method developed in my PhD. The library PETSc is used for the parallel structure of matrices and vectors, aswell as the parallel solvers for the linear systems. The code is also interfaced with the code SCoPI in order to handle contacts between the rigid bodies.

Algorithm

The idea of the method is to seek a smooth extension of the exact solution in the whole fictitious domain. For this purpose, the extension of the right-hand side within the rigid bodies is used. The problem amounts to look for an extension of the right-hand side such that the restriction of the solution of a classical Stokes problem, defined in the whole fictitious domain, to the fluid domain is the exact solution of the original problem (the fluid velocity satisfies the rigid-body motion constraint on the boundary of the rigid bodies). To find such an extension of the right-hand side, a cost function is minimized with a conjugate gradient like algorithm. This minimization process involves the resolution of two classical Stokes problems at each iteration of the conjugate gradient. The algorithm of the code interfaced with the contact code SCoPI is the following:

A lot of Stokes problems have to be solved with this method but the only part that is changing from one Stokes problem to another is the right-hand side. The matrices are the one of a classical incompressible Stokes problem and are always the same. Moreover, because we are using cartesian meshes, fast iterative solvers like geometric multigrids are used to solve these Stokes problems.

Some simulations

Description Video
7500 rigid bodies sedimenting in 3D. The rigid bodies are evenly distributed at initial time and have a radius of 0.0125. The cartesian meshes has the size 256x256x256 for the velocity. The simulation was ran on 24 cores and took 22 minutes by time iteration.
2000 rigid bodies sedimenting in 3D. The top of the cube is rotating. The rigid bodies have different radius. The cartesian mesh has the size 65x65x65 for the velocity.
Sedimentation of 1008 rigid bodies with the same radius of 0.01. The cartesian mesh has a size of 1024x1024 for the velocity.

Additional information