dhruvbhagtani / toy-model

This is a hybrid model of the global ocean with simplified governing equations to understand large scale circulations.
4 stars 0 forks source link

Mixture of primitive and conservative variables #1

Open navidcy opened 3 years ago

navidcy commented 3 years ago

Rotating 1D shallow-water inviscid dynamics over a flat bottom are:

∂u/∂t + u ∂u/∂x - f v  = - g ∂h/∂x
∂v/∂t + u ∂v/∂x + f u  = 0
∂h/∂t + ∂(u h)/∂x  = 0

We can rewrite the above in conservative form using variables U = u*h and V = v*h as:

∂U/∂t + ∂(U²/h)/∂x - f V  = - 1/2 g ∂(h²)/∂x
∂V/∂t + ∂(UV/h)/∂x + f U  = 0
∂h/∂t + ∂U/∂x  = 0

In this way, the variables are u, v, h if we are using the primitive-variable formulation (top) or U, V, h if we are using conservative variable (bottom).

At the moment, in the 1D Notebook it seems that the equations solve for some mixture of variables u, v, h, U, V? Or the notebook claims to be using conservative formulation but actually uses primitive? I'm a bit confused.

cc @AndyHoggANU

AndyHoggANU commented 3 years ago

Agree - it is cleaner to try this with Navid's version of these equations.

As an aside -- it is great having these notebooks so we can look at this material and discuss.

dhruvbhagtani commented 3 years ago

These will be my next equations to solve @navidcy. Let's see how it goes!

navidcy commented 3 years ago

These will be my next equations to solve @navidcy. Let's see how it goes!

No!!! These are complicated! Let’s solve the advection diffusion equation first.

(The hardest thing ends up being to be able to hold you slow @dhruvbhagtani2105 :).)

navidcy commented 3 years ago

The only reason I'm resisting is that I don't know of any simple analytical solutions of the rotating shallow water. And then how can we compare to get an idea of how good our schemes/algorithms are.

Also, shallow water equations admit shock solutions (solutions with discontinuities), which makes it even more difficult.

A good way forward is to develop some intuition with the advection-diffusion equation. Then try to solve the linearised shallow water equations (linearized, e.g., about some depth H). The linearized SW should admit gravity wave solutions with a known dispersion relation. We can try to see if we can get those right. Then add Coriolis and see if we get the waves that correspond to nonzero f. Then add nonlinearity...

Then repeat all steps from the beginning but now for 2D.

How's that for a plan @dhruvbhagtani2105 and @AndyHoggANU?

dhruvbhagtani commented 3 years ago

@navidcy this sounds good to me.