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

Where to define which fields to write?

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

Like Tree7Likes
  • 6 Post By bgoeppner
  • 1 Post By farhhad

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 13, 2010, 15:16
Default Where to define which fields to write?
  #1
New Member
 
Benedikt Goeppner
Join Date: Jan 2010
Posts: 15
Rep Power: 16
bgoeppner is on a distinguished road
Hi there,

that's maybe a very simple question, but where can I define which fields OpenFOAM will write? I solved a case with sonicFoam and wanted to have a look at the density, but there is no rho in the time-directories...

Can I make OpenFOAM to calculate and write rho without re-running the hole job?

BTW: Am I right that the pressure is the dynamicPressure? Because then I could calculate my desity from velocity...

Thanks a lot,
Ben

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

Old   April 14, 2010, 09:36
Default
  #2
Member
 
Cedric Van Holsbeke
Join Date: Dec 2009
Location: Belgium
Posts: 81
Rep Power: 17
CedricVH is on a distinguished road
The field p is the static pressure (in OpenFOAM 1.6). However, you can calculate the total pressue (static + dynamic pressure) by running the command ptot on the solved case. From there on, you can use foamCalc to calculate other parameters.
CedricVH is offline   Reply With Quote

Old   April 14, 2010, 10:22
Default
  #3
New Member
 
Benedikt Goeppner
Join Date: Jan 2010
Posts: 15
Rep Power: 16
bgoeppner is on a distinguished road
Thanks a lot. I tried that but as my p-Field is in Pa (kg/msē) not in mē/sē ptot wants to have a rho-file... And that is exactly what I'm not having ;-)
bgoeppner is offline   Reply With Quote

Old   December 3, 2010, 13:22
Default
  #4
New Member
 
Join Date: Aug 2009
Posts: 5
Rep Power: 17
aruv is on a distinguished road
Hi Benedikt,
I am facing with the same problem with sonicFoam.. how to calculate ptot ... have u found any solution to the problem ???
aruv is offline   Reply With Quote

Old   December 4, 2010, 04:09
Default
  #5
Senior Member
 
Nakul
Join Date: Apr 2010
Location: India
Posts: 147
Rep Power: 16
nakul is on a distinguished road
Hi,

You may change definition of rho in createFields.H file of sonicFoam locaed in "$applications/solvers".

You may define rho the way U is defined and the recompile your solver. In this way sonicFoam will output rho during runtime.
nakul is offline   Reply With Quote

Old   December 4, 2010, 08:06
Default
  #6
New Member
 
Join Date: Aug 2009
Posts: 5
Rep Power: 17
aruv is on a distinguished road
Hi,
I made the changes in the createFields.H and recompiled the solver, finally it works. thanks for the suggestion

Using Sampledict one can calculate p, T, U etc . do u have any idea how to calculate variables other than the standard ones for Example (isentropic Mach Number) around a compressor profile

thank u
aruv is offline   Reply With Quote

Old   December 5, 2010, 07:36
Default
  #7
Senior Member
 
Nakul
Join Date: Apr 2010
Location: India
Posts: 147
Rep Power: 16
nakul is on a distinguished road
Hi,

To get local Mach No. in the domain you may run the command "Mach".

Also refer to the utilities section of the User Guide to find out what all you can get as data from OF.
nakul is offline   Reply With Quote

Old   December 9, 2010, 08:25
Default
  #8
New Member
 
Benedikt Goeppner
Join Date: Jan 2010
Posts: 15
Rep Power: 16
bgoeppner is on a distinguished road
Hi aruv,

sorry for my late answer...

You can also add the following to the controlDict file:

Code:
functions
{
   rhofunc
   {
      type                 writeRegisteredObject;
      functionObjectLibs   ("libIOFunctionObjects.so");
      outputControl        outputTime;
      outputInterval       1;
      objectNames
      (
         "rho"
         "psi"
      );
   }
}
This will work with every solver and gives you all files you want to have... (In my case this is rho and psi)

Have fun!
arvindpj, Jos, lxwd and 3 others like this.
bgoeppner is offline   Reply With Quote

Old   July 15, 2011, 12:00
Default
  #9
New Member
 
Farhad N.
Join Date: Apr 2010
Posts: 6
Rep Power: 16
farhhad is on a distinguished road
I was just reading your posts and leant lots. There is one thing that seems to be forgotten and It is the dimensions of p and p_rgh in OF 1.7 and OF 1.6. The dimension of p is m^2/s^2 which is the square of velocity dimension. Basically, for p OF skips the density in its calculations. On the other hand, the dimension of p_rgh is kg/ms^2 meaning that density is included. Therefore, if p is the addition of dynamic and static pressure, the actual pressure has yet to be obtained multiplying the density to p.
mizzou likes this.
farhhad is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
HELP----Surface Reaction UDF Ashi Fluent UDF and Scheme Programming 1 May 19, 2020 22:13
Installing OF 1.6 on Mac OS X gschaider OpenFOAM Installation 129 June 19, 2010 10:23
Missing math.h header Travis FLUENT 4 January 15, 2009 12:48
Free surface boudary conditions with SOLA-VOF Fan Main CFD Forum 10 September 9, 2006 13:24
UDF FOR UNSTEADY TIME STEP mayur FLUENT 3 August 9, 2006 11:19


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