CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   UDF ERROR: ACCESS_VIOLATION (http://www.cfd-online.com/Forums/fluent-udf/36711-udf-error-access_violation.html)

M.Sundar May 19, 2005 10:38

UDF ERROR: ACCESS_VIOLATION
 
Hai fluent users

i want to add source term(In Energy Eq w/m3) as a function of volume fraction in VOF multi phase model. Is it possible to call C_VOF(c,pt[0])(Volume fraction) inside DEFINE_SOURCE. When i try to use it gives error message

C:\DEFINE.c:6: macro `DEFINE_SOURCE' used with only 3 args 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: ()

The udf is(DEFINE.c)

#include "udf.h"

DEFINE_SOURCE(heatgen,c,t) {

Thread **pt;

real x[ND_ND],y;

real source;

y=x[1];

C_CENTROID(x, c, t); if ((C_VOF(c,pt[1])==0))

source = 9e9;

else

source=0;

return source; }

Please tell what is the error

Thanks in advance


pUl| May 19, 2005 15:36

Re: UDF ERROR: ACCESS_VIOLATION
 
Syntax for DEFINE_SOURCE is

DEFINE_SOURCE( name, c, t, dS, eqn)

You are missing dS, the derivative of the source and eqn number, eqn.

Refer:

http://www.fluentusers.com/fluent/do...udf/node81.htm

Here is a sample UDF:

#include "udf.h"

#define C2 100.0

DEFINE_SOURCE(xmom_source,c,t,dS,eqn)

{

real x[ND_ND];

real con, source;

C_CENTROID(x,c,t);

con = C2*0.5*C_R(c,t)*x[1];

source = -con*fabs(C_U(c, t))*C_U(c,t);

dS[eqn] = -2.*con*fabs(C_U(c,t));

return source;

}

moun139 May 14, 2012 16:40

same problem
 
i write a udf and when i want to intialize it write me :

fluent faltal....

what is the problem ?


All times are GMT -4. The time now is 00:03.