Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
The Riemann problem shallow water wave systems Donna Calhoun Boise State University PASI 2013 Valparaiso, Chile January 2-13 Thursday, January 10, 13 Plan Part I : Discussion of the Riemann solution for onedimensional linear and nonlinear shallow water wave equations Part II : Approximate Riemann solvers in GeoClaw; discussion of accuracy, and extensions to higher dimensions; f-wave approach to well-balancing. Part III : Adaptive mesh refinement (AMR). PASI : Tsunami Workshop Jan 2-14 2013 Thursday, January 10, 13 Shallow water wave equations The shallow water wave equations, given by is an example of a system of equations written in conservative form. More generally, we can write PDEs in conservative form as qt + f (q)x = 0 These are typically derived from conservation laws for mass, momentum, energy, species, and so on. PASI : Tsunami Workshop Jan 2-14 2013 Thursday, January 10, 13 GeoClaw • Based on solving the conservative form of the shallow water wave equations using a finite volume method. • At the heart of many finite volume methods is a Riemann solver which is used to compute numerical fluxes. • In GeoClaw, these are stored in files like rpn2_geo.f and rpt2_geo.f PASI : Tsunami Workshop Jan 2-14 2013 Thursday, January 10, 13 Finite volume method Assume a conservation law of the form qt + f (q)x = 0 Define cell averages over the interval Ci = [xi Qni 1 = x 1/2 , xi+1/2 ] q(x, tn ) dx Ci How does the average evolve? d dt d q(x, t) dx = f (q(x, t)) dx Ci Ci dx = f (q(xi 1/2 , t)) f (q(xi+1/2 , t)) PASI : Tsunami Workshop Jan 2-14 2013 Thursday, January 10, 13 Finite volume method Evolution of the cell average value : d dt Z q(x, t) dx = f (q(xi 1/2 , t)) f (q(xi+1/2 , t)) Ci Integrate in time ⇤ q(x, tn+1 ) dx = Ci + ⇤ q(x, tn ) dx Ci ⇤ tn+1 tn f (q(xi 1/2 , t)) ⇥ f (q(xi+1/2 , t)) dt PASI : Tsunami Workshop Jan 2-14 2013 Thursday, January 10, 13 Finite volume method Using numerical fluxes, we use the update formula : n+1 Qi = n Qi t n Fi+1/2 x n Fi 1/2 ⇥ Written as this form resembles the conservation law : PASI : Tsunami Workshop Jan 2-14 2013 Thursday, January 10, 13 Numerical fluxes We want to approximate the numerical flux. Z tn+1 1 n Fi 1/2 ⇡ f (q(xi 1/2 , t)) dt t tn For an explicit time stepping scheme, we try to find formulas for the flux of the form n Fi 1/2 Qi 2 Qi n n F(Qi , Qi 1 ) = 1 Qi xi Qi+1 1/2 PASI : Tsunami Workshop Jan 2-14 2013 Thursday, January 10, 13 1d Riemann problem At each cell interface, solve the hyperbolic problem with special initial data, i.e. qt + f (q)x = 0 subject to q(x, 0) = ⇢ Qi Qi Qi 1 x < xi x > xx 1/2 1/2 1 t=0 Qi xi 1/2 PASI : Tsunami Workshop Jan 2-14 2013 Thursday, January 10, 13 1d Riemann problem Qi t=0 1 Qi xi t>0 Qi 1/2 q⇤ Solve the conservation law with piecewise constant initial data 1 Qi xi 1/2 PASI : Tsunami Workshop Jan 2-14 2013 Thursday, January 10, 13 1d Riemann problem q t>0 Qi ⇤ 1 Qi xi 1/2 Numerical flux at cell interface is then approximated by Fi 1/2 = f (q ) ⇤ This is the classical Godunov approach for solving hyperbolic conservation laws. • Resolves shocks and rarefactions PASI : Tsunami Workshop Jan 2-14 2013 Thursday, January 10, 13 Conservation? Integrating over entire domain, we have d dt Z Z xb q(x, t) dx = xa xb (f (q))x dx = f (q(xa , t)) f (q(xb , t)) xa Discrete case M X Qn+1 i = i=1 M X Qni i=1 = M X i=1 Qni M X t Fi+1/2 x i=1 t FM +1/2 x Fi 1/2 F1/2 Quantities are conserved up to fluxes at domain boundaries. PASI : Tsunami Workshop Jan 2-14 2013 Thursday, January 10, 13 Scalar advection Consider the constant initial value problem qt + ūqx = 0 It is easy to verify that solves the initial value problem. PASI : Tsunami Workshop Jan 2-14 2013 Thursday, January 10, 13 Scalar advection We can describe the problem in terms of how the solution behaves along curves in the x-t plane. We might look for curves solution is constant or along which the Then we would get PASI : Tsunami Workshop Jan 2-14 2013 Thursday, January 10, 13 Characteristic curves But this is true only if or Solution is constant along characteristic curves. For , PASI : Tsunami Workshop Jan 2-14 2013 Thursday, January 10, 13 Characteristic curves The solution can be traced back along characteristics. That is, can be found by determining the from which the solution propagated. Solve or PASI : Tsunami Workshop Jan 2-14 2013 Thursday, January 10, 13 Scalar advection Consider the scalar advection equation : qt + ūqx = 0 The solution travels along characteristic rays in the (x,t) plane given by . For u < 0 : t=1 t=0 PASI : Tsunami Workshop Jan 2-14 2013 Thursday, January 10, 13 Riemann problem for scalar advection qt + ūqx = 0 subject to particular initial conditions q(x, 0) = q qr x<0 x>0 t q qr Solution : PASI : Tsunami Workshop Jan 2-14 2013 Thursday, January 10, 13 Scalar Riemann Problem qt + ūqx = 0 subject to initial conditions q qr q(x, 0) = x<0 x>0 x/t = ū t Solution to the Riemann problem q qr Solution : PASI : Tsunami Workshop Jan 2-14 2013 Thursday, January 10, 13 Scalar constant coefficient advection Discontinuity propagates at speed and has strength t=1 t=0 PASI : Tsunami Workshop Jan 2-14 2013 Thursday, January 10, 13 Solving constant coefficient linear systems qt + Aqx = 0, A 2 Rm⇥m We assume that A has a complete set of eigenvectors and real eigenvalues and so can be written as A = R⇤R R = [r , r , . . . r ] 1 2 m 1 ⇤ = diag( 1 , 2 ,... m ) Examples : Linearized shallow water wave equations, constant coefficient acoustics, ... PASI : Tsunami Workshop Jan 2-14 2013 Thursday, January 10, 13 Solving a constant coefficient system ! q t + A qx = 0 qt + R⇤R 1 Define characteristic variables (x, t) = R 1 q(x, t), A 2 Rm⇥m qx = 0, R m Assume that A is diagonalizable as (x, 0) = R 1 q(x, 0) Characteristic equations decouple into m scalar equations : p ⇥t + p ⇥xp = 0, p = 1, 2, . . . , m Solution to characteristic equations are given by ⇥ (x, t) = ⇥ (x p p p t, 0) PASI : Tsunami Workshop Jan 2-14 2013 Thursday, January 10, 13 Solving a constant coefficient systems p ⇥t q t + A qx = 0 + p p ⇥x =0 Solution for general initial conditions q(x, 0) : m q(x, t) = R ⇥(x, t) = ⇥ (x, t) r p p ⇥ (x p p=1 m = q(x, t) p t, 0) r p p=1 t `p q(x x ⇥ 3 (x 3 t, 0) ⇥ 2 (x 2 t, 0) ⇥ 1 (x 1 p t, 0) = ! p (x p t, 0) t, 0) PASI : Tsunami Workshop Jan 2-14 2013 Thursday, January 10, 13 Riemann problem for systems Assume a constant coefficient system : with piecewise constant initial data : q(x, 0) = q qr x<0 x>0 which can be decomposed as : q` = 3 X p=1 p p !` r qr = 3 X p p !r r p=1 PASI : Tsunami Workshop Jan 2-14 2013 Thursday, January 10, 13 Riemann problem for systems t>0 Piecewise constant initial data t=0 x1 q q(x1 , t) = qr x=0 r + 1 1 r + 2 2 m r p=1 r = q` m p p q = 3 3 qr = p p r r p=1 PASI : Tsunami Workshop Jan 2-14 2013 Thursday, January 10, 13 Riemann problem for systems q t + A qx = 0 t>0 t=0 x2 q q(x2 , t) = 1 1 r r qr + r + 2 2 m r p=1 r m p p q = 3 3 qr = p p r r p=1 PASI : Tsunami Workshop Jan 2-14 2013 Thursday, January 10, 13 Riemann problem for systems q t + A qx = 0 t>0 t=0 x3 q q(x3 , t) = 1 1 r r + 2 2 r r m r p=1 + 3 3 r m p p q = qr qr = p p r r p=1 PASI : Tsunami Workshop Jan 2-14 2013 Thursday, January 10, 13 Riemann problem for systems q t + A qx = 0 t>0 t=0 q x4 qr q(x4 , t) = 1 1 r r + 2 2 r r m r p=1 = qr m p p q = + 3 3 r r qr = p p r r p=1 PASI : Tsunami Workshop Jan 2-14 2013 Thursday, January 10, 13 Riemann problem for systems q t + A qx = 0 t>0 t=0 q qr q(x1 , t) = 1 1 r + 2 2 r + 3 3 q(x2 , t) = 1 1 r r + 2 2 r + 3 3 q(x3 , t) = 1 1 r r + 2 2 r r + 3 3 q(x4 , t) = 1 1 r r + 2 2 r r + 3 3 r r r r r PASI : Tsunami Workshop Jan 2-14 2013 Thursday, January 10, 13 Riemann problem for systems q t + A qx = 0 t>0 t=0 q (x, t) p q qr } ??? PASI : Tsunami Workshop Jan 2-14 2013 Thursday, January 10, 13 Riemann problem for systems q t + A qx = 0 } q (x, t) p q(x1 , t) = 1 1 q(x2 , t) = 1 1 r r q(x2 , t) r + 2 2 + 2 2 q(x1 , t) = ( r + 3 3 r + 3 3 1 r r r 1 )r 1 PASI : Tsunami Workshop Jan 2-14 2013 Thursday, January 10, 13 Riemann problem for systems q t + A qx = 0 } q (x, t) p q(x2 , t) = 1 1 r r + 2 2 q(x3 , t) = 1 1 r r + 2 2 r r q(x3 , t) q(x2 , t) = ( r + 3 3 + 3 3 2 r r r 2 )r 2 PASI : Tsunami Workshop Jan 2-14 2013 Thursday, January 10, 13 Riemann problem for systems q t + A qx = 0 q (x, t) p q(x3 , t) = 1 1 r r q(x4 , t) = 1 1 r r q(x4 , t) + 2 2 r r + 3 3 + 2 2 r r + 3 3 r r q(x3 , t) = ( 3 r r 3 )r } 3 PASI : Tsunami Workshop Jan 2-14 2013 Thursday, January 10, 13 Riemann problem for systems q t + A qx = 0 q p (x, t) 3 ⇥ ) rp { q(x1 , t) = p { q(x4 , t) (⇥rp p=1 3 ⇥ R = qr p p r p=1 q PASI : Tsunami Workshop Jan 2-14 2013 Thursday, January 10, 13 Riemann problem for systems Solving the Riemann problem for linear problem q t + A qx = 0 (1) Compute eigenvalues and eigenvectors of matrix A (2) Compute characteristic variables by solving R = qr q (3) Use eigenvalues or “speeds” to determine piecewise constant solution q(x, t) = q⇧ + p p r p: p <x/t = qr p p r p: p >x/t PASI : Tsunami Workshop Jan 2-14 2013 Thursday, January 10, 13 Numerical solution qt + f (q)x = 0, Qn+1 i = Qi f (q) = Aq t n Fi+1/2 x Qni Fin 1/2 ⇥ 2 2 wave ↵ r travels at speed 2 > 0 q⇤ 1 Qi xi 1/2 Decompose jump in Q at the interface into waves : q ⇤ = Qi Fi 1/2 1 1 3 3 2 2 + ↵ r = Q ↵ r ↵ r 1 i Z t+ t 1 ⇡ f (q(xi 1/2 , t))dt = Aq ⇤ t t PASI : Tsunami Workshop Jan 2-14 2013 Thursday, January 10, 13 Example : Linearized shallow water qt + A qx = 0, A= ✓ U g ◆ H U , q= ✓ h u ◆ Characteristic information : Eigenvalues : Eigenvectors : 1 =U 1 r = ✓ p 2 gH, p gH g ◆ , =U+ 2 r = p gH ✓ p gH g ◆ PASI : Tsunami Workshop Jan 2-14 2013 Thursday, January 10, 13 Example : Linearized shallow water Characteristic variables : 1 Define : ✓ R = qr = qr ↵1 ↵2 ◆ q` 1 = 2gH ✓ ✓ ◆ 8 h` > > q` = > > u` > > < 1 1 q + ↵ r ` q(x, t) = > ✓ ◆ > > > hr > > : qr = u ` ! p gH p gH 2 q = = H H hr ur ◆✓ 1 2 h` u` ◆ p gH x/t < U p p U gH < x/t < U + gH x/t > U + p gH PASI : Tsunami Workshop Jan 2-14 2013 Thursday, January 10, 13 Linear shallow water wave equations Initial height and velocity W1 W2 ! PASI : Tsunami Workshop Jan 2-14 2013 Thursday, January 10, 13 Extending to nonlinear systems q ⇤ t q` qr q ⇤ 1 1 q` = ↵ r A(q ⇤ A(q ⇤ q` ) = 1 A(q ⇤ q` ) = 1 f (q) = Aq ! 1 1 1 ) (↵ r (q ⇤ q` ) = ↵ Ar ⇤ f (q ) Rankine-Hugoniot condition for the constant coefficent linear system q` ) ` f (q ) = 1 (q ⇤ q` ) PASI : Tsunami Workshop Jan 2-14 2013 Thursday, January 10, 13 Rankine-Hugoniot conditions For a 2x2 linear system, we have A(q ⇤ A(qr q` ) = ⇤ q )= 1 2 (q ⇤ q` ) (qr ⇤ q ) For f (q) = Aq , we can write this as : The left and right states q` and qr as “connected” by an ⇤ q intermediate state . PASI : Tsunami Workshop Jan 2-14 2013 Thursday, January 10, 13 Constant coefficient Riemann problem q q` t ? ⇤ qr ⇤ We could have asked “Find an intermediate state q such that ” For f (q) = Aq , this leads to the eigenvalue problem that we solved. PASI : Tsunami Workshop Jan 2-14 2013 Thursday, January 10, 13 Extending to nonlinear systems t q` qr Reminder : Solutions to the constant coefficient linear system travel along characteristic curves : must be an eigenvalue of , i.e. Solution remains constant along straight lines PASI : Tsunami Workshop Jan 2-14 2013 Thursday, January 10, 13 Nonlinear shallow water wave equations qt + f (q)x = 0 where q= ✓ h hu ◆ , f (q) = ✓ hu 1 2 2 hu + 2 gh ◆ for smooth solutions, this can also be written as where 0 f (q) = ✓ is the flux Jacobian matrix. 0 2 u + gh 1 2u ◆ Show! PASI : Tsunami Workshop Jan 2-14 2013 Thursday, January 10, 13 What changes in the nonlinear case? qt + f (q)x = 0 We can still ask “Are there characteristic curves on which the solution remains constant? For smooth solutions, we have where is the flux Jacobian matrix. Characteristics are governed by eigenvalues of the flux Jacobian PASI : Tsunami Workshop Jan 2-14 2013 Thursday, January 10, 13 Shallow water wave equations q= ✓ ◆ ✓ hu , f (q) = 1 2 hu + 2 gh2 ✓ ◆ 0 1 0 f (q) = u2 + gh 2u h hu ◆ Eigenvalues and eigenvectors of the flux Jacobian : p p 1 2 =u gh, = u + gh ✓ ◆ ✓ ◆ 1p 1p 1 2 r = , r = u gh u + gh Eigenvalues and eigenvectors depend on q! PASI : Tsunami Workshop Jan 2-14 2013 Thursday, January 10, 13 What can happen? ? q` t qr 1-characteristics ? q` qr 2-characteristics PASI : Tsunami Workshop Jan 2-14 2013 Thursday, January 10, 13 Riemann solution for the SWE Consider the case where : Assume that left and right states are constant in this infinitesimal box Using the conservation law, we can write Show! PASI : Tsunami Workshop Jan 2-14 2013 Thursday, January 10, 13 Riemann problem for SWE This leads to This is the required jump condition across shocks. generally we can write this condition as More Rankine Hugoniot jump condition where is the shock speed. q` qr PASI : Tsunami Workshop Jan 2-14 2013 Thursday, January 10, 13 Rarefaction waves Consider the case where Let for : be the slope of the characteristic. We need to find . Recall that . Then slope = The denominator is never 0! q` qr Solve resulting ODE to get in the centered rarefaction. PASI : Tsunami Workshop Jan 2-14 2013 Thursday, January 10, 13 Centered rarefaction Solve the system of two ODEs (for SWE) : subject to Use Riemann invariants to solve for unknown constants. q` qr PASI : Tsunami Workshop Jan 2-14 2013 Thursday, January 10, 13 Solving the Riemann problem q t q` ? ⇤ qr Find a state such that is connected to by a physically correct 1-shock wave or 1-rarefaction, and is connected to by a physically correct 2-shock or 2-rarefaction. The need to find a state that simultaneously satisfies both conditions above means we have to solve something... PASI : Tsunami Workshop Jan 2-14 2013 Thursday, January 10, 13 Solving the Riemann problem ck ho 1 2-s n o i t c a -raref Formulas for these curves are relatively simple. sh 1oc k 2-rarefaction Curves represent states that can be connected to or by a shock or a rarefaction. Use a nonlinear root-finder to find the middle state . • Determine the structure of the rarefaction (if there is one). PASI : Tsunami Workshop Jan 2-14 2013 Thursday, January 10, 13 Riemann solution 1-rarefaction t q` q ⇤ 2-shock qr The structure of the Riemann solution depends on the initial conditions. PASI : Tsunami Workshop Jan 2-14 2013 Thursday, January 10, 13 Next : Can we avoid the nonlinear solve? How does this extend to the two dimensional shallow water equations? How does GeoClaw use Riemann solvers? For details, see Finite Volume Methods for Hyperbolic Problems, R. J. LeVeque (Cambridge University Press, 2002). PASI : Tsunami Workshop Jan 2-14 2013 Thursday, January 10, 13 Lab sessions : • Experiment with linear SWE using ClawPack. • Experiment with nonlinear SWE using ClawPack. Goals : • • • • Learn about how Riemann solvers are used in Clawpack and GeoClaw Include bathymetry to see the effects of well-balancing. Learn about various plotting parameters in Clawpack Leave Chile with a simple 1d solver for the linear and nonlinear shallow water wave equations. See PASI website on Piazza for website describing project. PASI : Tsunami Workshop Jan 2-14 2013 Thursday, January 10, 13