Thanks for your reply @Ray_Scarr
However, after debugging, the problem did not lie in the direction of heat transfer or the sign of the coefficient.This problem is caused by the way Code_Aster writes data.
What was happening?
I printed out the content received by OpenFOAM, and the result shows that OpenFOAM was reading incorrect values:
Sink-Temperature-Solid
was receiving an unexpectedly high value (10000000
in my case).Heat-Transfer-Coefficient-Solid
was receiving a reasonable temperature value (e.g.,300.058303
).
This indicated that the two datasets were swapped in Code_Asterโs output. This also explains why the temperature on the interface is 10000000
Solution
The issue was caused by the incorrect order of writeDataNames
in the Code_Aster adapter. Originally, the code was:
self.precice.write_data(self.nodesMeshName, self.writeDataNames[0], self.preciceNodeIndices, writeHCoeff)
self.precice.write_data(self.nodesMeshName, self.writeDataNames[1], self.preciceNodeIndices, writeTemp)
However, the correct order should be:
self.precice.write_data(self.nodesMeshName, self.writeDataNames[1], self.preciceNodeIndices, writeHCoeff)
self.precice.write_data(self.nodesMeshName, self.writeDataNames[0], self.preciceNodeIndices, writeTemp)
After making this change, OpenFOAM received the correct temperature and heat transfer coefficient values, and the results matched the official preCICE benchmark.
Final Thoughts
The main issue was that Code_Aster was writing the temperature and heat transfer coefficient with reversed names. Fixing this resolved the incorrect data exchange.
I hope this helps anyone facing similar issues!