Notes: R.J. LeVeque, University of Washington. IPDE 2011, July 5, 2011 ... For qt
+ Aqx + Bqy = 0, split using eigenvalues, vectors: A = RΛR−1 =⇒ A− = RΛ−R−1 ...
Outline
Notes:
Lab on multidimensional problems • Acoustics
• Riemann solvers
R.J. LeVeque, University of Washington
IPDE 2011, July 5, 2011
Wave propagation algorithms in 2D
R.J. LeVeque, University of Washington
IPDE 2011, July 5, 2011
R.J. LeVeque, University of Washington
IPDE 2011, July 5, 2011
[FVMHP Chap. 19]
R.J. LeVeque, University of Washington
IPDE 2011, July 5, 2011
[FVMHP Chap. 19]
Notes:
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]
Wave propagation algorithm for qt + Aqx + Bqy = 0
Notes:
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]
Acoustics in 2 dimensions
Notes:
pt + K0 (ux + vy ) = 0 ρ0 ut + px = 0 ρ0 vt + 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 p 0 K0 0 0 0 K0 0 0 . q = u , A = 1/ρ0 0 0 , B= 0 v 0 0 0 1/ρ0 0 0 R.J. LeVeque, University of Washington
IPDE 2011, July 5, 2011
[FVMHP Chap. 18]
Acoustics in 2 dimensions
p q = u , v
Plane waves:
R.J. LeVeque, University of Washington
IPDE 2011, July 5, 2011
[FVMHP Chap. 18]
R.J. LeVeque, University of Washington
IPDE 2011, July 5, 2011
[FVMHP Chap. 18]
R.J. LeVeque, University of Washington
IPDE 2011, July 5, 2011
[FVMHP Chap. 18]
Notes:
0 K0 0 A = 1/ρ0 0 0 , 0 0 0
0 0 K0 0 0 . B= 0 1/ρ0 0 0
0 K0 cos θ K0 sin θ . 0 0 A cos θ + B sin θ = cos θ/ρ0 sin θ/ρ0 0 0
Eigenvalues: λ1 = −c0 , λ2 = 0, λ3 = +c0 where p 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]
Diagonalization 2 dimensions
Notes:
Can we diagonalize system qt + Aqx + Bqy = 0? Only if A and B have the same eigenvectors! If A = RΛR−1 and B = RM R−1 , then let w = R−1 q and wt + Λwx + M wy = 0 This decouples into scalar advection equations for each component of w: wtp + λp wxp + µp wyp = 0 =⇒ wp (x, y, t) = wp (x − λp t, y − µp t, 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]
Acoustics in 2 dimensions
Notes:
pt + K0 (ux + vy ) = 0 ρ0 ut + px = 0
ρ0 vt + py = 0
−Z0 0 Z0 1 0 1 R = 0 1 0
0 K0 0 A = 1/ρ0 0 0 , 0 0 0
x
Solving qt + Aqx = 0 gives pressure waves in (p, u). x-variations in v are stationary. 0 0 K0 −Z0 0 Z0 y 0 0 0 1 0 B= 0 R = 1/ρ0 0 0 1 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]
Storing data in aux arrays
R.J. LeVeque, University of Washington
IPDE 2011, July 5, 2011
R.J. LeVeque, University of Washington
IPDE 2011, July 5, 2011
R.J. LeVeque, University of Washington
IPDE 2011, July 5, 2011
Notes:
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
Using b4stepN.f
Notes:
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
[FVMHP Chap. 18]
Acoustics in heterogeneous media qt + A(x, y)qx + B(x, y)qy = 0, where
0 K(x, y) 0 0 0 , A = 1/ρ(x, y) 0 0 0
Notes: q = (p, u, v)T ,
0 0 K(x, y) . 0 0 0 B= 1/ρ(x, y) 0 0
Note: Not in conservation form!
Wave propagation still makes sense. In x-direction: −Zi−1,j 0 Zij , 1 W 1 = α1 W 2 = α2 0 , W 3 = α3 1 . 0 1 0 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]
Acoustics in heterogeneous media
−Zi−1,j , 1 W 1 = α1 0
0 W 2 = α2 0 , 1
Decompose ∆Q = (∆p, ∆u, ∆v)T :
R.J. LeVeque, University of Washington
IPDE 2011, July 5, 2011
[FVMHP Sec. 21.5]
R.J. LeVeque, University of Washington
IPDE 2011, July 5, 2011
[FVMHP Sec. 21.5]
R.J. LeVeque, University of Washington
IPDE 2011, July 5, 2011
[FVMHP Sec. 21.5.1]
Notes:
Zij W 3 = α3 1 . 0
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) 1 A− ∆Qi−1/2,j = s1i−1/2,j Wi−1/2,j , 3 A+ ∆Qi−1/2,j = s3i−1/2,j Wi−1/2,j .
R.J. LeVeque, University of Washington
IPDE 2011, July 5, 2011
[FVMHP Sec. 21.5]
Acoustics in heterogeneous media
Notes:
Transverse solver: Split right-going fluctuation 3 A+ ∆Qi−1/2,j = s3i−1/2,j Wi−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 0 1
R.J. LeVeque, University of Washington
#
+β
2
" # Zij 0 3 −1 + β 0 , 0 1
IPDE 2011, July 5, 2011
[FVMHP Sec. 21.5.1]
Transverse solver for acoustics Up-going part:
B + A+ ∆Qi−1/2,j
A+ ∆Qi−1/2,j = β 1
"
−Zij 0 1
#
Notes:
= ci,j+1 + β2
β 3 r3
from
" # Zi,j+1 0 3 −1 + β 0 , 0 1
β 3 = (A+ ∆Qi−1/2,j )1 + (A+ ∆Qi−1/2,j )3 Zi,j+1 / (Zij + Zi,j+1 ).
R.J. LeVeque, University of Washington
IPDE 2011, July 5, 2011
[FVMHP Sec. 21.5.1]
Transverse Riemann solver in Clawpack
R.J. LeVeque, University of Washington
IPDE 2011, July 5, 2011
[FVMHP Sec. 21.5.1]
R.J. LeVeque, University of Washington
IPDE 2011, July 5, 2011
[FVMHP Sec. 21.5.1]
Notes:
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]