|
[Sponsors] |
November 15, 2005, 21:15 |
Using UDF
|
#1 |
Guest
Posts: n/a
|
Hi,
I have an equation for unstaedy velocity. It is as follows: Q = 0.35 + 0.35* sin(2*pi*0.5*t) I wrote the following code in C to hook it to fluent: unsteady.c UDF for specifying a transient velocity profile boundary condition ************************************************** ************************************************** ******/ #include "udf.h" DEFINE_PROFILE(unsteady_velocity, thread, position) { face_t f; real t = CURRENT_TIME; begin_f_loop(f, thread) { F_PROFILE(f, thread, position) = 0.35 + 0.35* sin(2.*pi*0.5*t); } end_f_loop(f, thread) } But when I hook it to fluent, it displays an error that says parse error. What does this mean? Is there something wrong in my C code? How do I hook it to fluent? Any help/ suggestions are highly appreciated. Thanks, Vidya |
|
November 17, 2005, 03:12 |
Re: Using UDF
|
#2 |
Guest
Posts: n/a
|
Dont interpret your udf from a directory which name has spaces like in "c:\my documents". This will give a line 1: parse error. Use M_PI instead of pi. Hook your udf in the bc panel for the velocity inlet.
Hope it helps, RoM |
|
November 17, 2005, 09:55 |
Re: Using UDF
|
#3 |
Guest
Posts: n/a
|
Hi, Thanks for the help, but can I make the Desktop my working directory and then store the C file, and the case and data files on the desktop and work from there? If not, could you please tell me step- by- step how to do i
I use the compute in my lab and so temp files are deleted every day. Sorry for bothering you. Thanks, Vidya |
|
November 17, 2005, 10:35 |
Re: Using UDF
|
#4 |
Guest
Posts: n/a
|
I have not found a way to work around this "no spaces in directory names allowed" feature (someone could call it a bug). You will have to interpret your udf from a directory with no spaces in name. Once the udf is interpreted, hooked and the case is running it doesnt matter if the file is deleted. Fluent will continue running and as long as you have a backup of your source file you should be fine.
RoM |
|
November 17, 2005, 12:56 |
Re: Using UDF
|
#5 |
Guest
Posts: n/a
|
Thanks RoM.......... it worked. Thanks a lot, once again.
Vidya |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Dynamic Mesh UDF | Qureshi | FLUENT | 7 | March 23, 2017 07:37 |
UDF parallel error: chip-exec: function not found????? | shankara.2 | Fluent UDF and Scheme Programming | 1 | January 16, 2012 22:14 |
How to add a UDF to a compiled UDF library | kim | FLUENT | 3 | October 26, 2011 21:38 |
UDF...UDF...UDF...UDF | Luc SEMINEL | FLUENT | 0 | November 25, 2002 04:03 |
UDF, UDF, UDF, UDF | Luc SEMINEL | Main CFD Forum | 0 | November 25, 2002 04:01 |