SU2 icon indicating copy to clipboard operation
SU2 copied to clipboard

[WIP] Improve implementation of periodicity for implicit integration

Open pcarruscag opened this issue 2 years ago • 7 comments

Proposed Changes

This is a simple re-shuffling to have matrix-vector products (and therefore linear systems) that are aware of periodic connections. It uses something like:

  • A "PERIODIC_RESIDUAL" communication (sum contributions) applied to the result of matrix-vector products.
  • A "PERIODIC_IMPLICIT" communication (enforce periodicity) applied to the result of preconditioners.

It seems to avoid the performance degradation that @TobiKattmann saw when implementing periodicity for heat transfer, and also the issues in issue #1467.

However, making the matrix-vector product "periodicity-aware" through comms, without modifying the matrix, means that any preconditioner derived from the matrix is not consistent with the product, thus it is a worse preconditioner and more linear iterations are needed for the same reduction in residuals.

Related Work

Should help #1467 Should avoid #763

PR Checklist

  • [X] I am submitting my contribution to the develop branch.
  • [X] My contribution generates no new compiler warnings (try with the '-Wall -Wextra -Wno-unused-parameter -Wno-empty-body' compiler flags, or simply --warnlevel=2 when using meson).
  • [X] My contribution is commented and consistent with SU2 style.
  • [X] I have added a test case that demonstrates my contribution, if necessary.
  • [X] I have updated appropriate documentation (Tutorials, Docs Page, config_template.cpp) , if necessary.

pcarruscag avatar Mar 29 '22 22:03 pcarruscag

I'll take a more in-depth look my cases tomorrow (Saturday) to adapt the regression values, and options if necessary. In some cases I saw a massive improvement in convergence speed so I'll decrease the prescribed iterations to reflect that :+1: I hope it is ok to push to this PR directly (won't be that many lines ;)

TobiKattmann avatar Apr 01 '22 08:04 TobiKattmann

Whilst the primal computations work perfectly (greatly increased convergence speed in some cases, whilst not/or very very minorly altering the final solution), I see some issues with the discrete adjoint: The cases I have diverge after ~20-40 iterations. I tried to increase Linear solver iterations and lower the CFL-number quite a bit, without success.

Whether I use the primal solution-file created with the old version or with this branch, did not matter.

da_sp_pinArray_cht_2d_dp_hf from parallel_regression_AD is maybe a good case to start but I'll try to make a fluid-only case from that which might be easier to debug (in case that would be necessary) and post it here

TobiKattmann avatar Apr 04 '22 09:04 TobiKattmann

Here a fluid-only case that somewhat quickly converges. Contains the mesh, 1 cfg for primal and adjoint and a little bash-script where the path to the SU2 binaries has to be adapted to fit your system. The idea was to first run primal and adjoint with vanilla develop and then the same with the new code.

I left the log-files of my run in there as well for a quick look

If there is something else I can do let me know.

new-per-bc-test.tar.gz

TobiKattmann avatar Apr 04 '22 10:04 TobiKattmann

Yeah... I had not tested discrete adjoint but my spider senses were tingling.

pcarruscag avatar Apr 04 '22 11:04 pcarruscag

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is still a relevant issue please comment on it to restart the discussion. Thank you for your contributions.

stale[bot] avatar Jun 12 '22 16:06 stale[bot]

WIP

pcarruscag avatar Jun 14 '22 17:06 pcarruscag

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is still a relevant issue please comment on it to restart the discussion. Thank you for your contributions.

stale[bot] avatar Aug 13 '22 19:08 stale[bot]