0% found this document useful (0 votes)
37 views6 pages

2 Handout

1. The document summarizes the linear shallow water wave equations (LSWE) and some analytical methods used to study them, including: - Euler's formula, which shows that a traveling wave solution exists. 2. Fourier transforms can be used to express the free surface elevation η in the frequency domain as the wave amplitude spectrum ζ, simplifying the equations. 3. Basic finite difference methods are introduced to approximate derivatives, including first-order forward, backward, and second-order central differences.

Uploaded by

aladar520
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views6 pages

2 Handout

1. The document summarizes the linear shallow water wave equations (LSWE) and some analytical methods used to study them, including: - Euler's formula, which shows that a traveling wave solution exists. 2. Fourier transforms can be used to express the free surface elevation η in the frequency domain as the wave amplitude spectrum ζ, simplifying the equations. 3. Basic finite difference methods are introduced to approximate derivatives, including first-order forward, backward, and second-order central differences.

Uploaded by

aladar520
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

ESOE 5136 2021 March 8 - Handout Lo

1. Linear shallow water wave equations (LSWE) in 1DH


For small-amplitude waves, we can linearize the 1DH NSWE to obtain the 1DH linear
shallow water wave equations:

∂η ∂U h
 ∂t + ∂x = 0



, (1)

 ∂U ∂η

 = −g
∂t ∂x
where h = h(x) is the still water depth; i.e., without accounting for η(x, t).
In constant water depth, namely, when h is a constant that does not change in space, (1)
can be combined into
∂2η ∂2η
C2 2 = 2 , (2)
∂x ∂t

where C = gh. (2) is the classical “wave equation” that arises in many other fields.

Any wave of translation (平移波) moving at the speed C = gh is a solution to (2).
Namely, f (x − C · t) and f (x + C · t) are both solutions.

2. Euler’s formula
Euler’s formula is very useful in the analytical study of water waves. It states that

eix = cos(x) + i sin(x). (3)

As an exercise, verify that a wave of the form

η(x, t) = Aeikx e−iωt + Be−ikx e−iωt , (4)

where A and B are some coefficients (they may be complex numbers), is a solution to the
LSWE in constant depth, (2).
Under this notation, the flow velocity is calculated from the second equation in (1) as
gk ikx −iωt gk −ikx −iωt
U (x, t) = Ae e − Be e . (5)
ω ω

3. Fourier transform and the LSWE


(4) is a solution to the LSWE with one specified frequency ω. If we integrate over all
possible frequencies and allow the coefficients A and B to be functions of ω, we can write
Z ∞ 
η(x, t) = A(ω)eikx e−iωt + B(ω)e−ikx e−iωt dω
−∞
Z ∞  
= A(ω)eikx + B(ω)e−ikx e−iωt dω , (6)
−∞
Z ∞ Z ∞

ix √ωgh −ix √ωgh

−iωt 1
= A(ω)e + B(ω)e e dω = √ ζ(x, ω)e−iωt dω
−∞ 2π −∞

in which the factor 1/ 2π is sometimes absorbed into ζ depending on the notation used.
The greek letter “zeta”, ζ(x, ω), is called the wave amplitude spectrum (波振幅譜). It is
the free surface elevation η expressed in the frequency domain. Solving the LSWE in the
frequency domain is sometimes easier.

1
ESOE 5136 2021 March 8 - Handout Lo

We recall that the Fourier transform of a function f (t) is defined as


Z ∞
1
f (t)e−iωt dt,
 
F f (t) (ω) = f (ω) = √ (7)
2π −∞
and the inverse Fourier transform is
Z ∞
−1 1
f (ω)eiωt dω.
 
F f (ω) (t) = f (t) = √ (8)
2π −∞

Thus, we see that (6) essentially states “η(x, t) is the Fourier transform of ζ(x, t)”. Con-
sequently, ζ(x, ω) is the inverse Fourier transform of η(x, t):
 Z ∞
1
η(x, t)eiωt dt = F −1 η(x, t)
 


 ζ(x, ω) = √

 2π −∞
Z ∞ . (9)
 1
ζ(x, ω)e−iωt dω = F ζ(x, ω)
  
 η(x, t) = √


2π −∞

The use of Euler’s formula together with Fourier transform are very helpful in the analytical
study of LSWE. Some reasons include:

(a) We only need to solve the problem for one single wave frequency ω, and then just
integrate over the frequency domain to get the desired wave form.
(b) Fourier transform simplifies differentiation. For example, ηt = −iωη.
(c) Many functions have tabulated Fourier transforms, allowing us to obtain closed-form
analytical solutions.

有限 差 分 法 )
4. Basic finite difference methods (有
The Taylor series expansion of a function f (x) about a point x = x0 is

f 0 (x0 ) f 00 (x0 ) f 000 (x0 )


f (x0 + ∆x) = f (x0 ) + ∆x + ∆x2 + ∆x2 + · · · , (10)
1! 2! 3!
where ∆x > 0 is a small distance.
We can rearrange (10) to get means to approximate the first derivative of f (x0 ):

f (x0 + ∆x) − f (x0 ) ∆x 00 ∆x2 000


f 0 (x0 ) = − f (x0 ) − f (x0 ) − · · · . (11)
∆x 2 6

If we keep only the first term, we end up with the first-order accurate forward-
difference formula:
f (x0 + ∆x) − f (x0 )
f 0 (x0 ) = + O(∆x). (12)
∆x

Using this approximation, we know the largest truncation error scales with ∆x – the other
truncation terms are O(∆x2 ), O(∆x3 ), etc. If ∆x is small (which is what we want), the
higher-order terms will be much smaller than the leading-order term. Therefore, when we
decrease the size of ∆x, we expect the approximation to become more accurate, at a rate of
O(∆x) – this is called the rate of convergence (收 收斂 速率). Since the convergence rate of
the forward-difference formula (18) is first-order in terms of ∆x, we call this approximation
to be first-order accurate.

2
ESOE 5136 2021 March 8 - Handout Lo

We can also use the Taylor series expansion


f 0 (x0 ) f 00 (x0 ) f 000 (x0 )
f (x0 − ∆x) = f (x0 ) − ∆x + ∆x2 − ∆x2 + · · · , (13)
1! 2! 3!
which can be arranged to yield
f (x0 ) − f (x0 − ∆x) ∆x 00 ∆x2 000
f 0 (x0 ) = + f (x0 ) − f (x0 ) + · · · . (14)
∆x 2 6

We then end up with the first-order accurate backward-difference formula:


f (x0 ) − f (x0 − ∆x)
f 0 (x0 ) = + O(∆x). (15)
∆x

A more efficient method is to combine the forward- and backward-difference formulas.


Adding (11) and (14) and dividing by two, we have

f (x0 + ∆x) − f (x0 − ∆x) ∆x2 000


f 0 (x0 ) = − f (x0 ) + · · · . (16)
2∆x 3

Thus, the second-order accurate central-difference formula is derived:


f (x0 + ∆x) − f (x0 − ∆x)
f 0 (x0 ) = + O(∆x2 ). (17)
2∆x
The central-difference formula is not only more accurate (using the same number of points),
but also symmetric in space. Unless there are other compelling reasons to use a nonsy-
metric method like the forward-difference formula or the backward-difference formula, the
central-difference formula is the preferred choice.

5. A very simple (but useless) numerical scheme


A very simple finite-difference scheme can be implemented to solve the 1DH LSWE (1).
Recall that the first-order accurate forward-difference formula is
f (x0 + ∆x) − f (x0 )
f 0 (x0 ) = + O(∆x), (18)
∆x
and the second-order accurate central-difference formula is
f (x0 + ∆x) − f (x0 − ∆x)
f 0 (x0 ) = + O(∆x2 ). (19)
2∆x

We use the forward-difference formula to write the temporal derivatives as


 (n+1) (n)
 ∂η (n+1) ηi − ηi

 (
 ∂t i ) '
∆t

, (20)
 (n+1) (n)
 ( ∂U )(n+1) ' Ui


 − Ui
∂t i ∆t
and we use the central-difference formula to write the spatial derivatives as
(n) (n)

 ( ∂(U h) )(n) ' Ui+1 hi+1 − Ui−1 hi−1


∂x i 2∆x


, (21)
 (n)
 ∂η (n) ηi+1 − ηi−1
 (n)
 ( ) '

∂x i 2∆x

3
ESOE 5136 2021 March 8 - Handout Lo

where ∆t is the step size in time, ∆x is the step size in space, the subscript i is used to
denote the i-th discretized node in space, the superscript (n) is used to denote variables
at the current time step, and the superscript (n + 1) is used to denote variables at the new
time step.
Substituting these approximations into the 1DH LSWE (1), we obtain
(n) (n)
 (n+1) (n)
 ∂η ∂(U h) ηi − ηi Ui+1 hi+1 − Ui−1 hi−1


 ∂t = − ⇒ = −
∂x ∆t 2∆x

. (22)
 (n+1) (n) (n) (n)
 ∂U = −g ∂η ⇒ Ui

 − Ui ηi+1 − ηi−1
= −g

∂t ∂x ∆t 2∆x
From these two equations, we acquire means to update ηi and Ui in time:

(n+1) (n) ∆t  (n) (n)


 η i = η i − Ui+1 hi+1 − U i−1 hi−1
2∆x


. (23)

 (n+1) (n) ∆t 
(n) (n)

 Ui
 = Ui − g ηi+1 − ηi−1
2∆x
In addition, numerical boundary conditions need to be imposed at the two ends.
The numerical scheme (23) is a very intuitive way to solve the 1DH LSWE (1). It is
first-order accurate in time and second-order accurate in space. However, this method is
actually “unconditionally unstable”, which means that the numerical results will eventually
“blow up” regardless of the sizes of ∆x and ∆t. Therefore, while this scheme is helpful
for learning numerical methods, it is never used in practice. We will discuss an improved
(yet still very basic) method next.

6. The Lax-Friedrichs numerical scheme


The basic yet unstable numerical scheme (23) can be modified to yield a stable scheme,
which is called the Lax-Friedrichs numerical scheme:
(n) (n)

 (n+1) ηi+1 + ηi−1 ∆t  (n) (n)



 iη = − U h i+1 − U h
i−1 i−1
 2 2∆x i+1
. (24)
 (n) (n)
 U (n+1) = Ui+1 + Ui−1 − ∆t g η (n) − η (n)

  

i i+1 i−1
2 2∆x
We see that the first terms on the right hand sides of (23) are now replaced by the two-point
averages:
(n) (n)

 (n) ηi+1 + ηi−1
 ηi

 ⇒
2

. (25)
 (n) (n)
 U (n) ⇒ Ui+1 + Ui−1



i
2
The Lax-Friedrichs method is also first-order accurate in time and second-order accurate
in space. It can be proved to be stable for
∆x
∆t ≤ √ , (26)
ghmax
where hmax is the maximum still water depth in the numerical domain.

4
ESOE 5136 2021 March 8 - Handout Lo

While the Lax-Friedrichs method is easy to understand and numerically stable, it has
significant numerical dissipation. This means that the numerical solution is damped as if
there were artificial friction – it becomes smaller and smaller over time. As you will see
in Assignment#2, the wave height will decrease quickly over time due to this numerical
dissipation. As a result, the Lax-Friedrichs method is also quite useless in practice without
further modification.

7. Courant-Friedrichs-Lewy (CFL) condition


The CFL condition requires that in a convergent numerical method, the relation between
∆t and ∆x must satisfy
∆x
∆t ≤ CCFL , (27)
uCFL

where uCFL is a characteristic speed (we may use uCFL = ghmax for LSWE), and CCFL is
a constant called the Courant number (庫 庫朗數 ) or the CFL number.
The Courant number varies for different numerical methods. For the Lax-Friedrichs
method, CCFL = 1 in theory. However, in practice, a smaller number is usually used.
CCFL = 0.9 for example.

8. Local truncation error


The location truncation error is a measure of how well a numerical scheme such as (24)
approximates the original PDE locally. The local truncation error of the Lax-Friedrichs
method can be derived using Taylor series expansion.
Take the first discretized equation in (24) for example. It can be written as
(n) (n)
 
ηi+1 +ηi−1 (n) (n)
ηi
(n+1)
− U h
i+1 i+1 − U h
i−1 i−1
2
+ = 0, (28)
∆t 2∆x
which looks like the discretized version of the governing equation
∂η ∂U h
+ = 0. (29)
∂t ∂x

If we plug the exact solutions, η(x, t) and U (x, t), of the 1DH LSWE (1) into (28), the
equation will not equal zero, because (28) is different from the original PDE. This difference
is the local truncation error L(x, t):
η(x+∆x,t)+η(x−∆x,t)
η(x, t + ∆t) − 2
∆t
  . (30)
U (x + ∆x, t)h(x + ∆x) − U (x − ∆x, t)h(x − ∆x)
+ = L(x, t)
2∆x

5
ESOE 5136 2021 March 8 - Handout Lo

Next, we use Taylor series to write


2 2
   
 ∆t2
 η+∆xηx + ∆x
2
ηxx +··· + η−∆xηx + ∆x
2
ηxx −···
η + ∆tηt + 2 ηtt + · · · − 2
∆t
2 ∆x3
(U h) + ∆x(U h)x + ∆x
 
2 (U h)xx + 6 (U h)xxx + · · ·
+
2∆x .
2 3
(U h) − ∆x(U h)x + ∆x ∆x
 
2 (U h)xx − 6 (U h)xxx + · · ·

2∆x
 ∆t ∆x2 ∆x2 ∆x2
, ∆x2 )

= ηt + (U h)x + ηtt − ηxx + (uh)xxx + · · · = L(x, t) = O(∆t,
2 2∆t 6 ∆t
(31)
Note that (29) is used to simplify the first term on the last line of (31).
2
Due to the CFL condition (27), ∆t is in fact proportional to ∆x. Thus, O(∆t, ∆x 2
∆t , ∆x ) '
O(∆t). The overall accuracy of the Lax-Friedrichs scheme is really only first-order, since
the local truncation error
L(x, t) = O(∆t). (32)

9. Global error
What we are ultimately interested in is the global error; that is, overall, how well the
numerical solution approximates the true solution. A commonly used measure is the L2 -
norm (範 範 數). At the n-th time step, the L2 -norm based on the free surface elevation is
calculated as
v
u
u1 X N
2 (n) (n) (n) (n)
L -norm = t (ηi,num − ηi,true )2 = ||ηnum − ηtrue ||2 , (33)
N
i=1

where N is the number of discretized nodes in space, ηi,true is the true solution at the
location of the i-th node, ηi,num is the model-predicted value at the i-th node, and the
superscript (n) denotes the current time step.
A numerical scheme is said to be convergent in the L2 -norm if

L2 -norm → 0 (34)

as the step size (e.g., ∆x or ∆t) decreases to zero.


How fast the L2 -norm approaches zero as the step size decreases is called the convergence
rate of a numerical method. There are theories that allow us to estimate the global error
from the local truncation error. Thus, we can claim that the Lax-Friedrichs numerical
scheme has an overall first-order convergence rate (or first-order in time and second-order
in space).
10. Stability
A numerical method is said to be stable if the numerical results do not “blow up” over
time. In terms of the L2 -norm of the free surface elevation, this means that
(n+1) (n)
||ηnum − ηtrue ||2 ≤ ||ηnum − ηtrue ||2 . (35)

In practice, if we encounter unforeseen numerical instabilities in a simulation, we can try


reducing the Courant number CCFL .

You might also like