CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   UDF file for defining density as fn of pressure (https://www.cfd-online.com/Forums/fluent/32279-udf-file-defining-density-fn-pressure.html)

anton October 7, 2003 07:30

UDF file for defining density as fn of pressure
 
Hi all

Does anyone have a UDF where I can define the density as a function of pressure. I need to make water compressible

Thanks

mateus October 7, 2003 08:04

Re: UDF file for defining density as fn of pressur
 
Hi!

It should look pretty much the same as the UDF that relates density to temerature (look in UDF manual - examples/tutorial). But I'm not shure if fluent allows this kind of relation. I've tried to do this for cavitation simulation but it did't work. Maybe you'll have better luck since you probabilly don't have so significant changes in density...

regards

MATEUS

Philipp Beierer October 8, 2003 02:35

Re: UDF file for defining density as fn of pressur
 
I guess it could look something like:

DEFINE_PROPERTY(cell_density,cell,thread)

{

real density;

real pressure = C_P(cell,thread);

if( pressure > 1E-08 ) // to ensure that you have only positive pressure values

density = "your function";

else

density = "your lowest value (of course, previous function should be continuous)";

return density;

}

Philipp

mateus October 10, 2003 10:09

Re: UDF file for defining density as fn of pressur
 
Hi!

I found this sentance in Fluent documentation... "density (as a function of temperature only)", but i'm not totally convinsed that it's impossible...

REGARDS

mateus


Alexandre October 13, 2003 03:14

Re: UDF file for defining density as fn of pressur
 
Hi,

I had the same problem.

The Fluent support team said : "it cannot be done".

Unfortunately the density cannot be given as a function of pressure.

regards

Alexandre

Philipp Beierer October 16, 2003 03:18

Re: UDF file for defining density as fn of pressur
 
...never say never. Have you tried yourself or did you just ask the "support team"?

I agree that you face some problems when you have large density variations in situ. However, if these are relatively minor, it should work. I'm saying this as I was actually able to successfully model a liquid with a desity variation of about 5%.

Regards Philipp

Alexandre October 16, 2003 03:22

Re: UDF file for defining density as fn of pressur
 
you're right ...

... but I tried to add a covolume term to the ideal gas law and it failed.

I must agree that my case was totally different from yours. After this failure I asked the support.

raluca October 16, 2003 04:04

Re: UDF file for defining density as fn of pressur
 
Hi, once I tried to define the density as un udf and I assure you that it doesn't work. More than this I asked Fluent support from France and they know that it is impossible. Try to write your density as an udf and to rewrite your equation as an udf. Good luck.

anton November 11, 2003 09:59

Re: UDF file for defining density as fn of pressur
 
Hi Philipp

This sounds like exactly what I want to do (compress water with a 5% density variation)

How did you do this....did you add your own udf?

Thanks in advance


All times are GMT -4. The time now is 02:44.