|
[Sponsors] |
November 6, 2005, 19:24 |
UDF Error Message
|
#1 |
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; } |
|
November 6, 2005, 22:35 |
Re: UDF Error Message
|
#2 |
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 |
|
November 8, 2005, 22:47 |
Re: UDF Error Message
|
#3 |
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) } |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
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 |