Skip to content

Fix for memory leak with VCSImplicit

Issue/feature addressed

The implicit Velocity-Correction Scheme for IncNavierStokesSolver causes a memory leak when the velocity variables do not use identical boundary conditions on all domain boundaries. Essentially, the GlobalLinSys would not be deleted and build up in memory.

Proposed solution

Re-build and remove GlobalLinSys for each velocity component.

Implementation

Change if condition in VCSImplicit::SolveViscous(..) to not only call UnsetGlobalLinSys after final solve, but instead call it after each solve.

Tests

  • We do not have tests for memory leaks as of now and could have a look into memory constraint tests with the gitlab CI. Happy to have a chat about that.

Suggested reviewers

@CFD-Xing

Notes

Checklist

  • [ ] Functions and classes, or changes to them, are documented.
  • [ ] User guide/documentation is updated.
  • Changelog is updated.
  • [ ] Suitable tests added for new functionality.
  • [ ] Contributed code is correctly formatted. (See the [contributing guidelines](https://gitlab.nektar.info/nektar/nektar/-/blob/master/CONTRIBUTING.md#using-clang-format)).
  • [ ] License added to any new files.
  • [ ] No extraneous files have been added (e.g. compiler output or test data files).
Edited by Henrik Wustenberg

Merge request reports