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

areaAverage pressure along streamwise direction

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 16, 2015, 17:43
Default areaAverage pressure along streamwise direction
  #1
Member
 
SM
Join Date: Dec 2010
Posts: 97
Rep Power: 15
canopus is on a distinguished road
I want to compute pressure drop across a planar diffuser (2-D) using RANS with simpleFOAM.

I would like to get area averaged pressure
Code:
(sum(Ai*pi)/Sum(Ai))
all along my streamwise (X) direction.

For instance to get area averaged pressure at one particular section
I put in controlDict the following-
Code:
up_plane
{
    type            faceSource;
    functionObjectLibs ("libfieldFunctionObjects.so");
    enabled         true;
    outputControl   timeStep;
    log             true;
    valueOutput     false;// Output field values as well
    source          sampledSurface;   

    sampledSurfaceDict
    {
        type            plane;    // always triangulated
        basePoint       (0.6 0 0);
        normalVector    (1 0 0);
    }
    operation       areaAverage;
    fields
    (
        p
        U
    );
}
But how can I get area averaged p across all along streamwise direction without writing as many files as nodes?
I want data in a single file like
Code:
 x areaAverage(p)


Or is there a way to use sampleDict / pressureTools ?
canopus is offline   Reply With Quote

Old   March 28, 2016, 17:13
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings canopus,

I've had this post of yours on my to-do list for some time now and I've finally managed to take a look into this.

And I have to say that I'm very confused with your question. I tested just now in the tutorial case "incompressible/icoFoam/cavity" the following entry in "system/controlDict":
Code:
functions
{
    up_plane
    {
        type            faceSource;
        functionObjectLibs ("libfieldFunctionObjects.so");
        enabled         true;
        outputControl   timeStep;
        log             true;
        valueOutput     false;// Output field values as well
        source          sampledSurface;
        sourceName      cookie;

        sampledSurfaceDict
        {
            type            plane;    // always triangulated
            basePoint       (0.05 0 0);
            normalVector    (1 0 0);
        }
        operation       areaAverage;
        fields
        (
            p
            U
        );
    }
}
And after running icoFoam, I got the file "postProcessing/up_plane/0/faceSource.dat" which has something like this:
Code:
#   Source : sampledSurface cookie
#   Faces  : 40
#   Area   : 1.000000e-03
#        Time   areaAverage(p)  areaAverage(U)
5.000000e-03    7.284116e-01    (1.161758e-05 -2.866114e-03 0.000000e+00)
1.000000e-02    1.397881e-02    (-7.844885e-06 -4.445986e-03 0.000000e+00)
1.500000e-02    1.426849e-01    (-1.312083e-05 -5.276828e-03 0.000000e+00)
2.000000e-02    3.357030e-02    (-1.681121e-05 -5.723470e-03 0.000000e+00)
2.500000e-02    3.938627e-02    (-1.845171e-05 -6.021526e-03 0.000000e+00)
3.000000e-02    2.860943e-02    (-1.961279e-05 -6.265176e-03 0.000000e+00)
3.500000e-02    1.667961e-02    (-2.065645e-05 -6.466568e-03 0.000000e+00)
4.000000e-02    3.061324e-02    (-2.121525e-05 -6.647684e-03 0.000000e+00)
4.500000e-02    1.743975e-02    (-2.162312e-05 -6.811977e-03 0.000000e+00)
5.000000e-02    1.584760e-02    (-2.158444e-05 -6.955973e-03 0.000000e+00)
5.500000e-02    1.482289e-02    (-2.202660e-05 -7.083342e-03 0.000000e+00)
6.000000e-02    1.418260e-02    (-2.213669e-05 -7.194694e-03 0.000000e+00)
6.500000e-02    1.309184e-02    (-2.220456e-05 -7.291144e-03 0.000000e+00)
7.000000e-02    1.354508e-02    (-2.222582e-05 -7.373679e-03 0.000000e+00)
and it continues down to Time = 0.5. Each line is for a specific time step.

From what I can figure out, this does what you asked for.

Best regards,
Bruno
__________________
wyldckat 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
Calculation of the Governing Equations Mihail CFX 7 September 7, 2014 07:27
how to manage pressure direction amrbagh ANSYS 3 September 4, 2011 02:36
Pressure BC for combustion chamber Giuki FLUENT 1 July 19, 2011 12:35
Pressure Loss dependet on Flow Direction MichaelN CFX 2 June 5, 2011 12:22
Neumann pressure BC and velocity field Antech Main CFD Forum 0 April 25, 2006 03:15


All times are GMT -4. The time now is 08:35.