Convergence problems - UDF
Hello everyone,
I am trying to implement a real-gas model for a CO2 ejector. My properties are interpolated from lookup tables, and this is working well for thermal conductivity, specific heat and viscosity. As for density, the simulation converges when I use an ideal-gas model; however, when I switch to my UDF, the simulation does not converge. Even if I write a UDF for density that replicates the ideal gas model, I have problems. I would appreciate any help. Thank you. |
well, if you have problems with UDF, you should show it, at least
show the error log as well, show compilation log |
Yes, of course.
Here it is: #include "udf.h" #include "mem.h" #include "external.h" DEFINE_PROPERTY(property_density,c,t) { float density; density = C_P(c,t)/(69.29*C_T(c,t)); return density; } The molecular weight of my fluid is 120 kg/kmol. When I use this UDF, I get negative pressure values. |
C_P is gauge pressure, you have to add the reference pressure.
|
Thank you for your reply.
I have set my operating pressure at 0. Also, I get no compilation or loading errors! All the other UDFs work. |
If you initialize it at e.g. 5 Pa, 300 K, don't iterate, and plot density, does it make sense?
(I don't know what is causing your problem, but this might give some information to help solve the problem.) |
Yes it does! Which adds to my confusion...
|
All times are GMT -4. The time now is 05:22. |