CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   When I activate DEFINE_ON_DEMAND --> "received fatal signal (ACCESS_VIOLATION)" (https://www.cfd-online.com/Forums/fluent-udf/162536-when-i-activate-define_on_demand-received-fatal-signal-access_violation.html)

heliyongkb November 12, 2015 09:45

When I activate DEFINE_ON_DEMAND --> "received fatal signal (ACCESS_VIOLATION)"
 
Dear all,

I'm working in the simulation of snowdrift.I have problems in my UDF.When i activate the DEFINE_ON_DEMAND macro ,the following error will occur:
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: ()

This is my UDF of the volume fraction in boundary condition and computing the erosion and deposition of snow.

#include"udf.h"
#define zo 1
#define uo 5
#define ps 150
#define uxt 0.15
#define zs 0.00003
#define af 0.25
#define wf 0.2

/*PROFILE FOR VOLUME FRACTION*/
DEFINE_PROFILE(volume_fraction,thread,index)
{
real x[ND_ND];
real z,um,ux,hs;
Thread**pt;
cell_t c;
begin_c_loop(c,thread)
{
C_CENTROID(x,c,thread);
z=x[2];
um=uo*pow((z/zo),af);
ux=um*0.4/log(z/zs);
hs=0.8*ux*ux/9.8;
if(z<=hs)
{
F_PROFILE(c,thread,index)=0.8*exp(-1.55*(4.78*pow(ux,-0.544)-pow(z,-0.544)))/ps;
}
else
{
F_PROFILE(c,thread,index)=0.68*uxt*(ux*ux-uxt*uxt)/ux/uxt/22.54;
}
}
end_c_loop(c,thread)
}

/*DEMAND FOR COMPUTE EROSION AND DEPOSITION*/
DEFINE_ON_DEMAND(on_demand_calc)
{
Domain*d;
real x[ND_ND];
real z,um,ux,hs,vof;
Thread*t;
cell_t c;
d=Get_Domain(1);
thread_loop_c(t,d);
begin_c_loop(c,t)
{
C_CENTROID(x,c,t);
z=x[2];
um=uo*pow((z/zo),af);
ux=um*0.4/log(z/zs);
hs=0.8*ux*ux/9.8;
C_VOF(c,t);
if(z<=hs)
{
vof+=0.8*exp(-1.55*(4.78*pow(ux,-0.544)-pow(z,-0.544)))/ps;
}
else
{
vof+=0.68*uxt*(ux*ux-uxt*uxt)/ux/uxt/22.54;
}
}
end_c_loop(c,t)
printf("\n VOF=%g \n",vof);
begin_c_loop(c,t)
{
if(ux<=uxt)
{
C_UDMI(c,t,0)=wf*ps*vof*(uxt*uxt-ux*ux)/uxt/uxt;
}
else
{
C_UDMI(c,t,1)=0.0007*(uxt*uxt-ux*ux);
}
}
end_c_loop(c,t)
}

This UDF can be interpreted,but i can't solve and calculate with it.

I just start to learn the FLUENT software and i don't know how to modify the UDF,especially in the DEFINE_ON_DEMAND macro.

I'm very grateful for someone can help me with the modifying of UDF or point out that the basic mistake.

heliyongkb November 13, 2015 23:57

In badly need of help
 
Please help me with my UDF.
Thanks for you in advance.:)

heliyongkb November 15, 2015 01:14

Why
 
Why no one to help me?You can just point out the basic error.Thanks.


All times are GMT -4. The time now is 02:15.