# GfsVariableStreamFunction

### From Gerris

Revision as of 14:45, 2 November 2009; view current revision

←Older revision | Newer revision→

←Older revision | Newer revision→

GfsVariableStreamFunction is used to maintain a consistent (i.e. discretely non-divergent) velocity field defined by its streamfunction. Both the cell-centered and face-centered (i.e. MAC) velocity fields are maintained.

Note that this object can only be used for 2D simulations.

The syntax in parameter files is

[ GfsVariableFunction ]

### Examples

VariableStreamFunction Psi -4.*(x*x + y*y)

`
`

`
`

VariableStreamFunction { # make sure that the entire field is reinitialised at t = 2.5 step = 2.5 } Psi (t < 2.5 ? 1. : -1.)*sin((x + 0.5)*M_PI)*sin((y + 0.5)*M_PI)/M_PI

`
`

`
`

VariableStreamFunction { step = 2.5 } Psi (t < 2.5 ? 1. : -1.)*sin((x + 0.5)*M_PI)*sin((y + 0.5)*M_PI)/M_PI

`
`

`
`

VariableStreamFunction { # make sure that the entire field is reinitialised at t = 2.5 step = 2.5 } Psi (t < 2.5 ? 1. : -1.)*sin((x + 0.5)*M_PI)*sin((y + 0.5)*M_PI)/M_PI

`
`

`
`

VariableStreamFunction { istep = 1 } Psi1 Psi

`
`

`
`

VariableStreamFunction Psi -U0*(sin (y*DTR)*cos (DTR*ALPHA) - cos (x*DTR)*cos (y*DTR)*sin (DTR*ALPHA))

`
`