Parallel Programming :

Wall distance Calculation



In this paragraph, A program allowing to obtain wall minimal distance for each node of the grid wil be described.

Why try to calculate the distance from a node to the nearest wall?

For instance, wall minimal distance computation is useful to apply turbulence wall laws.

How to do this ?

In a parallel context, this task becomes hard : the nearest wall may be in the data of an other process than the one concerned. Consequently, this information is not available for the concerned process. So, information exchange will be done between the different processes. This will be done using COUPL libraries.

The program written for this operation does the following :


Get all wall nodes in his field
Send to the master the wall nodes obtained
receive the total amount of wall nodes
compute the minimum distance between each node and the wall nodes.


get all wall noes in his field
gather all wall nodes from slave processes
send all the wall nodes to each slave process
compute the minimum distance between each node and the wall nodes.

Download the code here

Take a look at it here

The results of this operation can be observed by commenting out the lines of AVBP doing the fluid dynamics, and replacing them with a call  to the wall distance calculus, storing it in the fluid density.


The code seems to be correct.