CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Fluent UDF and Scheme Programming (
-   -   Heat Transfer coefficient udf (

Musa October 12, 2012 22:52

Heat Transfer coefficient udf
I am attempting to write a udf to calculate the htc from the gunn correlation but I keep getting a parse error in line 6. I have tried reviewing the code several times but I cannot find the source of the error. Any suggestions, recommendations?
#include "udf.h"

#define PR_NUMBER(cp,mu,k) ((cp)*(mu)/(k))
#define IP_HEAT_COEFF(vof,k,nu,d) ((vof)*6.*(k)*(Nu)/(d)/(d))

static real heat_gunn(cell_t c, Thread *ti, Thread *tj)
real h;
real vof_g=C_VOF(c,ti);
real d = C_PHASE_DIAMETER(c,tj);
real k = C_K_L(c,ti);
real NV_VEC(v), vel, Re, Pr, Nu;

vel = NV_MAG(v);

Re = RE_NUMBER(C_R(c,ti),vel,d,C_MU_L(c,ti));
Pr = PR_NUMBER (C_CP(c,ti),C_MU_L(c,ti),k);
Nu = (7.-10.*vof_g+5.*pow(vof_g,2.))*(1+0.7*pow(Re,0.7)*pow (Pr,1./3.))+(1.33-2.40*vof_g+1.20*pow(vof_g,2))*pow(Re,0.7)*pow(Pr,1 ./3.);

h = IP_HEAT_COEFF(C_VOF(c,tj),k,Nu,d);
return h;

sadjad.s October 13, 2012 04:29

hi mate,
use "THREAD_SUB_THREADS()" macro to separate ti and tj.
and also are you sure lines 2 and 3 ('#define' ) are right? i don't know either.

All times are GMT -4. The time now is 07:49.