CFD Online Logo CFD Online URL
Home > Forums > FLUENT

Access_violation Errors when using the macros C_T_G(c,t) in FLUENT UDF

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

LinkBack Thread Tools Display Modes
Old   August 1, 2011, 13:52
Default Access_violation Errors when using the macros C_T_G(c,t) in FLUENT UDF
New Member
Join Date: Aug 2011
Posts: 2
Rep Power: 0
SuperNova79 is on a distinguished road

I am using FLUENT 6.3.26 on a Windows 64 bit machine with XP installed. I am writing UDF source files in Visual Studio 2008 on the same computer.

If I use the following code without line [*] (i.e. just set grad_f = 0.0 or something), then the code will generally initialise and iterate fine. (Using interpreted UDFs for now).

#include "udf.h"
#include "mem.h"

#define K_MEMB 0.6
#define K_F 0.0242
#define T_o 310.66
#define DELTA_MEMB 0.001

DEFINE_PROFILE(heat_flux, thread, position)
face_t f;
cell_t c;

/*Local variables*/
real T_s, grad_f, q_f, q_memb, q_use;
real NV_VEC(A);

begin_f_loop(f, thread)
/*Find the relavant cell to current face*/
c = F_C0(f,thread);

/*Find the face temperature*/
T_s = F_T(f,thread);

/*Find the face area vector*/

/*Find the temperature gradient in the face normal direction*/
[*] grad_f = (C_T_G(c,thread)[0])*A[0] + (C_T_G(c,thread)[1])*A[1] + (C_T_G(c,thread)[2])*A[2];

/*Find the heat flux*/
q_f = -K_F*grad_f;

/*Apply this value to the boundary*/
F_PROFILE(f, thread, position) = q_f;
end_f_loop(f, thread)


When the problem is either initialised or iterations are begun (it differs from time to time), the following error pops up:

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

And just cannot get it to work. It will work provided there is no mention of C_T_G(c,t). (it works with A[0], A[1] and A[2]). I have tried typing solve/set/expert into the command window and selecting yes to "keep tempory memory from being freed?", to no avail.

Any help would be very appreciated!

Last edited by SuperNova79; August 4, 2011 at 08:48.
SuperNova79 is offline   Reply With Quote


Thread Tools
Display Modes

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Fluent UDF Discontinuous Motion lequi7 Fluent UDF and Scheme Programming 2 November 4, 2011 00:18
UDF in Fluent subha_meter Main CFD Forum 0 October 17, 2009 23:54
Compiling UDF in Fluent 12 jsm FLUENT 1 July 22, 2009 07:40
accessing solver data with UDF macros Dushan FLUENT 0 October 4, 2006 01:39
UDF of Zimont model in fluent Z Main CFD Forum 0 February 17, 2005 04:07

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