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

Pressure difference across 2 internal faces

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree14Likes
  • 8 Post By tomf
  • 1 Post By jtipton2
  • 5 Post By jtipton2

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 26, 2018, 03:44
Default Pressure difference across 2 internal faces
  #1
New Member
 
Sarath
Join Date: Mar 2017
Location: Spain
Posts: 22
Rep Power: 9
sk11 is on a distinguished road
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 05:10.
sk11 is offline   Reply With Quote

Old   April 26, 2018, 09:45
Default
  #2
New Member
 
Sarath
Join Date: Mar 2017
Location: Spain
Posts: 22
Rep Power: 9
sk11 is on a distinguished road
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
sk11 is offline   Reply With Quote

Old   April 30, 2018, 08:29
Default
  #3
Senior Member
 
Tom Fahner
Join Date: Mar 2009
Location: Breda, Netherlands
Posts: 646
Rep Power: 32
tomf will become famous soon enoughtomf will become famous soon enough
Send a message via MSN to tomf Send a message via Skype™ to tomf
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 );
        }
    }
Regards,
Tom
kaifu, jtipton2, hwangpo and 5 others like this.
tomf is offline   Reply With Quote

Old   December 19, 2019, 11:20
Default
  #4
New Member
 
Joseph Tipton
Join Date: Jun 2010
Posts: 27
Rep Power: 16
jtipton2 is on a distinguished road
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.
Svetlana likes this.
jtipton2 is offline   Reply With Quote

Old   April 12, 2020, 16:05
Default
  #5
New Member
 
Joseph Tipton
Join Date: Jun 2010
Posts: 27
Rep Power: 16
jtipton2 is on a distinguished road
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 );
        }



// ************************************************************************* //
The file can then be run using as a postProcess via something akin to:

Code:
rhoSimpleFoam -postProcess -func sample1 -latestTime
jtipton2 is offline   Reply With Quote

Old   August 4, 2020, 10:26
Default
  #6
New Member
 
Join Date: Mar 2020
Posts: 4
Rep Power: 6
Selinus is on a distinguished road
Hi jtipton2,
what about if I would like to use this method to compute average properties value on a circle surface?



Thanks for your help
Selinus is offline   Reply With Quote

Old   December 25, 2020, 03:22
Default
  #7
New Member
 
Alexey Ryakhovskiy
Join Date: Sep 2014
Posts: 11
Rep Power: 12
Alexee is on a distinguished road
Quote:
Originally Posted by Selinus View Post
Hi jtipton2,
what about if I would like to use this method to compute average properties value on a circle surface?



Thanks for your help
I think in case of arbitrary surface you'd need to create a faceZone with topoSet and use

source faceZone;
Alexee is offline   Reply With Quote

Old   July 18, 2022, 04:09
Default
  #8
Member
 
Daniel
Join Date: May 2018
Posts: 43
Rep Power: 8
CFDanielGER is on a distinguished road
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
CFDanielGER is offline   Reply With Quote

Old   July 18, 2022, 06:11
Default
  #9
Senior Member
 
Tom Fahner
Join Date: Mar 2009
Location: Breda, Netherlands
Posts: 646
Rep Power: 32
tomf will become famous soon enoughtomf will become famous soon enough
Send a message via MSN to tomf Send a message via Skype™ to tomf
For future reference:

multiFieldValue is the name from v2112 onwards.

Cheers,
Tom
tomf is offline   Reply With Quote

Reply

Tags
internal faces, porous media, pressure drop

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
pisoFOAM (LES) - internal pipe flow - convergence gu1 OpenFOAM Running, Solving & CFD 0 January 11, 2018 16:39
decomposePar -allRegions stru OpenFOAM Pre-Processing 2 August 25, 2015 03:58
foam-extend_3.1 decompose and pyfoam warning shipman OpenFOAM 3 July 24, 2014 08:14
createPatch Segmentation Fault (CORE DUMPED) sam.ho OpenFOAM Pre-Processing 2 April 21, 2014 02:01
[swak4Foam] Calculate pressure between internal faces Kalas OpenFOAM Community Contributions 1 February 3, 2012 04:18


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