CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Community Contributions (https://www.cfd-online.com/Forums/openfoam-community-contributions/)
-   -   [swak4Foam] groovyBC variable parallel reduce? (https://www.cfd-online.com/Forums/openfoam-community-contributions/115730-groovybc-variable-parallel-reduce.html)

startingWithCFD April 5, 2013 10:19

groovyBC variable parallel reduce?
 
Hello there!

I would like to impose a boundary condition based on the amount of mass which is inside my domain, as follows

Code:

        type            groovyBC;
        ...
        variables
        (
            ...
            "Mass{cellSet'allCells}=sum(rho*vol());"
            ...
        );
        valueExpression "bananas*Mass";

The problem is that when the problem is decomposed, Mass contains the value corresponding to the current processor domain. Is there a way to force a parallel reduce operation?

gschaider April 5, 2013 13:52

Quote:

Originally Posted by startingWithCFD (Post 418570)
Hello there!

I would like to impose a boundary condition based on the amount of mass which is inside my domain, as follows

Code:

        type            groovyBC;
        ...
        variables
        (
            ...
            "Mass{cellSet'allCells}=sum(rho*vol());"
            ...
        );
        valueExpression "bananas*Mass";

The problem is that when the problem is decomposed, Mass contains the value corresponding to the current processor domain. Is there a way to force a parallel reduce operation?

The question is "is there a way to force swak to NOT do a parallel reduce?". To which I would have to say "No".

Seriously: functions like sum, max, min AUTOMATICALLY reduce over all processors (if you find instances where this isn't the case: report a bug). In my mind this is the only behaviour that makes sense for this application

startingWithCFD April 8, 2013 03:36

Great, thanks for the answer :-)
I guess I reached a conclusion too fast!


All times are GMT -4. The time now is 18:15.