|
[Sponsors] |
[swak4Foam] single scalar variable in swak function working on cellSet |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 30, 2016, 09:06 |
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 |
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); ); |
|
|
|
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 |