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

[swak4Foam] Incorrect results of SWAK4FOAM function objects if Parallelisation involved

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 17, 2015, 09:57
Default Incorrect results of SWAK4FOAM function objects if Parallelisation involved
  #1
New Member
 
Join Date: Aug 2014
Location: Bremen, Germany
Posts: 5
Rep Power: 11
wstapel is on a distinguished road
Dear Foamers,

I have a flow simulation where groovyBC and several function objects of SWAK4FOAM are utilised. The simulation is an internal flow which consists of a single inlet and some kind of a pipe system with many outlets. These "outlets" are actually predefined faceZones in the internal mesh.

The main idea for the simulation is that the inlet pressure boundary condition is dependent on the total mass output of the system. Hence what the function objects do is to track the flowrate of each outlet at every time step and accumulate it in a global variable called extAgntVol. extAgentVol is handed over to the groovyBC to correct the pressure.

I have added most of the code but not all because it repeads a lot.

Boundary condition

Code:
    INLET    {
        type            groovyBC;
        refValue        uniform 6887.42;
             value           uniform 6887.417;
        valueExpression "p0*(pow((V0/Vneu),kappa))";
             evaluateDuringConstruction 0;
        variables       
        4
        (
            "p0=6887.42;"
            "V0=0.00274;"
            "Vneu=V0+extAgntVol;"
            "kappa=1.4;"
        );
            timelines       ();
            lookuptables    ();
            globalScopes    1(extAgntControl);
    }
Function objects:

Code:
functions
{

// Definition of global varibles

    defineFlowrate {
        type addGlobalVariable;
        // outputControl none;
        // outputInterval 0;
        
        isSingleValue 1;
        noReset 0;
    
        globalScope extAgntControl;
        globalVariables {

            fr_up_SLOT01 {
                valueType scalar;
                value 0.0;
            }     

            fr_up_SLOT02 {
                valueType scalar;
                value 0.0;
            } 
            
            ... and many other variables

           extAgntVol {
                valueType scalar;
                value 0.0;
            }

        }
    }          

   // Calculate Flowrate

    calculateFlowrate_for_upper_SLOT01 {
        type calculateGlobalVariables;
        valueType faceZone;
        zoneName int_INT_OUTLET_INNENRING_SLOT-01;
        isSingleValue 1;
        noReset 0;    

    
        toGlobalNamespace extAgntControl;
        globalScopes (
            extAgntControl
        );
        toGlobalVariables (
            fr_up_SLOT01
        );
        variables (
            "fr_up_SLOT01= (-1.0)*sum(phi);"
        );
    }

    ... and for many other outlets

   // sum everything up

        calculateVolume {
        type calculateGlobalVariables;
        valueType faceZone;
        zoneName int_INT_NORMALISER_A;
        isSingleValue 1;
        noReset 0;    

    
        toGlobalNamespace extAgntControl;
        globalScopes (
            extAgntControl
        );
        toGlobalVariables (
            fr_up_SLOT01
        );
        
        ...

             variables (
            "extAgntVol= extAgntVol+(fr_up_SLOT01+fr_up_SLOT02+...+fr_SLOT20)*deltaT();"
        );
    }

If the simulation is performed on a single processor everything works fine. However as soon as it is runs in parallel the tracked flowrates are false (they are always too little). I kind of had the same problem when I wrote the code for the flowrate accumulation directly into the solver. There it was solved by replacing sum(...) with gSum(...). (http://www.cfd-online.com/Forums/ope...n-cluster.html)
But afaik gSum(...) is not available for SWAK4FOAM.

I would be glad for any suggestions and workarounds.
wstapel 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
[Other] mesh airfoil NACA0012 anand_30 OpenFOAM Meshing & Mesh Conversion 13 March 7, 2022 17:22
[Other] refineWallLayer Error Yuby OpenFOAM Meshing & Mesh Conversion 2 November 11, 2021 11:04
using METIS functions in fortran dokeun Main CFD Forum 7 January 29, 2013 04:06
channelFoam for a 3D pipe AlmostSurelyRob OpenFOAM 3 June 24, 2011 13:06
LES of highly heated pipe flow - incorrect results MichalH FLUENT 3 June 3, 2009 05:00


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