|
[Sponsors] |
February 22, 2001, 11:57 |
On the Sample UDF in Fluent
|
#1 |
Guest
Posts: n/a
|
Hi I was going through the Fluent supplied 'inlet.c' file to try modifying it for my use.
I reproduce the file below. ================== #include "udf.h" DEFINE_PROFILE(inlet_uv_parabolic, thread, np) { face_t f; real x[ND_ND]; begin_f_loop (f,thread) { F_CENTROID(x,f,thread); F_PROFILE(f,thread,np) = -2.1 + 157.5*x[1] - 2625.*x[1]*x[1]; } end_f_loop (f,thread) } ================================== My question is how does the code know what 'ND_ND' (in x[ND_ND]) is ? ( Is it a global parameter ?) Or is it something which is already defined in the header file 'udf.h' ? Thanks Prabhu |
|
February 22, 2001, 22:20 |
Re: On the Sample UDF in Fluent
|
#2 |
Guest
Posts: n/a
|
I think its defined in a header file and depends on whether you have compiled in 2d or 3d - since it represents the number of dimensions. In 3D you have x[0], x[1] and x[2] in 2d only the first two.
Greg |
|
February 23, 2001, 12:42 |
Re: On the Sample UDF in Fluent
|
#3 |
Guest
Posts: n/a
|
Thanks Greg,
Probably the moment we start 'fluent 2d/3d' this variable gets fixed ..somewhere.. I have one more query. I was trying to use two UDFS at two boundary faces in my problem ..say inlet1.c at face 1 and inlet2.c on face 2. I used define/UDFs/interpreted ..each time. I defined the boundary conditions immediately after each UDF that I read and compiled (interpreted). I found fluent keeps the last UDF that was compiled. Each time I iterate I find the 'first' UDF missing.. The solver says...'function velocity_inlet_w' not found! ( I mean.. the name of the function which I used in the first UDF that I read into fluent.) How do we supply more than One UDFs to Fluent then ? Thanks Prabhu |
|
February 23, 2001, 20:56 |
Re: On the Sample UDF in Fluent
|
#4 |
Guest
Posts: n/a
|
In your .c file just put the functions sequentially in the file. Ie all your udfs can be in the one file.
In fact you can spread them across multiple files for the compiled ones if you like. Greg |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
solving a conduction problem in FLUENT using UDF | Avin2407 | Fluent UDF and Scheme Programming | 1 | March 13, 2015 03:02 |
Please, Help with linking UDF precompiled outside fluent to fluent!!! | gracerlima | Fluent UDF and Scheme Programming | 1 | May 4, 2010 08:19 |
fluent UDF external library lapack problem | Rick | FLUENT | 0 | May 7, 2008 11:16 |
developing FLUENT UDF programs by VC++ 6.0 IDE | huang peng | FLUENT | 2 | February 25, 2007 15:58 |
Fluent 6.1/6.2 UDF compatability | Allan Walsh | FLUENT | 1 | April 29, 2005 12:49 |