Thanks for the advice! Are you able to elaborate or link me to the documentation on how to serialize the cell loop and pass information to the other nodes?
For context, I am trying to build a solar ray tracer for cells to determine which cells are “shaded” and which cells are “exposed”. The built-in solar ray tracer in Fluent only works on surfaces but not on interior cells. I’ve considered using a diffuse radiation model but I found it to be very unreliable.
In my current serial code, I trace a ray from every cell centroid, and then loop over all the wall faces. I then run an algorithm to determine whether the ray intersects each face. If it intersects a face, a UDM value of 1 is assigned to the cell, and then it skips to the next cell in the loop and repeats the process. This is why I need to pass information (i.e. the cell centroid) from the begin_c_loop into thread_loop_f and begin_f_loop.
I understand the computation will be expensive. However, for each cell, there will be several “if” conditions that need to be satisfied before it considers each face (e.g. a simple one being that the cell centroid would need to be below the face centroid), so the actual computation will hopefully be manageable. I can also consider dividing the mesh into boxes, and determine whether the ray intersects a box before looping over the faces that lie within the box. However, I’m currently just trying to get a basic code working in parallel before I consider ways to reduce the computational time.