ddemidov / amgcl

C++ library for solving large sparse linear systems with algebraic multigrid method
http://amgcl.readthedocs.org/
MIT License
717 stars 109 forks source link

Preconditioners add considerable dissipation when solving Euler equations with a discontinuous Galerkin discretization #240

Open 2pt0 opened 1 year ago

2pt0 commented 1 year ago

The use of AMG and ILU0 preconditioners is somehow adding dissipation to the solution of the Euler equations discretized with a discontinuous Galerkin (DG) method. This result is particularly interesting because the Euler equations lack a diffusive term.

Solving the Newton system resulting from the DG discretization with and without a preconditioner achieves fundamentally different solutions. Of course, this is to be expected if the system is ill-conditioned. However, the preconditioned solution appears as a viscous flow solution (e.g. formation of a boundary layer, flow separation regions, etc.). When the DG system is solved without preconditioning (i.e. using the Dummy preconditioner), a much more physically consistent solution lacking these viscous effects is achieved.

I recognize the intended effect of preconditioners is to reduce the condition number of the matrix which is directly dependent on the eigenvalues of the matrix. Is there anyway that a preconditioner could act as a "smoother" on the final solution of the system and not just the system itself?

More details: I have ran both GMRES and FGMRES with AMG, ILU0, and Dummy preconditioners. The AMG preconditioners use a V-cycle with smoothed aggregation and SPIA0.

2pt0 commented 1 year ago

To add a little more context, I am trying to recreate potential flow around a cylinder. The solution should be symmetric about the cylinder.

Here are some image that illustrate what I mean. The only difference between these two simulations is the application of a preconditioner.

With preconditioner (ILU0)

euler-potential-preconditioned

Without preconditioner

euler-potential-no-preconditioner

The solution without the preconditioner is still not perfect. I'm seeing dissipation likely cause by the grid. Still, the preconditioned solution looks like a viscous flow simulation.

ddemidov commented 1 year ago

Hi, did you check that the preconditioned solution really converged with the required tolerance? That is, is ||f - Ax|| / ||f|| < 1e-8 (or however small did you set the tolerance)?

2pt0 commented 1 year ago

Neither have converged that the tolerance. The residual is decreasing in both cases for each Newton iteration, which is converging on solutions similar to the images above.

Eventually GMRES gives the zero solution, resulting in a relative error of 1.