Skip to content

Fixed issue with having different trace spaces with mixed BCs by adding a new...

Spencer Sherwin requested to merge fix/IncNS_SubStep_MixedBCs into master

Issue/feature addressed

Previously if we have mixed boundary conditions (i.e. symmetric BCs) in the IncNavierStokes solver the substepping scheme is not working correctly since the traces of the u and v fields are different and so add trace terms are not correctly handled.

There was also a bug in the forcing that was provided to the pressure solve in the IncNavierStokesSolver

Proposed solution

The solution is to ensure all fields have the same trace layout or ensure the code only uses one of the traces in relevant methods. In this fix I have adopted the second approach


I have added a new GetFwdBwdTrace() method which can take the boundary conditions from a different field. With this new method we can only use the trace space/layout of the first field but apply the boundary conditions from other fields. The syntax is therefore of the form


Note I have not added it as a virtual function so the dynamic cast is necessary to aceess the method from and ExpList.

Updated the forcing in the pressure field to use the correct velocity field (the one from the previous time step not the substep value)


I have modified two IncNavierStokesSolver tests so that they would fail on the older version of the code. Essentially this was acheived by making the time step larger. Both tests now pass but with larger errors so have updated the errors in the tst file.

Suggested reviewers

Dave & Chris


  • [ ] 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).
  • [ ] License added to any new files.
  • No extraneous files have been added (e.g. compiler output or test data files).
Edited by Chris Cantwell

Merge request reports