# GfsSpatialSum

Revision as of 09:00, 12 November 2010; view current revision
←Older revision | Newer revision→
Jump to: navigation, search

GfsSpatialSum defines a new GfsConstant containing the spatial sum (spatial integral) of a GfsFunction.

The syntax in parameter files is

```[ GfsConstant ] [ GfsFunction ]
```

For example, the following computes the spatial sum of Variable U at every time step, placing the result in a Constant Ubar

``` SpatialSum { istep = 1 } Ubar U
```

### Examples

• Forced isotropic turbulence in a triply-periodic box
• ```  SpatialSum { istep = 1 } SU U
```

```  SpatialSum { istep = 1 } SV V
```

```  SpatialSum { istep = 1 } SW W
```

```  SpatialSum { istep = 1 } Un Velocity
```

```  SpatialSum { istep = 1 } Dissipation {
return MU*(dx("U")*dx("U") + dy("U")*dy("U") + dz("U")*dz("U") +
dx("V")*dx("V") + dy("V")*dy("V") + dz("V")*dz("V") +
dx("W")*dx("W") + dy("W")*dy("W") + dz("W")*dz("W"));
}
```

```  SpatialSum { istep = 1 } FluctKinEn {
return 0.5*((U - Ubar)*(U - Ubar) +
(V - Vbar)*(V - Vbar) +
(W - Wbar)*(W - Wbar));
}
```