## Numerical solver for the hydrodynamic granular equations

### Project summary

Flows of granular materials are relevant in nature as well as in industry. Our code simulates granular flows solving numerically the Navier-Stokes equations for a 2-dimensional granular gas with constant coefficient of restitution. The solver is composed by different subroutines written in Fortran, and uses finite difference methods and a iterative method Runge-Kutta. The code was compared and validated for different instabilities: cluster formation in homogeneous cooling state and Faraday instability. But it took quite long to simulate this systems and we really needed a parallel implementation.

Working together with RRZE we optimize the code. We used OpenMP to parallelize it. At the end we left only a serial part of around 0.9%. We made the performance study for different CPU's: SandyBridge, IvyBridge, Hasewell and XeonPhi. The best performance is obtained by SandyBridge which is a cpu with 2 sockets and 8 cores per socket. Using 8 threads the speed-up is around 7 and with 16 threads, it means the full node, is around 10. This is a very good optimization taking into account that the theoretical maximum speed-up for 8 threads is 7.5 and for 16 threads is 12.

Another important optimization that we did was related with the size of the system. We usually simulated the same system with a wide range of sizes to make a better study of it. This is a problem in Fortran77 because we have to know the size of the matrices and vectors before compiling. We translated the declaration of the matrices and vectors to Fortran90 using "allocate", allowing us to give multiple sizes after compiling. This was useful too to study the performance for a wide range of size systems for the different machines.

Now, we will use this very good optimization to a different open systems saving considerable amount of computing time.

### KONWIHR funding

- KONWIHR funding: two months during Multicore-Software-Initiative 2013/2014

### Contact:

- Prof. Pöschel, LS Multiscale Simulation of Particulate Systems, FAU