|
[Sponsors] |
September 11, 2006, 13:45 |
Help with UDF
|
#1 |
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 |
|
September 11, 2006, 15:19 |
Re: Help with UDF
|
#2 |
Guest
Posts: n/a
|
Did you remember to set the the user defined memory?
Mark |
|
September 11, 2006, 16:49 |
Re: Help with UDF
|
#3 |
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?
|
|
September 12, 2006, 03:54 |
Re: Help with UDF
|
#4 |
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 |
|
September 14, 2006, 08:50 |
Re: Help with UDF
|
#5 |
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
|
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
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 |