CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

Incorrect results of SWAK4FOAM function objects if Parallelisation involved

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   December 17, 2015, 10:57
Default Incorrect results of SWAK4FOAM function objects if Parallelisation involved
  #1
New Member
 
Join Date: Aug 2014
Location: Hamburg, Germany
Posts: 4
Rep Power: 4
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(...). (on the run flow-rate evaluation on a cluster)
But afaik gSum(...) is not available for SWAK4FOAM.

I would be glad for any suggestions and workarounds.
wstapel is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
InterDyMFoam+simpleFunctionObject Elham OpenFOAM Running, Solving & CFD 0 October 1, 2015 00:28
swak4foam fails in parallel with -otherTime? Phicau OpenFOAM Post-Processing 3 June 26, 2013 13:00
mesh airfoil NACA0012 anand_30 OpenFOAM Meshing & Mesh Conversion 12 December 12, 2011 05:16
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 11:56.