CFD Online Logo CFD Online URL
Home > Forums > FLUENT

Is this UDF correct?

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

LinkBack Thread Tools Display Modes
Old   April 4, 2001, 03:36
Default Is this UDF correct?
Posts: n/a
Hi all,

I am a novice in C programming, I wrote the following in an attempt to generate a two layer flow in my domain. But when I try to compile it, fluent keeps giving me error msg. Not sure what is wrong. Can anybody help? Thanx.

#include "udf.h"

DEFINE_PROPERTY(cell_density, cell, threads) {

real density;

real grid_y = NODE_Y(c,t);

if (grid_y<0.81)

density = 998;


density = 968;

return density; }

Regards, JJ

  Reply With Quote

Old   April 4, 2001, 04:27
Default Re: Is this UDF correct?
Greg Perkins
Posts: n/a
try grid_y = NODE_Y(cell,threads);
  Reply With Quote

Old   April 6, 2001, 07:08
Default Re: Is this UDF correct?
Posts: n/a
Hi Greg,

Thanx for your help, tried it and I was able to compile it. But I am still stuck cos when I try to initialize the flow, I obtain the following error msg "2ldensity.cpp:6: macro `NODE_Y' used with too many (2) args"

2ldensity is the name of the UDF. May I know what can be done?

Thanx in advance.

  Reply With Quote

Old   April 8, 2001, 18:54
Default Re: Is this UDF correct?
Greg Perkins
Posts: n/a
Actually you'd be better to use C_CENTROID to determine the location of the cell centroid. Check this out in the udf manual.

  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
how can I correct the udf? happyrabbit FLUENT 9 January 28, 2011 10:50
UDF to record FLUENT Solver variables... mariachi Fluent UDF and Scheme Programming 9 February 19, 2010 13:25
UDF to record FLUENT solver variables... mariachi FLUENT 1 February 3, 2010 23:18
UDF and text commands David FLUENT 1 March 24, 2005 13:19
UDF...UDF...UDF...UDF Luc SEMINEL FLUENT 0 November 25, 2002 05:03

All times are GMT -4. The time now is 04:46.