Notes Shallow water equations
! To recap, using eta for depth=h+H: D! = "!# $ u Dt Du = "g#h Dt ! We!re currently working on the advection (material derivative) part
cs533d-term1-2005 1 cs533d-term1-2005 2
Advection Exploiting Lagrangian view
! Let!s discretize just the material derivative ! We want to stick an Eulerian grid for now, (advection equation): but somehow exploit the fact that Dq q + u! "q = 0 or = 0 • If we know q at some point x at time t, we just t Dt follow a particle through the flow starting at x ! For a Lagrangian scheme this is trivial: just to see where that value of q ends up move the particle that stores q, don!t change the value of q at all q(x(t + !t),t + !t) = q(x(t),t) q(x(t),t) = q(x0,0) dx = u(x), x(t) = x0 dt
cs533d-term1-2005 3 cs533d-term1-2005 4 Looking backwards Semi-Lagrangian method
! Problem with tracing particles - we want values at grid ! Developed in weather prediction, going back to nodes at the end of the step the 50!s • Particles could end up anywhere ! Also dubbed “stable fluids” in graphics ! But… we can look backwards in time (reinvention by Stam #99) q = q x(t ! "t),t ! "t ijk ( ) ! To find new value of q at a grid point, trace dx particle backwards from grid point (with velocity = u(x), x(t) = xijk dt u) for -"t and interpolate from old values of q ! Same formulas as before - but new interpretation ! Two questions • To get value of q at a grid point, follow a particle backwards • How do we trace? through flow to wherever it started • How do we interpolate?
cs533d-term1-2005 5 cs533d-term1-2005 6
Tracing Tracing: 1st order
! The errors we make in tracing backwards ! We!re at grid node (i,j,k) at position xijk aren!t too big a deal ! Trace backwards through flow for -"t • We don!t compound them - stability isn!t an x = x ! "t u issue old ijk ijk • How accurate we are in tracing doesn!t effect • Note - using u value at grid point (what we know shape of q much, just location already) like Forward Euler. ! Whether we get too much blurring, oscillations, or ! Then can get new q value (with interpolation) a nice result is really up to interpolation n +1 n ! Thus look at “Forward” Euler and RK2 qijk = q (xold ) n = q (xijk ! "tuijk )
cs533d-term1-2005 7 cs533d-term1-2005 8