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

UDF for Density variation

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 11, 2006, 17:35
Default UDF for Density variation
  #1
Naresh
Guest
 
Posts: n/a
Dear Forum users,

I am facing a problem with an UDF that I have written. Basically I am trying to change the density based on the length. The model is a multiphase model(2 phase Eulerian), and is a vertical column of 30m height with a pressure outlet at the top. The code is as follows:

#include "udf.h" #include "metric.h"

FILE *fp;

DEFINE_PROPERTY(rho,c1,t1) { float density,rho=C_R(c1,t1); float temperature=1523.01; float x[ND_ND];

C_CENTROID(x,c1,t1);

if (x[1]<=4.64)

{temperature=1773+246.9136*(x[1]-1.4);

if (temperature<=2573 || temperature>=1773)

density = rho*1523.01/temperature;

} else if (x[1]>4.64 && x[1]<=35.64)

{temperature=2573-83.83648*(x[1]-4.64);

if (temperature<=2573 || temperature>=393)

density = rho*1523.01/temperature;

} else density=0.7;

return density; }

The problem is, when I try to use this UDF it diverges and eventually gives a floating point error(invalid number). All help in fixing this will be appreciated.

-Naresh
  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 temperature variation Alex E-H FLUENT 3 February 19, 2017 14:55
UDF parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 22:14
UDF temperature variation Alex E-H FLUENT 2 November 5, 2008 09:18
UDF for C_VOF variation with time and space Frederik FLUENT 4 December 19, 2005 00:53


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