Giter Site home page Giter Site logo

fdrmrc / stokes_solver Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 965 KB

C++ programs that solve, adaptively, the Stokes equations in 2D, using block preconditioners and exploiting MPI parallelisation. Time marching using ARKODE wrappers is still ongoing

C++ 95.03% CMake 4.97%
stokes dealii mpi navier-stokes

stokes_solver's Introduction

Stokes solver

Lid cavity problem:

The boundary conditions (for the velocity field) for this problem are homogeneous Dirichlet on three edges, and (U_x,0) on the top face. As a block preconditioner I used (A,Bt; 0, -S) where S is the classical Schur complement. The implementation of the preconditioner has been done by using a block backsubstitution, by intepreting each matrix inverse as a linear operator, instead of the usual low level implementation. As a linear solver, FGMRES has been chosen. It performs automatically a right preconditioning, so the observed residual is the true one, not the one of the preconditioned system.

With 1 MPI process, here's the elapsed CPU time for the lid cavity problem

+---------------------------------------------+------------+------------+
| Total CPU time elapsed since start          |       194s |            |
|                                             |            |            |
| Section                         | no. calls |  CPU time  | % of total |
+---------------------------------+-----------+------------+------------+
| assemble_system                 |         8 |      75.5s |        39% |
| constructor                     |         1 |   0.00278s |         0% |
| estimate                        |         8 |        22s |        11% |
| initialize                      |         1 |   0.00335s |         0% |
| make_grid                       |         1 |    0.0142s |         0% |
| mark                            |         7 |    0.0136s |         0% |
| output_results                  |         8 |      8.19s |       4.2% |
| refine_grid                     |         7 |      1.45s |      0.74% |
| setup_system                    |         8 |      5.39s |       2.8% |
| solve                           |         8 |      81.6s |        42% |
+---------------------------------+-----------+------------+------------+

Running on 4 processors with mpirun -np 4 ./stokes the CPU time scales with a factor of roughly 3

+---------------------------------------------+------------+------------+
| Total CPU time elapsed since start          |      61.9s |            |
|                                             |            |            |
| Section                         | no. calls |  CPU time  | % of total |
+---------------------------------+-----------+------------+------------+
| assemble_system                 |         8 |      19.1s |        31% |
| constructor                     |         1 |    0.0027s |         0% |
| estimate                        |         8 |      6.58s |        11% |
| initialize                      |         1 |   0.00336s |         0% |
| make_grid                       |         1 |    0.0107s |         0% |
| mark                            |         7 |    0.0375s |         0% |
| output_results                  |         8 |      2.52s |       4.1% |
| refine_grid                     |         7 |      1.09s |       1.8% |
| setup_system                    |         8 |      2.14s |       3.5% |
| solve                           |         8 |      30.4s |        49% |
+---------------------------------+-----------+------------+------------+

Here the result after 7 grid refinements, showing the magnitude of the velocity vector. Screenshot

Navier stokes for incompressible viscous flow [Work in progress]

Time dependent incompressible Navier Stokes with ARKODE

The goal of this is to march in time with an IMEX approach, using the SUNDIALS wrappers provided by the library, instead of hard-coding an implicit-explicit first order method.

  • it requires dealii version 9.3.0, as it is necessary to solve problems with mass matrices and older versions are not compatible anymore.

stokes_solver's People

Contributors

fdrmrc avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.