CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   UDF for effective thermal conductivity (http://www.cfd-online.com/Forums/fluent/46421-udf-effective-thermal-conductivity.html)

Rashmi October 26, 2007 04:34

UDF for effective thermal conductivity
 
Hi All

Iam simulating nanofluids using fluent. I have written udf for effective thermal conductivity of nanofluid suspension of water and Al2O3 particles. here is the udf

#include "udf.h" #include "prop.h" #include "sg_mphase.h"

#define h 1.0

DEFINE_PROPERTY(cell_conductivity, c, mix_Thread, s_col, f_col)

{ Thread **pt = THREAD_SUB_THREADS(mix_Thread);

float k_f, k_p, d, a, k_lr, gamma, beta, beta1, beta3, beta13, phi_lr, term1, term2, term3, k_r, k_eff, phi_p;

/*------------------------------------------------*/ /* Read thermal conductivity of fluid and particle*/ /*------------------------------------------------*/

k_f = C_K_L(c,pt[s_col]); k_p = C_K_L(c,pt[f_col]);

real C_K_EFF(c, mix_Thread);

/*--------------------------------------------------*/ /* Grab the diameter of nano particle (d) */ /*--------------------------------------------------*/

d = C_PHASE_DIAMETER(c,pt[f_col]);

a=d/2.0; /* Particle radius*/

/*------------------------------------------------------------------*/ /* Grab the local volume fraction of the dispersed phase - no units */ /*------------------------------------------------------------------*/ phi_p = C_VOF(c,pt[f_col]);

k_lr = 2.0*k_f; /* Assumption */ gamma = h/a; beta = 1.0 + gamma; beta1 = 1.0 + (gamma/2.0);

beta3 = beta*beta*beta; beta13 = beta1*beta1*beta1; phi_lr = phi_p * (beta3-1.0); term1 = ((k_p-k_lr)*phi_lr*k_lr*(2.0*beta13-beta3+1.0)); term2 = (((k_p+(2.0*k_lr))*beta13)*(phi_lr*beta3*(k_lr-k_f)+k_f)); term3= (((beta13*(k_p+(2.0*k_lr)))-((k_p-k_lr)*phi_lr*(beta13+ beta3-1)))); k_eff = (term1+term2)/term3; /*---------------------------------------------*/ /* Store the value of k_eff in memory */ /*---------------------------------------------*/

C_UDMI(c, mix_Thread, 0)= k_eff;

k_r = k_eff/k_f;

/*------------------------------------------------------------------------*/ /* Store the value of Thermal conductivity ratio (k_r) in memory */ /*------------------------------------------------------------------------*/

C_UDMI(c, mix_Thread, 1)= k_r;

return k_eff;

}

------------------------- here are the error msgs ------------------------- ..\..\src\TCeffmodify.c(7) : warning C4002: too many actual parameters for macro 'DEFINE_PROPERTY' ..\..\src\TCeffmodify.c(19) : error C2065: 's_col' : undeclared identifier ..\..\src\TCeffmodify.c(20) : error C2065: 'f_col' : undeclared identifier ..\..\src\TCeffmodify.c(24) : warning C4003: not enough actual parameters for macro 'C_K_EFF' ..\..\src\TCeffmodify.c(24) : error C2063: 'real' : not a function ..\..\src\TCeffmodify.c(24) : error C2059: syntax error : ')'

Done. "C:/working"

Opening library "libudf"... Error: open_udf_library: The system cannot find the file specified.

Error Object: ()

Can anyone help me to solve this. Thanks Rashmi


Woo Meng Wai November 6, 2007 21:08

Re: UDF for effective thermal conductivity
 
Hi,

I also faced some previously in obtaining effective thermal ocnductivity for my UDF. I noticed u used this macro:

real C_K_EFF(c, mix_Thread)

the actual call for effective thermal conductivity is:

C_K_EFF(c,t,prt)

where prt is the turbulent prandtl number. I am not sure how u are going to access the prandtl number. Hope it helps.

cheers, Woo


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