Calculate custom pressure - best way?
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 |
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 :D |
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()); Good luck! |
Thanks All. Ok, I've tried with
Code:
volScalarField gh("gh", g & mesh.C()); |
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 |
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 |
All times are GMT -4. The time now is 13:46. |