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

UDF Error Message

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 6, 2005, 19:24
Default UDF Error Message
  #1
Andy
Guest
 
Posts: n/a
Hi everyone. I have written a UDF to allow me to vary the inertial resistance of a porous zone at a particular time step. However, when I try interpreting the UDF into Fluent, I get the following error message:

"chip-exec: valve_1: wrong return type: void udf function expected"

Can anyone tell me what I am doing wrong? My UDF is below... Thanks!

#include "udf.h"

DEFINE_SOURCE(valve_1, c, t, dS, eqn) { int timestep; real inertia_term; timestep = N_TIME; inertia_term = 10000.;

if (timestep == 3)

inertia_term = 0.; else

inertia_term = 10000.;

return inertia_term;

}
  Reply With Quote

Old   November 6, 2005, 22:35
Default Re: UDF Error Message
  #2
Joey
Guest
 
Posts: n/a
I don't know what happened to your case exactly, but I guess that you had hooked the udf in a wrong panel maybe. hope it helps

Joey
  Reply With Quote

Old   November 8, 2005, 22:47
Default Re: UDF Error Message
  #3
Andy
Guest
 
Posts: n/a
Thanks Joey. Although you didn't exactly answer my question, you did point me in the right direction.

The issue wasn't that I hooked up the UDF wrong, I just used the wrong type. The Fluent manual uses an example with porous material for the DEFINE_SOURCE macro. However, this macro can only be used to change the mass, momentum, viscosity, and energy source terms. It cannot be used to change the inertial or viscous resistances. To change those, the DEFINE_PROFILE macro must be used.

Searching through the archives, I found that this issue has come up before. For posterity's sake, here is the UDF that did what I wanted:

#include "udf.h"

DEFINE_PROFILE(valve_2, t, i) { face_t f; real x[ND_ND]; int timestep; real inertia_term; timestep = N_TIME; inertia_term = 0.;

begin_f_loop(f, t) {

F_CENTROID(x,f,t);

if (timestep == 3)

inertia_term = 10000.;

else

inertia_term = 0.;

F_PROFILE(f,t,i)=inertia_term; }

end_f_loop(f,t)

}

  Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Dynamic Mesh UDF Qureshi FLUENT 7 March 23, 2017 07:37
UDF parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 22:14
How to add a UDF to a compiled UDF library kim FLUENT 3 October 26, 2011 21:38
UDF...UDF...UDF...UDF Luc SEMINEL FLUENT 0 November 25, 2002 04:03
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 04:01


All times are GMT -4. The time now is 09:07.