Lecture Solution Shallow water FD FV 1D...

Preview:

Citation preview

Overview of Finite Volume Methods for Solution of the Shallow Water Equations in 1D and 2D

Prof. Arturo S. Leon, Ph.D., P.E., D.WREFlorida International University

Evolving from Finite Difference (FD) to Finite Volume (FV)• Over the last several decades, the shallow water

equations in 1D and 2D were solved mostly using Finite Difference (FD) techniques.

• Since about a decade ago (~2005), there is more emphasis on using Finite-Volume (FV) methods for the solution of the shallow water equations in 1D and 2D

• A FV solution approach, similar to what was added for 2D modeling will be available for 1D modeling in HEC-RAS version 5.1

Preissmann Scheme (Finite Difference) This method has been widely used (e.g.,

HEC-RAS)

The advantage of this method is that variable spatial grid may be used

Steep wave fronts may be properly simulated by varying the weighting coefficient

1D HEC-RAS (< V. 5.1)

1 11 1( ) ( )2

k k k ki i i if f f ff

t t

xff

xff

xf k

ik

ik

ik

i

))(1()( 1

111

))(1(21)(

21

111

1k

ik

ik

ik

i fffff

Preissmann Scheme cont…

Where α is a weighting coefficient By selecting a suitable value for α, the scheme may

be made totally explicit (α=0) or implicit (α=1) Usually, the scheme is stable if 0.6< α ≤1.

Finite Volume Methods(1D-2D)

Adapted from Lecture Notes on Shallow-Water equations by Andrew Sleigh, Toro (1999,2001) and Leon et al. (2006, 2010)

Ability to handle extreme flows Transitions between subcritical / supercritical

flows are easily handled– Other techniques have problems with trans-critical

flows Steep wave fronts can be accurately

simulated

Finite Volume Shock-Capturing Methods

Dam break

Source: An unstructured node-centered finite volume scheme for shallow water flows with wet/dry fronts over complex topography, Nikolos and Delis

Dam break (animation)http://www.youtube.com/watch?v=-QXUViTi_b0

Shallow-water equations in 1D

USUFU xt

QA

U

1

2

gIA

QQ

UF

fo SSgAgI

US2

0

Governing equations in conservative form

I1 and I2 Trapezoidal channel

– Base width B, Side slope SL= Y/Z

Rectangular, SL = 0

Source term

322

1LShBhI

dxdSh

dxdBhI L

3212

2

BABhI22

22

1 dxdB

BAI 2

2

2 2

)3/4(2

2

RAnQQ

S f

Rectangular Prismatic

huh

U

22

21 ghhu

huUF

fo SSgh

US0

dUUSdtUFdxUVV

Finite volume formulation For homogeneous form

– i.e. without source terms

rectangular control volume in x-t space

0V

dtUFdxU

xi-1/2 xi+1/2

tn+1

i

Fi-1/2Fi+1/2

xi-1/2 xi+1/2

tn+1

i

Fi-1/2Fi+1/2

t

x

Finite Volume Formulation (Cont.)

Defining as integral averages

Finite volume formulation becomes

1/2

1/2

1 ,i

i

xni nx

U U x t dxx

1/2

1/2

11

1 ,i

i

xni nx

U U x t dxx

1

1/2 1/21 ,n

n

t

i itF F U x t dt

t

1

1/2 1/21 ,n

n

t

i itF F U x t dt

t

2/12/11

iini

ni FF

xtUU

So far no approximation was made

The solution now depends on how the integral averages are estimated

In particular, the inter-cell fluxes Fi+1/2 and F1-1/2

need to be estimated.

Finite Volume Formulation (Cont.)

Godunov method for flux comput. Uses information from the wave structure Assume piecewise linear data states

Flux calculation is solution of local Riemann problem

n

n+1

i-1 i i-1

Fi+1/2Fi-1/2Cells

Data states

n+1

n

U(0)i+1/2U(0)i-1/2

n

n+1

i-1 i i-1

Fi+1/2Fi-1/2Cells

Data states

n+1

n

U(0)i+1/2U(0)i-1/2

Riemann Problem The Riemann problem is an initial value

problem defined by

The solution of this problem can be used to estimate the flux at xi+1/2

0 xt UFU

2/11

2/1,i

ni

ini

n xxifUxxifU

txU

Riemann Problem (Cont.)The Riemann problem is a generalisation of the dam break problem

Dam wall

Deep water at rest

Shallow water at rest

Dam wall

Deep water at rest

Shallow water at rest

Dam Break Solution

Evolution of solution

x

x

x

Water levels at time t=t*

t*t

Velocity at time t=t*

v

h

Shock

Rarefaction

xx

xx

xx

Water levels at time t=t*

t*t

Velocity at time t=t*

v

h

Shock

Rarefaction

Wave structure

Exact Solution

Toro (1992) demonstrated an exact solution

Considering all possible wave structures a single non-linear algebraic equation gives solution.

Exact Solution Consider the local Riemann problem

Wave structure

0 xt UFU

00

0,xifUxifU

xUR

L

x

t

Right wave, (u+c)Left wave (u-c)Star region, h*, u*

(u)

vL

tShear wave

vR

hL, uL, vL hR, uR, vR

0xx

t

Right wave, (u+c)Left wave (u-c)Star region, h*, u*

(u)

vL

tShear wave

vR

hL, uL, vL hR, uR, vR

0

hvhuh

U

huv

ghhuhu

UF 22

21

PossibleWave structures

x

tRight Shock

Left Rarefaction Shear wave

x

t

Left Shock Right RarefactionShear wave

x

tRight Rarefacation

Left RarefactionShear wave

x

t

Right ShockLeft ShockShear wave

xx

tRight Shock

Left Rarefaction Shear wave

xx

t

Left Shock Right RarefactionShear wave

xx

tRight Rarefacation

Left RarefactionShear wave

xx

t

Right ShockLeft ShockShear wave

Across left and right wave h, u change v is constant

Across shear wave v changes, h, u constant

LL cudtdx /**/ cudtdx

LL cudtdx /

**/ cudtdx

* */dx dt u c

/ R Rdx dt u c

* */dx dt u c / R Rdx dt u c

Conditions across each wave

Left Rarefaction wave

Smooth change as move in x-direction Bounded by two (backward) characteristics

Left bounding characteristic

x

t

hL, uL h*, u*

Right bounding characteristic

LL cudtdx / **/ cudtdx

Crossing the rarefaction

We cross on a forward characteristic

States are linked by:

or

constant2 cu

** 22 cucu LL

** 2 ccuu LL

Solution inside the left rarefaction

The backward characteristic equation is For any line in the direction of the rarefaction

Crossing this the following applies:

Solving gives

On the t axis dx/dt = 0

cucu LL 22

cudtdx

dtdxcuc LL 2

31 1 2 2

3 L Ldxu u cdt

LL cuc 231

LL cuu 231

Right rarefaction

Bounded by forward characteristics Cross it on a backward characteristic

In rarefaction

On the t axis dx/dt = 0

RR cuc 231

** 22 cucu RR RR ccuu ** 2

dtdxcuc RR 2

31

dtdxcuu RR 22

31

cudtdx

RR cuu 231

Shock waves

Two constant data states are separated by a discontinuity or jump

Shock moving at speed Si

Using Conservative flux for left shock

LL

LL uh

hU

**

** uh

hU

Conditions across shock

Rankine-Hugoniot condition

Entropy condition

λ1,2 are equivalent to characteristics. They tend towards being parallel at shock

LiL UUSUFUF **

*USU iiLi

Shock analysis

Change frame of reference, add SL

Rankine-Hugoniot (mass and momentum ) gives

LLL Suu ˆLSuu **ˆ

LL

LL uh

hU

ˆˆ

**

** ˆ

ˆuh

hU

222*

2**

**

21ˆ

21ˆ

ˆˆ

LLL

LL

ghuhghuh

uhuh

Shock analysis

Mass flux conserved

From momentum eqn.

Using

also

LLL uhuhM ˆˆ**

L

LL uu

hhgMˆˆ2

1*

22*

** /ˆ hMu L LLL hMu /ˆ

LLL hhhhgM **21

LL uuuu ** ˆˆ

L

LL uu

hhgM*

22*

21

Left Shock Equation

Equating gives

Also

LLL hhfuu ,**

L

LLLL hh

hhghhhhf*

*** 2

1,

L L L LS u c q

2

**

21

L

LL h

hhhq

Right Shock Equation

Similar analysis gives

Also

RRR hhfuu ,**

R

RRRR hh

hhghhhhf*

*** 2

1,

R R R RS u c q

2

**

21

R

RR h

hhhq

Complete equation Equating the left and right equations for u*

Which is the iterative of the function of Toro (2001)

* *,L L Lu u f h h RRR hhfuu ,**

* *, , 0R L L L R Ru u f h h f h h

0,, *** uhhfhhfhf LRLL

Determine which wave

Which wave is present is determined by the change in data states thus:

– h* > hL left wave is a shock– h* ≤ hL left wave is a rarefaction

– h* > hR right wave is a shock– h* ≤ hR right wave is a rarefaction

Steps to determine exact solution

Solution Procedure Construct this equation

And solve iteratively for h (=h*). – The functions may change in each iteration

, ,L L R Rf h f h h f h h u

f(h) The function f(h) is defined as

And u*

, ,L L R Rf h f h h f h h u

)(21

)(2

shockhhifhh

hhghh

nrarefactiohhifghghf

LL

LL

LL

L

)(21

)(2

shockhhifhh

hhghh

nrarefactiohhifghghf

RR

RR

RR

R

LR uuu

* * *1 1 , ,2 2L R R R L Lu u u f h h f h h

Iterative solution

The function is well behaved and solution by Newton-Raphson is fast – (2 or 3 iterations)

One problem – if negative depth calculated! This is a dry-bed problem. Check with depth positivity condition:

RLLR ccuuu 2

Dry–Bed solution

Dry bed on one side of the Riemann problem

Dry bed evolves Wave structure is

different.

x

t

x

t

x

t

Wet bed

Dry bed

Wet bed

Wet bed

Wet bed

Dry bed

Dry bed

xx

t

xx

t

xx

t

Wet bed

Dry bed

Wet bed

Wet bed

Wet bed

Dry bed

Dry bed

Dry-Bed Solution (Cont.) Solutions are explicit

– Need to identify which applies – (simple to do) Dry bed to right

Dry bed to left

Dry bed evolves h* = 0 and u* = 0– Fails depth positivity test

LL cuc 231

* LL cuu 231

*

RR cuc 231

* RR cuu 231

*

gch /2**

Shear wave (discontinuities that arise from eigenmodal analysis)

The solution for the shear wave is straight forward.– If vL > 0 v* = vL

– Else v* = vR

Can now calculate inter-cell flux from h*, u* and v*– For any initial conditions

Approximate Riemann Solvers –1D Model No need to use exact solution

Exact solutions require iterations and are computationally expensive

For some problems, exact solutions may not exist

Many Riemann solvers are available (Roe’s and HLL are most popular)

Toro Two-Rarefaction Solver

Assume two rarefactions Take the left and right equations

Solving gives

For critical rarefaction use solution earlier

** 2 ccuu LL RR ccuu ** 2

24*RLRL ccuuc

Toro Two-Shock Solver Assuming the two waves are shocks

Use two rarefaction solver to give h0

RL

RLRRLL

qquuhqhqh

*

LLRRRL qhhqhhuuu *** 21

21

Lo

LoL hh

hhgq2

Ro

RoR hh

hhgq2

Roe’s Solver Governing equations are approximated as:

Where is obtained by Roe averaging

xtxtxt UAUAUUUFU ~

A~

L L R R

L R

u h u hu

h h

RLhhh ~

22

21~

RL ccc

Approximate Riemann Solvers – 1D

; L L R Rc gh c gh

Roe’s Solver (Cont.) Properties of matrix

– Eigen values

– Right Eigen vectors

– Wave strengths

Flux is given by

cu ~~~1 2 u c

cu

R ~~1~ )1(

cu

R ~~1~ )2(

u

chh ~

~

21~

1

u

chh ~

~

21~

2

; R L R Lh h h u u u

2

112/1

~~~21

21

j

jjj

ni

nii FFF R

HLL Solver Harten, Lax, Van Leer Assume wave speed Construct volume Integrate

Or,

t

URUL

U*

FRFL F*

t

xL xR

t

URUL

U*

FRFL F*

t

xL xR

0* LRRLRRLL tUtUUxxUxUx

txS L

L

t

xS RR

LRRLLLRR SSFFUSUSU /*

LRLRRLRLLR SSUUSSFSFSF /*

HLL Solver What wave speeds to use?

– One option:

For dry bed (right)

Simple, but robust

TRTRLLL cucuS ,min

TRTRRRR cucuS ,min

LLL cuS

RRR cuS 2

Higher-Order in Space Construct Riemann problem using surrounding cells May create oscillations Piecewise reconstruction

Need to use limiters

i-1 i i+1 i+2

i-1 i i+1 i+2

L

R

LR

Limiters Obtain a gradient for variable in cell i, Δi

Gradient obtained from Limiter functions Provide gradients at cell faces

Limiter Δi =G(a,b)

iiL xUU 21

11 21

iiR xUU

ii

iii xx

uua

2/1

12/1

1

12/1

ii

iii xx

uub

Limiters (Cont.) A general limiter

β=1 give MINMOD, β=2 give SUPERBEE

Van Leer

0,max,,max,0min0,min,,min,0max

,aforbabaaforbaba

baG

ba

bababaG

,

Higher order in time Needs to advance half time step MUSCL-Hancock

– Primitive variable– Limit variable– Evolve the cell face values 1/2t:

Update as normal solving the Riemann problem using evolved WL, WR

0 xt WWAW

Ri

Li

ni

RLi

RLi x

t WWWAWW

21,,

2/12/11

iini

ni FF

xtUU

Wet / Dry Fronts

Wet / Dry fronts are difficult– Source of error– Source of instability

Found in: Filling of storm-water and combined sewer

systems Flooding - inundation

Dry front speed

Dry front is fast Can cause problem with time-step / Courant

number

*

*

2 20

2

L

L L

L L L

S u cu c u c

cS u c

t

Wet bed

x

Dry bed

Solutions for wet/dry fronts

Most popular way is to artificially wet bed Provide a small water depth with zero

velocity Can drastically affect front speed Need to be very careful about dividing by

zero

Boundary Conditions

Set flux on boundary– Directly– Ghost cell

Wall u, v = 0. Ghost cell un+1=-un

Transmissive Ghost cell hn+1 = hn

un+1 = un

Source Terms

“Lumped” in to one term and integrated Attempts at “upwinding source” Current time-step

– Could use the half step value E.g.

xB

BKuu

xzghS

2

02

2

nRK

3/2

2/1CRK

Main Problem is Slope Term Flat still water over uneven bed starts to

move. Problem with discretisation of

xzgh

xzzgh lr

i

i-1 i i+1

z, hx

datum level

bed level

water surface

iz1izlz1iz

rh

rz

1ihihlh1ih

Discretisation

Discretised momentum eqn

For flat, still water

Require

lrirl

rlini zzgh

xtghghhuhu

xthuhu

22

22221

022

221

ri

rli

lni zhhzhh

xtghu

rir

lil zh

hzh

h

22

22

A solution Assume a “datum” depth, measure down.For horizontal water surface:

Momentum eqn:– Flat surface

212

i ii i

h hzg h g h gx x x

x

zzhzzhg liirii

22

21

2222'

2 liiriirli zzhzzhhhxtghu

liil zzhh riir zzhh

ihzx x

Shallow-water in two-dimensions

In 2-d we have an extra term:

Friction

hvhuh

U

yy

xx

fo

fo

SSghSSghUS

0

22)3/1(

2

vuuhnS

xf

USUGUFU yxt

huv

ghhuhu

UF 22

21

22

21 ghhv

huvhu

UG

Finite Volume in 2-DIf nodes and sides are labelled as :

Solution is

Where Fns1 is normal flux for side 1 etc.

A1A3

A2

A4

V

L4L3

L2

L1

A1A3

A2

A4

V

L4L3

L2

L1

11 1 2 2 3 3 4 4

n ni i s s s s

tU U Fn L Fn L Fn L Fn LV

FV 2-D Rectangular Grid

Solution is

Fi-1/2Fi+1/2

Gj-1/2

Gj+1/2

i+1/2,j-1/2

i-1/2,j+1/2

i-1/2,j-1/2

i+1/2,j+1/2

i, jFi-1/2Fi+1/2

Gj-1/2

Gj+1/2

i+1/2,j-1/2

i-1/2,j+1/2

i-1/2,j-1/2

i+1/2,j+1/2

i, j

2/1,2/1,,2/1,2/11

jijijijini

ni GG

ytFF

xtUU

y

x

Eigen values

Right Eigen vectors

cu ~~~1 3 u c

(1)

1R u c

v

(3)

1R u c

v

2 u

(2)

001

R

Roe’s Solver:

Roe’s Solver is simple and one of the most popular. This solver will be used in this class.

Approximate Riemann Solvers – 2D

L L R R

L R

u h u hu

h h

L L R R

L R

v h v hv

h h

22

21~

RL ccc

; L L R Rc gh c gh

RLhhh ~

Roe’s Solver (Cont.)

Where:

Wave strengths1 2

1 2 3 1

1 23

( ) ; ; 2

( )2

u u c u u v uc

u u c uc

Roe’s Solver (Cont.)

1 2

3

; or ;

R L R R L L R L

R R R L

u h h u u h u h q qu h v h v

Where:

Update of solution:

3

1/2 11

1 12 2

jn ni i i j j

jF F F

R

Roe’s Solver (Cont.)

Numerical Flux is given by (Toro 2001)

2/1,2/1,,2/1,2/11

jijijijini

ni GG

ytFF

xtUU

Show Demo in MATLAB for Solution of 2D Shallow Water Equations using Roe’s solver (Droplets and Dam break problem)Download Matlab files from Canvas.

References E.F. Toro. Riemann Solvers and Numerical Methods for

Fluid Dynamics. Springer Verlag (2nd Ed.) 1999.

E.F. Toro. Shock-Capturing Methods for Free-Surface Flows. Wiley (2001)

Lecture notes on Shallow-Water equations by Andrew Sleigh

Leon, A. S., Ghidaoui, M. S., Schmidt, A. R. and Garcia, M. H. (2010) “A robust two-equation model for transient mixed flows.” Journal of Hydraulic Research, 48(1), 44-56.

Leon, A. S., Ghidaoui, M. S., Schmidt, A. R. and Garcia, M. H. (2006) “Godunov-type solutions for transient flows in sewers”. Journal of Hydraulic Engineering, 132(8), 800-813.

Recommended