## ZonalFlow.jl

Simulating zonal flows on the β-plane.
Author gvn22
Popularity
4 Stars
Updated Last
2 Years Ago
Started In
October 2020

## ZonalFlow

`ZonalFlow` is a spectral solver for Direct Numerical Simulation (DNS) and Direct Statistical Simulation (DSS) of the barotropic vorticity equation on the beta-plane.

DNS can be performed for the following equations:

• NL: original (fully non-linear) master equations
• QL: quasilinear equations
• GQL: generalised quasilinear equations

DSS can be performed making use of the following equations:

• CE2: cumulant expansions at second order
• GCE2: generalised cumulant expansions at second order

`ZonalFlow` uses time integrators from the OrdinaryDiffEq.jl and StochasticDiffEq.jl packages. Choice of unity-rank or full-rank initialisation is provided, and the following types of problems (corresponding to different driving mechanisms) can be solved:

• Deterministic pointjet [1]
• Two-scale Kolmogorov flow [2]
• Stochastic narrow-band forcing [3]

Simulation data is saved as `.jld2` files and the post-processed output is saved in `.npz` files (sample `Python` post-processing files are located in the examples directory).

### Installation

Add `ZonalFlow` using the `Julia` package manager as:

```julia> using Pkg

### Examples

Example scripts are located in the examples directory. A fully-nonlinear solution of stochastically-driven jets can be obtained by the following code:

``````using Logging: global_logger
using TerminalLoggers: TerminalLogger
global_logger(TerminalLogger())

using ZonalFlow

tspan   = (0.0,1000.0);
tsargs  = (
dt=0.001,
progress=true,
progress_steps=100000,
save_everystep=false,
saveat=100,
save_noise=false
);

domain  = Domain(extent=(2π,2π),res=(16,16));
coeffs  = Coefficients(Ω=5.0,θ=0.0,μ=0.01,ν=0.0,ν₄=1.0);
forcing = Stochastic(kf=10,dk=4,ε=0.01);
prob    = BetaPlane(domain,coeffs,forcing);
eq      = NL()

sol = integrate(prob,eq,tspan;tsargs...);
write(prob,eq,sol,dn="data/",fn="jets_nl")
``````

### References

[1] Marston et al. (2008) Journal of Atmospheric Sciences
[2] Tobias and Marston (2017) Physics of Fluids
[3] Constantinou et al. (2016) Journal of Atmospheric Sciences