openfoam-adapter icon indicating copy to clipboard operation
openfoam-adapter copied to clipboard

write-data should be independent from the boundary condition

Open MakisH opened this issue 5 years ago • 3 comments

When we read data from the buffer, it is expected that the type we read corresponds to the type of the boundary condition (e.g. fixedValue for reading temperature, fixedGradient for reading gradient).

However, the writing data should have nothing to do with the boundary condition. At the moment we have the assumption that for writing gradients, the boundary condition needs to be fixedValue, because of the following cast:

https://github.com/precice/openfoam-adapter/blob/3bc68a013db5d59e4e1703864a633c14e3994e74/CHT/HeatFlux.C#L37-L43

We should try to find an abstract type that can do the same job, without assuming the type of the boundary condition. Even though this works for Dirichlet-Neumann coupling, it could become a barrier for further experimentation in the future.

The same affects us in the upcoming fluid-fluid module (#67), for VelocityGradient and PressureGradient.

MakisH avatar Mar 24 '19 12:03 MakisH

OpenFOAM ships with the externalFileCoupler. The functionality is fixed, but should do the work for the most cases. Another drawback is maybe the higher complexity to setup an case on openfoam side.

TEFEdotCC avatar Oct 28 '20 12:10 TEFEdotCC

Interesting! We would definitely like to avoid writing files to the disk, but looking at the source code of this would definitely help.

MakisH avatar Oct 28 '20 16:10 MakisH

Of course, writting to file (maybe /tmp) should be avoided by design. The ideas of the base class externalFileCoupler and the file based implementation class externalCoupled could be used.

I will looking forward to the next weeks and month to get an implemention, if I had time. (hobby only project)

TEFEdotCC avatar Oct 28 '20 19:10 TEFEdotCC