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

Is this UDF correct?

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 4, 2001, 04:36
Default Is this UDF correct?
  #1
JJ
Guest
 
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;

else

density = 968;

return density; }

Regards, JJ

  Reply With Quote

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

Old   April 6, 2001, 08:08
Default Re: Is this UDF correct?
  #3
JJ
Guest
 
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.

JJ
  Reply With Quote

Old   April 8, 2001, 19:54
Default Re: Is this UDF correct?
  #4
Greg Perkins
Guest
 
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.

Greg
  Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
UDF and text commands David FLUENT 3 June 27, 2022 00:10
UDF to record FLUENT Solver variables... mariachi Fluent UDF and Scheme Programming 11 September 24, 2019 01:07
how can I correct the udf? happyrabbit FLUENT 9 January 28, 2011 10:50
UDF to record FLUENT solver variables... mariachi FLUENT 1 February 3, 2010 23:18
UDF...UDF...UDF...UDF Luc SEMINEL FLUENT 0 November 25, 2002 05:03


All times are GMT -4. The time now is 14:56.