CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM

How to get density-field for compressible flow?

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

Like Tree4Likes
  • 4 Post By bgoeppner

Reply
 
LinkBack Thread Tools Display Modes
Old   April 15, 2010, 05:59
Default How to get density-field for compressible flow?
  #1
New Member
 
Benedikt Goeppner
Join Date: Jan 2010
Posts: 15
Rep Power: 7
bgoeppner is on a distinguished road
Hi there,

I was wondering how to get the density-field if using some compressible solver?

Beside rhoCentralFoam I think all other solvers define rho as a NOWRITE-object (like basicThermo does with psi, too). As density and compressiblity are a fundamental thing of compressible flow - if not it would be incompressible, right? - there should be a way to visualize those fields in postprocessing, shouldn't it?

Or do I have to calculate the Mach-Number, out of that the compressiblity, and according to this finally the density? Sounds complicated to me..

Is it advisable as an easy solution to create a new solver as a copy of the existing one, say sonicFoam, with rho defined as AUTOWRITE-object?

Ben
bgoeppner is offline   Reply With Quote

Old   April 15, 2010, 08:32
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,914
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by bgoeppner View Post
Hi there,

I was wondering how to get the density-field if using some compressible solver?

Beside rhoCentralFoam I think all other solvers define rho as a NOWRITE-object (like basicThermo does with psi, too). As density and compressiblity are a fundamental thing of compressible flow - if not it would be incompressible, right? - there should be a way to visualize those fields in postprocessing, shouldn't it?

Or do I have to calculate the Mach-Number, out of that the compressiblity, and according to this finally the density? Sounds complicated to me..

Is it advisable as an easy solution to create a new solver as a copy of the existing one, say sonicFoam, with rho defined as AUTOWRITE-object?

Ben
The rho-Field is there. It's just not being written. I think I saw somewhere in recent commits of 1.6.x a functionObject that lets you write such fields. Alternatively you can try writeFieldsAdditional from http://openfoamwiki.net/index.php/Co...unctionObjects
gschaider is offline   Reply With Quote

Old   April 15, 2010, 10:59
Default
  #3
New Member
 
Benedikt Goeppner
Join Date: Jan 2010
Posts: 15
Rep Power: 7
bgoeppner is on a distinguished road
Hi Bernhard,

thanks for your quick reply. That sounds exactly what I'm looking for. Unfortunately I'm not very used to functionObjects in OpenFOAM right now and the official documention does not offer a lot of instructions about that, too... There's just a general reference to the tutorials-folder... ;-)

I will also check out your tools from the link you posted and have a look at the README-file, as well as I'm currently trying to understand the source-code.

Anyway, if you have any suggestions on where to get more information regarding this topic or if you could give some examples how to use those objects, that would be great!

Edit: I had a look at the source guide and some other resources... Am I right that the following steps would solve my problem?

1) Add some functions to the controlDict:
Code:
functions
(
  rho
  {
    type     writeRegisteredObject;
    functionObjectLibs   ("libfunctionObjects.so");
    objectNames
    (
      rho
    );
  }
)
2) if postprocessing then: Call execFlowFunctionObjects
or if having added the functions-section to control-dict before running the case, everything should be fine anyway

I will try that as soon as I'm back at my simulation-computer...

Last edited by bgoeppner; April 15, 2010 at 12:23.
bgoeppner is offline   Reply With Quote

Old   April 15, 2010, 12:48
Default
  #4
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,914
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by bgoeppner View Post
thanks for your quick reply. That sounds exactly what I'm looking for. Unfortunately I'm not very used to functionObjects in OpenFOAM right now and the official documention does not offer a lot of instructions about that, too... There's just a general reference to the tutorials-folder... ;-)

I will also check out your tools from the link you posted and have a look at the README-file, as well as I'm currently trying to understand the source-code.

Anyway, if you have any suggestions on where to get more information regarding this topic or if you could give some examples how to use those objects, that would be great!
You're on the right track. There is not much more material that I know of.
gschaider is offline   Reply With Quote

Old   April 16, 2010, 06:54
Thumbs up Problem solved
  #5
New Member
 
Benedikt Goeppner
Join Date: Jan 2010
Posts: 15
Rep Power: 7
bgoeppner is on a distinguished road
Just in case someone's having the same problem and is using the search-function, here's the solution:

Add the following to your controlDict:
Code:
functions
{
   rhofunc
   {
      type                 writeRegisteredObject;
      functionObjectLibs   ("libIOFunctionObjects.so");
/*      outputControl        outputTime;*/
      outputControl        timeStep;
      outputInterval       1;
      objectNames
      (
         "rho"
         "psi"
      );
   }
}
If you insert this before running your case, you should have
Code:
outputControl    outputTime
enabled, otherwise (if you run the case without this section) you should have
Code:
outputControl    timeStep
enabled. Then just run
Code:
execFlowFunctionObjects
from your case-directory.

Have fun!
bgoeppner is offline   Reply With Quote

Old   September 9, 2013, 07:37
Default
  #6
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,186
Rep Power: 16
immortality is on a distinguished road
Hi
for notice:
rhoCentralFoam now (in 2.2.0 version) writes "rho" field itself but doesn't write "phi" field.
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.
immortality is offline   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
Flow meter Design CD adapco Group Marketing CD-adapco 3 June 21, 2011 08:33
rerun with same flow field, different fluid props Tim Phoenics 0 March 3, 2004 15:51
Injection of partical into flow field M.Mahendran FLUENT 2 November 24, 2002 01:54
Inviscid Drag at subsonic, subcritical Mach # Axel Rohde Main CFD Forum 1 November 19, 2001 13:19
Flow field measurement in turbomachinery! Wanlai Lin Main CFD Forum 3 September 3, 1999 12:06


All times are GMT -4. The time now is 07:11.