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

[swak4Foam] single scalar variable in swak function working on cellSet

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 30, 2016, 09:06
Default single scalar variable in swak function working on cellSet
  #1
New Member
 
Duncan Roy van der Heul
Join Date: May 2010
Posts: 26
Rep Power: 15
Duncan_vdH is on a distinguished road
In my swak function object I want to set the value of a global variable to the sum of
the values of a variable defined in a cellSet.

The global value has fieldSize 1, but the storedVariables one and two have fieldSize
4000, equal to the number of cells in the set. How do I get a storedVariable of
fieldSize 1 equal to the average value over the cellSet? The syntax is not clear to me.

average(one) is again a variable with fieldSize 4000.


Code:
myFunction {
        globalScopes (  
          my_globalvariables      
    );
        type calculateGlobalVariables;
        outputControl timeStep;
        outputInterval 1;
    noReset  true;
        valueType cellSet;
        setName my_set;
        storedVariables (
            {
                name one;     
                initialValue "0";
            }
            {   name two; 
            initialValue "0";
            }
          
    my_global_var=sum(one);
        );
Duncan_vdH 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
problem during mpi in server: expected Scalar, found on line 0 the word 'nan' muth OpenFOAM Running, Solving & CFD 3 August 27, 2018 04:18
using a Fortran library of thermodynamics inside sutherland transport model Mehdi3031 OpenFOAM Programming & Development 0 April 7, 2016 09:34
[swak4Foam] installation problem with version 0.2.3 Claudio87 OpenFOAM Community Contributions 9 May 8, 2013 10:20
[blockMesh] error message with modeling a cube with a hold at the center hsingtzu OpenFOAM Meshing & Mesh Conversion 2 March 14, 2012 09:56


All times are GMT -4. The time now is 03:32.