CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

about eddy viscosity :UDF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 23, 2004, 03:17
Default about eddy viscosity :UDF
  #1
sagga
Guest
 
Posts: n/a
i 'd like to define new eddy viscosity in Fluent by UDF i have C code but when it compile it was error somebody help me please thank my code #include "udf.h" // T.B. Model constants//

#define C_MU 0.09

#define C1_D 1.44

#define C2_D 1.92

// UDS //

enum {

TKE,

TDR,

N_REQUIRED_UDS };

// RE NUM DEFINE //

real Re_y(cell_t c, Thread *t) { float A ;

A =sqrt(C_UDSI(c,t,TKE));

return C_R(c,t)*A*C_WALL_DIST(c,t)/C_MU_L(c,t);}

real Re_t(cell_t c, Thread *t)

{ return C_R(c,t)*SQR(C_UDSI(c,t,TKE))/C_MU_L(c,t)/C_UDSI(c,t,TDR);}

// DAMPING FUNCTION //

real f_mu(cell_t c, Thread *t)

{ float B ,C;

B=tanh(0.008*Re_y(c,t));

C=pow(Re_t(c,t),0.75);

return B*(1.+4/C) ;}

real f_1(cell_t c, Thread*t)

{ return 1.;}

real f_2(cell_t c, Thread*t)

{ float D ,E;

D=(1.-2./9.*exp(-Re_t(c,t)*Re_t(c,t)/36.));

E=(1.-exp(-Re_t(c,t)/12.));

return D*E ;}

DEFINE_ADJUST(turb_adjust, domain)

{

Thread *t;

cell_t c;

// set turbulent viscoscity //

thread_loop_c(t,domain)

if (FLUID_THREAD_P(t))

{

begin_c_loop(c,t)

{

C_MU_T(c,t) = C_R(c,t)*C_MU*f_mu(c,t)*SQR(C_UDSI(c,t,TKE))/C_UDSI(c,t,TDR)

}

end_c_loop(c,t)

}

}

  Reply With Quote

Old   January 10, 2005, 13:51
Default Re: about eddy viscosity :UDF
  #2
Michael
Guest
 
Posts: n/a
I have a similar problem. The compiler error happened for the following line:

C_MU_T(c,t) = C_R(c,t)*C_MU*f_mu(c,t)*SQR(C_UDSI(c,t,TKE))/C_UDSI(c,t,TDR)

error C2106: '=' : left operand must be l-value. Basically it would not let me to assign any value to C_MU_T(c,t).

Anyone knows a solution? Thanks
  Reply With Quote

Old   January 10, 2005, 22:07
Default Re: about eddy viscosity :UDF
  #3
sagga
Guest
 
Posts: n/a
thank Michael
  Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Link between eddy viscosity and subgrid-scale turbulent viscosity in LES Marvin Main CFD Forum 6 December 4, 2009 12:08
Question about eddy viscosity ratio limit Piti CFX 2 January 17, 2008 17:49
viscosity in UDF! denhan FLUENT 0 April 6, 2007 02:12
Help - UDF for solid shear viscosity nbh2801 FLUENT 0 April 21, 2006 08:49
eddy viscosity Mike CFX 1 April 4, 2006 14:12


All times are GMT -4. The time now is 05:03.