CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   density change with pressure (https://www.cfd-online.com/Forums/fluent/159824-density-change-pressure.html)

chem engineer September 24, 2015 03:09

density change with pressure
 
Hi everyone
I modeled a gas flow in a pipeline.because of the lack of availability of proper boundary condition in outlet I should use outflow boundary condition in outlet, so i have to use incompressible model and in fact the flow is incompressible.so I can't use ideal gas model and choose floating choice in operating condition.but because of the high pressure change in the pipeline I should verify density change with pressure.all of fluent models for changing density in material tab is are functions of temperature.so I wrote a udf for density changing with pressure and i interpreted it and there was no problem.but when I run the program, it stops in first iteration and shows the following error:

Error: Floating point error: invalid number
Error object: #f

and this is my udf:

#include "udf.h"

DEFINE_PROPERTY(cell_density, cell, thread)
{
real ro;
real press = C_P(cell, thread);

ro=1.8495e-6*press;
return ro;
}

the inlet pressure is 1723689 pa.

I will be really thankful if anyone could help me with this problem

Bruno Machado September 24, 2015 05:51

just to be sure this is not the problem, can you try to compile it? sometimes, interpreted UDFs does not work properly.

chem engineer September 24, 2015 13:01

Quote:

Originally Posted by Bruno Machado (Post 565400)
just to be sure this is not the problem, can you try to compile it? sometimes, interpreted UDFs does not work properly.

I compiled the udf and tried to run the program but again there was the same error.

chem engineer September 26, 2015 10:57

is there any other idea or anyone else who could help me with this problem??


All times are GMT -4. The time now is 13:35.