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

Help with UDF

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 11, 2006, 13:45
Default Help with UDF
  #1
Blas
Guest
 
Posts: n/a
Hi, can anybody help me out with this simple UDF. It compiles and loads fine but I keep getting the ACCESS VIOLATION error when iteration starts.

The UDF is as follows:

#include "udf.h" DEFINE_ADJUST(temp_cell, d) {

Thread *t;

cell_t c;

thread_loop_c(t,d)

{

begin_c_loop(c,t)

{

C_UDMI(c,t,0) = C_T(c,t);

printf("temp pared [C] = %f\n", C_UDMI(c,t,0));

}

end_c_loop(c,t)

} }

Thanks
  Reply With Quote

Old   September 11, 2006, 15:19
Default Re: Help with UDF
  #2
MarkRussell
Guest
 
Posts: n/a
Did you remember to set the the user defined memory?

Mark
  Reply With Quote

Old   September 11, 2006, 16:49
Default Re: Help with UDF
  #3
Blas
Guest
 
Posts: n/a
Mark, thanks for your help. I have now set the memory locations to 100 (I don't know whether this is too many locations or not)and apparently is the UDF is working (at least the access violation is gone) The thing is this UDF should print the cells' temperatures to the console window but nothing happens. Any idea of what may be going on?
  Reply With Quote

Old   September 12, 2006, 03:54
Default Re: Help with UDF
  #4
MarkRussell
Guest
 
Posts: n/a
Blas,

1. in your code you have

C_UDMI ...

this is the User Defined Memory, and since you only have one (referred to by the last entry in the array of C_UDMI, i.e. 0), recall C and C++ arrays start at zero, set the number to 1, not 100.

2. Try 'Message' instead of printf.

This should work

i.e. Message("hello world");

Mark

  Reply With Quote

Old   September 14, 2006, 08:50
Default Re: Help with UDF
  #5
Blas
Guest
 
Posts: n/a
Hi Mark I have been out for a couple of days. Today I came back and used Message instead of printf and the UDF worked fine!!. Thanks a lot again. Regards Blas
  Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic Mesh UDF Qureshi FLUENT 7 March 23, 2017 08:37
UDF parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 23:14
How to add a UDF to a compiled UDF library kim FLUENT 3 October 26, 2011 22:38
UDF...UDF...UDF...UDF Luc SEMINEL FLUENT 0 November 25, 2002 05:03
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 05:01


All times are GMT -4. The time now is 16:22.