Compiled UDF error
I'm writing a UDF to change the turbulent viscosity through a DEFINE_ADJUST macro.
DEFINE_ADJUST(turb_adjust, domain) { Thread *t; cell_t c; 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); /* Line 124 */ } end_c_loop(c,t) } } During compilation I get the following error: LowReKE.c: In function `turb_adjust': LowReKE.c:124: warning: use of conditional expressions as lvalues is deprecated LowReKE.c:124: error: invalid lvalue in assignment LowReKE.c:124: warning: use of cast expressions as lvalues is deprecated make[3]: *** [LowReKE.o] Error 1 I tried to change line 124 to C_MU_T(c,t) = 1.; just to do a test, but the error massege is the same. What does it mean? How can I change the turbulent viscosity in my domain in a UDF? Best regards, ap |
Re: Compiled UDF error
I'm not sure what's wrong with your UDF, but firstly you can't separate the "thread_loop "and "{ " by the if(). When I use the FLUID_THREAD_P, some error occurred. I don't know why. (error : thread storage not implement)
Goodluck Erica |
Re: Compiled UDF error
Thank you for your answer, Erica.
I tried to change the code as follows: DEFINE_ADJUST(turb_adjust, domain) { Thread *t; cell_t c; /* Set the turbulent viscosity */ thread_loop_c (t, domain) { 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) } } but the error is still there. Looking in the UDF manual I saw the specific macro DEFINE_TURBULENT_VISCOSITY, but I'm not sure if it will work because I'm going to implement a new turbulence model, which will be solved instead of the FLUENT standard k-eps model, whose equation will be disabled in the Control -> Solution panel. Best regards, ap |
Re: Compiled UDF error
if you want I can try it on my computer cut and paste the code here. Y
|
Re: Compiled UDF error
The DEFINE_TURBULENT_VISCOSITY should work with user defined scalars.
|
Re: Compiled UDF error
Thank you. I tried with DEFINE_TURBULENT_VISCOSITY and it worked nice.
Regards, ap |
All times are GMT -4. The time now is 06:51. |