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

On the Sample UDF in Fluent

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

Reply
 
LinkBack Thread Tools Display Modes
Old   February 22, 2001, 11:57
Default On the Sample UDF in Fluent
  #1
R.D.Prabhu
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

  Reply With Quote

Old   February 22, 2001, 22:20
Default Re: On the Sample UDF in Fluent
  #2
Greg Perkins
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
  Reply With Quote

Old   February 23, 2001, 12:42
Default Re: On the Sample UDF in Fluent
  #3
R.D.Prabhu
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
  Reply With Quote

Old   February 23, 2001, 20:56
Default Re: On the Sample UDF in Fluent
  #4
Greg Perkins
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
  Reply With Quote

Reply

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
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 07:19
fluent UDF external library lapack problem Rick FLUENT 0 May 7, 2008 10: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 11:49


All times are GMT -4. The time now is 12:38.