Sie sind auf Seite 1von 22

EP711 Supplementary Material

Thursday, September 18, 2014

The Lax-Wendroff Method And


Multi-Dimensional Problems

Jonathan B. Snively

!Embry-Riddle Aeronautical University


EP711 Supplementary Material
Thursday, September 18, 2014

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

This is better for some problems, worse for others!


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

Stability Constraint: If A=B, ∆x=∆y, then same as 1D problem!


Lax-Wendroff Method:

Single-step Coupled 2D Method
A single-step, coupled, 2D solution can be obtained for:
@u @u @u
= A B
@t @x @y
Performing a Taylor series expansion:
@u 1 2@ u
2
u(x, y, t + t) = u(x, y, t) + t + ( t)
@t 2 @t2
However, note that new second order terms arise:
2 2 2 2 2
@ u 2@ u 2@ u @ u @ u
2
=A 2
+B 2
+ AB + BA
@t @x @y @y@x @x@y
Lax-Wendroff Method:

Single-step Coupled 2D Method
So, taking into account these coupling terms, a full 2D
expression for the Lax-Wendroff method can be obtained:

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

Note this extra term!


EP711 Supplementary Material
Thursday, September 18, 2014

Contents

• Lax-Wendroff, Revisited

• Notes on Boundary Conditions


Boundary Conditions for DEs
When solving physical differential equations we recall that it is
necessary to specify “boundary conditions”.

Examples:
• Specifying temperature at ends of a thermally-conducting rod.

• Specifying heat flow rate (via gradient of temperature) on a rod.

• Specifying electric potential at a conducting wall.

Steady-state solutions, for example for Laplace or Poisson


equations, can form a pure boundary-value problem.

Time dependent initial value-boundary value problems may also


be solved, for example to the heat equation.
Dirichlet Conditions
Simply, Dirichlet Conditions involve direct specification of a
quantity at a boundary x0. I.e., temperature at a boundary.

u(x0 , t) = T (t)

Alternatively, for a steady-state problem:

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

Alternatively, for a steady-state problem:

@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

For our coded examples, quantity u may refer to the


“velocity” on the string, where quantity v may refer to the
“angular displacement”.
Linear Acoustics Equations
The equations of linear acoustics describe conservation of
mass density (continuity) and conservation of linear
momentum, which in the following system have been
coupled via an ideal gas equation of state:

@p @u
+ p0 =0
@t @x
@u 1 @p
+ =0
@t ⇢0 @x

Here, p is pressure, u is velocity, rho0 is density, and


gamma is the ratio of specific heats.
Physical Boundary Conditions
For waves on a stretched string:
• Velocity at fixed end points must go to zero, hence
the string is not free to move at these boundaries.

• Angular displacement may be non-zero at fixed end


points, hence this quantity can vary freely.

For acoustic waves in a confined space:


• Velocity normal to surface at the fixed boundary must
go to zero, hence the gas is not free to pass.

• Pressure may be non-zero at the fixed boundary,


hence this quantity may vary freely.
Numerical Boundary Conditions
Reflective Boundary: 

Example 1D waves on a string, or acoustic waves:

• For quantity representing pressure (or angular


displacement), allow boundary cell or grid-point value
to be equal to first inner cell or grid-point value.

• For quantity representing velocity (or velocity), allow


boundary cell to be equal in magnitude, opposite in
sign (direction) to the first inner cell or grid-point.

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:

• For quantity representing pressure (or angular


displacement), allow boundary cell or grid-point value
to be equal to first inner cell or grid-point value.

• For quantity representing velocity (or velocity), allow


boundary cell to be equal to the first inner cell or grid-
point.
Effectively, this prevents influx of
additional information as the wave
n
p0 = n
p1 flows outward.

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

• Left-most boundary cells equal to right-most domain


cells, for all quantities solved.

• Right-most boundary cells equal to left-most domain


cells, for all quantities solved.

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)

These can be combined, linearly, with any of the above.

Das könnte Ihnen auch gefallen