CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   Problem UDF for Turbulen viscosity (https://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!!!!

Ekta J January 17, 2017 15:18

Hello, Does anyone know the correct udf for modifying turbulent viscosity in k-epsilon per phase model? (for Euler-Euler)

I am using the following udf (modified as per my knowledge, from the basic udf for k-epsilon mixture model) But it does not seem to be taking the correct value of k, epsilon etc from the fluent:

"
#include "udf.h"


DEFINE_TURBULENT_VISCOSITY(mu_t_ke_air,c,t)
{

real rho_g, KE_g, D_g, mu_t_g;

rho_g = C_R(c, t); /* gas phase density */
KE_g = C_K(c, t); /* gas phase Kinetic energy */
D_g = C_D(c, t); /* gas phase epsilon */

mu_t_g= 0.09*rho_g*KE_g*KE_g/D_g;

C_UDMI(c,t,2) = mu_t_g; // (Calculated above)

return mu_t_g;

}
"

vcvedant June 25, 2017 18:25

Hi Ekta,

I face similar problem for implementing turbulent viscosity. Even though I am implementing the exact same definition as given in the equations for Re_y, Re_t, f_mu to implement User Defined viscosity for Lam-Bermhorst and Yang-Shih model but the results are quite different.
Any ideas?

Thanks


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