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

Script to obtain "real" static pressure (pressure times density)

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 1 Post By arnaud6
  • 2 Post By wyj216

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 6, 2015, 12:43
Default Script to obtain "real" static pressure (pressure times density)
  #1
New Member
 
Join Date: May 2013
Posts: 23
Rep Power: 13
arnaud6 is on a distinguished road
Hello,

I am struggling with making the really easy scripting line which I am sure is very useful for all OpenFOAM users !
How to obtain the "real" static pressure from an openfoam incompressible solver ?
So performing p*density on the relevant lines.
Let's say in a bash line, it would be perfect !

for example, my "p" file looks like

PHP Code:
scalar
part
         1
hexa8
 6.11803e+02
 6.11877e+02
 6.11775e+02
 6.11666e+02 
and after using
Quote:
awk -F " " '{print $1*1.225}' p > p_output
PHP Code:
0
0
1.225
0
749.459
749.549
749.424
749.291 
While of course I would like to have

PHP Code:
scalar
part
         1
hexa8
  749.459
  749.549
  749.424
  749.291 
To have a p field still working in openfoam.

Any idea how to set this condition in awk ? Or using sed ? Or running something in openfoam ?
mizzou likes this.
arnaud6 is offline   Reply With Quote

Old   May 5, 2021, 10:22
Default
  #2
New Member
 
Youjiang Wang
Join Date: Apr 2015
Location: Hamburg
Posts: 22
Rep Power: 11
wyj216 is on a distinguished road
If anybody comes to find solution here like me. I have tried out the simple way in OF2012

Code:
postProcess -func "staticPressure(p, pRef=**, rho=rhoInf, rhoInf=**)"
Just replace ** with the values you want. Results is then stored in static(p). I use this to transfer results from pimpleFoam to interPhaseChangeFoam.
Edee and rezaeimahdi like this.
wyj216 is offline   Reply With Quote

Reply

Tags
density, incompressible, script, static pressure


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
Pressure Inlet VS velocity Inlet difference Mohsin FLUENT 9 January 4, 2021 11:34
Static pressure problem Kiat110616 CFX 0 April 12, 2011 14:11
UDF to control Static Pressure (in cylinder) James FLUENT 0 July 20, 2004 08:54
Static vs Total Pressure Alfonso Ferrandez FLUENT 2 May 23, 2000 09:53
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 12:37.