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

Compiled UDF error

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 19, 2005, 21:00
Default Compiled UDF error
  #1
ap
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
  Reply With Quote

Old   March 20, 2005, 07:54
Default Re: Compiled UDF error
  #2
Erica
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
  Reply With Quote

Old   March 20, 2005, 09:26
Default Re: Compiled UDF error
  #3
ap
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
  Reply With Quote

Old   March 21, 2005, 01:42
Default Re: Compiled UDF error
  #4
Y
Guest
 
Posts: n/a
if you want I can try it on my computer cut and paste the code here. Y
  Reply With Quote

Old   March 21, 2005, 06:11
Default Re: Compiled UDF error
  #5
Dirk
Guest
 
Posts: n/a
The DEFINE_TURBULENT_VISCOSITY should work with user defined scalars.
  Reply With Quote

Old   March 22, 2005, 14:11
Default Re: Compiled UDF error
  #6
ap
Guest
 
Posts: n/a
Thank you. I tried with DEFINE_TURBULENT_VISCOSITY and it worked nice.

Regards, ap
  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
OpenFOAM install on Ubuntu Natty 11.04 bkubicek OpenFOAM 13 May 26, 2011 05:48
ParaView for OF-1.6-ext Chrisi1984 OpenFOAM Installation 0 December 31, 2010 06:42
checking the system setup and Qt version vivek070176 OpenFOAM Installation 22 June 1, 2010 12:34
Installation OF1.5-dev ttdtud OpenFOAM Installation 46 May 5, 2009 02:32
Compiling problems with hello worldC fw407 OpenFOAM Installation 21 January 6, 2008 17:38


All times are GMT -4. The time now is 06:14.