Register Blogs Members List Search Today's Posts Mark Forums Read

 August 12, 2010, 04:57 Fluent received fatal signal (ACCESS_VIOLATION) #1 New Member   Sravan Join Date: Aug 2010 Posts: 5 Rep Power: 8 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

 August 12, 2010, 06:07 #2 Senior Member   Max Join Date: Mar 2009 Posts: 133 Rep Power: 9 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

 August 12, 2010, 09:58 #3 New Member   Sravan Join Date: Aug 2010 Posts: 5 Rep Power: 8 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.

 August 13, 2010, 04:22 #4 Senior Member   Max Join Date: Mar 2009 Posts: 133 Rep Power: 9 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

 August 17, 2010, 03:04 #5 New Member   Sravan Join Date: Aug 2010 Posts: 5 Rep Power: 8 Thanks coglione for your help.

May 10, 2011, 23:37
#6
New Member

Join Date: May 2011
Posts: 18
Rep Power: 7
Quote:
 Originally Posted by coglione 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 :

{
{
begin_f_loop(f,t)
{
F_UDMI(f,t,1) = 10000;

}
}
}

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?

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post CHAKER FLUENT 4 December 11, 2015 04:20 lzgwhy FLUENT 0 August 26, 2009 06:41 Lourival FLUENT 3 January 16, 2008 17:48 manu FLUENT 0 December 10, 2007 07:10 samy FLUENT 0 November 10, 2007 14:09

All times are GMT -4. The time now is 17:49.