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

error: FLUENT received fatal signal (ACCESS_VIOLATION)

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Bruno Machado

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 16, 2016, 10:45
Default error: FLUENT received fatal signal (ACCESS_VIOLATION)
  #1
New Member
 
ehsan
Join Date: Oct 2015
Location: tehran
Posts: 26
Rep Power: 11
ehsan105 is on a distinguished road
when I want hooking (UDF DEFINE_ON_DEMAND(reset_UDM)) in Execute on Demand menu,This error occurs.

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: ()

I want to use DEFINE_EROSION, Which includes the above UDF
plz guid me
ehsan105 is offline   Reply With Quote

Old   February 16, 2016, 10:52
Default
  #2
Senior Member
 
Bruno Machado
Join Date: May 2014
Posts: 271
Rep Power: 13
Bruno Machado is on a distinguished road
Quote:
Originally Posted by ehsan105 View Post
when I want hooking (UDF DEFINE_ON_DEMAND(reset_UDM)) in Execute on Demand menu,This error occurs.

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: ()

I want to use DEFINE_EROSION, Which includes the above UDF
plz guid me
Usually ACCESS VIOLATION means you are trying to access some information that is not available yet. If you post your UDF we can have a look and help you accordingly.
ehsan105 likes this.
Bruno Machado is offline   Reply With Quote

Old   February 16, 2016, 17:53
Default
  #3
New Member
 
ehsan
Join Date: Oct 2015
Location: tehran
Posts: 26
Rep Power: 11
ehsan105 is on a distinguished road
Quote:
Originally Posted by Bruno Machado View Post
Usually ACCESS VIOLATION means you are trying to access some information that is not available yet. If you post your UDF we can have a look and help you accordingly.
TANKS FOR REPLY
#include "udf.h"

#define MIN_IMPACT_VELO -1000.
/* Minimum particle velocity normal to wall (m/s) to allow Accretion.*/

Domain *domain; /* Get the domain pointer and assign it later to domain*/

enum /* Enumeration of used User-Defined Memory Locations. */
{
NUM_OF_HITS, /* Number of particle hits into wall face considered.*/
AVG_DIAMETER, /* Average diameter of particles that hit the wall. */
AVG_RADI_VELO, /* Average radial velocity of "" "" ------------ */
NUM_OF_USED_UDM
};

int UDM_checked = 0; /* Availability of UDMLs checked? */

void reset_UDM_s(void); /* Function to follow below. */

int check_for_UDM(void) /* Check for UDMLs' availability... */
{
Thread *t;

if (UDM_checked)
return UDM_checked;

/* if (!rp_axi)*/
/* Internal_Error("UDF-Error: only valid for 2d-axisymmetric cases!\n");*/
thread_loop_c(t,domain) /* We require all cell threads to */
{ /* provide space in memory for UDML */
if (FLUID_THREAD_P(t))
if (NULLP(THREAD_STORAGE(t,SV_UDM_I)))
return 0;
}

UDM_checked = 1; /* To make the following work properly... */
reset_UDM_s(); /* This line will be executed only once, */
return UDM_checked; /* because check_for_UDM checks for */
} /* UDM_checked first. */

void
reset_UDM_s(void)
{
Thread *t;
cell_t c;
face_t f;
int i;

if (!check_for_UDM()) /* Don't do it, if memory is not available. */
return;

Message("Resetting User Defined Memory...\n");

thread_loop_f(t, domain)
{
if (NNULLP(THREAD_STORAGE(t,SV_UDM_I)))
{
begin_f_loop(f,t)
{
for (i = 0; i < NUM_OF_USED_UDM; i++)
F_UDMI(f,t,i) = 0.;
}
end_f_loop(f, t)
}
else
{
Message("Skipping FACE thread no. %d..\n", THREAD_ID(t));
}
}
thread_loop_c(t,domain)
{
if (NNULLP(THREAD_STORAGE(t,SV_UDM_I)))
{
begin_c_loop(c,t)
{
for (i = 0; i < NUM_OF_USED_UDM; i++)
C_UDMI(c,t,i) = 0.;
}
end_c_loop(c,t)
}
else
{
Message(" Skipping CELL thread no. %d..\n", THREAD_ID(t));
}
} /* Skipping Cell Threads can happen if the user */
/* uses reset_UDM prior to initializing. */
Message(" --- Done.\n");
}

DEFINE_DPM_SCALAR_UPDATE(dpm_scalup,c,t,if_init,p)
{ if (if_init)
P_USER_REAL(p, 0) = 0; /* Simple initialization. Used later for
stopping trajectory calculation */
}

DEFINE_DPM_EROSION(dpm_accr, p, t, f, normal, alpha, Vmag, Mdot)
{
real A[ND_ND], area;
int num_in_data;
Thread *t0;
cell_t c0;

real radi_pos[2], radius, imp_vel[2], vel_ortho;

/* The following is ONLY valid for 2d-axisymmetric calculations!!! */
/* Additional effort is necessary because DPM tracking is done in */
/* THREE dimensions for TWO-dimensional axisymmetric calculations. */

radi_pos[0] = p->state.pos[1]; /* Radial location vector. */
radi_pos[1] = p->state.pos[2]; /* (Y and Z in 0 and 1...) */

radius = NV_MAG(radi_pos);
NV_VS(radi_pos, =, radi_pos, /, radius);
/* Normalized radius direction vector.*/
imp_vel[0] = P_VEL(p)[0]; /* Axial particle velocity component. */
imp_vel[1] = NVD_DOT(radi_pos, P_VEL(p)[1], P_VEL(p)[2], 0.);
/* Dot product of normalized radius vector and y & z components */
/* of particle velocity vector gives _radial_ particle velocity */
/* component */
vel_ortho = NV_DOT(imp_vel, normal); /*velocity orthogonal to wall */

if (vel_ortho < MIN_IMPACT_VELO) /* See above, MIN_IMPACT_VELO */
return;

if (!UDM_checked) /* We will need some UDMs, */
if (!check_for_UDM()) /* so check for their availability.. */
return; /* (Using int variable for speed, could */
/* even just call check_for UDFM().) */
c0 = F_C0(f,t);
t0 = THREAD_T0(t);

num_in_data = F_UDMI(f,t,NUM_OF_HITS);

/* Average diameter of particles that hit the particular wall face:*/
F_UDMI(f,t,AVG_DIAMETER) = (P_DIAM(p)
+ num_in_data * F_UDMI(f,t,AVG_DIAMETER))
/ (num_in_data + 1);
C_UDMI(c0,t0,AVG_DIAMETER) = F_UDMI(f,t,AVG_DIAMETER);

/* Average velocity normal to wall of particles hitting the wall:*/
F_UDMI(f,t,AVG_RADI_VELO) = (vel_ortho
+ num_in_data * F_UDMI(f,t,AVG_RADI_VELO))
/ (num_in_data + 1);
C_UDMI(c0,t0,AVG_RADI_VELO) = F_UDMI(f,t,AVG_RADI_VELO);

F_UDMI(f, t, NUM_OF_HITS) = num_in_data + 1;
C_UDMI(c0,t0,NUM_OF_HITS) = num_in_data + 1;

F_AREA(A,f,t);
area = NV_MAG(A);
F_STORAGE_R(f,t,SV_DPMS_ACCRETION) += Mdot / area;
/* copied from source. */

P_USER_REAL(p,0) = 1.; /* "Evaporate" */
}

DEFINE_DPM_LAW(stop_dpm_law,p,if_cpld)
{
if (0. < P_USER_REAL(p,0))
P_MASS(p) = 0.; /* "Evaporate" */
}

DEFINE_ON_DEMAND(reset_UDM)
{
/* assign domain pointer with global domain */
domain = Get_Domain(1);
reset_UDM_s();
}
ehsan105 is offline   Reply With Quote

Old   February 17, 2016, 07:08
Default
  #4
Senior Member
 
Bruno Machado
Join Date: May 2014
Posts: 271
Rep Power: 13
Bruno Machado is on a distinguished road
Quote:
Originally Posted by ehsan105 View Post
TANKS FOR REPLY
#include "udf.h"

#define MIN_IMPACT_VELO -1000.
/* Minimum particle velocity normal to wall (m/s) to allow Accretion.*/

Domain *domain; /* Get the domain pointer and assign it later to domain*/

enum /* Enumeration of used User-Defined Memory Locations. */
{
NUM_OF_HITS, /* Number of particle hits into wall face considered.*/
AVG_DIAMETER, /* Average diameter of particles that hit the wall. */
AVG_RADI_VELO, /* Average radial velocity of "" "" ------------ */
NUM_OF_USED_UDM
};

int UDM_checked = 0; /* Availability of UDMLs checked? */

void reset_UDM_s(void); /* Function to follow below. */

int check_for_UDM(void) /* Check for UDMLs' availability... */
{
Thread *t;

if (UDM_checked)
return UDM_checked;

/* if (!rp_axi)*/
/* Internal_Error("UDF-Error: only valid for 2d-axisymmetric cases!\n");*/
thread_loop_c(t,domain) /* We require all cell threads to */
{ /* provide space in memory for UDML */
if (FLUID_THREAD_P(t))
if (NULLP(THREAD_STORAGE(t,SV_UDM_I)))
return 0;
}

UDM_checked = 1; /* To make the following work properly... */
reset_UDM_s(); /* This line will be executed only once, */
return UDM_checked; /* because check_for_UDM checks for */
} /* UDM_checked first. */

void
reset_UDM_s(void)
{
Thread *t;
cell_t c;
face_t f;
int i;

if (!check_for_UDM()) /* Don't do it, if memory is not available. */
return;

Message("Resetting User Defined Memory...\n");

thread_loop_f(t, domain)
{
if (NNULLP(THREAD_STORAGE(t,SV_UDM_I)))
{
begin_f_loop(f,t)
{
for (i = 0; i < NUM_OF_USED_UDM; i++)
F_UDMI(f,t,i) = 0.;
}
end_f_loop(f, t)
}
else
{
Message("Skipping FACE thread no. %d..\n", THREAD_ID(t));
}
}
thread_loop_c(t,domain)
{
if (NNULLP(THREAD_STORAGE(t,SV_UDM_I)))
{
begin_c_loop(c,t)
{
for (i = 0; i < NUM_OF_USED_UDM; i++)
C_UDMI(c,t,i) = 0.;
}
end_c_loop(c,t)
}
else
{
Message(" Skipping CELL thread no. %d..\n", THREAD_ID(t));
}
} /* Skipping Cell Threads can happen if the user */
/* uses reset_UDM prior to initializing. */
Message(" --- Done.\n");
}

DEFINE_DPM_SCALAR_UPDATE(dpm_scalup,c,t,if_init,p)
{ if (if_init)
P_USER_REAL(p, 0) = 0; /* Simple initialization. Used later for
stopping trajectory calculation */
}

DEFINE_DPM_EROSION(dpm_accr, p, t, f, normal, alpha, Vmag, Mdot)
{
real A[ND_ND], area;
int num_in_data;
Thread *t0;
cell_t c0;

real radi_pos[2], radius, imp_vel[2], vel_ortho;

/* The following is ONLY valid for 2d-axisymmetric calculations!!! */
/* Additional effort is necessary because DPM tracking is done in */
/* THREE dimensions for TWO-dimensional axisymmetric calculations. */

radi_pos[0] = p->state.pos[1]; /* Radial location vector. */
radi_pos[1] = p->state.pos[2]; /* (Y and Z in 0 and 1...) */

radius = NV_MAG(radi_pos);
NV_VS(radi_pos, =, radi_pos, /, radius);
/* Normalized radius direction vector.*/
imp_vel[0] = P_VEL(p)[0]; /* Axial particle velocity component. */
imp_vel[1] = NVD_DOT(radi_pos, P_VEL(p)[1], P_VEL(p)[2], 0.);
/* Dot product of normalized radius vector and y & z components */
/* of particle velocity vector gives _radial_ particle velocity */
/* component */
vel_ortho = NV_DOT(imp_vel, normal); /*velocity orthogonal to wall */

if (vel_ortho < MIN_IMPACT_VELO) /* See above, MIN_IMPACT_VELO */
return;

if (!UDM_checked) /* We will need some UDMs, */
if (!check_for_UDM()) /* so check for their availability.. */
return; /* (Using int variable for speed, could */
/* even just call check_for UDFM().) */
c0 = F_C0(f,t);
t0 = THREAD_T0(t);

num_in_data = F_UDMI(f,t,NUM_OF_HITS);

/* Average diameter of particles that hit the particular wall face:*/
F_UDMI(f,t,AVG_DIAMETER) = (P_DIAM(p)
+ num_in_data * F_UDMI(f,t,AVG_DIAMETER))
/ (num_in_data + 1);
C_UDMI(c0,t0,AVG_DIAMETER) = F_UDMI(f,t,AVG_DIAMETER);

/* Average velocity normal to wall of particles hitting the wall:*/
F_UDMI(f,t,AVG_RADI_VELO) = (vel_ortho
+ num_in_data * F_UDMI(f,t,AVG_RADI_VELO))
/ (num_in_data + 1);
C_UDMI(c0,t0,AVG_RADI_VELO) = F_UDMI(f,t,AVG_RADI_VELO);

F_UDMI(f, t, NUM_OF_HITS) = num_in_data + 1;
C_UDMI(c0,t0,NUM_OF_HITS) = num_in_data + 1;

F_AREA(A,f,t);
area = NV_MAG(A);
F_STORAGE_R(f,t,SV_DPMS_ACCRETION) += Mdot / area;
/* copied from source. */

P_USER_REAL(p,0) = 1.; /* "Evaporate" */
}

DEFINE_DPM_LAW(stop_dpm_law,p,if_cpld)
{
if (0. < P_USER_REAL(p,0))
P_MASS(p) = 0.; /* "Evaporate" */
}

DEFINE_ON_DEMAND(reset_UDM)
{
/* assign domain pointer with global domain */
domain = Get_Domain(1);
reset_UDM_s();
}
In each part of the code are you getting this error? You can add a message in parts of the code to help you track the missing information.

Message("Doing XXXXX\n");
Message("Checking YYYYY\n");
Message("Reading ZZZZZZ ...\n");

When you run the code, it will print this information in the order you put it and you can check where it is stoping.
Bruno Machado is offline   Reply With Quote

Old   April 4, 2016, 17:37
Default Thank you so much
  #5
New Member
 
ehsan
Join Date: Oct 2015
Location: tehran
Posts: 26
Rep Power: 11
ehsan105 is on a distinguished road
Quote:
Originally Posted by Bruno Machado View Post
In each part of the code are you getting this error? You can add a message in parts of the code to help you track the missing information.

Message("Doing XXXXX\n");
Message("Checking YYYYY\n");
Message("Reading ZZZZZZ ...\n");

When you run the code, it will print this information in the order you put it and you can check where it is stoping.

When using of uds in particle track panel This error occurs:

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: ()
This error occurs

And I can not find a way to solve it.. plz guide me
ehsan105 is offline   Reply With Quote

Old   April 4, 2016, 18:52
Default
  #6
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
Quote:
Originally Posted by ehsan105 View Post
When using of uds in particle track panel This error occurs:

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: ()
This error occurs

And I can not find a way to solve it.. plz guide me
You need to first allocate an appropriate number of user-defined scalars for the particles in the DPM dialog box (their code uses one UDS for example).
`e` is offline   Reply With Quote

Old   April 6, 2016, 20:20
Default thank for reply
  #7
New Member
 
ehsan
Join Date: Oct 2015
Location: tehran
Posts: 26
Rep Power: 11
ehsan105 is on a distinguished road
Quote:
Originally Posted by `e` View Post
You need to first allocate an appropriate number of user-defined scalars for the particles in the DPM dialog box (their code uses one UDS for example).
I did this, This means that in scaler menu define one scalar and in memory's menu define 10 udm.
and in material's menu I made the necessary adjustments.

But faced with the same error...
plz guide me
ehsan105 is offline   Reply With Quote

Old   April 6, 2016, 20:30
Default Photos of my work
  #8
New Member
 
ehsan
Join Date: Oct 2015
Location: tehran
Posts: 26
Rep Power: 11
ehsan105 is on a distinguished road

------------------

------------------
ehsan105 is offline   Reply With Quote

Old   April 6, 2016, 21:02
Default
  #9
New Member
 
ehsan
Join Date: Oct 2015
Location: tehran
Posts: 26
Rep Power: 11
ehsan105 is on a distinguished road
After this process was error

-------------------

-------------------

-------------------
ehsan105 is offline   Reply With Quote

Old   April 15, 2016, 07:03
Default
  #10
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
Quote:
Originally Posted by ehsan105 View Post
I did this, This means that in scaler menu define one scalar and in memory's menu define 10 udm.
and in material's menu I made the necessary adjustments.

But faced with the same error...
plz guide me
From your images, you've created one user-defined scalar (what is this UDS used for?) with a boundary condition. You've also created one storage location (user variable) for the particles (DPM); this allocation is required for P_USER_REAL(p,0).

However, your user-defined function also employs three user-defined memory locations (with C_UDMI and similar macros). These locations need to be allocated via Define > User-Defined > Memory...
`e` is offline   Reply With Quote

Reply


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
receive fluent received a fatal signal (Segmentation fault). chenkaiqe FLUENT 2 March 10, 2015 09:21
FLUENT received fatal signal (ACCESS_VIOLATION) osamaghani FLUENT 2 March 31, 2012 17:15
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 14:03.