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

Using UDF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 15, 2005, 21:15
Default Using UDF
  #1
Vidya Raja
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
  Reply With Quote

Old   November 17, 2005, 03:12
Default Re: Using UDF
  #2
RoM
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
  Reply With Quote

Old   November 17, 2005, 09:55
Default Re: Using UDF
  #3
Vidya Raja
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

  Reply With Quote

Old   November 17, 2005, 10:35
Default Re: Using UDF
  #4
RoM
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
  Reply With Quote

Old   November 17, 2005, 12:56
Default Re: Using UDF
  #5
Vidya Raja
Guest
 
Posts: n/a
Thanks RoM.......... it worked. Thanks a lot, once again.

Vidya
  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
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


All times are GMT -4. The time now is 11:07.