|
[Sponsors] |
July 13, 2009, 13:34 |
udf
|
#1 |
New Member
songok
Join Date: Jul 2009
Posts: 4
Rep Power: 17 |
Hello experts,
Below is a short UDF i wrote to calculate the density of supercritical CO2, however it does not run, it gives a floating point error. If firstly,I replace the C_P(c,t) with a value say 2 bars it calculates the correct density though constant throughout. Secondly, if I initialize the gauge pressure in the solve menu, it uses that value as C_P(c,t) which results to constant density in the bed... does not depict any pressure drop or change. I just wandering and wondering where the problem could be. inlet boundary condition- mass inflow and pressure outlet BC. regards mmoja #include "udf.h" #define B 1.1 #define Q 0.2 #define D 0.01 #define R 188.90 #define K 1.330 DEFINE_PROPERTY(superfluid_density, c, t) { real rho; real press; real p_operating; real temp= C_T(c,t); press = C_P(c,t); rho = D*pow(press,B)/pow(temp,Q); return rho; } DEFINE_PROPERTY(sound_speed, c, t) { real a; real temp = C_T(c,t); a = sqrt(R*K*temp); return a; |
|
July 23, 2009, 03:17 |
|
#2 |
Member
Byron Smith R J
Join Date: Mar 2009
Location: India
Posts: 46
Rep Power: 17 |
The macro for density is C_R(c,t) in mem.h try using the macro instead of the variable rho
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Dynamic Mesh UDF | Qureshi | FLUENT | 7 | March 23, 2017 08:37 |
How to add a UDF to a compiled UDF library | kim | FLUENT | 3 | October 26, 2011 22:38 |
I need UDF help. | S.Whitney | FLUENT | 0 | October 15, 2007 12:29 |
UDF...UDF...UDF...UDF | Luc SEMINEL | FLUENT | 0 | November 25, 2002 05:03 |
UDF, UDF, UDF, UDF | Luc SEMINEL | Main CFD Forum | 0 | November 25, 2002 05:01 |