# Calculate custom pressure - best way?

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

 November 22, 2011, 06:07 Calculate custom pressure - best way? #1 Member   Greg Melling Join Date: Nov 2010 Posts: 41 Rep Power: 7 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

 November 22, 2011, 06:16 #2 Senior Member   Nima Samkhaniani Join Date: Sep 2009 Location: Tehran, Iran Posts: 1,193 Blog Entries: 1 Rep Power: 16 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

 November 22, 2011, 06:18 #3 Senior Member   Bernhard Join Date: Sep 2009 Location: Delft Posts: 790 Rep Power: 14 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!

 December 15, 2011, 05:38 #4 Member   Greg Melling Join Date: Nov 2010 Posts: 41 Rep Power: 7 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?

 February 1, 2012, 11:05 #5 New Member   Fabien Farella Join Date: Jan 2012 Posts: 7 Rep Power: 6 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

 February 1, 2012, 12:07 #6 Member   Greg Melling Join Date: Nov 2010 Posts: 41 Rep Power: 7 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

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post engahmed FLUENT 0 July 6, 2010 17:19 emueller CFX 0 May 5, 2009 11:08 Souviktor FLUENT 0 April 3, 2009 08:09 Antech Main CFD Forum 0 April 25, 2006 02:15 HB &DS CFX 0 January 9, 2000 14:19

All times are GMT -4. The time now is 09:49.