|
[Sponsors] |
February 11, 2006, 18:35 |
UDF for Density variation
|
#1 |
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 |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Dynamic Mesh UDF | Qureshi | FLUENT | 7 | March 23, 2017 08:37 |
UDF temperature variation | Alex E-H | FLUENT | 3 | February 19, 2017 15:55 |
UDF parallel error: chip-exec: function not found????? | shankara.2 | Fluent UDF and Scheme Programming | 1 | January 16, 2012 23:14 |
UDF temperature variation | Alex E-H | FLUENT | 2 | November 5, 2008 10:18 |
UDF for C_VOF variation with time and space | Frederik | FLUENT | 4 | December 19, 2005 01:53 |