CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   Identifying cell in parallel UDF (http://www.cfd-online.com/Forums/fluent-udf/121248-identifying-cell-parallel-udf.html)

upeksa July 24, 2013 11:27

Identifying cell in parallel UDF
 
I have an DEFINE_ON_DEMAND serial UDF which stores in a memory the cell index, like this:

begin_c_loop(c,t0)
{
if (/*certain condition*/)
{
C_UDMI(c0,t0,0)=c;
}
}
end_c_loop(c,t0)


The next step of my code is reopen the same case in PARALLEL Fluent and execute another UDF code which will store in another memory the pressure of the cell whose index has been previously stored, like the following:

begin_c_loop(c,t0)
{
C_UDMI(c0,t0,1)=C_P((int)(C_UDMI(c0,t0,0)),t0);
}
end_c_loop

The point is that my UDF works properly in serial process, but it doesn't work at all in parallel process.
In conclusion, I need to create an UDF which will be able to retrieve an index of some cell which had been previously stored in a memory and work IN PARALLEL as well.

Maybe I should do a loop of partitions, but I don't have actually any idea.

Could someone give me some advices or hints in order to parallelize UDFs?

Thanks in advance.

Best regards.


All times are GMT -4. The time now is 02:25.