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

[swak4Foam] Warning messages during runtime postprocessing

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 4, 2013, 14:41
Default Warning messages during runtime postprocessing
  #1
New Member
 
caduqued
Join Date: Apr 2009
Location: UK
Posts: 16
Rep Power: 17
caduqued is on a distinguished road
Hi All,

I have setup a simulation with a good set of measures... For this task I am using swak4Foam. The simulation seems to be OK, although I still need to check for coherence of the values. However, something that is baffling me is the good amount of warning messages that are coming out:

Code:
 Expression UMeanAtPlane01LeftBranch : --> FOAM Warning : 
    From function ExpressionResult::getUniformInternal(const label size,bool noWarn)
    in file ExpressionResult/ExpressionResultI.H at line 324
    The minimum value 0.00897812 and the maximum 5.5276 differ. I will use the average 0.409302
 sum=0.409302 average=0.000113822
Expression pAvgAtPlane01LeftBranch : --> FOAM Warning : 
    From function ExpressionResult::getUniformInternal(const label size,bool noWarn)
    in file ExpressionResult/ExpressionResultI.H at line 324
    The minimum value -2.21591e-05 and the maximum 9.08284e-06 differ. I will use the average 1.37541e-07
 sum=0.000494599 average=1.37541e-07
Expression rhoFlowAtPlane01LeftBranch : --> FOAM Warning : 
    From function ExpressionResult::getUniformInternal(const label size,bool noWarn)
    in file ExpressionResult/ExpressionResultI.H at line 324
    The minimum value 0.00897812 and the maximum 5.5276 differ. I will use the average 0.409302
 sum=3.04379 average=0.000846439
What does exactly this mean? Should I correct something within the swakExpressions? Here I am attaching those too (in case a big guru wants to jump in... )
Code:
    createPlane01Parent
    {
        type            createSampledSurface;
        outputControl   timeStep;
        outputInterval  10;
        surfaceName     plane01Parent;
        surface
        {
            type            cuttingPlane;
            planeType       pointAndNormal;
            pointAndNormalDict
            {
                basePoint       (0.00000   8.00000   0.00000);
                normalVector    (0.00000  -1.00000   0.00000);
            };
            interpolate     true;
        };
    }

    UMeanAtPlane01Parent
    {
        type            swakExpression;
        valueType       surface;
        surfaceName     plane01Parent;
        verbose         true;   
        variables       "UmeanPlane01P0{internalField}=mag(U);";//*area()/sum(area());";
        expression      "UmeanPlane01P0*area()/sum(area())"; //
        accumulations   (sum average);
    };
    
    pAvgAtPlane01Parent
    {
        type            swakExpression;
        valueType       surface;
        surfaceName     plane01Parent;
        verbose         true;   
        variables       "pAvg{internalField}=p*vol()/sum(vol());";
        expression      "pAvg";
        accumulations   (sum average);
    };

    rhoFlowAtPlane01Parent
    {
        globalScopes    ("thisSimulation");
        // Function generated to get average of rho in a Plane.
        type            swakExpression;
        valueType       surface;
        surfaceName     plane01Parent;
        verbose         true;
        variables       "UmeanPlane01P0{internalField}=mag(U);";//*area()/sum(area());";
        expression      "rhoDensity*UmeanPlane01P0*area()";
        accumulations   (sum average);
    }
and another set of expressions are given by:


Code:
    createPlane01LeftBranch
    {
        type            createSampledSurface;
        outputControl   timeStep;
        outputInterval  10;
        surfaceName     plane01LeftBranch;
        surface
        {
            type            cuttingPlane;
            planeType       pointAndNormal;
            pointAndNormalDict
            {
                basePoint       (-1.6000  -2.771281  0.00000);
                normalVector    (-0.5000  -0.8660254 0.00000);
            };
            interpolate     true;
        };
    }

    UMeanAtPlane01LeftBranch
    {
        type            swakExpression;
        valueType       surface;
        surfaceName     plane01LeftBranch;
        verbose         true;   
        variables       "UmeanPlane01{cellZone'leftBranch}=mag(U);";//*area()/sum(area());";
        expression      "UmeanPlane01*area()/sum(area())"; //
        accumulations   (sum average);
    };
    
    pAvgAtPlane01LeftBranch
    {
        type            swakExpression;
        valueType       surface;
        surfaceName     plane01LeftBranch;
        verbose         true;   
        variables       "pAvg{cellZone'leftBranch}=p*vol()/sum(vol());";
        expression      "pAvg";
        accumulations   (sum average);
    };

    rhoFlowAtPlane01LeftBranch
    {
        globalScopes    ("thisSimulation");
        // Function generated to get average of rho in a Plane.
        type            swakExpression;
        valueType       surface;
        surfaceName     plane01LeftBranch;
        verbose         true;
        variables       "UmeanPlane01{cellZone'leftBranch}=mag(U);";//*area()/sum(area());";
        expression      "rhoDensity*UmeanPlane01*area()";
        accumulations   (sum average);
    }
Any help or hint is greatly appreciated!!!
caduqued is offline   Reply With Quote

Old   June 4, 2013, 17:44
Default
  #2
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 caduqued View Post
Hi All,

I have setup a simulation with a good set of measures... For this task I am using swak4Foam. The simulation seems to be OK, although I still need to check for coherence of the values. However, something that is baffling me is the good amount of warning messages that are coming out:

Code:
 Expression UMeanAtPlane01LeftBranch : --> FOAM Warning : 
    From function ExpressionResult::getUniformInternal(const label size,bool noWarn)
    in file ExpressionResult/ExpressionResultI.H at line 324
    The minimum value 0.00897812 and the maximum 5.5276 differ. I will use the average 0.409302
 sum=0.409302 average=0.000113822
What does exactly this mean? Should I correct something within the swakExpressions? Here I am attaching those too (in case a big guru wants to jump in... )
Code:
UMeanAtPlane01LeftBranch
    {
        type            swakExpression;
        valueType       surface;
        surfaceName     plane01LeftBranch;
        verbose         true;   
        variables       "UmeanPlane01{cellZone'leftBranch}=mag(U);";//*area()/sum(area());";
        expression      "UmeanPlane01*area()/sum(area())"; //
        accumulations   (sum average);
    };
Any help or hint is greatly appreciated!!!
It took out this one example: what is happening there? You calculate UmeanPlane01 on a cellZone and use it on a surface. Now: what would in your opinion be the proper way to map the values from the cellZone to the surface? (Which is what you'd have to do in that situation) I can't think of any and OpenFOAM doesn't provide such a mapping too. So what swak does it that insists that the expression of remote variable is the same on all cells/faces/points in the remote (for instance because it is a max or a sum) because that is trivially mapped: it's the same constant value on the target. So when it finds that this is not the case (because min!=max) instead of aborting the run or (and that would be worse) silently doing something with the values it calculates the average (in your case of mag(U) ) and uses that as UmeanPlane01 ... but it prints out this warning.

The only exception from this are mapped patches if their "partner" patch is used as a remote because OpenFOAM provides a mapping there.

I'm not quite sure what you're trying to do with this functionObject so I can't give you a recommendation how to fix it
__________________
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

Old   June 4, 2013, 19:24
Default
  #3
New Member
 
caduqued
Join Date: Apr 2009
Location: UK
Posts: 16
Rep Power: 17
caduqued is on a distinguished road
Quote:
Originally Posted by gschaider View Post
It took out this one example: what is happening there? You calculate UmeanPlane01 on a cellZone and use it on a surface. Now: what would in your opinion be the proper way to map the values from the cellZone to the surface? (Which is what you'd have to do in that situation) I can't think of any and OpenFOAM doesn't provide such a mapping too. So what swak does it that insists that the expression of remote variable is the same on all cells/faces/points in the remote (for instance because it is a max or a sum) because that is trivially mapped: it's the same constant value on the target. So when it finds that this is not the case (because min!=max) instead of aborting the run or (and that would be worse) silently doing something with the values it calculates the average (in your case of mag(U) ) and uses that as UmeanPlane01 ... but it prints out this warning.

The only exception from this are mapped patches if their "partner" patch is used as a remote because OpenFOAM provides a mapping there.

I'm not quite sure what you're trying to do with this functionObject so I can't give you a recommendation how to fix it

Hi Bernhard,

Thanks for your fast reply and explanation. I am not really an expert in swak4Foam, just a big fan, so maybe a lot of "not-really-well-designed" expressions are already contained in this simple example (I am pretty sure my full set of swak expressions already look like a Frankestein case!!).

Well, what I am trying to do is relatively simple. I just want to extract average pressure and mean velocity (besides some other measures) at some specific points/planes. The problem is that the domain is composed by a set of ducts, not parallel each other. In this case, any plane defined to sample points, within any of the ducts, will intersect sections of the other ducts. Here I am assuming that, then, these averages (or any other measure) will be "contaminated" with (i.e. will take into account) values extracted from other parts of the domain being intersected by the given plane, but that do not correspond to the specific duct I need to analyze. Another small complication is that the planes are not necessarily aligned with any major direction.

In any case, I also have a "back-up" measure: using the probes functionality, but I would really like to have a compact form, as usually provided by swak4Foam. I really would like to have the data almost ready, instead of "postProcessing the postProcessed" data.

Regards,
caduqued is offline   Reply With Quote

Old   June 5, 2013, 16:58
Default
  #4
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 caduqued View Post

Hi Bernhard,

Thanks for your fast reply and explanation. I am not really an expert in swak4Foam, just a big fan, so maybe a lot of "not-really-well-designed" expressions are already contained in this simple example (I am pretty sure my full set of swak expressions already look like a Frankestein case!!).

Well, what I am trying to do is relatively simple. I just want to extract average pressure and mean velocity (besides some other measures) at some specific points/planes. The problem is that the domain is composed by a set of ducts, not parallel each other. In this case, any plane defined to sample points, within any of the ducts, will intersect sections of the other ducts. Here I am assuming that, then, these averages (or any other measure) will be "contaminated" with (i.e. will take into account) values extracted from other parts of the domain being intersected by the given plane, but that do not correspond to the specific duct I need to analyze. Another small complication is that the planes are not necessarily aligned with any major direction.

In any case, I also have a "back-up" measure: using the probes functionality, but I would really like to have a compact form, as usually provided by swak4Foam. I really would like to have the data almost ready, instead of "postProcessing the postProcessed" data.

Regards,
OK. I think you get it. You only want the part of the surface that lies inside the cellZone leftBranch. You can do that with an indicator field that is only 1 in the cellZone (note that there may be required parameters missing or typos ... I'm doing this off the top of my head)
Code:
leftBranchIndicator {
    type expressionField;
    fieldName isLeftBranch;
    expression "zone(leftBranch) ? 1 : 0";
}
then using that indicator field via autoInterpolate you calculate the weighted average
Code:
UMeanAtPlane01LeftBranch
    {
        type            swakExpression;
        valueType       surface;
        surfaceName     plane01LeftBranch;
        verbose         true;   
        variables  (
             "leftArea=sum(isLeftBranch*area());
        );
        expression      "mag(U)*isLeftBranch*area()/leftArea;";
        autoInterpolate true;
        accumulations   (sum);
    };
Of course this is computationally more expensive than having a proper surface (the indicator field has to be computed ... although there are ways to do this only in the beginning... and you sum up 0 on the unneeded parts of the surface).
__________________
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

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
foamToTecplot360 thomasduerr OpenFOAM Post-Processing 121 June 11, 2021 10:05
[swak4Foam] installation problem with version 0.2.3 Claudio87 OpenFOAM Community Contributions 9 May 8, 2013 10:20
latest OpenFOAM-1.6.x from git failed to compile phsieh2005 OpenFOAM Bugs 25 February 9, 2010 04:37
Version 15 on Mac OS X gschaider OpenFOAM Installation 113 December 2, 2009 10:23
[blockMesh] Axisymmetrical mesh Rasmus Gjesing (Gjesing) OpenFOAM Meshing & Mesh Conversion 10 April 2, 2007 14:00


All times are GMT -4. The time now is 23:45.