lab on multidimensional problems acoustics

29
Outline Lab on multidimensional problems Acoustics Riemann solvers R.J. LeVeque, University of Washington IPDE 2011, July 5, 2011

Upload: others

Post on 16-Jul-2022

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Lab on multidimensional problems Acoustics

Outline

Lab on multidimensional problems• Acoustics• Riemann solvers

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

Page 2: Lab on multidimensional problems Acoustics

Wave propagation algorithms in 2D

Clawpack requires:

Normal Riemann solver rpn2.fSolves 1d Riemann problem qt +Aqx = 0Decomposes ∆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.fDecomposes A+∆Q into B−A+∆Q and B+A+∆Q by splittingthis 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]

Page 3: Lab on multidimensional problems Acoustics

Wave propagation algorithms in 2D

Clawpack requires:

Normal Riemann solver rpn2.fSolves 1d Riemann problem qt +Aqx = 0Decomposes ∆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.fDecomposes A+∆Q into B−A+∆Q and B+A+∆Q by splittingthis 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]

Page 4: Lab on multidimensional problems Acoustics

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]

Page 5: Lab on multidimensional problems Acoustics

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]

Page 6: Lab on multidimensional problems Acoustics

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]

Page 7: Lab on multidimensional problems Acoustics

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]

Page 8: Lab on multidimensional problems Acoustics

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]

Page 9: Lab on multidimensional problems Acoustics

Acoustics in 2 dimensions

pt +K0(ux + vy) = 0ρ0ut + px = 0ρ0vt + py = 0

Note: pressure responds to compression or expansion and sopt is proportional to divergence of velocity.

Second and third equations are F = ma.

Gives hyperbolic system qt +Aqx +Bqy = 0 with

q =

puv

, A =

0 K0 01/ρ0 0 0

0 0 0

, B =

0 0 K0

0 0 01/ρ0 0 0

.

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

Page 10: Lab on multidimensional problems Acoustics

Acoustics in 2 dimensions

pt +K0(ux + vy) = 0ρ0ut + px = 0ρ0vt + py = 0

Note: pressure responds to compression or expansion and sopt is proportional to divergence of velocity.

Second and third equations are F = ma.

Gives hyperbolic system qt +Aqx +Bqy = 0 with

q =

puv

, A =

0 K0 01/ρ0 0 0

0 0 0

, B =

0 0 K0

0 0 01/ρ0 0 0

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

Page 11: Lab on multidimensional problems Acoustics

Acoustics in 2 dimensions

q =

puv

, A =

0 K0 01/ρ0 0 0

0 0 0

, B =

0 0 K0

0 0 01/ρ0 0 0

.Plane waves:

A cos θ +B sin θ =

0 K0 cos θ K0 sin θcos θ/ρ0 0 0sin θ/ρ0 0 0

.

Eigenvalues: λ1 = −c0, λ2 = 0, λ3 = +c0 wherec0 =

√K0/ρ0

Independent of angle θ.

Isotropic: sound propagates at same speed in any direction.

Note: Zero wave speed for “shear wave” with variation only invelocity in direction (− sin θ, cos θ). (Fig 18.1)

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

Page 12: Lab on multidimensional problems Acoustics

Acoustics in 2 dimensions

q =

puv

, A =

0 K0 01/ρ0 0 0

0 0 0

, B =

0 0 K0

0 0 01/ρ0 0 0

.Plane waves:

A cos θ +B sin θ =

0 K0 cos θ K0 sin θcos θ/ρ0 0 0sin θ/ρ0 0 0

.Eigenvalues: λ1 = −c0, λ2 = 0, λ3 = +c0 wherec0 =

√K0/ρ0

Independent of angle θ.

Isotropic: sound propagates at same speed in any direction.

Note: Zero wave speed for “shear wave” with variation only invelocity in direction (− sin θ, cos θ). (Fig 18.1)

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

Page 13: Lab on multidimensional problems Acoustics

Acoustics in 2 dimensions

q =

puv

, A =

0 K0 01/ρ0 0 0

0 0 0

, B =

0 0 K0

0 0 01/ρ0 0 0

.Plane waves:

A cos θ +B sin θ =

0 K0 cos θ K0 sin θcos θ/ρ0 0 0sin θ/ρ0 0 0

.Eigenvalues: λ1 = −c0, λ2 = 0, λ3 = +c0 wherec0 =

√K0/ρ0

Independent of angle θ.

Isotropic: sound propagates at same speed in any direction.

Note: Zero wave speed for “shear wave” with variation only invelocity in direction (− sin θ, cos θ). (Fig 18.1)

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

Page 14: Lab on multidimensional problems Acoustics

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 eachcomponent of w:

wpt +λpwp

x +µpwpy = 0 =⇒ wp(x, y, t) = wp(x−λpt, y−µpt, 0).

Note: In this case information propagates only in a finitenumber 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]

Page 15: Lab on multidimensional problems Acoustics

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 eachcomponent of w:

wpt +λpwp

x +µpwpy = 0 =⇒ wp(x, y, t) = wp(x−λpt, y−µpt, 0).

Note: In this case information propagates only in a finitenumber 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]

Page 16: Lab on multidimensional problems Acoustics

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 eachcomponent of w:

wpt +λpwp

x +µpwpy = 0 =⇒ wp(x, y, t) = wp(x−λpt, y−µpt, 0).

Note: In this case information propagates only in a finitenumber 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]

Page 17: Lab on multidimensional problems Acoustics

Acoustics in 2 dimensions

pt +K0(ux + vy) = 0ρ0ut + px = 0ρ0vt + py = 0

A =

0 K0 01/ρ0 0 0

0 0 0

, Rx =

−Z0 0 Z0

1 0 10 1 0

Solving qt +Aqx = 0 gives pressure waves in (p, u).

x-variations in v are stationary.

B =

0 0 K0

0 0 01/ρ0 0 0

Ry =

−Z0 0 Z0

0 1 01 0 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]

Page 18: Lab on multidimensional problems Acoustics

Acoustics in 2 dimensions

pt +K0(ux + vy) = 0ρ0ut + px = 0ρ0vt + py = 0

A =

0 K0 01/ρ0 0 0

0 0 0

, Rx =

−Z0 0 Z0

1 0 10 1 0

Solving qt +Aqx = 0 gives pressure waves in (p, u).

x-variations in v are stationary.

B =

0 0 K0

0 0 01/ρ0 0 0

Ry =

−Z0 0 Z0

0 1 01 0 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]

Page 19: Lab on multidimensional problems Acoustics

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 iscreated (when AMR is used).

To use this, copy library version (which does nothing) toapplication directory and modify this file and Makefile.

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

Page 20: Lab on multidimensional problems Acoustics

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 iscreated (when AMR is used).

To use this, copy library version (which does nothing) toapplication directory and modify this file and Makefile.

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

Page 21: Lab on multidimensional problems Acoustics

Using b4stepN.f

The setaux function is only called when grids are created.

The b4stepN function (in N dimensions) is called before eachtime 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) toapplication 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

Page 22: Lab on multidimensional problems Acoustics

Acoustics in heterogeneous media

qt +A(x, y)qx +B(x, y)qy = 0, q = (p, u, v)T ,

where

A =

0 K(x, y) 01/ρ(x, y) 0 0

0 0 0

, B =

0 0 K(x, y)0 0 0

1/ρ(x, y) 0 0

.Note: Not in conservation form!

Wave propagation still makes sense. In x-direction:

W1 = α1

−Zi−1,j

10

, W2 = α2

001

, W3 = α3

Zij

10

.Wave speeds: s1i−1/2,j = −ci−1,j , s2i−1/2,j = 0, s3i−1/2,j = +cij .

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

Page 23: Lab on multidimensional problems Acoustics

Acoustics in heterogeneous media

qt +A(x, y)qx +B(x, y)qy = 0, q = (p, u, v)T ,

where

A =

0 K(x, y) 01/ρ(x, y) 0 0

0 0 0

, B =

0 0 K(x, y)0 0 0

1/ρ(x, y) 0 0

.Note: Not in conservation form!

Wave propagation still makes sense. In x-direction:

W1 = α1

−Zi−1,j

10

, W2 = α2

001

, W3 = α3

Zij

10

.Wave speeds: s1i−1/2,j = −ci−1,j , s2i−1/2,j = 0, s3i−1/2,j = +cij .

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

Page 24: Lab on multidimensional problems Acoustics

Acoustics in heterogeneous media

W1 = α1

−Zi−1,j

10

, W2 = α2

001

, W3 = α3

Zij

10

.Decompose ∆Q = (∆p, ∆u, ∆v)T :

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

α2i−1/2,j = ∆Q3,

α3i−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 = s1i−1/2,jW1i−1/2,j ,

A+∆Qi−1/2,j = s3i−1/2,jW3i−1/2,j .

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

Page 25: Lab on multidimensional problems Acoustics

Acoustics in heterogeneous media

W1 = α1

−Zi−1,j

10

, W2 = α2

001

, W3 = α3

Zij

10

.Decompose ∆Q = (∆p, ∆u, ∆v)T :

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

α2i−1/2,j = ∆Q3,

α3i−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 = s1i−1/2,jW1i−1/2,j ,

A+∆Qi−1/2,j = s3i−1/2,jW3i−1/2,j .

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

Page 26: Lab on multidimensional problems Acoustics

Acoustics in heterogeneous media

Transverse solver: Split right-going fluctuation

A+∆Qi−1/2,j = s3i−1/2,jW3i−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

01

]+ β2

[ 0−1

0

]+ β3

[Zij01

],

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

Page 27: Lab on multidimensional problems Acoustics

Transverse solver for acousticsUp-going part: B+A+∆Qi−1/2,j = ci,j+1β

3r3 from

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

[−Zij

01

]+ β2

[ 0−1

0

]+ β3

[Zi,j+1

01

],

β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]

Page 28: Lab on multidimensional problems Acoustics

Transverse Riemann solver in Clawpack

rpt2 takes vector asdq and returns bmasdq and bpasdqwhere

asdq = A∗∆Q represents eitherA−∆Q if imp = 1, orA+∆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 andthe 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]

Page 29: Lab on multidimensional problems Acoustics

Transverse Riemann solver in Clawpack

rpt2 takes vector asdq and returns bmasdq and bpasdqwhere

asdq = A∗∆Q represents eitherA−∆Q if imp = 1, orA+∆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 andthe 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]