|October 2, 2015, 08:48||
Problems with UDF in parallel mode
Join Date: Sep 2015
Posts: 4Rep Power: 3
I have written a UDF to calculate the average value of a passive scalar at the outlet boundary to use it as a prescribed value at the inlet. The code works fine when in serial mode but not in parallel. seems like only one of the cores got the right value!? or how to express it.
Would be very pleased if someone knows what's wrong or could guide me in right direction!
see code below
real concavg, concavg1;
conc=F_UDSI(f, t, 0);
concavg += conc*area;
printf("\n area_tot = %f\n",area_tot); /*print once for every cell face on outlet, counts to the right area, OK!*/
printf("\n concavg = %f\n",concavg1); /*print once for every cell face on outlet, right value, OK!*/
printf("\n area_tot2 = %f\n",area_tot);/* Print once for every core, first one OK the other three =0??!*/
printf("\n concavg2 = %f\n",concavg1);
DEFINE_PROFILE ( inl_uds, t, i)
real flow_time, inlvalue;
F_PROFILE(face, t, i)=1;
F_PROFILE(face, t, i)=inlvalue;
|October 6, 2015, 11:17||
Join Date: Mar 2009
Posts: 278Rep Power: 14
The documentation has a section about parallelizing UDFs. You can't just use the version you use in serial, since part of the information can't be accessed by all compute nodes.
For instance, the averaging procedure you're doing won't work since some of the compute nodes might not have any cells on the zone you're looking for. That is why you're getting a null area on some partitions.
Search for Global Reduction Macros in the doc and make the appropriate corrections (but read the entire parallel section to know other things you'll need to change).
|parallel, scalar, udf|
|Thread||Thread Starter||Forum||Replies||Last Post|
|problem with compiling boundary condition udf in parallel mode||chem engineer||Fluent UDF and Scheme Programming||11||June 29, 2015 06:23|
|decomposePar is missing a library||whk1992||OpenFOAM Pre-Processing||8||March 7, 2015 08:53|
|compiling UDF for moving mesh in parallel mode||vespa50l||Fluent UDF and Scheme Programming||3||September 22, 2014 11:11|
|UDF parallel error: chip-exec: function not found?????||shankara.2||Fluent UDF and Scheme Programming||1||January 16, 2012 23:14|
|problem using property udfs in parallel mode||EllenW||Fluent UDF and Scheme Programming||5||July 10, 2009 04:31|