Outline Lab on multidimensional problems Acoustics Riemann solvers - - PowerPoint PPT Presentation

outline
SMART_READER_LITE
LIVE PREVIEW

Outline Lab on multidimensional problems Acoustics Riemann solvers - - PowerPoint PPT Presentation

Outline Lab on multidimensional problems Acoustics Riemann solvers R.J. LeVeque, University of Washington IPDE 2011, July 5, 2011 Wave propagation algorithms in 2D Clawpack requires: Normal Riemann solver rpn2.f Solves 1d Riemann


slide-1
SLIDE 1

Outline

Lab on multidimensional problems

  • Acoustics
  • Riemann solvers

R.J. LeVeque, University of Washington IPDE 2011, July 5, 2011

slide-2
SLIDE 2

Wave propagation algorithms in 2D

Clawpack requires: Normal Riemann solver rpn2.f Solves 1d Riemann problem qt + Aqx = 0 Decomposes ∆Q = Qij − Qi−1,j into A+∆Q and A−∆Q. For qt + Aqx + Bqy = 0, split using eigenvalues, vectors: A = RΛR−1 = ⇒ A− = RΛ−R−1, A+ = RΛ+R−1 Input parameter ixy determines if it’s in x or y direction. In latter case splitting is done using B instead of A. This is all that’s required for dimensional splitting.

R.J. LeVeque, University of Washington IPDE 2011, July 5, 2011 [FVMHP Chap. 19]

slide-3
SLIDE 3

Wave propagation algorithms in 2D

Clawpack requires: Normal Riemann solver rpn2.f Solves 1d Riemann problem qt + Aqx = 0 Decomposes ∆Q = Qij − Qi−1,j into A+∆Q and A−∆Q. For qt + Aqx + Bqy = 0, split using eigenvalues, vectors: A = RΛR−1 = ⇒ A− = RΛ−R−1, A+ = RΛ+R−1 Input parameter ixy determines if it’s in x or y direction. In latter case splitting is done using B instead of A. This is all that’s required for dimensional splitting. Transverse Riemann solver rpt2.f Decomposes A+∆Q into B−A+∆Q and B+A+∆Q by splitting this vector into eigenvectors of B. (Or splits vector into eigenvectors of A if ixy=2.)

R.J. LeVeque, University of Washington IPDE 2011, July 5, 2011 [FVMHP Chap. 19]

slide-4
SLIDE 4

Wave propagation algorithm for qt + Aqx + Bqy = 0

Decompose A = A+ + A− and B = B+ + B−. For ∆Q = Qij − Qi−1,j:

R.J. LeVeque, University of Washington IPDE 2011, July 5, 2011 [FVMHP Chap. 19]

slide-5
SLIDE 5

Wave propagation algorithm for qt + Aqx + Bqy = 0

Decompose A = A+ + A− and B = B+ + B−. For ∆Q = Qij − Qi−1,j:

R.J. LeVeque, University of Washington IPDE 2011, July 5, 2011 [FVMHP Chap. 19]

slide-6
SLIDE 6

Wave propagation algorithm for qt + Aqx + Bqy = 0

Decompose A = A+ + A− and B = B+ + B−. For ∆Q = Qij − Qi−1,j:

R.J. LeVeque, University of Washington IPDE 2011, July 5, 2011 [FVMHP Chap. 19]

slide-7
SLIDE 7

Wave propagation algorithm for qt + Aqx + Bqy = 0

Decompose A = A+ + A− and B = B+ + B−. For ∆Q = Qij − Qi−1,j:

R.J. LeVeque, University of Washington IPDE 2011, July 5, 2011 [FVMHP Chap. 19]

slide-8
SLIDE 8

Wave propagation algorithm for qt + Aqx + Bqy = 0

Decompose A = A+ + A− and B = B+ + B−. For ∆Q = Qij − Qi−1,j:

R.J. LeVeque, University of Washington IPDE 2011, July 5, 2011 [FVMHP Chap. 19]

slide-9
SLIDE 9

Acoustics in 2 dimensions

pt + K0(ux + vy) = 0 ρ0ut + px = 0 ρ0vt + py = 0 Note: pressure responds to compression or expansion and so pt is proportional to divergence of velocity. Second and third equations are F = ma.

R.J. LeVeque, University of Washington IPDE 2011, July 5, 2011 [FVMHP Chap. 18]

slide-10
SLIDE 10

Acoustics in 2 dimensions

pt + K0(ux + vy) = 0 ρ0ut + px = 0 ρ0vt + py = 0 Note: pressure responds to compression or expansion and so pt is proportional to divergence of velocity. Second and third equations are F = ma. Gives hyperbolic system qt + Aqx + Bqy = 0 with q =   p u v   , A =   K0 1/ρ0   , B =   K0 1/ρ0   .

R.J. LeVeque, University of Washington IPDE 2011, July 5, 2011 [FVMHP Chap. 18]

slide-11
SLIDE 11

Acoustics in 2 dimensions

q =   p u v   , A =   K0 1/ρ0   , B =   K0 1/ρ0   . Plane waves: A cos θ + B sin θ =   K0 cos θ K0 sin θ cos θ/ρ0 sin θ/ρ0   .

R.J. LeVeque, University of Washington IPDE 2011, July 5, 2011 [FVMHP Chap. 18]

slide-12
SLIDE 12

Acoustics in 2 dimensions

q =   p u v   , A =   K0 1/ρ0   , B =   K0 1/ρ0   . Plane waves: A cos θ + B sin θ =   K0 cos θ K0 sin θ cos θ/ρ0 sin θ/ρ0   . Eigenvalues: λ1 = −c0, λ2 = 0, λ3 = +c0 where c0 =

  • K0/ρ0

Independent of angle θ. Isotropic: sound propagates at same speed in any direction.

R.J. LeVeque, University of Washington IPDE 2011, July 5, 2011 [FVMHP Chap. 18]

slide-13
SLIDE 13

Acoustics in 2 dimensions

q =   p u v   , A =   K0 1/ρ0   , B =   K0 1/ρ0   . Plane waves: A cos θ + B sin θ =   K0 cos θ K0 sin θ cos θ/ρ0 sin θ/ρ0   . Eigenvalues: λ1 = −c0, λ2 = 0, λ3 = +c0 where c0 =

  • K0/ρ0

Independent of angle θ. Isotropic: sound propagates at same speed in any direction. Note: Zero wave speed for “shear wave” with variation only in velocity in direction (− sin θ, cos θ). (Fig 18.1)

R.J. LeVeque, University of Washington IPDE 2011, July 5, 2011 [FVMHP Chap. 18]

slide-14
SLIDE 14

Diagonalization 2 dimensions

Can we diagonalize system qt + Aqx + Bqy = 0? Only if A and B have the same eigenvectors! If A = RΛR−1 and B = RMR−1, then let w = R−1q and wt + Λwx + Mwy = 0

R.J. LeVeque, University of Washington IPDE 2011, July 5, 2011 [FVMHP Chap. 18]

slide-15
SLIDE 15

Diagonalization 2 dimensions

Can we diagonalize system qt + Aqx + Bqy = 0? Only if A and B have the same eigenvectors! If A = RΛR−1 and B = RMR−1, then let w = R−1q and wt + Λwx + Mwy = 0 This decouples into scalar advection equations for each component of w: wp

t +λpwp x +µpwp y = 0 =

⇒ wp(x, y, t) = wp(x−λpt, y −µpt, 0). Note: In this case information propagates only in a finite number of directions (λp, µp) for p = 1, . . . , m.

R.J. LeVeque, University of Washington IPDE 2011, July 5, 2011 [FVMHP Chap. 18]

slide-16
SLIDE 16

Diagonalization 2 dimensions

Can we diagonalize system qt + Aqx + Bqy = 0? Only if A and B have the same eigenvectors! If A = RΛR−1 and B = RMR−1, then let w = R−1q and wt + Λwx + Mwy = 0 This decouples into scalar advection equations for each component of w: wp

t +λpwp x +µpwp y = 0 =

⇒ wp(x, y, t) = wp(x−λpt, y −µpt, 0). Note: In this case information propagates only in a finite number of directions (λp, µp) for p = 1, . . . , m. This is not true for most coupled systems, e.g. acoustics.

R.J. LeVeque, University of Washington IPDE 2011, July 5, 2011 [FVMHP Chap. 18]

slide-17
SLIDE 17

Acoustics in 2 dimensions

pt + K0(ux + vy) = 0 ρ0ut + px = 0 ρ0vt + py = 0 A =   K0 1/ρ0   , Rx =   −Z0 Z0 1 1 1   Solving qt + Aqx = 0 gives pressure waves in (p, u). x-variations in v are stationary.

R.J. LeVeque, University of Washington IPDE 2011, July 5, 2011 [FVMHP Chap. 18]

slide-18
SLIDE 18

Acoustics in 2 dimensions

pt + K0(ux + vy) = 0 ρ0ut + px = 0 ρ0vt + py = 0 A =   K0 1/ρ0   , Rx =   −Z0 Z0 1 1 1   Solving qt + Aqx = 0 gives pressure waves in (p, u). x-variations in v are stationary. B =   K0 1/ρ0   Ry =   −Z0 Z0 1 1 1   Solving qt + Bqy = 0 gives pressure waves in (p, v). y-variations in u are stationary.

R.J. LeVeque, University of Washington IPDE 2011, July 5, 2011 [FVMHP Chap. 18]

slide-19
SLIDE 19

Storing data in aux arrays

In Clawpack, q(i,j,m), m=1,...,meqn holds the solution. Often there is spatially varying data that describes the problem:

  • Edge velocities for advection,
  • Density ρ0(x, y), bulk modulus K0(x, y) for acoustics,
  • Topography or bathymetry for shallow water.
  • Edge lengths, angles, and cell areas for mapped grids,

R.J. LeVeque, University of Washington IPDE 2011, July 5, 2011

slide-20
SLIDE 20

Storing data in aux arrays

In Clawpack, q(i,j,m), m=1,...,meqn holds the solution. Often there is spatially varying data that describes the problem:

  • Edge velocities for advection,
  • Density ρ0(x, y), bulk modulus K0(x, y) for acoustics,
  • Topography or bathymetry for shallow water.
  • Edge lengths, angles, and cell areas for mapped grids,

These can be stored in aux(i,j,m), m=1,2,...,maux. The Fortran function setaux is called every time a new grid is created (when AMR is used). To use this, copy library version (which does nothing) to application directory and modify this file and Makefile.

R.J. LeVeque, University of Washington IPDE 2011, July 5, 2011

slide-21
SLIDE 21

Using b4stepN.f

The setaux function is only called when grids are created. The b4stepN function (in N dimensions) is called before each time step. Can use this for example to:

  • Change aux arrays for time-dependent velocities,
  • Print something out every time step (e.g. total mass),

To use this, copy library version (which does nothing) to application directory and modify this file and Makefile. See:

$CLAW/apps/advection/2d/swirl/b4step2.f $CLAW/apps/advection/2d/swirl/setaux.f $CLAW/apps/advection/2d/swirl/psi.f

R.J. LeVeque, University of Washington IPDE 2011, July 5, 2011

slide-22
SLIDE 22

Acoustics in heterogeneous media

qt + A(x, y)qx + B(x, y)qy = 0, q = (p, u, v)T , where A =   K(x, y) 1/ρ(x, y)   , B =   K(x, y) 1/ρ(x, y)   . Note: Not in conservation form!

R.J. LeVeque, University of Washington IPDE 2011, July 5, 2011 [FVMHP Sec. 21.5]

slide-23
SLIDE 23

Acoustics in heterogeneous media

qt + A(x, y)qx + B(x, y)qy = 0, q = (p, u, v)T , where A =   K(x, y) 1/ρ(x, y)   , B =   K(x, y) 1/ρ(x, y)   . Note: Not in conservation form! Wave propagation still makes sense. In x-direction: W1 = α1   −Zi−1,j 1   , W2 = α2   1   , W3 = α3   Zij 1   . Wave speeds: s1

i−1/2,j = −ci−1,j, s2 i−1/2,j = 0, s3 i−1/2,j = +cij.

R.J. LeVeque, University of Washington IPDE 2011, July 5, 2011 [FVMHP Sec. 21.5]

slide-24
SLIDE 24

Acoustics in heterogeneous media

W1 = α1   −Zi−1,j 1   , W2 = α2   1   , W3 = α3   Zij 1   . Decompose ∆Q = (∆p, ∆u, ∆v)T : α1

i−1/2,j = (−∆Q1 + Z∆Q2)/(Zi−1,j + Zij),

α2

i−1/2,j = ∆Q3,

α3

i−1/2,j = (∆Q1 + Zi−1,j∆Q2)/(Zi−1,j + Zij).

R.J. LeVeque, University of Washington IPDE 2011, July 5, 2011 [FVMHP Sec. 21.5]

slide-25
SLIDE 25

Acoustics in heterogeneous media

W1 = α1   −Zi−1,j 1   , W2 = α2   1   , W3 = α3   Zij 1   . Decompose ∆Q = (∆p, ∆u, ∆v)T : α1

i−1/2,j = (−∆Q1 + Z∆Q2)/(Zi−1,j + Zij),

α2

i−1/2,j = ∆Q3,

α3

i−1/2,j = (∆Q1 + Zi−1,j∆Q2)/(Zi−1,j + Zij).

Fluctuations: (Note: s1 < 0, s2 = 0, s3 > 0) A−∆Qi−1/2,j = s1

i−1/2,jW1 i−1/2,j,

A+∆Qi−1/2,j = s3

i−1/2,jW3 i−1/2,j.

R.J. LeVeque, University of Washington IPDE 2011, July 5, 2011 [FVMHP Sec. 21.5]

slide-26
SLIDE 26

Acoustics in heterogeneous media

Transverse solver: Split right-going fluctuation A+∆Qi−1/2,j = s3

i−1/2,jW3 i−1/2,j

into up-going and down-going pieces: Decompose A+∆Qi−1/2,j into eigenvectors of B. Down-going:

A+∆Qi−1/2,j = β1 −Zi,j−1 1

  • + β2
  • −1
  • + β3

Zij 1

  • ,

R.J. LeVeque, University of Washington IPDE 2011, July 5, 2011 [FVMHP Sec. 21.5.1]

slide-27
SLIDE 27

Transverse solver for acoustics

Up-going part: B+A+∆Qi−1/2,j = ci,j+1β3r3 from

A+∆Qi−1/2,j = β1 −Zij 1

  • + β2
  • −1
  • + β3

Zi,j+1 1

  • ,

β3 =

  • (A+∆Qi−1/2,j)1 + (A+∆Qi−1/2,j)3Zi,j+1
  • / (Zij + Zi,j+1).

R.J. LeVeque, University of Washington IPDE 2011, July 5, 2011 [FVMHP Sec. 21.5.1]

slide-28
SLIDE 28

Transverse Riemann solver in Clawpack

rpt2 takes vector asdq and returns bmasdq and bpasdq where asdq = A∗∆Q represents either A−∆Q if imp = 1, or A+∆Q if imp = 2. Returns B−A∗∆Q and B+A∗∆Q.

R.J. LeVeque, University of Washington IPDE 2011, July 5, 2011 [FVMHP Sec. 21.5.1]

slide-29
SLIDE 29

Transverse Riemann solver in Clawpack

rpt2 takes vector asdq and returns bmasdq and bpasdq where asdq = A∗∆Q represents either A−∆Q if imp = 1, or A+∆Q if imp = 2. Returns B−A∗∆Q and B+A∗∆Q. Note: there is also a parameter ixy: ixy = 1 means normal solve was in x-direction, ixy = 2 means normal solve was in y-direction, In this case asdq represents B−∆Q or B+∆Q and the routine must return A−B∗∆Q and A+B∗∆Q.

R.J. LeVeque, University of Washington IPDE 2011, July 5, 2011 [FVMHP Sec. 21.5.1]