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

Fix iterator in FSI reader and writer for multiple patches #289

Closed davidscn closed 1 year ago

davidscn commented 1 year ago

The current FSI reader (Force/Stress/Displacement/DisplacementDelta) don't behave correctly in case of multiple patches: The previous implementation didn't take the size of the previous patch into account, i.e., was only iterating over the 'beginning' of the read and write buffer. In most of our cases (actually all I know), we only use one patch per interface mesh, where this is not relevant. However, as soon as multiple patches are combined into one interface mesh, this becomes relevant and produces malicious results. In the CHT module, we do it actually correct.

Might be worth a bugfix release compatible with preCICE v2

FYI @LeonardWilleke

TODO list:

davidscn commented 1 year ago

Have you tested the fix? If yes, how?

Yes, I compared (at least for the forces) the data against the function object results, which produces now correct results. I didn't check the displacement, but it is somewhat obvious that the same applies. Would be necessary to add tests for the coupling physics, though.