CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

need help for parallelize a serial UDF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 22, 2012, 09:01
Question need help for parallelize a serial UDF
  #1
Member
 
Sandeep
Join Date: Apr 2009
Location: Munich, Germany
Posts: 30
Rep Power: 17
sandeep_tu is on a distinguished road
I'm trig to run a UDF that should do the followings:
1-reading some values from a text file in HOST
2-transfering these values to the NODES
3-seting as the boundary condition in NODES

the codes is this.


DEFINE_PROFILE (Temperature_profile,t,j)
{


int node_zero = 0;
int node_host = 999999;
int node_one = 1;
int node_serial = 1000000;



int zone_ID;
int names[48];
int ID[48];
double temp[48];
double emiss[48];
double tempp;
int i,ii,iii,pe;
ii=0;
iii=329;
pe=0;
for (i=0; i<48; i++)
{

names[i]=20;

ID[i]=0;

temp[i]=0;

emiss[i]=0;
}

#if !RP_NODE
FILE *fi=fopen("input.txt","r");
if(fi==NULL)
return 1;
#endif

#if RP_HOST
for (i=0; i<48; i++)
{

fscanf(fi, "%d",&names[i]);

fscanf(fi, "%d",&ID[i]);

fscanf(fi, "%lf",&temp[i]);

fscanf(fi, "%lf",&emiss[i]);
}
#endif



/*????????????????????????????????????????????????? ???????????????????????


I don't know how to make the communication between host and nodes,
I also used host_to_nodes but it didn't work



************************************************** *******************************************/




#if !RP_HOST
zone_ID=THREAD_ID(t);
face_t f;

for(i=0;i<48;i++)
{
ii=5;
if(zone_ID==ID[i])
{
ii=i;
tempp=temp[i];
}
}



/*????????????????????????????????????????????????? ???????????????????????



I don't know whether it's right to use "compute_node_loop_not_zero (pe)"
here!!!!!



************************************************** *********************************************/


compute_node_loop_not_zero (pe)
{
begin_f_loop(f,t)
{
if PRINCIPAL_FACE_P(f,t)
{
F_PROFILE(f,t,j)=temp[ii]
}
}
end_f_loop(f,t)
}
#endif

#if !RP_NODE
fclose(fi);
#endif


}
sandeep_tu is offline   Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
UDF Parallel error (Is operating only in the serial.) startup0820 Fluent UDF and Scheme Programming 0 March 7, 2012 08:26
UDF parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 23:14
Can any one suggest How to Parallelize Serial UDF sri31049 Fluent UDF and Scheme Programming 0 September 9, 2010 08:10
parallelization of serial Fluent UDF for surface reaction sri31049 FLUENT 0 September 8, 2010 15:15
parapllelizing a serial udf mahi FLUENT 1 November 13, 2008 09:32


All times are GMT -4. The time now is 19:51.