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

averaged pressure over the boundary

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 3 Post By Jason_Duguay

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 18, 2016, 11:12
Default averaged pressure over the boundary
  #1
New Member
 
Sachin Thakre
Join Date: Jun 2009
Location: Sweden
Posts: 25
Rep Power: 17
sachinthakre is on a distinguished road
Send a message via Skype™ to sachinthakre
Hello,
I am running a transient case (of course in OpenFoam) and I wish to plot average pressure on one of the boundaries with the time. Can anybody suggest me how to do it?

I tried PatchAverage p boundaryname. But I can't see anything either in paraview or something in post-processing folder (Or, I don't know how to see it).

Any help or suggestion is highly appreciated.

regards,
Naive user
sachinthakre is offline   Reply With Quote

Old   April 18, 2016, 18:34
Default
  #2
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 22
jherb is on a distinguished road
If you install swak4foam you can use this:
https://openfoamwiki.net/index.php/C...unctionObjects
jherb is offline   Reply With Quote

Old   April 19, 2016, 19:51
Default
  #3
New Member
 
Université de Sherbrooke
Join Date: Jul 2015
Posts: 6
Rep Power: 11
Jason_Duguay is on a distinguished road
Hi Sachin,

This is a way to do it without having to install swak4Foam:

averagePressure
{
type faceSource;
functionObjectLibs ("libfieldFunctionObjects.so");
outputControl timeStep;
log true;
valueOutput true;
source patch;
surfaceFormat off;
verbose true;
sourceName upstream; // replace this with your boundary patch name
operation areaAverage;

fields
(
p
);
}

Add the code above within the functions subdictionary in your controlDict file and change the sourceName to the boundary patch name that you want to calculate the average pressure over. The average pressure along the boundary will be printed out in a text file in the postProcessing folder in your case. To plot the pressure data you can easily do it with gnuplot (have a look online for a simple tutorial). Also, most solvers in OpenFOAM give pressure as the kinematic pressure (p/rho), so if you end up getting what look to be very small pressure values try multiplying them by your fluid density.

Hope that helps.
M.W.G., otaolafr and JD_PM like this.

Last edited by Jason_Duguay; April 20, 2016 at 09:08.
Jason_Duguay is offline   Reply With Quote

Old   April 22, 2016, 05:12
Default
  #4
New Member
 
Sachin Thakre
Join Date: Jun 2009
Location: Sweden
Posts: 25
Rep Power: 17
sachinthakre is on a distinguished road
Send a message via Skype™ to sachinthakre
Many thanks, Jason and Joachim, for your solutions.

Best,
Sachin
sachinthakre is offline   Reply With Quote

Old   May 11, 2020, 05:28
Default
  #5
Senior Member
 
Franco
Join Date: Nov 2019
Location: Compiègne, France
Posts: 129
Rep Power: 7
otaolafr is on a distinguished road
Quote:
Originally Posted by Jason_Duguay View Post
Hi Sachin,

This is a way to do it without having to install swak4Foam:

averagePressure
{
type faceSource;
functionObjectLibs ("libfieldFunctionObjects.so");
outputControl timeStep;
log true;
valueOutput true;
source patch;
surfaceFormat off;
verbose true;
sourceName upstream; // replace this with your boundary patch name
operation areaAverage;

fields
(
p
);
}

Add the code above within the functions subdictionary in your controlDict file and change the sourceName to the boundary patch name that you want to calculate the average pressure over. The average pressure along the boundary will be printed out in a text file in the postProcessing folder in your case. To plot the pressure data you can easily do it with gnuplot (have a look online for a simple tutorial). Also, most solvers in OpenFOAM give pressure as the kinematic pressure (p/rho), so if you end up getting what look to be very small pressure values try multiplying them by your fluid density.

Hope that helps.
thanks it was excatly what i was looking for!
small question, I am in a steadystate simulation (simpleFoam) so i would like to extract the averagePressure at the inlet but only for the last time, is it possible?
also when i continued my old simulation for the next time (I added the function to the controlDict) it have not created a postProssesing folder, should i do something extra to the run of the application so OF adds it?
thanks
otaolafr is offline   Reply With Quote

Old   May 11, 2020, 19:52
Default
  #6
HPE
Senior Member
 
HPE's Avatar
 
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13
HPE is on a distinguished road
Hi,

>> small question, I am in a steadystate simulation (simpleFoam) so i would like to extract the averagePressure at the inlet but only for the last time, is it possible?

- Adding the following entry to your function object may help in this regard: `writeTime onEnd;`.


>> also when i continued my old simulation for the next time (I added the function to the controlDict) it have not created a postProssesing folder, should i do something extra to the run of the application so OF adds it?

- Could you please elaborate this question, if possible? The `postProcessing` folder should be created when the function object writes out the relevant information.
HPE is offline   Reply With Quote

Old   May 12, 2020, 05:23
Default
  #7
Senior Member
 
Franco
Join Date: Nov 2019
Location: Compiègne, France
Posts: 129
Rep Power: 7
otaolafr is on a distinguished road
Quote:
Originally Posted by HPE View Post
Hi,

>> small question, I am in a steadystate simulation (simpleFoam) so i would like to extract the averagePressure at the inlet but only for the last time, is it possible?

- Adding the following entry to your function object may help in this regard: `writeTime onEnd;`.


>> also when i continued my old simulation for the next time (I added the function to the controlDict) it have not created a postProssesing folder, should i do something extra to the run of the application so OF adds it?

- Could you please elaborate this question, if possible? The `postProcessing` folder should be created when the function object writes out the relevant information.
hello thanks for the help!
>>- Adding the following entry to your function object may help in this regard: `writeTime onEnd;`.
thanks a lot!

>>- Could you please elaborate this question, if possible? The `postProcessing` folder should be created when the function object writes out the relevant information.
I have my case already run it (it achieved the minimum residuals I gave in fvSolutions, so to see if this was functional, I added to the functions in the controlDict file, and then change the minimum residuals (to a lower level so the simulation could continue from the lastestTime) and run de solver, but there were no postProcessing folder created ( I changed as mentioned "sourceName upstream; // replace this with your boundary patch name" for "sourceName inlet" that is the name of my patch that i want to investigate.
EDIT: it shows as openFOAM (at least the version (vr7) i have does not have the same functions?) I did not saw this in the log file as it was at the beginning of the log and i though that if there was an error it would not continue at all...
first it does not recognise the function faceSource:
Quote:
--> FOAM Warning :
From function void Foam::timeControl::read(const Foam::dictionary&)
in file db/functionObjects/timeControl/timeControl.C at line 89
Reading "/mnt/c/Users/Microreactors/Documents/OpenFOAM_Simulations/crearMeshWithPatches/Simulation_block_snap_topo_creat_simpleF/system/controlDict.functions.averagePressure" from line 52 to line 66
Using deprecated 'outputControl'
Please use 'writeControl' with 'writeInterval'
--> FOAM Warning :
From function bool Foam::functionObjectList::read()
in file db/functionObjects/functionObjectList/functionObjectList.C at line 746
Caught FatalError
--> FOAM FATAL ERROR:
Unknown function type faceSource
ps. it was the same proyect you helped me but i corrected the issue with the patches
franco

Last edited by otaolafr; May 12, 2020 at 09:46.
otaolafr is offline   Reply With Quote

Old   May 18, 2020, 18:34
Default
  #8
HPE
Senior Member
 
HPE's Avatar
 
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13
HPE is on a distinguished road
Hi,

I lost track of things, and lost entries where I promised to help. Can you poke me within few weeks time if I don't come back to your problem, and you would still need something. Thanks.
HPE is offline   Reply With Quote

Reply


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
Radiation in semi-transparent media with surface-to-surface model? mpeppels CFX 11 August 22, 2019 08:30
Problem with SIMPLEC-like finite volume channel flow boundary conditions ghobold Main CFD Forum 3 June 15, 2015 12:14
An error has occurred in cfx5solve: volo87 CFX 5 June 14, 2013 18:44
what the result is negatif pressure at inlet chong chee nan FLUENT 0 December 29, 2001 06:13
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 14:13.