CFD Online Logo CFD Online URL
Home > Forums > Fluent UDF and Scheme Programming

UDF - Parallel processes

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Display Modes
Old   December 23, 2011, 05:51
Default UDF - Parallel processes
Senior Member
Bionico's Avatar
Join Date: Sep 2011
Location: Brescia, Italy
Posts: 181
Rep Power: 7
Bionico is on a distinguished road
Hi everybody,
I'm working on this UDF using a 32 processors workstation

#include "udf.h"
real tm=0.00;
 real trif;
 real trif_coordinate[ND_ND];
 real x,y,z;
 real nt;
 int ID=120573;
 Thread *t=Lookup_Thread(d,ID);
 cell_t c;
 printf("trif iniziale vale %f\n", trif);
 /* Loop on the thread */
     if (sqrt(ND_SUM(pow(x+1.900,2.),pow(y+1.000,2.),pow(z-1.400,2.))) < 0.04)
        trif=trif + C_T(c,t); 
        printf("trif somma vale %f\n", trif);  
        printf("nr celle vale %f\n", nt);  
 if (nt!=0)
     tm=trif/nt; /* calculate average*/
printf("tm vale %f\n", tm);
DEFINE_PROFILE(twall, thread, position)
 real tlim;
 face_t f;
 if (tm>tlim)
     F_PROFILE(f, thread, position) = 291.15-(tm-291.15);  
   end_f_loop(f, thread)
     F_PROFILE(f, thread, position) = 291.15;    
   end_f_loop(f, thread)
This UDF should do a feedback: the wall temperature must depend on the temperature of a sensor in a fixed point of the room.
The problem is that it calculates 32 times (and once there's the average, only the processor that calculates in the zone of the sensor)!
Can anyone tell me how parallelize my UDF in such a way that it calculates my UDF once?
(excuse for my horrible english)

Last edited by Bionico; December 23, 2011 at 10:28.
Bionico is offline   Reply With Quote


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Parallel UDF problem Lindsay FLUENT 4 June 20, 2016 09:37
UDF parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 23:14
loading udf in parallel sytem tahere FLUENT 5 December 13, 2008 02:17
UDF for parallel computation Stanislav Kraev FLUENT 3 October 10, 2006 03:12
UDF in parallel version of fluent yobee FLUENT 2 August 5, 2004 00:36

All times are GMT -4. The time now is 20:35.