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

Heat Transfer coefficient udf

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

LinkBack Thread Tools Display Modes
Old   October 12, 2012, 22:52
Default Heat Transfer coefficient udf
Musango Lungu
Join Date: Dec 2011
Location: China
Posts: 73
Rep Power: 7
Musa is on a distinguished road
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;
Musa is offline   Reply With Quote

Old   October 13, 2012, 04:29
sadjad.s's Avatar
Join Date: Jan 2012
Posts: 70
Rep Power: 7
sadjad.s is on a distinguished road
Send a message via Yahoo to sadjad.s
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.
sadjad.s is offline   Reply With Quote

Old   May 18, 2016, 13:38
Post Kmiec correlation
New Member
Junia Mendes
Join Date: Apr 2016
Posts: 7
Rep Power: 3
junianatalia is on a distinguished road

I'm try write a Kmiec correlation, but I don't get sucess.
#include "udf.h"

#define PR_NUMBER(cp,mu,k) ((cp)*(mu)/(k))
#define IP_HEAT_COEFF(vof,k,Nu,dp) ((1.-vof)*6.*(k)*(Nu)/(dp)(dp))
#define AR_NUMBER(rhof,rhop,dp,mu) (9.81*((rhop)-(rhof))*(dp)*(dp)*(dp)*(rhof)/mu/mu)
#define dp 0.00313356

real heat_kmiec_1980(cell_t c, Thread *ti, Thread *tj)

real h;
real k = C_K_L(c,ti);
real NV_VEC(v), vel, Re, Pr, Nu, Ar, vof, H0, dc, n1, n2, n3, n4;

NV_DD(v,=, C_U(c,tj),C_V(c,tj),C_W(c,tj),-,C_U(c,ti),C_V(c,ti),C_W(c,ti));
vel = NV_MAG(v);

Re = RE_NUMBER(C_R(c,ti),vel,dp,C_MU_L(c,ti));
Pr = PR_NUMBER(C_CP(c,ti),C_MU_L(c,ti),k);
Ar = AR_NUMBER(C_R(c,ti),C_R(c,tj),dp,C_MU_L(c,ti));
H0 = 0.175;
dc = 0.30;
n1 = 0.5753;
n2 = H0/dp;
n3 = dc/dp;
n4 = 0.79;
Nu = 0.0451*pow(Re,0.644)*pow(Pr,1./3.)*pow(Ar,0.226)*pow(n1,-0.852)*pow(n2,-1.47)*pow(n3,0.947)*pow(n4,2.304);

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



Can you help me?
junianatalia 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
Heat Transfer Coefficient Alberto Schroth FLUENT 14 September 9, 2015 10:00
Heat transfer coefficient CIN3X OpenFOAM Running, Solving & CFD 3 November 25, 2013 06:54
UDF for heat transfer coefficient Shankar Fluent UDF and Scheme Programming 9 February 18, 2013 10:13
error message cuteapathy CFX 14 March 20, 2012 07:45
Convective / Conductive Heat Transfer in Hypersonic flows enigma Main CFD Forum 2 November 1, 2009 23:53

All times are GMT -4. The time now is 13:02.