Beruflich Dokumente
Kultur Dokumente
Jonathan B. Snively
Contents
• Lax-Wendroff, Revisited
• Notes on Boundary Conditions
Lax-Friedrichs Method in 2D
1 n
For Advection: n+1
ui,j = (ui+1,j + ui
n
+ n
ui,j+1 + ui,j 1 )
n
4 1,j
t
vx (ui+1,j
n
ui 1,j )
n
2 x
y-axis domain
j+1 t
vy (ui,j+1
n
ui,j 1 )
n
2 y
j
For equal grid-spacing:
j-1 x(=
y)
t q p
i-1 i i+1 vx2 + vy2 2
x-axis domain
Dimensionally-split Lax-
Friedrichs Method in 2D
For Advection:
1 n t
u⇤i,j= (ui+1,j + uni 1,j ) 2
v (u n
x i+1,j uni 1,j )
2 2( x)
n 1 ⇤ ⇤ t ⇤ ⇤
ui,j = (ui,j+1 + ui,j 1 ) 2
vy (ui,j+1 ui,j 1 )
2 2( y)
Stability Constraint: x
If vx=vy, ∆x=∆y, it is now t
same as 1D problem! vx
n+1
Two-step
t-stepping
n+1⁄2
evolution
n
j-1 j-1⁄2 j j+1⁄2 j+1
Effectively, an initial half-step is taken via Lax-Friedrichs
method, and used to support a second Leapfrog step.
Lax-Wendroff Method
The Lax-Wendroff method for solving hyperbolic PDEs is
second order accurate, and is often implemented in a 2-
step (“Richtmeyer”) form.
n+1/2 1 n t n
uj+1/2 = (uj + unj+1 ) (fj+1 fjn )
2 2 x
n+1/2 n+1/2
Fj+1/2 = f (uj+1/2 )
t n+1/2 n+1/2
n+1
uj = n
uj (Fj+1/2 Fj 1/2 )
x
This apparently simple approach has numerous pitfalls,
many of which can be well-controlled given appropriate
choices of time-steps and filtering / stabilizing viscosity.
Lax-Wendroff Method:
Single-step formulation
Alternatively, a single-step version of the method can be
constructed, starting from a Taylor-series expansion:
@u 1 @ 2
u
u(x, t + t) = u(x, t) + t + ( t)2
@t 2 @t2
Note that the advection equation (here with speed replaced
by A, for reasons that we will appreciate later) is given by:
@u @u
= A
@t @x
@2u @ @u @ 2
u
Also, note that: = A =A 2
@t2 @t @x @x2
Lax-Wendroff Method:
Single-step formulation
So, we can easily convert our Taylor series into an
expression given in terms of spatial derivatives:
@u 1 @ 2
u
u(x, t + t) = u(x, t) tA + ( t) A
2 2
@x 2 @x2
Applying finite difference approximations to the spatial
derivatives (first and second order):
t
n+1
uj = n
uj n
A(uj+1 uj 1 )
n
2 x
( t)2 2 n
+ A (u 2uj
n
+ uj+1 )
n
2( x) 2 j 1
Lax-Wendroff Method:
Single-step 2D Split Method
A dimensionally-split 2D Lax-Wendroff scheme can be
constructed via time-splitting of x and y direction solutions:
t
u⇤i,j = uni,j A(uni+1,j uni 1,j )
2 x
( t)2 2 n
+ A (u 2uni,j + uni+1,j )
2( x)2 i 1,j
t
n+1
ui,j = ⇤
ui,j ⇤
B(ui,j+1 ui,j 1 )
⇤
2 y
( t)2 2 ⇤
+ B (u 2u⇤i,j + u⇤i,j+1 )
2( y) 2 i,j 1
t t
un+1 = uni,j A(uni+1,j uni 1,j ) B(uni,j+1 uni,j 1)
i,j
2 x 2 y
( t)2 2 n ( t)2
+ A (u 2u n
+ u n
) + B (u
2 n
2u n
+ u i,j+1 )
n
2( x) 2 i 1,j i,j i+1,j
2( y) 2 i,j 1 i,j
( t)2 ⇥ n ⇤
+ (AB + BA) (ui+1,j+1 ui 1,j+1 ) (ui+1,j 1 ui 1,j 1 )
n n n
8 x y
Contents
• Lax-Wendroff, Revisited
Examples:
• Specifying temperature at ends of a thermally-conducting rod.
u(x0 , t) = T (t)
u(x0 ) = T0
Neumann Conditions
Simply, Neumann Conditions involve specification of a
quantity’s derivative at a boundary x0. I.e., gradient of
temperature at a boundary.
@u
(x0 , t) = (t)
@x
@u
(x0 ) =
@x
Waves on a String
As noted by Potter, a system of two PDEs describing
advection of quantities velocity (v = @⇠/@t ) and angular
displacement ( ✓ = @⇠/@t ) can be specified:
@v @✓
+c =0
@t @x
@✓ @v
+c =0
@t @x
@p @u
+ p0 =0
@t @x
@u 1 @p
+ =0
@t ⇢0 @x
p0 =
n n
p1 Effectively and intuitively, this
“launches” an opposing reflection
v0 =
n n
v1 wave to replace the incident wave.
Numerical Boundary Conditions
Open Boundary:
Example 1D waves on a string, or acoustic waves:
n
v0 = n
v1 These “extrapolated” conditions
work well for practical solutions in
FVMs, as we’ll see later.
Numerical Boundary Conditions
Periodic Boundaries:
No boundaries – Infinite domain
n
p0 = n
pJ 1 Effectively, what goes out on one side
comes back in the other. Add
v0n = vJn 1 additional “ghost” cells as needed.
pJn
= p1n
These work brilliantly for testing
and ideal studies, but are not
vJn = v1n “physical” in many systems.
Numerical Boundary Conditions
Forced Boundaries:
A boundary is a great place to inject source terms! I.e.,
u(x0 , t) = U0 sin(!t)
Or:
p(x0 , t) = P0 sin(!t)