CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Fluent UDF and Scheme Programming

Problem UDF for Turbulen viscosity

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

Reply
 
LinkBack Thread Tools Display Modes
Old   October 26, 2012, 15:40
Default Problem UDF for Turbulen viscosity
  #1
Member
 
Fer Villa
Join Date: Apr 2012
Posts: 35
Rep Power: 5
fevi84 is on a distinguished road
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!!!!
fevi84 is offline   Reply With Quote

Reply

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
Problem with divergence TDK FLUENT 10 September 8, 2012 01:11
UDF using problem, error happens-heip!! Michael FLUENT 1 December 9, 2008 08:51
Problem in compiling property(density) UDF satish2968 FLUENT 3 October 31, 2008 16:06
parallel UDF problem kerem FLUENT 2 June 20, 2006 06:56
Problem of Turbulent Viscosity Ratio Limited David Yang FLUENT 3 June 3, 2002 06:13


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