CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   Problem UDF for Turbulen viscosity (http://www.cfd-online.com/Forums/fluent-udf/108578-problem-udf-turbulen-viscosity.html)

fevi84 October 26, 2012 15:40

Problem UDF for Turbulen viscosity
 
Hi all,

How i can retrieve variables of different domains inside the same macro? I have retrieve the liquid density value, gas density value and turbulent viscosity inside the same macro. I want set up the Turbulent viscosity in the secondary phase using "dispersed" as Turbulent Multiphase Model in the k-e model.

I tried with the following udf:

DEFINE_TURBULENT_VISCOSITY(mu_t_ke_air, c, phase_t)
{
Thread *mt; /* mixture or super thread*/
Thread **all_phase_threads; /* An array of all the phase threads */

mt = THREAD_SUPER_THREAD(phase_t);
all_phase_threads = THREAD_SUB_THRADS(mt);


/* all_phase_threads[0] is primary thread, */
/* all_phase_threads[1] first secondary phase thread */

real mu_tg;
real rho_l = C_R(c,all_phase_threads[0]);
real rho_g = C_R(c,all_phase_threads[1]);
real mu_tl = C_MU_T(c,all_phase_threads[0]);
mu_tg = mu_tl*rho_g/rho_l;

return mu_tg;

}

But, this udf gave the following erro:

THREAD_SUB_THRADS is an undeclared variable.

Anyone know why gave this erro. If anyone knows another way to do it, using other pointer, etc..., please tell me.

Thanks!!!!


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