CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

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

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 12, 2015, 10:45
Default When I activate DEFINE_ON_DEMAND --> "received fatal signal (ACCESS_VIOLATION)"
  #1
New Member
 
lyhim
Join Date: Nov 2015
Posts: 5
Rep Power: 11
heliyongkb is on a distinguished road
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.

Last edited by heliyongkb; November 13, 2015 at 08:17. Reason: In need of help
heliyongkb is offline   Reply With Quote

Old   November 14, 2015, 00:57
Post In badly need of help
  #2
New Member
 
lyhim
Join Date: Nov 2015
Posts: 5
Rep Power: 11
heliyongkb is on a distinguished road
Please help me with my UDF.
Thanks for you in advance.
heliyongkb is offline   Reply With Quote

Old   November 15, 2015, 02:14
Smile Why
  #3
New Member
 
lyhim
Join Date: Nov 2015
Posts: 5
Rep Power: 11
heliyongkb is on a distinguished road
Why no one to help me?You can just point out the basic error.Thanks.
heliyongkb is offline   Reply With Quote

Reply

Tags
udf snowdrift


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
[ImmersedBoundary] About the moving immersed boundary tutorial: icoDyMIbFoam+movingCylinderInChannelIco wyldckat OpenFOAM Community Contributions 25 September 14, 2021 18:15
fluentError: received a fatal signal (Segmentation fault). thomaszhangjing Fluent UDF and Scheme Programming 11 January 13, 2021 10:37
FLUENT received fatal signal (ACCESS_VIOLATION) osamaghani FLUENT 2 March 31, 2012 17:15
fatal signal (ACCESS_VIOLATION) manu FLUENT 0 December 10, 2007 07:10
error while compiling the USER Sub routine CFD user CFX 3 November 25, 2002 16:16


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