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

Pressuretools: pressureDifferencePatch

Register Blogs Community New Posts Updated Threads Search

Like Tree5Likes
  • 1 Post By verboomj
  • 1 Post By dyle
  • 1 Post By sepp.zell
  • 2 Post By randolph

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 28, 2016, 08:48
Default Pressuretools: pressureDifferencePatch
  #1
New Member
 
Jeroen
Join Date: Oct 2016
Posts: 21
Rep Power: 9
verboomj is on a distinguished road
I'm want to use this tool to calculate the pressure difference between the inlet and outlet, as I'm optimizing with respect to minimum pressure loss.

Code:
postProcess -func "pressureDifferencePatch(...)"
I've tried different ways to define my patches (name=outlet,name=inlet) or (outlet, inlet). But none seem to work, and give me the following error:

Code:
--> FOAM Warning :
    From function bool Foam::functionObjectList::read()
    in file db/functionObjects/functionObjectList/functionObjectList.C at line 644
    Caught FatalError
--> FOAM FATAL ERROR:
surfaceRegion pressureDifferencePatch(inletoutlet).region1: patch(<patch1>):
    Unknown patch name: <patch1>. Valid patch names are:
4
(
inlet
outlet
fixedWalls
frontAndBack
)
The pressureDifferencePach file looks like:

Code:
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      pressureDifferencePatch;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

pressureDifferencePatch
{
    patch1 <patch1>;
    patch2 <patch2>;

    #includeEtc "caseDicts/postProcessing/pressure/pressureDifferencePatch.cfg"
}


I got the flow rate command working for a single patch as given in the user guide:

Code:
postProcess -func "flowRatePatch(name=outlet)"
Thanks.
kuprat likes this.
verboomj is offline   Reply With Quote

Old   February 17, 2017, 07:17
Default
  #2
New Member
 
Daniel L
Join Date: Oct 2016
Posts: 5
Rep Power: 9
dyle is on a distinguished road
Hi, Jeroen,
Check out the file pressureDifferencePatch at $FOAM_ETC\caseDicts\postProcessing\pressure. Names of Two patches , in your case outlet and inlet, could be defined in it.
Then you can use postPrcoess by including it in controlDict file. Now it would work.
dyle is offline   Reply With Quote

Old   February 18, 2017, 11:44
Default
  #3
Member
 
Andrea Di Ronco
Join Date: Nov 2016
Location: Milano, Italy
Posts: 57
Rep Power: 9
Diro7 is on a distinguished road
Quote:
Originally Posted by dyle View Post
Hi, Jeroen,
Check out the file pressureDifferencePatch at $FOAM_ETC\caseDicts\postProcessing\pressure. Names of Two patches , in your case outlet and inlet, could be defined in it.
Then you can use postPrcoess by including it in controlDict file. Now it would work.
Hi Dyle,

I'm trying too to use pressureDifferencePatch but I didn't understand what you suggested.
I tried to use the dictionary in the ect/... folder by copying and modifying it in the case directory and then using the -dict attribute while calling postProcess in the command line, but it is not working.

How did you make it work?

Thanks
Diro7 is offline   Reply With Quote

Old   February 18, 2017, 19:07
Default
  #4
New Member
 
Daniel L
Join Date: Oct 2016
Posts: 5
Rep Power: 9
dyle is on a distinguished road
Hi Andrea,

I didn't use the -dict attribute. Instead, I add
functions
{
#includeFunc pressureDifferencePatch
}
to controlDict, and then call postProcess directly.


Best,
Dyle
zyliao likes this.
dyle is offline   Reply With Quote

Old   March 1, 2017, 15:18
Default
  #5
Member
 
Min Zhang
Join Date: Mar 2017
Posts: 81
Rep Power: 9
minzhang is on a distinguished road
Hello Jeroen,

Have you fixed your problem with pressureDifferencePatch function?
minzhang is offline   Reply With Quote

Old   January 10, 2018, 05:22
Default
  #6
New Member
 
Sebastian
Join Date: Feb 2017
Posts: 22
Rep Power: 9
sepp.zell is on a distinguished road
Hi together,

I try to give a solution that works for me:
Add in your system directory of your case a file pressureDifferencePatch as suggested in the first post and replace <patch1> and <patch2> by the names of your patches.

Then in the command line one can call the command
Code:
postProcess -fields '(p)' -func pressureDifferencePatch
At least for me this works. Maybe you can report, if this also works for you.

Regards
Sebastian
Robin.Kamenicky likes this.
sepp.zell is offline   Reply With Quote

Old   April 9, 2018, 07:19
Default
  #7
Member
 
Robin Kamenicky
Join Date: Mar 2016
Posts: 74
Rep Power: 11
Robin.Kamenicky is on a distinguished road
Hi Sebastian,

this approach works also for me.

Thank you,
Regards,
Robin
Robin.Kamenicky is offline   Reply With Quote

Old   April 10, 2018, 02:03
Default
  #8
New Member
 
JD
Join Date: May 2017
Posts: 24
Rep Power: 9
dickcruz is on a distinguished road
Code:
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      pressureDifferencePatch;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

pressureDifferencePatch
{
    patch1 <patch1>;
    patch2 <patch2>;

    #includeEtc "caseDicts/postProcessing/pressure/pressureDifferencePatch.cfg"
}
I think that this right here was the problem, that you're supposed to replace the square brackets with your actual patch names. It works fine for me when this is done. As dyle mentioned, you just need to ensure that you have the #include directive in the controlDict for the case.
dickcruz is offline   Reply With Quote

Old   March 27, 2020, 14:07
Default
  #9
Senior Member
 
Reviewer #2
Join Date: Jul 2015
Location: Knoxville, TN
Posts: 141
Rep Power: 11
randolph is on a distinguished road
pressureDifferencePatch is nothing but a wrapper over fieldValueDelta.

For more controls. Just use

Code:
	pressureDifferencePatch1
	{
		type            fieldValueDelta;
		libs            ("libfieldFunctionObjects.so");
		operation       subtract;
		writeControl    timeStep;
		writeInterval   1;
		log             true;

		region1
		{
    		#includeEtc "caseDicts/postProcessing/surfaceFieldValue/surfaceRegion.cfg"
    		operation       areaAverage;
    		fields          (p);
			regionType  patch;
    		name        inlet;
		}
		region2
		{
    		#includeEtc "caseDicts/postProcessing/surfaceFieldValue/surfaceRegion.cfg"
    		operation       areaAverage;
    		fields          (p);
			regionType  patch;
    		name        outlet;
		}
	}
Iose and Michael@UW like this.
randolph is online now   Reply With Quote

Old   June 8, 2020, 13:56
Default
  #10
Member
 
Himanshu
Join Date: Jan 2017
Posts: 34
Rep Power: 9
Himanshu_Shrivastava is on a distinguished road
Quote:
Originally Posted by randolph View Post
pressureDifferencePatch is nothing but a wrapper over fieldValueDelta.

For more controls. Just use

Code:
	pressureDifferencePatch1
	{
		type            fieldValueDelta;
		libs            ("libfieldFunctionObjects.so");
		operation       subtract;
		writeControl    timeStep;
		writeInterval   1;
		log             true;

		region1
		{
    		#includeEtc "caseDicts/postProcessing/surfaceFieldValue/surfaceRegion.cfg"
    		operation       areaAverage;
    		fields          (p);
			regionType  patch;
    		name        inlet;
		}
		region2
		{
    		#includeEtc "caseDicts/postProcessing/surfaceFieldValue/surfaceRegion.cfg"
    		operation       areaAverage;
    		fields          (p);
			regionType  patch;
    		name        outlet;
		}
	}
Old post but i hope to get a reply....
I have internal "faceZone" (using writeZone) and I wanted to calculate total pressure on this facezone. But, as we know pressure value is stored on cell center.
if we use faceSource will it interpolate the value or we have some other way to calculate total pressure.
and p will give static pressure so for total pressure do we use " fields (total(p))"?
Himanshu_Shrivastava 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
pressureTools postProcessing function objects in 2.2.0 immortality OpenFOAM Post-Processing 33 December 22, 2018 11:15
How to control output time of pressureTools functions? Fluido OpenFOAM Post-Processing 1 May 19, 2014 08:49


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