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

How to calculate a zone Average

Register Blogs Community New Posts Updated Threads Search

Like Tree13Likes

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   November 14, 2012, 17:41
Default
  #21
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by aerogt3 View Post
I just download swak4foam, and right now I just want to get the average pressure and total mass flow rate at my velocity inlet, to compare with hand calcs and make sure I am using it correctly. To sum these, I am doing the following:

Code:
            mdot_inlet
            {
              type swakExpression;                                    
              valueType patch                                    
              patchName inlet      
              expression "phi*flip()";                                 
              accumulations
                (
                  sum                                                            
                );
              verbose true;
            }

            p_inlet
            {
              type swakExpression;                                    
              valueType patch;                                    
              patchName inlet      
              expression "p";                                 
              accumulations
                (
                  average                                                            
                );
              verbose true;
            }
I get the following error for averaging p, and I get the same error when performing the operation on faceZones.

[44] [24]
--> FOAM FATAL ERROR:
[42] --> FOAM FATAL ERROR: Could not find a field name "p" of type scalar (neither surfaceScalarField nor volScalarField) Autointerpolate: 0
[16]

And this one for mass flow rate. When I do mass flow rate calcs on faceZones, it works.

[42]
[42] --> FOAM FATAL ERROR:
[42] Parser Error at "1.5-8" :"field flip not existing or of wrong type"
"phi*flip()"
" ^^^^ "


Any ideas? As best I can tell, I am following your syntax correctly, no?
Average pressure should work ... if there is a field p. Which solver are you using

About flip(): you only need that on faceSets and faceZones. On patches the orientation of the faces is defined (all looking "in") and therefor flip() is not implemented for patches
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

 

Tags
openfoam 1.7.1, patchaverage, porous modellling, sampledict


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
How to calculate a time average spwater OpenFOAM 2 February 24, 2010 08:04
Problem in IMPORT of ICEM input file in FLUENT csvirume FLUENT 2 September 9, 2009 01:08
calculate the average velocity of particles robert FLUENT 0 August 1, 2008 09:44
Error to re-open fluent case file J.Gimbun FLUENT 0 April 27, 2006 08:42
Sliding mesh error Karl Kevala FLUENT 4 February 21, 2001 15:52


All times are GMT -4. The time now is 05:41.