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

Serial UDF is working for parallel computation also

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 26, 2013, 18:24
Default Serial UDF is working for parallel computation also
  #1
Senior Member
 
Tanjina Afrin
Join Date: May 2013
Location: South Carolina
Posts: 169
Rep Power: 12
Tanjina is on a distinguished road
Dear all,

I needed an UDF to assign hydrostatic pressure on vertical inlet of 0.4925 m. So I wrote down the following UDF-

#include "udf.h"
DEFINE_PROFILE(pressure_profile,t,i)
{
real x[ND_ND];
real y;
face_t f;
begin_f_loop(f,t)
{
F_CENTROID(x,f,t);
y=x[1];
F_PROFILE(f,t,i)=(0.4925-y)*998.2*9.81;
}
end_f_loop(f,t)
}

About what I am confused about is, it is working also for parallel cluster computation also. I know for parallel , I need to add some if ,end if, print syntax, but I am not sure how to use those properly, so I tried to write down this code in the following form for parallel-

#include "udf.h"
DEFINE_PROFILE(pressure_profile,t,i)
{
#if !RP_HOST
real x[ND_ND];
real y;
face_t f;
begin_f_loop(f,t)
{
F_CENTROID(x,f,t);
y=x[1];
F_PROFILE(f,t,i)=(0.4925-y)*998.2*9.81;
}
end_f_loop(f,t)
#endif
}

It is also working for parallel also! And for both UDF in parallel, I got same result.

Is there anything wrong I did or not every UDF requires different macro for serial and parallel ?

Thanks in advance.

Regards,
Tanjina
Tanjina 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
Source Term UDF VS Porous Media Model pchoopanya Fluent UDF and Scheme Programming 1 August 28, 2013 06:12
Weird problem in my UDF aleisia Fluent UDF and Scheme Programming 1 June 29, 2011 13:17
DEFINE_DPM_OUTPUT macro UDF HELP Puneet FLUENT 3 November 28, 2003 10:55
DEFINE_GEOM UDF Problems Pat FLUENT 0 August 14, 2003 13:16
UDF...UDF...UDF...UDF Luc SEMINEL FLUENT 0 November 25, 2002 04:03


All times are GMT -4. The time now is 18:26.