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

Skip velocity object from the initializer list #330

Closed MakisH closed 2 weeks ago

MakisH commented 2 weeks ago

@Fujikawas noticed that the volume-coupled flow tutorial was failing early on, complaining that it could not find U_vol when adding coupling data readers.

In the original implementation (https://github.com/precice/openfoam-adapter/pull/270), the velocity was not initialized in the initializer list of the Velocity constructor, but it was deferred to the body, where it was created if needed. This is actually needed when reading source terms, since we need a temporary object to read data from preCICE.

In the follow-up extension https://github.com/precice/openfoam-adapter/pull/281, the OpenFOAM velocity object was added to the initializer list, at which point it tries to find an object that (intentionally) does not exist at that point. @thesamriel do I overlook any other reason this was added again into the initializer list?

TODO list:

thesamriel commented 2 weeks ago

I think this is just something overlooked during merging my branch since all solvers I tested had a velocity field available. _U was initialized in the initializer list in the original version of the adapter, on which I had based my branch. (Before the volume coupling).

MakisH commented 2 weeks ago

I assumed so, makes sense. Thank you for the quick reply!