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

error message about using DEFINE_SOURCE

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

Reply
 
LinkBack Thread Tools Display Modes
Old   March 30, 2004, 10:09
Default error message about using DEFINE_SOURCE
  #1
emma
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
  Reply With Quote

Old   March 31, 2004, 14:24
Default Re: error message about using DEFINE_SOURCE
  #2
ap
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
  Reply With Quote

Old   April 1, 2004, 07:04
Default Re: error message about using DEFINE_SOURCE
  #3
emma
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;

}

  Reply With Quote

Old   April 1, 2004, 08:07
Default Re: error message about using DEFINE_SOURCE
  #4
thomas
Guest
 
Posts: n/a
Where did you hook your source term ?
  Reply With Quote

Old   April 1, 2004, 14:20
Default Re: error message about using DEFINE_SOURCE
  #5
ap
Guest
 
Posts: n/a
The code is ok. Probably you're hooking it in the wrong place.

Hi

ap
  Reply With Quote

Old   April 2, 2004, 04:18
Default Re: error message about using DEFINE_SOURCE
  #6
emma
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
  Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 13:37.