This module solves two-dimensional incompressible turbulence. The flow is given
through a streamfunction
where
The equation is time-stepped forward in Fourier space:
In doing so the Jacobian is computed in the conservative form:
Thus:
Params
For the unforced case (Params
and it includes:
-
ν
: Float; viscosity or hyperviscosity coefficient. -
nν
: Integer$>0$; the order of viscosity$n_\nu$ . Case$n_\nu=1$ gives normal viscosity. -
μ
: Float; bottom drag or hypoviscosity coefficient. -
nμ
: Integer$\ge 0$; the order of hypodrag$n_\mu$ . Case$n_\mu=0$ gives plain linear drag$\mu$ .
For the forced case (ForcedParams
. It includes all parameters in Params
and additionally:
-
calcF!
: Function that calculates the forcing$\widehat{f}$
Vars
For the unforced case (Vars
and it includes:
-
zeta
: Array of Floats; relative vorticity. -
u
: Array of Floats;$x$ -velocity,$u$ . -
v
: Array of Floats;$y$ -velocity,$\upsilon$ . -
sol
: Array of Complex; the solution,$\widehat{\zeta}$ . -
zetah
: Array of Complex; the Fourier transform$\widehat{\zeta}$ . -
uh
: Array of Complex; the Fourier transform$\widehat{u}$ . -
vh
: Array of Complex; the Fourier transform$\widehat{\upsilon}$ .
For the forced case (ForcedVars
. It includes all variables in Vars
and additionally:
-
Fh
: Array of Complex; the Fourier transform$\widehat{f}$ . -
prevsol
: Array of Complex; the values of the solutionsol
at the previous time-step (useful for calculating the work done by the forcing).
calcN!
function
The nonlinear term
-
calcN_advection!
: computes$- \widehat{\mathsf{J}(\psi, \zeta)}$ and stores it in arrayN
. -
calcN_forced!
: computes$- \widehat{\mathsf{J}(\psi, \zeta)}$ viacalcN_advection!
and then adds to it the forcing$\widehat{f}$ computed viacalcF!
function. Also saves the solution$\widehat{\zeta}$ of the previous time-step in arrayprevsol
. -
updatevars!
: usessol
to compute$\zeta$ ,$u$ ,$\upsilon$ ,$\widehat{u}$ , and$\widehat{\upsilon}$ and stores them into corresponding arrays ofVars
/ForcedVars
.
-
examples/twodnavierstokes_decaying.jl
: A script that simulates decaying two-dimensional turbulence reproducing the results of the paper byMcWilliams, J. C. (1984). The emergence of isolated coherent vortices in turbulent flow. J. Fluid Mech., 146, 21-43.
-
examples/twodnavierstokes_stochasticforcing.jl
: A script that simulates forced-dissipative two-dimensional turbulence with isotropic temporally delta-correlated stochastic forcing.