precice / openfoam-adapter

OpenFOAM-preCICE adapter
https://precice.org/adapter-openfoam-overview.html
GNU General Public License v3.0
134 stars 77 forks source link

Remove unnecessary `timestepPrecice_` #322

Closed BenjaminRodenberg closed 3 months ago

BenjaminRodenberg commented 3 months ago

This is a pure refactoring to simplify the code if determining the time step size.

BenjaminRodenberg commented 3 months ago

This indeed looks like a relic. Is it only unnecessary, or was it also a bug?

I think it was only unnecessarily complicated.

But it's always hard to pin bugs down if subcycling is involved, so I cannot promise I have not accidentally fixed a bug :smirk: Therefore I also changed this to have a version of the code where I'm quite optimistic it's not buggy.

MakisH commented 3 months ago

Just for the future reader: This was originally implemented with a separate variable (for preCICE v1) just to reduce the function calls and avoid duplication. No other particular intention here.