|
[Sponsors] |
March 19, 2005, 22:00 |
Compiled UDF error
|
#1 |
Guest
Posts: n/a
|
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 |
|
March 20, 2005, 08:54 |
Re: Compiled UDF error
|
#2 |
Guest
Posts: n/a
|
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 |
|
March 20, 2005, 10:26 |
Re: Compiled UDF error
|
#3 |
Guest
Posts: n/a
|
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 |
|
March 21, 2005, 02:42 |
Re: Compiled UDF error
|
#4 |
Guest
Posts: n/a
|
if you want I can try it on my computer cut and paste the code here. Y
|
|
March 21, 2005, 07:11 |
Re: Compiled UDF error
|
#5 |
Guest
Posts: n/a
|
The DEFINE_TURBULENT_VISCOSITY should work with user defined scalars.
|
|
March 22, 2005, 15:11 |
Re: Compiled UDF error
|
#6 |
Guest
Posts: n/a
|
Thank you. I tried with DEFINE_TURBULENT_VISCOSITY and it worked nice.
Regards, ap |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
OpenFOAM install on Ubuntu Natty 11.04 | bkubicek | OpenFOAM | 13 | May 26, 2011 06:48 |
ParaView for OF-1.6-ext | Chrisi1984 | OpenFOAM Installation | 0 | December 31, 2010 07:42 |
checking the system setup and Qt version | vivek070176 | OpenFOAM Installation | 22 | June 1, 2010 13:34 |
Installation OF1.5-dev | ttdtud | OpenFOAM Installation | 46 | May 5, 2009 03:32 |
Compiling problems with hello worldC | fw407 | OpenFOAM Installation | 21 | January 6, 2008 18:38 |