|
[Sponsors] |
March 30, 2004, 10:09 |
error message about using DEFINE_SOURCE
|
#1 |
Guest
Posts: n/a
|
Hi, there,
I wrote one UDF using the macro DEFINE_SOURCE, the return data type is real as in fluent documentation. But when I initialized the solution, I got the following error message: chip-exec: SW_Kompressibel: wrong return type: void udf function expected Error: FLUENT received fatal signal (ACCESS_VIOLATION) 1. Note exact events leading to error. 2. Save case/data under new name. 3. Exit program and restart to continue. 4. Report error to your distributor. Error Object: () Note: SW_Kompressibel is the function name. I would be greatly appreciated for any suggestions or comments. Regards, Emma |
|
March 31, 2004, 14:24 |
Re: error message about using DEFINE_SOURCE
|
#2 |
Guest
Posts: n/a
|
It seems you're returning a value in a function which doesn't want anything in return.
Can you post the source code? Hi ap |
|
April 1, 2004, 07:04 |
Re: error message about using DEFINE_SOURCE
|
#3 |
Guest
Posts: n/a
|
Hi,
I'd like to post my source code. Any suggestions? Regards Emma ------------------------------------ #include "udf.h" #include "sg_mphase.h" DEFINE_SOURCE(SW_Kompressibel, c, thread, dS, eqn) { real alpha; real druck; real vapor_vol; real liquid_vol; real source = 0.; real C = 0.99499; druck = C_P(c,thread); alpha=(1.0-C)/8000000.0*druck+C; if (alpha>=1.0) { alpha = 1.0; } if (alpha<=0.0) { alpha = 0.0; } C_VOF(c, thread) = alpha; liquid_vol = C_VOF(c, thread); vapor_vol = 1 - C_VOF(c, thread); source = vapor_vol; return source; } |
|
April 1, 2004, 08:07 |
Re: error message about using DEFINE_SOURCE
|
#4 |
Guest
Posts: n/a
|
Where did you hook your source term ?
|
|
April 1, 2004, 14:20 |
Re: error message about using DEFINE_SOURCE
|
#5 |
Guest
Posts: n/a
|
The code is ok. Probably you're hooking it in the wrong place.
Hi ap |
|
April 2, 2004, 04:18 |
Re: error message about using DEFINE_SOURCE
|
#6 |
Guest
Posts: n/a
|
Hi, ap and thomas,
Thank you both for the quick reply! I want to get the vapor volume fraction in my model through UDF. I defined it as UDS by clicking define-> user-defined->scalars,gave "1" to the number of USD, and keeping the default setting of flux funfction and unsteady function. Then in the velocity inlet panel, I chose "specified value" for the UDS boundary condition, and "udf SW_Kompressibrel" for UDS boundary value. Any comment or suggestion is greatly welcome. Regards, Emma |
|
|
|