jejjohnson / jejjohnson/spectraldiffx

Barotropic Quasi-Geostrophic Turbulence (Flat Plane)

Open
#10 1 comment 0 reactions 1 assignee Claimed by @jejjohnson View on GitHub
Dominant language
Python
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Description

### Formulation
2D barotropic QG turbulence for spectral benchmarking.

#### Governing Equation:
$$
\partial_t q + \mathbf{u} \cdot \nabla q = \nu \nabla^{2n} q - \mu q
$$
where $q = \nabla^2 \psi$ (vorticity streamfunction), $\mathbf{u} = (-\partial_y \psi, \partial_x \psi)$,
$\nu$ = (hyper)viscosity, $\mu$ = drag, $n$ = hyperviscosity order.

#### Forcing/Initial Condition:
- McWilliams (1984) spectrum random vorticity or deterministic vortex dipole

#### Starter code snippet
```python
# Grid setup
Nx, Ny = 256, 256
Lx, Ly = 2 * math.pi, 2 * math.pi
grid = FourierGrid2D.from_N_L(Nx=Nx, Ny=Ny, Lx=Lx, Ly=Ly, dealias="2/3")

# Initialize q or psi
q = ...
psi = ...

# Compute u from psi
u = -dpsi_dy
v = dpsi_dx

# Timestep with spectraldiffx operators
for t in timeline:
# Compute q tendency and update
dqdt = -advect(q, u, v) + viscosity_terms
```

#### Dependencies
- Core exists; extend demos as needed.

#### Reference: McWilliams J. Fluid Mech. 1984.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.