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

Very urgent- FLUENT FATAL SIGNAL(Access Violation)

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 25, 2010, 01:43
Default Very urgent- FLUENT FATAL SIGNAL(Access Violation)
  #1
New Member
 
S. Mano Theja
Join Date: Sep 2010
Posts: 4
Rep Power: 15
hari10 is on a distinguished road
Hiii the following UDF gives access violation fatal error during execution in FLUENT while running in interpreted mode.

I'm trying to simulate a 2D fluidised bed and I have used this UDF to update mass fractions of two species(Oxygen and Ozone(Ozone decomposition)) ie. for the volumetric rate, in two phases according to an equation of mass balance using finite difference method. I have tried a lot and I'm running out of time. Kindly help me in this regard.

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



#include "udf.h"
#include "threads.h"
#define C_NFACES(c,t)(cell_type_nfaces[(int)(C_TYPE((c),(t)))])
real deltaT = 0.0002;
real uX = 0.01;
real uY = 0.02;
int h = 200;
real dAM = 0.00001;
real epsilon = 0.95;
real kG = 1;
real epsilonS = 0.97;
real kR = 5.4;
real dCell = 0.01;
real dP = 1;
int l = 20;

DEFINE_EXECUTE_ON_LOADING(inst_cValues, libname)
{
Thread *t;
cell_t c;
Domain *d;
Thread **pt; /* initialize pt */


thread_loop_c(t,d)
{
begin_c_loop(c,t)
{
if(Data_Valid_P())
{
pt = THREAD_SUB_THREADS(t);
C_YI(c, pt[0], 0) = 0.2097;
C_YI(c, pt[1], 0) = 0;
C_YI(c, pt[0], 1) = 0.1;
C_YI(c, pt[1], 1) = 0;
}


}
end_c_loop(c,t)
}
}

DEFINE_ADJUST(adjustRate, d)
{
Thread* t;
cell_t c, c1, c2;
Thread *newT;
face_t f;
cell_t leftCell, rightCell, aboveCell, belowCell;
int count = 0, temp1, temp2, temp3, temp4;

int n = 0;
int nz;
cell_t adjC;
real x1[ND_ND], x2[ND_ND];

Thread **pt;
Thread *ft;
int boundThread = 1;
int x_coord,y_coord, x;

d = Get_Domain(1);
thread_loop_c(t, d)
{
begin_c_loop(c, t)
{
count = 0;
C_CENTROID( x1, c, t);
x_coord = x1[0]/dCell;
y_coord = x1[1]/dCell;

c_face_loop( c, t, nz)
{
f = C_FACE(c, t, nz);
ft = C_FACE_THREAD(c,t,nz);

c1 = c;
c2 = c;
if(!(x_coord == 0 || x_coord == l-1 || y_coord == 0 || y_coord == h-1))
c1 = F_C0(f, t);
if(!(x_coord == 0 || x_coord == l-1 || y_coord == 0 || y_coord == h-1))
c2 = F_C1(f, t);


if(c1 == c)
{
C_CENTROID( x2, c2, t);
adjC = c2;
}
else
{
C_CENTROID(x2, c1, t);
adjC = c1;
}

if(x1[0] > x2[0])
{
leftCell = adjC;
count++;
}
else if(x1[0] < x2[0])
{
rightCell = adjC;
count++;
}
else if(x1[1] > x2[1])
{
belowCell = adjC;
count++;
}
else if(x1[1] < x2[1])
{
aboveCell = adjC;
count++;
}





}

if(count >= 4 && Data_Valid_P())
{
x = (int)x1[0]/dCell;
pt = THREAD_SUB_THREADS(t);



temp1 = dAM/x*( C_YI_M1(rightCell, pt[0], 0) - C_YI_M1(leftCell, pt[0], 0) )/2/h + dAM *( C_YI_M1(rightCell, pt[0], 0)-2*C_YI_M1(c, pt[0], 0)+C_YI_M1(leftCell, pt[0], 0) )/h/h + dAM*( C_YI_M1(aboveCell, pt[0], 0)-2*C_YI_M1(c, pt[0], 0)+C_YI_M1(belowCell, pt[0], 0) )/h/h + 6*(1-epsilon)/dP*kG*( C_YI_M1(c, pt[0], 0)-C_YI_M1(c, pt[1], 0) )// + (1-epsilon)*epsilonS*kR*C_YI_M1(c, t, 1)
+ C_YI_M1(c, pt[0], 0)/deltaT - uX*( C_YI_M1(rightCell, pt[0], 0)-C_YI_M1(leftCell, pt[0], 0) )/2/h - uX*C_YI_M1(c, pt[0], 0)/x - uY*( C_YI_M1(aboveCell, pt[0], 0)-C_YI_M1(belowCell, pt[0], 0) )/2/h;
temp1 *= deltaT;
if(temp1 > 0 && temp1 < 1)
C_YI(c, pt[0], 0) = temp1;
else
C_YI(c, pt[0], 0) = 0;

temp2 = 6/dP*kG*( C_YI_M1(c, pt[0], 0)-C_YI_M1(c, pt[1], 0) ) + epsilonS*kR*C_YI_M1(c, pt[1], 0) + C_YI_M1(c, pt[1], 0)/deltaT;
temp2 *= deltaT;
if(temp2 > 0 && temp2 < 1)
C_YI(c, pt[1], 0) = temp2;
else
C_YI(c, pt[1], 0) = 0;


temp3 = dAM/x*( C_YI_M1(rightCell, pt[0], 1) - C_YI_M1(leftCell, pt[0], 1) )/2/h + dAM *( C_YI_M1(rightCell, pt[0], 1)-2*C_YI_M1(c, pt[0], 1)+C_YI_M1(leftCell, pt[0], 1) )/h/h + dAM*( C_YI_M1(aboveCell, pt[0], 1)-2*C_YI_M1(c, pt[0], 1)+C_YI_M1(belowCell, pt[0], 1) )/h/h + 6*(1-epsilon)/dP*kG*( C_YI_M1(c, pt[0], 1)-C_YI_M1(c, pt[1], 1) )// + (1-epsilon)*epsilonS*kR*C_YI_M1(c, t, 1)
+ C_YI_M1(c, pt[0], 1)/deltaT - uX*( C_YI_M1(rightCell, pt[0], 1)-C_YI_M1(leftCell, pt[0], 1) )/2/h - uX*C_YI_M1(c, pt[0], 1)/x - uY*( C_YI_M1(aboveCell, pt[0], 1)-C_YI_M1(belowCell, pt[0], 1) )/2/h;
temp3 *= deltaT;
if(temp1 > 0 && temp1 < 1)
C_YI(c, pt[0], 1) = temp3;
else
C_YI(c, pt[0], 1) = 0;

temp4 = 6/dP*kG*( C_YI_M1(c, pt[0], 1)-C_YI_M1(c, pt[1], 1) ) + epsilonS*kR*C_YI_M1(c, pt[1], 1) + C_YI_M1(c, pt[1], 1)/deltaT;
temp3 *= deltaT;
if(temp1 > 0 && temp1 < 1)
C_YI(c, pt[1], 1) = temp4;
else
C_YI(c, pt[1], 1) = 0;

}

}
end_c_loop(c, t)
}
}

DEFINE_VR_RATE(user_rate, c, t, r, mole_weight, species_mf, rate, rr_t)
{
if(Data_Valid_P() )
{
Thread **pt = THREAD_SUB_THREADS(t);
*rate = kR * epsilonS * C_YI(c, pt[1], 1);

}
else
*rate = 0;
*rr_t = *rate;
}
hari10 is offline   Reply With Quote

Old   September 25, 2010, 01:46
Angry
  #2
New Member
 
S. Mano Theja
Join Date: Sep 2010
Posts: 4
Rep Power: 15
hari10 is on a distinguished road
Even if I remove all the functions and just keep the DEFINE_VR_RATE function, an error occured in 81st loop..
hari10 is offline   Reply With Quote

Old   September 26, 2010, 06:51
Post
  #3
New Member
 
S. Mano Theja
Join Date: Sep 2010
Posts: 4
Rep Power: 15
hari10 is on a distinguished road
please reply asap...
I know today is Sunday but tomorrow is my submission date..!!!
hari10 is offline   Reply With Quote

Reply

Tags
access violation error, rate of reaction, udf error


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
FLUENT received fatal signal (ACCESS_VIOLATION) CHAKER FLUENT 4 December 11, 2015 03:20
Urgent Help Needed!!! (regarding FLUENT UDF) dsen FLUENT 2 May 28, 2010 13:36
Master node in parallel computing only distirubtion syadgar FLUENT 1 September 8, 2009 16:41
On Bug of Fluent 12.0 lzgwhy FLUENT 0 August 26, 2009 06:41
Urgent help needed- FLUENT to ANSYS Omer Main CFD Forum 3 September 18, 2006 10:24


All times are GMT -4. The time now is 18:56.