|
[Sponsors] |
February 13, 2008, 17:11 |
Error using UDF to modify density
|
#1 |
Guest
Posts: n/a
|
Hello,
I am trying to specify an equation of state (instead of ideal gas law). I am using DEFINE_PROPERTY for this. As a first step I have written an UDF where I calculate the density of gas using ideal gas law and activate for density in the properties of air and also turned on the energy equation. The simulation diverges. Not sure why since the UDF as shown below is fairly straightforward. Works fine if I make rhoa=constant. Can someone suggest any corrections. Thanks in advance. #include "udf.h" #define rg 287.03 DEFINE_PROPERTY(liquid, c, t) { real rhoa, p_operating, pres, temp; p_operating = RP_Get_Real ("operating-pressure"); pres = C_P(c,t) + p_operating; temp=C_T(c,t); rhoa=pres/(rg*temp); return rhoa; } |
|
July 13, 2011, 08:35 |
|
#2 |
New Member
Navid Sharifi
Join Date: Oct 2010
Location: Iran, Tehran
Posts: 10
Rep Power: 16 |
Hello
I've encountered a problem like you. when i simplify the problem and use an inviscid compressible flow with the same UDF define property macro, the other bugs are observed. 1) the cell center contour of T-static and T-total are the same !!! 2) the net mass flow rate is changed. 3) the maximum velocity is increased. so i believe that we should introduce a static temperatue and static pressure calculation macros to the solver.but how can we do it and how does it hooked? if you have an idea please note it. may be it useful for us. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
how to set periodic boundary conditions | Ganesh | FLUENT | 15 | November 18, 2020 07:09 |
UDF: Density Cell Gradient Vector Macros | matteo | FLUENT | 0 | December 1, 2007 13:14 |
UDF to change density in species transport | Karthik | FLUENT | 6 | December 8, 2004 19:19 |
Density Gradient- UDF | Michal | FLUENT | 2 | May 23, 2002 07:45 |
UDF : derivate of density | D.Stratmann | FLUENT | 2 | February 2, 2001 04:02 |