CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)

 sagga December 23, 2004 03:17

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);}

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

// DAMPING FUNCTION //

{ float B ,C;

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

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

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

{ return 1.;}

{ 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 ;}

{

cell_t c;

// set turbulent viscoscity //

{

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)

}

}

 Michael January 10, 2005 13:51

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

 sagga January 10, 2005 22:07