openfoam-adapter
openfoam-adapter copied to clipboard
write-data should be independent from the boundary condition
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
.
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.
Interesting! We would definitely like to avoid writing files to the disk, but looking at the source code of this would definitely help.
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)