Here is a code that calculates the electrostatic field and the x-component of force from the scalar potential solved in fluent. This is currently written for single core only.
Parallel computing in UDF requires data communication between different modules. You need to add some instructions for data transmission between different modules, such as summing a certain variable and assigning it uniformly to different modules. At the same time, when it comes to parallelism, it is necessary to pay attention to the processing of grids at the boundaries of different blocks to prevent duplicate calculations. For specific operation details, please refer to the official help document of Fluent.
Yes, I have referred to the parallel computing chapter of the Ansys help document. The challenge is that the examples/information is targeted toward computing a single value from all the computation nodes assigned to the solver. For example, calculating the average pressure drop across the entire domain. Here they record the values of pressure drop in all the cells from individual nodes and then pass it to node-0 which then calculates the final answer.
The challenge for me is that I am working with UDS values on every cell. My result relies on accurate values of these UDS on the cells at the end (when the individual nodes pass the values to node-0). I tried message-passing commands such as PRF_CRECV_INT(i, UDSI(c,t,0), 1, i), however, the results do not match the results obtained from a single core.
It would be really helpful if I could see examples suitable for my case or a couple of lines of codes I could work from.
Regardless, thank you for your reply. Much appreciated.