|
[Sponsors] |
April 26, 2018, 04:44 |
Pressure difference across 2 internal faces
|
#1 |
New Member
Sarath
Join Date: Mar 2017
Location: Spain
Posts: 22
Rep Power: 9 |
Dear FOAMers,
I need a help regarding how to find the pressure across internal faces. For example, I have a 2D channel flow and a porous block in the flow. how can I find the pressure drop caused by the porous media? (Using functions) Inlet and outlet of the porous media are internal faces. I found there is "pressureDifferencePatch" to find the pressure between two patches. But is there any way I can find the pressure between these internal faces (Since it can not be considered as boundary patches?) I strongly believe there is some way to get this pressure drop, but I could not find a relevant thread. Thank you for the help. Regards, Sarath Last edited by sk11; April 26, 2018 at 06:10. |
|
April 26, 2018, 10:45 |
|
#2 |
New Member
Sarath
Join Date: Mar 2017
Location: Spain
Posts: 22
Rep Power: 9 |
I found a way by using singleGraph function. By plotting the pressure in two different planes. But I had to write a script to do it for two planes and get the pressure drop. I wonder how "pressureDifferenceSurface" works! It can be more easy than this way.
Kind regards, Sarath |
|
April 30, 2018, 09:29 |
|
#3 |
Senior Member
|
Hi,
I had to do something similar recently. The following works in version 1712: Code:
deltaTotalPressure_inOutlet { type fieldValueDelta; libs ("libfieldFunctionObjects.so"); operation subtract; region1 { type surfaceFieldValue; libs ("libfieldFunctionObjects.so"); log false; writeControl timeStep; writeFields false; regionType patch; name inlet; operation areaIntegrate; fields ( p ); } region2 { type surfaceFieldValue; libs ("libfieldFunctionObjects.so"); log false; writeControl timeStep; writeFields false; regionType patch; name outlet; operation areaIntegrate; fields ( p ); } } Tom |
|
December 19, 2019, 12:20 |
|
#4 |
New Member
Joseph Tipton
Join Date: Jun 2010
Posts: 27
Rep Power: 16 |
Thanks tomf for your function!
Note that, if you want pressure drop, you should use operation areaAverage. As the code snippet is currently set, operation areaIntegrate will calculate the net force caused by pressure on the patch. |
|
April 12, 2020, 17:05 |
|
#5 |
New Member
Joseph Tipton
Join Date: Jun 2010
Posts: 27
Rep Power: 16 |
Just for the sake of posterity... the original poster was asking how to calculate the pressure drop between internal faces that weren't boundary patches. This can be accomplished with a file as follows:
Code:
/*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 6 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "system"; object sample1; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // type fieldValueDelta; libs ("libfieldFunctionObjects.so"); operation subtract; region1 { type surfaceFieldValue; libs ("libfieldFunctionObjects.so"); log false; writeControl timeStep; writeFields false; regionType sampledSurface; name plane300mm; sampledSurfaceDict { type plane; source cells; planeType pointAndNormal; pointAndNormalDict { point (0.3 0.025 0); normal (0.3 0 0); } } operation areaAverage; fields ( p ); } region2 { type surfaceFieldValue; libs ("libfieldFunctionObjects.so"); log false; writeControl timeStep; writeFields false; regionType sampledSurface; name plane600mm; sampledSurfaceDict { type plane; source cells; planeType pointAndNormal; pointAndNormalDict { point (0.6 0.025 0); normal (0.6 0 0); } } operation areaAverage; fields ( p ); } // ************************************************************************* // Code:
rhoSimpleFoam -postProcess -func sample1 -latestTime |
|
December 25, 2020, 04:22 |
|
#7 | |
New Member
Alexey Ryakhovskiy
Join Date: Sep 2014
Posts: 11
Rep Power: 12 |
Quote:
source faceZone; |
||
July 18, 2022, 05:09 |
|
#8 |
Member
Daniel
Join Date: May 2018
Posts: 43
Rep Power: 8 |
Hello everybody,
did something change for the fieldValueDelta function? Because I want to run this code with OpenFOAM v2112 and it gives me following error: Code:
--> FOAM FATAL IO ERROR: (openfoam-2112) Entry 'type' not found in dictionary "functions.pressureDrop" file: functions.pressureDrop at line 22 to 49. From bool Foam::dictionary::readEntry(const Foam::word&, T&, Foam::keyType::option, bool) const [with T = Foam::word] in file lnInclude/dictionaryTemplates.C at line 322. FOAM exiting Does anyone know what should be changed or is there another way of calculating the pressure drop between two surfaces? Many thanks for your help and best regards, Daniel |
|
July 18, 2022, 07:11 |
|
#9 |
Senior Member
|
||
Tags |
internal faces, porous media, pressure drop |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
pisoFOAM (LES) - internal pipe flow - convergence | gu1 | OpenFOAM Running, Solving & CFD | 0 | January 11, 2018 17:39 |
decomposePar -allRegions | stru | OpenFOAM Pre-Processing | 2 | August 25, 2015 04:58 |
foam-extend_3.1 decompose and pyfoam warning | shipman | OpenFOAM | 3 | July 24, 2014 09:14 |
createPatch Segmentation Fault (CORE DUMPED) | sam.ho | OpenFOAM Pre-Processing | 2 | April 21, 2014 03:01 |
[swak4Foam] Calculate pressure between internal faces | Kalas | OpenFOAM Community Contributions | 1 | February 3, 2012 05:18 |