CFD Online Logo CFD Online URL
Home > Forums > FLUENT

help for a simple UDF

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

LinkBack Thread Tools Display Modes
Old   April 14, 2008, 07:21
Default help for a simple UDF
Posts: n/a
Hi I am writting my first UDF but I did programming a long time ago..

So as to set a non constant pressure boundary, I wrote:

#include "udf.h"

DEFINE_PROFILE(pressure_profile, t, i)

{ face_t f; real to; to=1.3e-3; real po; po=10.5e6;

i= po*(1-time/to)*exp(time/to); }

After I will have to compile this .txt file in Fluent thanks to Compiled UDF buld. Am I right?

Thank you for your help.

  Reply With Quote

Old   April 14, 2008, 10:17
Default Re: help for a simple UDF
Posts: n/a

firstly, You wonīt succeed if you compile *.txt. It must be *.c Then you can proceed compiling, but your UDF isnīt complete anyway! Check it out!

  Reply With Quote

Old   April 14, 2008, 10:53
Default Re: help for a simple UDF
Posts: n/a
Try considering including the following lines in your code:

-------------------------------------------- real time = RP_Get_Real("flow-time");

begin_f_loop(f,t) {

F_PROFILE(f,t,i)=po*(1-time/to)*exp(time/to); } end_f_loop(f,t) -------------------------------------------- save your file with a .c extension and put it in your workind directory. now you can compile and build the UDF. Maybe you need a pressure inlet to hook this UDF properly. When selecting the gauge total pressure, use the drop down menu to select the profile you compiled previously.

See the UDF manual for details on hooking the UDF to the solver.


  Reply With Quote


Thread Tools
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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
About Phase Coupled SIMPLE (PC-SIMPLE) algorithm Yan Kai Main CFD Forum 0 April 18, 2007 03:48
About Phase Coupled SIMPLE (PC-SIMPLE) algorithm Yan Kai FLUENT 0 April 13, 2007 23:17
simple vof yang Main CFD Forum 0 November 18, 2005 09:19
Can i get help for SIMPLE Ramu Main CFD Forum 5 September 21, 2003 18:37
C++ & SIMPLE saba Main CFD Forum 3 December 3, 2002 23:43

All times are GMT -4. The time now is 09:06.