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

How to control output time of pressureTools functions?

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Fluido

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 2, 2013, 08:58
Default How to control output time of pressureTools functions?
  #1
New Member
 
Join Date: Jul 2013
Posts: 6
Rep Power: 13
Fluido is on a distinguished road
Dear Foamers,

As my first problem posted on this forum was resolved so quickly, I’ll try with another problem I have been struggling with for a while

I would like to calculate the mass flux weighted averaged total pressure on internal faces or on boundaries (outlet for example) of the domain. Only the final value is of interest.

Currently I am using the pressureTools and faceSource functions in the controlDict for this. The value should be calculated at the final step only and be added to the log file. Here is an example (based on the thread http://www.cfd-online.com/Forums/ope...tml#post435131 for example)

Code:
    pressureTools-total
    {
        type        pressureTools;
        functionObjectLibs ("libutilityFunctionObjects.so");
        rhoRef        1.225;
        pRef        0;
        calcTotal   yes;
        calcCoeff   no;
        outputControl outputTime;
    }

    reloadTotalP
      {
          type        readFields;
          functionObjectLibs ("libfieldFunctionObjects.so");
          enabled         yes;
          fields
          (
              "total(p)"
          );
      }
    
    outlet-total-pressure
    {
        type            faceSource;
        functionObjectLibs ("libfieldFunctionObjects.so");
        enabled         true;
        outputControl outputTime;
        log             true;
        valueOutput     false;
        source          patch;
        sourceName      outlet;
        operation       weightedAverage;
        weightField        phi;        
        fields
        (
            "total(p)"
        );
    }

    outlet-pressure
    {
        type            faceSource;
        functionObjectLibs ("libfieldFunctionObjects.so");
        enabled         true;
        outputControl outputTime;
        log             true;
        valueOutput     false;
        source          patch;
        sourceName      outlet;
        operation       weightedAverage;
        weightField        phi;        
        fields
        (
            p
        );
    }
The calculation of the total pressure works fine. Also the total pressure field total(p) is written to the final time directory. And the output of the mass averaged kinetic pressure at the final step works. Just I do not manage to get the values of the mass averaged total pressure at the latest time step only.

I tried different settings of the “global time control” (startFrom, stopAt, writeControl) and of the time control of the pressure functions (outputControl):

When setting

Code:
outputControl outputTime;
in the pressure functions, I get the mass averaged total pressure only at intermediate time steps, but never at the final time step.

When setting

Code:
outputControl timeStep;
in the pressure functions, I get the total pressure at ALL time steps including the final one, regardless of the global input, if the number of global time steps is greater than 1.

For one global time step there is no output.

Here’s an output at the final time step how it should look like

Code:
ExecutionTime = 1.1 s  ClockTime = 2 s
   
  faceSource outlet-total-pressure output:
    weightedAverage(outlet) for total(p) = 61.4176
   
  faceSource outlet-pressure output:
      weightedAverage(outlet) for p = 0
   
  End
And here how it should not look like (empty output)

Code:
ExecutionTime = 0.63 s  ClockTime = 0 s
   
  faceSource outlet-total-pressure output:
   
  faceSource outlet-pressure output:
      weightedAverage(outlet) for p = 0
   
  End
So, my questions are:

Can someone explain this?

Does someone know how to tell OpenFOAM to write the mass averaged total pressure only at the latest time step?

Maybe there is another way to calculate mass averaged total pressure on internal faces and boundaries at the latest time step? Maybe as a post processing tool that can be run after the actual simulation...


Thank you!
- Fluido -
immortality likes this.
Fluido is offline   Reply With Quote

Old   May 19, 2014, 09:49
Default
  #2
New Member
 
Mohammed Ameenuddin
Join Date: Feb 2014
Posts: 15
Rep Power: 12
ameen@cfd is on a distinguished road
Hello Fluido,

Did you find answer for your problem. If yes can you share it.

And when I use the above functions I get total(p) = 0, is this ok

Quote:
faceSource outlet-total-pressure output:
weightedAverage(outlet) for total(p) = 0

faceSource outlet-pressure output:
weightedAverage(outlet) for p = 0
Thank you
ameen@cfd 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
Extrusion with OpenFoam problem No. Iterations 0 Lord Kelvin OpenFOAM Running, Solving & CFD 8 March 28, 2016 12:08
Sudden jump in Courant number NJG OpenFOAM Running, Solving & CFD 7 May 15, 2014 14:52
mixerVesselAMI2D's mass is not balancing sharonyue OpenFOAM Running, Solving & CFD 6 June 10, 2013 10:34
calculation stops after few time steps sivakumar OpenFOAM Running, Solving & CFD 7 March 17, 2013 07:37
error in two way fsi kmgraju CFX 1 May 2, 2011 03:32


All times are GMT -4. The time now is 06:40.