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

Calculate custom pressure - best way?

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

Reply
 
LinkBack Thread Tools Display Modes
Old   November 22, 2011, 06:07
Default Calculate custom pressure - best way?
  #1
Member
 
Greg Melling
Join Date: Nov 2010
Posts: 41
Rep Power: 6
grjmell is on a distinguished road
I want to add rho*g*h to my pressure field as output by pimpleFoam. The options in my mind are:

1. inclusion of write.H to output p+rho*g*h (requires compiling new pimpleFoam solver)
2. post-process results with a utility to calculate p+rho*g*h

Have i missed an option? it seems option 2 is more appropriate since it only involves making a utility and no recompilation of the entire solver.

What is the best way to get the value for h?

Thanks
grjmell is offline   Reply With Quote

Old   November 22, 2011, 06:16
Default
  #2
Senior Member
 
Nima Sam
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,124
Blog Entries: 1
Rep Power: 14
nimasam is on a distinguished road
Send a message via Yahoo to nimasam
im not sure but as i know in new OpenFoam version we have two pressures
1) p
2) p - rho*g*h
so i guess the first p contains the effect of gravity! i insist im not sure
nimasam is offline   Reply With Quote

Old   November 22, 2011, 06:18
Default
  #3
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 12
Bernhard is on a distinguished road
Either of the two methods will do. If you need it for every timestep or want to sample during runtime I would chose option 1. If you need it only every once in a while, then option 2 will do.

If you go for option 2, have a look at the existing ptot utility. It has almost everything you need.

For the calculation of h, you can have a look in for example the interFoam e.g. createFields.H line 109 reads
Code:
volScalarField gh("gh", g & mesh.C());
Which is probably what you are looking for. mesh.C() refers to the central coordinate of a cell.

Good luck!
Bernhard is offline   Reply With Quote

Old   December 15, 2011, 05:38
Default
  #4
Member
 
Greg Melling
Join Date: Nov 2010
Posts: 41
Rep Power: 6
grjmell is on a distinguished road
Thanks All. Ok, I've tried with
Code:
volScalarField gh("gh", g & mesh.C());
but that gives me the height of the cell from z=0, rather than the depth from top of my domain which is what i need in order to calculate the hydrostatic component g*depth rather than gh. How can I get the depth, i.e. domain height - h?
grjmell is offline   Reply With Quote

Old   February 1, 2012, 11:05
Default
  #5
New Member
 
Fabien Farella
Join Date: Jan 2012
Posts: 7
Rep Power: 5
FabienF is on a distinguished road
Hi Greg,
I have the same problem. I would like to calculate the vertical offset from my boundary surface (the ground) of my mesh cell centers. Have you found a way to get the cell height relative to a surface/boundary?
Thank you
FabienF is offline   Reply With Quote

Old   February 1, 2012, 12:07
Default
  #6
Member
 
Greg Melling
Join Date: Nov 2010
Posts: 41
Rep Power: 6
grjmell is on a distinguished road
Hi Fabien,
No I haven't done much more on this. There must be a relatively easy way to find the max z value of the mesh to use as the relative datum. But not sure how... if you find anything please post!
G
grjmell 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
UDF to define or adjust pressure??? engahmed FLUENT 0 July 6, 2010 17:19
Pressure Rise Error emueller CFX 0 May 5, 2009 11:08
custom pressure field at the faces Souviktor FLUENT 0 April 3, 2009 08:09
Neumann pressure BC and velocity field Antech Main CFD Forum 0 April 25, 2006 02:15
Hydrostatic pressure in 2-phase flow modeling (CFX4.2) HB &DS CFX 0 January 9, 2000 14:19


All times are GMT -4. The time now is 19:51.