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

UDF Parallizing.....!!

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

LinkBack Thread Tools Display Modes
Old   September 16, 2010, 07:41
Default UDF Parallizing.....!!
New Member
Join Date: Mar 2009
Posts: 18
Rep Power: 8
sri31049 is on a distinguished road
I have serial UDF for surface reaction kinetics (applied only at the wall). It does not include any operations like averaging etc. I need to parallelize the serial UDF in order to submit in clusters. The serial UDF is as follows

#include "udf.h"
#define R 8314
#define p 1013250
#define pi 3.14159

Thread *t0 = t -> t0;
cell_t c0=F_C0(f,t);
real c3h8 = yi[0];
real o2 = yi[1];
real co2 = yi[2];
real h2o = yi[3];
real n2 = yi[4];

real rho_w = 1.0, sd = 2.49e-8, T_w;
real o_s,o_vac;
real xc3h8 = 1.0, xo2 = 1.0;
real tn,Tg,Ea3, Ea4, Ea5;
real rA3, rA4, rA5,rk3, rk4, rk5;
real ro,rate;

T_w = F_T(f,t);
rho_w = C_R(c0,t0)*C_T(c0,t0)/T_w;

c3h8 *= rho_w/mw[0];
o2 *= rho_w/mw[1];
co2 *= rho_w/mw[2];
h2o *= rho_w/mw[3];
n2 *= rho_w/mw[4];

/* Mole fraction of CH4 and O2 */

xc3h8 = c3h8/(c3h8+o2+co2 +h2o+n2);
xo2 = o2/(c3h8+o2+co2 +h2o+n2);

Tg = C_T(c0,t0);
tn = T_w/300;

Ea3 = 0.0;
Ea4 = 0.126*tn*tn*tn*tn - 1.849*tn*tn*tn + 9.124*tn*tn - 13.253*tn + 23.903;
Ea5 = 4.0;
Ea3 *= 4184e7;
Ea4 *= 4184e7;
Ea5 *= 4184e7;

rA3 = (0.0542)*pow(tn,0.766);
rA4 = (8.41e12)*pow(tn,-0.796);
rA5 = (0.06)*pow(tn,0.154);

rk3 = (rA3/(sd*sd))*sqrt(R*T_w/(2*pi*mw[1]))*(p/(R*T_w));
rk4 = (rA4/sd)*exp(-Ea4/(R*T_w));
rk5 = (rA5/(sd*sd))*sqrt(R*T_w/(2*pi*mw[0]))*(p/(R*T_w))*exp(-Ea5/(R*T_w));

ro = sqrt(rk3*xo2/rk4);
o_s = ro/(1+ro);
o_vac = 1-o_s;
rate = rk5*xc3h8*(sd*sd)*pow(o_vac,2);

if (STREQ(r->name, "reaction-1"))
*rr = rate*pow(10,1);

I tried by putting the if PARALLEL command but it does not work. Can any one suggest where to put the proper commands such that udf will be shared for all the nodes. I am trying from 3 months but i could not solve theis problem. I am waiting for your valuable reply.

Thanks in Advance
sri31049 is offline   Reply With Quote


parallel, serial, udf

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
UDF parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 23:14
How to add a UDF to a compiled UDF library kim FLUENT 3 October 26, 2011 21:38
Dynamic Mesh UDF Qureshi FLUENT 1 December 2, 2009 01:27
UDF...UDF...UDF...UDF Luc SEMINEL FLUENT 0 November 25, 2002 05:03
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 05:01

All times are GMT -4. The time now is 08:34.