WebGPU spectral transform shallow water model.
The goal:
In order to allow people to play with shallow water models
and examine their dynamics, I'm going to implement
a gpu-parallelized spectral transform shallow water model.
If scalability is feasible, I will extend this to a full
eulerian spectral transform solver for the hydrostatic
primitive equations (HPE).
The paper:
I'll be following the details of Hack and Jakob, 92
Provisionally this paper
which indicates that we really should just use webGPU for this project.
The equation sets:
The simpler continuous equation set for vorticity/divergence formulation
∂tζ | =−∇⋅(ζ+f)v |
∂tδ | =k⋅(∇×(ζ+f)v)−∇2(Φ+2v⋅v) |
∂tΦ | =−∇⋅(Φv)−Φδ |
note that this assumes no baseline topography for the moment, and the equations are inviscid.
Rewriting the equations
Make the following definitions:
μ | =sinφ |
U | =ucosφ |
V | =vcosφ |
η | ≡ζ+f=a(1−μ2)1∂λV−a1∂μU+f |
δ | =a(1−μ2)1∂λU+a1∂μV |
Then we get the following set of continuous equations:
∂tη | =−a(1−μ2)1∂λ[Uη]−a1∂μ[Vη] |
∂tδ | =a(1−μ2)1∂λ[Vη]−a1∂μ[Uη]−∇2(Φ+2U2+V2) |
∂tΦ | =−a(1−μ2)1∂λ[UΦ]−a1∂μ[VΦ]−Φδ |
Extracting velocity components:
Use helmholz theorem to decompose:
v=k×∇ψ+∇χ.
Rearranging this and substituting the above definitions gives that
η=∇2Ψ+f
and
δ=∇2χ
where we finally find
U=a1∂λχ−a(1−μ2)∂μψ
and
V=a1∂λψ+a(1−μ2)∂μχ.
Discretizing:
Any scalar quantity ξ(λ,φ)
will be represented by
ξ(λ,φ)=m=−M∑Mn=∣m∣∑Nξn,mPn,m(μ)eimλ