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

Fluent received fatal signal (ACCESS_VIOLATION)

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 12, 2010, 05:57
Default Fluent received fatal signal (ACCESS_VIOLATION)
  #1
New Member
 
Sravan
Join Date: Aug 2010
Posts: 5
Rep Power: 16
sravan451 is on a distinguished road
Hi All,

I wrote a UDF for calculating erosion in a pipe. UDF is compiling sucessfully, but after running for some (around) iterations it is giving Access_violation error. Here is my UDF:

#include "udf.h"

#include "stdio.h"

#include "mem.h"

#define con 1

#define e 0.9988 /* Volume Fraction of Fluid */

#define rho 1650 /* Density of solids in kg/m3*/

#define d 0.127 /* Diameter of Pipe in m */

#define H 3.434e+8 /* Material Hardness in kg/m-sec2*/

#define vol 0.1102 /* Volume of the fluid in m3 */



DEFINE_DPM_EROSION(dpm_erosion, p, t, f, normal, alpha, Vmag, Mdot)
{

real a,U,res;
cell_t c ;

// c = F_C(f,t);

real imp_vel[3];

imp_vel[0] = P_VEL(p)[0];
imp_vel[1] = P_VEL(p)[1];
imp_vel[2] = P_VEL(p)[2];

a = 3.14*d*d/4;

res = (NVD_DOT(imp_vel,C_DUDX(f,t),C_DUDY(f,t),C_DUDZ(f, t)));

F_STORAGE_R(f,t,SV_DPMS_EROSION) = (-con*(1-e)*rho*vol*res)/(a*H);

}

Can somebody please help me?



Thanks
Sravan
sravan451 is offline   Reply With Quote

Old   August 12, 2010, 07:07
Default
  #2
Senior Member
 
Max
Join Date: Mar 2009
Posts: 133
Rep Power: 17
coglione is on a distinguished road
C_DUDX returns the respective velocity-gradient in a cell. That won't work if you give this macro a face-id f and a face-thread t as arguments.
Get the cell c and cell-thread ct of the adjacent cell to your wall faces and C_DUDX(c,ct) should work.
cheers
coglione is offline   Reply With Quote

Old   August 12, 2010, 10:58
Default
  #3
New Member
 
Sravan
Join Date: Aug 2010
Posts: 5
Rep Power: 16
sravan451 is on a distinguished road
Thanks so much Coglione for your reply. I tried with the following and got the same error.


#include "udf.h"

#include "stdio.h"

#include "mem.h"

#define con 1

#define e 0.9988 /* Volume Fraction of Fluid */

#define rho 1650 /* Density of solids in kg/m3*/

#define d 0.127 /* Diameter of Pipe in m */

#define H 3.434e+8 /* Material Hardness in kg/m-sec2*/

#define vol 0.1102 /* Volume of the fluid in m3 */



DEFINE_DPM_EROSION(dpm_erosion, p, t, f, normal, alpha, Vmag, Mdot)
{

real a,U,res;
cell_t c ;

// c = F_C(f,t);

real imp_vel[3];

imp_vel[0] = P_VEL(p)[0];
imp_vel[1] = P_VEL(p)[1];
imp_vel[2] = P_VEL(p)[2];

a = 3.14*d*d/4;

res = (NVD_DOT(imp_vel,C_DUDX(c,t),C_DUDY(c,t),C_DUDZ(c, t)));

F_STORAGE_R(f,t,SV_DPMS_EROSION) = (-con*(1-e)*rho*vol*res)/(a*H);

}

Could you please suggest me?

Thanks
Sravan.
sravan451 is offline   Reply With Quote

Old   August 13, 2010, 05:22
Default
  #4
Senior Member
 
Max
Join Date: Mar 2009
Posts: 133
Rep Power: 17
coglione is on a distinguished road
Your code still does not tell Fluent for which cell (and cell thread) velocity gradients are to be evaluated.
Use
c0 = F_C0(f,t);
t0 = THREAD_T0(t);
to get them.

cheers
coglione is offline   Reply With Quote

Old   August 17, 2010, 04:04
Default
  #5
New Member
 
Sravan
Join Date: Aug 2010
Posts: 5
Rep Power: 16
sravan451 is on a distinguished road
Thanks coglione for your help.
sravan451 is offline   Reply With Quote

Old   May 11, 2011, 00:37
Default
  #6
New Member
 
Join Date: May 2011
Posts: 18
Rep Power: 15
ximik is on a distinguished road
Quote:
Originally Posted by coglione View Post
Your code still does not tell Fluent for which cell (and cell thread) velocity gradients are to be evaluated.
Use
c0 = F_C0(f,t);
t0 = THREAD_T0(t);
to get them.

cheers

coglione, I was wondering if you could help me with the F_C0 and THREAD_T0(t) functions. Essentially, I have :

thread_loop_f(t,d)
{
if (t == Lookup_Thread(d, ID))
{
begin_f_loop(f,t)
{
F_UDMI(f,t,1) = 10000;

C_UDMI(F_C0(f,t),THREAD_T0(t),1) = F_UDMI(f,t,1);

}
}
}

in a DEFINE_EXECUTE_AT_END(calc_ID) macro. Everything interprets fine, but when i test this in my energy source:

DEFINE_SOURCE(energy_source,c,t,dS,eqn)
{
real source;

source = C_UDMI(c,t,1);

return source;
}

the UDMI(1) is a 0 when I check it via running a few iterations.

Any suggestions?
ximik 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
FLUENT received fatal signal (ACCESS_VIOLATION) CHAKER FLUENT 4 December 11, 2015 04:20
On Bug of Fluent 12.0 lzgwhy FLUENT 0 August 26, 2009 07:41
Problems in lauching FLUENT Lourival FLUENT 3 January 16, 2008 17:48
fatal signal (ACCESS_VIOLATION) manu FLUENT 0 December 10, 2007 07:10
FLUENT received fatal signal (ACCESS_VIOLATION) samy FLUENT 0 November 10, 2007 14:09


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