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 Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By arnaud6

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 6, 2015, 11:43
Default Script to obtain "real" static pressure (pressure times density)
  #1
New Member
 
Join Date: May 2013
Posts: 23
Rep Power: 10
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, 09:22
Default
  #2
New Member
 
Youjiang Wang
Join Date: Apr 2015
Location: Hamburg
Posts: 22
Rep Power: 8
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.
wyj216 is offline   Reply With Quote

Reply

Tags
density, incompressible, script, static pressure

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
Pressure Inlet VS velocity Inlet difference Mohsin FLUENT 9 January 4, 2021 10:34
Static pressure problem Kiat110616 CFX 0 April 12, 2011 13:11
UDF to control Static Pressure (in cylinder) James FLUENT 0 July 20, 2004 07:54
Static vs Total Pressure Alfonso Ferrandez FLUENT 2 May 23, 2000 08:53
Hydrostatic pressure in 2-phase flow modeling (CFX4.2) HB &DS CFX 0 January 9, 2000 13:19


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