CFD Online URL
[Sponsors]
Home > Forums > FLUENT

UDF file for defining density as fn of pressure

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   October 7, 2003, 08:30
Default UDF file for defining density as fn of pressure
  #1
anton
Guest
 
Posts: n/a
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
  Reply With Quote

Old   October 7, 2003, 09:04
Default Re: UDF file for defining density as fn of pressur
  #2
mateus
Guest
 
Posts: n/a
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
  Reply With Quote

Old   October 8, 2003, 03:35
Default Re: UDF file for defining density as fn of pressur
  #3
Philipp Beierer
Guest
 
Posts: n/a
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
  Reply With Quote

Old   October 10, 2003, 11:09
Default Re: UDF file for defining density as fn of pressur
  #4
mateus
Guest
 
Posts: n/a
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

  Reply With Quote

Old   October 13, 2003, 04:14
Default Re: UDF file for defining density as fn of pressur
  #5
Alexandre
Guest
 
Posts: n/a
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
  Reply With Quote

Old   October 16, 2003, 04:18
Default Re: UDF file for defining density as fn of pressur
  #6
Philipp Beierer
Guest
 
Posts: n/a
...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
  Reply With Quote

Old   October 16, 2003, 04:22
Default Re: UDF file for defining density as fn of pressur
  #7
Alexandre
Guest
 
Posts: n/a
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.
  Reply With Quote

Old   October 16, 2003, 05:04
Default Re: UDF file for defining density as fn of pressur
  #8
raluca
Guest
 
Posts: n/a
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.
  Reply With Quote

Old   November 11, 2003, 10:59
Default Re: UDF file for defining density as fn of pressur
  #9
anton
Guest
 
Posts: n/a
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
  Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
wmake compiling new solver mksca OpenFOAM Programming & Development 13 August 18, 2014 23:26
paraview installation woes vex OpenFOAM Installation 15 January 30, 2011 08:11
Problem installing on Ubuntu 9.10 -> 'Cannot open : No such file or directory' mfiandor OpenFOAM Installation 2 January 25, 2010 10:50
error while compiling the USER Sub routine CFD user CFX 3 November 25, 2002 16:16
Fluent 5.2, UDF and Pressure BC's Alfonso Ferrandez FLUENT 0 May 4, 2000 08:02


All times are GMT -4. The time now is 03:23.