# UDF for Density variation

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

 LinkBack Thread Tools Search this Thread Display Modes
 February 11, 2006, 17:35 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

 Thread Tools Search this Thread Search this Thread: Advanced Search Display Modes Linear Mode

 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 OffTrackbacks are Off Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Qureshi FLUENT 7 March 23, 2017 07:37 Alex E-H FLUENT 3 February 19, 2017 14:55 shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 22:14 Alex E-H FLUENT 2 November 5, 2008 09:18 Frederik FLUENT 4 December 19, 2005 00:53

All times are GMT -4. The time now is 16:44.

 Contact Us - CFD Online - Privacy Statement - Top