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

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

Register Blogs Community New Posts Updated Threads Search

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

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*/
F_AREA(A,f,thread);

/*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 09:48.
SuperNova79 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
accessing solver data with UDF macros Dushan FLUENT 1 April 22, 2017 22:05
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 18, 2009 00:54
Compiling UDF in Fluent 12 jsm FLUENT 1 July 22, 2009 08:40
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 00:40.