jejjohnson / jejjohnson/spectraldiffx
Shallow Water Equations on a Sphere (SWE Sphere)
- Dominant language
- Python
- Stars
- 1
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
### Formulation
Implement the canonical shallow water equations (SWE) on a rotating sphere geometry using spectral methods.
#### Governing Equations (Williamson et al., 1992):
$$
\begin{align*}
\frac{\partial \mathbf{u}}{\partial t} + (\mathbf{u}\cdot\nabla)\mathbf{u} + f\mathbf{k}\times\mathbf{u} + g\nabla h = 0 \\
\frac{\partial h}{\partial t} + \nabla \cdot (h \mathbf{u}) = 0
\end{align*}
$$
where \(\mathbf{u}\) is the horizontal velocity, \(h\) is fluid depth, \(f\) is Coriolis parameter, \(g\) gravity.
#### Forcing/Initial Condition:
- Typical test cases are force-free, but wind/stochastic/topographic or prescribed vorticity forcing may be added for demos.
#### Starter code snippet
```python
# Spherical grid setup (schematic)
grid = SphericalGrid2D(lat_points, lon_points, radius=R_earth)
# State variables
h = ... # depth field
u = ... # zonal velocity
v = ... # meridional velocity
# Time integration loop
for t in timesteps:
# Compute tendencies using spectraldiffx spherical operators
dhdt = -div(h * (u, v))
dudt, dvdt = ... # based on momentum eq
# Update step (Euler, Runge-Kutta, etc)
```
#### Dependencies
- [nlocked by] PR: Spherical grid & associated operators (if not implemented)
#### Reference: Williamson et al. J. Comput. Phys. 1992.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.