# about eddy viscosity :UDF

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

 LinkBack Thread Tools Display Modes
 December 23, 2004, 03:17 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) } }

 January 10, 2005, 13:51 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

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

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Marvin Main CFD Forum 6 December 4, 2009 12:08 Piti CFX 2 January 17, 2008 17:49 denhan FLUENT 0 April 6, 2007 01:12 nbh2801 FLUENT 0 April 21, 2006 07:49 Mike CFX 1 April 4, 2006 13:12

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

 Contact Us - CFD Online - Top