You are on page 1of 39

Mixing in natural water bodies

Yiqing GUAN

College of Water Resources and Hydrology


Hohai University
Y. Guan Contents

•  Objectives

•  Governing equations

•  Numerical methods

•  Review of advective schemes

•  TVD schemes

•  Numerical tests

•  Model application

•  Conclusions and recommendations

Y. Guan Approaches

•  Theoretical method

•  Experimental method

•  Computational Methods

Y. Guan Processes

•  Modeling procedure

Model Terminology
Water Quality Models

Environments Lake, River, Estuary

Purposes Hydrochemical , Mixing Zone, Time of


travel
Dimension 0D, 1D, 2D, 3D

Processes Empirical, Mechanistic

Data types Stochastic, Deterministic

Time variations Dynamic , Steady state


Y. Guan Governing equation

• 
3D advection-diffusion equation-time averaging procedure

used to the 3D ADE in the laminar flow regime

!c !(u c ) !(v c ) !(wc ) ! !c ! !c ! !c


+ + + = (" x ) + (" y ) + ("z ) + s
!t !x !y !z !x !x !y !y !z !z

•  Turbulent diffusion coefficients, or diffusivities



•  Advection terms in x-, y- and z-directions

•  Diffusion terms in x-, y- and z-directions

•  Source or sink term

Y. GUAN
Governing Equation

•  2D DA mixing equation with reaction term-spatial
averaging the 3D ADE
∂hC ∂ ∂
+ (hUC) + (hVC)
∂t ∂x ∂y
∂ ∂C ∂ ∂C
= (h(K x + ε x ) ) + (h(K y + ε y ) ) ± S
' '

∂x ∂x ∂y ∂y

•  2D DA mixing equation for steady source condition


∂ ∂ ∂ ∂C ∂ ∂C
(hUC) + (hVC) = (hK x ) + (hK y )
∂x ∂y ∂x ∂x ∂y ∂y
Y. GUAN
Governing Equation

•  2D DA mixing equation in the non-conservative form

∂C ∂C ∂C ∂ 2C ∂ 2C
+U +V = Kx 2 + Ky 2 ± S
∂t ∂x ∂y ∂x ∂y
Y. GUAN
Governing Equation

•  Cross-section averaging 2D equation

•  1D mixing equation – 1D longitudinal equation

∂AC ∂ ∂ ∂C
+ (AUC) = (AK x )
∂t ∂x ∂x ∂x

•  1D mixing equation for steady source


∂ ∂ ∂C
(AUC) = (AK x )
∂x ∂x ∂x
•  1D mixing equation with source/sink term

∂ ∂ ∂C
(AUC) = (AK x ) ±S
∂x ∂x ∂x
Y. Guan
Governing equation

•  2D depth-averaged ADE in the orthogonal curvilinear
coordinate system or nature system (Harden and Shen, 1979;
Krishnappan and Lau, 1980; Guan, 2003):

!C U !C V !C 1 ! hy !C 1 ! hx !C
+ + = ( hK x )+ ( hK y ) + S
!t h x !x h y !y hh x h y !x h x !x hh x h y !z h y !y
Y. Guan

Stream tube model

•  2D ADE based on the stream tube method

!C U !C 1 ! hy !C U 1 ! !C
+ = ( hK x )+ (h h 2
UK " ) + hS
!t h x !x hh x h y !x h x !x h x Q !"
2 x
!"
Y. Guan
Numerical methods

Y. Guan
Numerical method

•  Operator splitting method is commonly used in solving ADE:

•  1D advection equation:

!C U !C
+ =0
!t h x !x

•  1D dispersion equations:

!C 1 ! hy !C !C U 1 ! !C
= ( hK x ) = (h h 2
UK )
!t hh x h y !x h x !x !t h x Q !"
2 x "
!"

•  1D reaction equation:
!C
= "K1C + K 0
!t
Y. Guan
Numerical method

FDM

FEM

FVM

Particle Tracking , Random Walk,


Spectral Method

Hybrid

•  Difficulty in solving advection equations: Numerical


diffusion and numerical dispersion

Y. Guan
Numerical method

•  Numerical considerations

Y. Guan
Numerical method

•  Numerical considerations

•  The numerical characteristics of time and spatial deviations?



•  The error in a method's solution is defined as the difference between its
approximation and the exact analytical solution.

•  The two sources of error in finite difference methods are :



1. Round –off error, the loss of precision due to computer rounding of
decimal quantities,

2. Truncation error or discretization error, the difference between the exact
solution of the finite difference equation and the exact quantity assuming
perfect arithmetic (that is, assuming no round-off).
Y. Guan
Numerical method

Finite Difference Methods:



1.  Upwind (UW)

2.  Central difference (CD)

3.  Lax-Wendroff (LW)

4.  Leap-frog (LF)

5.  QUICK

6.  QUICKEST

7.  Brian-Stone

8.  Double-time step implicit-explicit method

9.  Semi-Lagrangian method (SMM, HP)

Y. Guan
Numerical method

•  FCT, TVD algorithms



•  Variable element method

Y. GUAN Solution of advection equation

Advantages and Disadvantages


1.  Lower order not accurate
2.  Higher order schemes often give spurious results:
3.  Negative values
4.  Too high values
5.  Wiggle values around fronts
Y. Guan

Flux form

1.  Derivation from Taylor's polynomial
2.  First, assuming the function whose derivatives are to be approximated is
properly-behaved, by Taylor’s theorem, we can create a Taylor Series expansion

1 ∂φ 1 ∂ 2 φ 2 1 ∂ 3φ 3
φ(x i + Δx) = φ(x i ) + Δx + Δx + Δx + ...
1! ∂x 2! ∂x 2
3! ∂x 3

1 ∂φ 1 ∂ 2φ 1 ∂ 3
φ
φ(x i − Δx) = φ(x i ) + (−Δx) + ( −Δx) 2
+ ( −Δx) 3
+ ...
1! ∂x 2! ∂x 2
3! ∂x 3

2 3
Δx 1 ∂φ Δx 1 ∂ 2φ ⎛ Δx ⎞ 1 ∂ 3φ ⎛ Δx ⎞
φ ( xi + ) = φ ( xi ) + + 2 ⎜ ⎟ + 3 ⎜ ⎟ + ...
2 1! ∂x 2 2! ∂x ⎝ 2 ⎠ 3! ∂x ⎝ 2 ⎠
2 3
Δx 1 ∂φ Δx 1 ∂ φ ⎛ Δx ⎞ 1 ∂ φ ⎛ Δ x ⎞
2 3
φ ( xi − ) = φ ( xi ) + (− ) + 2 ⎜
− ⎟ + 3 ⎜
− ⎟ + ...
2 1! ∂x 2 2! ∂x ⎝ 2 ⎠ 3! ∂x ⎝ 2 ⎠
Y. Guan

Flux form

first order: φi +1/2 = φi

1 ( −φi −1 + φi ) Δx
2’nd order: φi +1/2 = φi + + 0 = ( −φi −1 + 3φi ) / 2
1! Δx 2

1 ( −φi + φi +1 ) Δx
φi +1/2 = φi + + 0 = (φi + φi +1 ) / 2
1! Δx 2

⎛ − φi −1 + φi +1 ⎞ ⎛ φi −1 − 2φi + φi +1 ⎞
3’rd order: φi +1/ 2 = φi + ⎜ ⎟+⎜ ⎟
⎝ 2 ⎠ ⎝ 8 ⎠
Y. Guan
Numerical method

•  Finite difference method is employed to solve ADE:
•  1D advection dispersion equations: ∂C ∂C ∂ 2C
+U = Kx
∂t ∂x ∂ x2

Cin+1 − Cin Cin+1 − Cin Cin+1 − 2Cin + Cin−1


+U = Kx
Δt Δx (Δx) 2

n +1 U Δt n K x Δt n
Ci = Ci − n
(Ci +1 − Ci ) +
n
(Ci +1 − 2Ci + Ci −1 )
n n

Δx (Δx) 2

Cin +1 = Cin − α (Cin+1 − Cin ) + β (Cin+1 − 2Cin + Cin−1 )


U Δt K x Δt
α= , β=
Δx (Δx) 2
Y. Guan
Numerical method

•  Finite difference method is employed to solve ADE:
•  By using LW scheme, it is given below:

α α 2
Cin +1 = Cin − (Cin+1 − Cin−1 ) + (Cin+1 − 2Cin + Cin−1 ) + β(Cin+1 − 2Cin + Cin−1 )
2 2
Y. Guan
Solution of advection

•  Solving 1D advection equation

Cin +1 = Cin " ! nr Cnr + ! nl Cnl

•  !(x, t) = U!t/(hx !x); Cl and Cr are the face values of


CV

Y. GUAN Solution of advection

•  The upwind finite-difference scheme (UW) is mass conserving,
positive and monotonic. It provides stable solution if the
Courant number is less than unity and it is easy to be
implemented into computer codes. Assuming positive velocity,
the first-order upwind difference scheme is

C =C
n
r
n
i

•  The second-order central difference scheme (CD) is unstable and


with unphysical oscillations, but without the addition of
diffusion. For solving the pure advection equation, it is defined
as

1
Cr = (Ci + Ci +1 )
2
Y. GUAN Solution of advection

∂c cin +1 − cin −1
•  Leap-frog technique =
∂t 2Δt
•  A straightforward 5 point central discretization with 4th order
accuracy in space
∂c 1
= (−cin+ 2 + 8cin+1 − 8cin−1 + cin−2 )
∂x 6Δx
•  The 4th-order leap-frog method is :

cin +1 − cin −1 1
=− (−cin+ 2 + 8cin+1 − 8cin−1 + cin−2 )
2Δt 6Δx
•  The 2nd-order leap-frog method (second-order accuracy in space
and time ) is
cin +1 − cin −1 1
=− (cin+1 − cin−1 )
2Δt 2Δx
Y. GUAN Solution of advection equation

•  To discretize C in time and space involves a clever use of
the Taylor expansion
∂C(x, t) Δt 2 ∂ 2 C(x, t)
C(x, t + Δt) = C(x, t) + Δt + + O( Δt 3
)
∂t 2! ∂t 2

•  But we note from the governing one-way wave equation


∂C U ∂C U 1
=− ≈− (Ci +1 − Ci −1 )
∂t h x ∂x h x 2Δx
•  Taking the derivative of the equation results in the relation

∂ 2C U 2 ∂ 2C U 2 1
= ≈ (Ci +1 − 2Ci + Ci −1 )
∂t 2
h x ∂x 2
h x Δx 2

∂C ∂2C
•  These two expressions for and can be substituted
∂t ∂t 2

into the Taylor series expression to yield the iterative scheme



Y. GUAN Solution of advection equation

α α 2
Cin +1 = Cin − (Cin+1 − Cin−1 ) + (Cin+1 − 2Cin + Cin−1 )
2 2

•  This is the Lax-Wendroff scheme (LW)



•  It is a second-order scheme. It has no dissipation, but has
dispersion errors resulting in strong oscillations.

•  However, it introduces an important stabilizing diffusion
term which is proportional to a2.
•  It useful as example, it is difficult to implement in practice
for variable coefficient problems. It illustrates, however, the
variety and creativity in developing iteration schemes for
advancing the solution in time and space.
Y. Guan
Solution of dispersion/reaction

•  The implicit central FD scheme solving sub-dispersion
equations

n +1 n +1 n +1 n +1
Ci,n+1
j ! C n
i, j 1 h C ! C h C ! C
=( ) i, j[( y hK x )i+1/ 2, j i+1, j 2 i, j ) ! ( y hK x ) i!1/2, j i, j 2 i!1, j )]
"t hh x h y hx "x hx "x

n +1
j ! Ci, j
Ci,n+1 n
U 1 j+1 ! C i, j
Ci,n+1 C ni,+1 n +1
j ! C i, j!1
=( 2
) [(h h UK # ) i, j+1/2 ) ! (h x h UK # ) i, j!1/2
2
)]
"t h x Q2 i, j x "#2 "#2

•  The explicit FD scheme solving the first-order reaction


n !k1"t
C n+1
i,j = C i, je
Y. Guan
Stability conditions

•  The Courant number for the explicit


schemes must be less than unity

•  The implicit schemes do not suffer from the
stability conditions

Y. Guan
Boundary conditions

•  Solid boundaries, no diffusion flux



•  Downstream and upstream boundary
conditions must be specified

Y. Guan Numerical test for pure advection

•  The numerical test for pure advection is normally carried out


in the straight wide rectangular channel under uniform flow
condition

•  Two initial and boundary conditions are specified as follows

C(x, 0) = 10
for 5Δx < x < 15Δx
πx
C(x, 0) = 10sin (
2
)
20Δx
for 40Δx < x < 60Δx
Y. Guan
Numerical tests for pure advection

C(x,0) = 10,
for 5!x < x < 15!x
"x
C(x,0) = 10sin 2 ( ),
20!x
for 40!x < x < 60!x
Y. Guan
Dispersion results

Y. Guan
Dispersion results

Y. Guan
Dispersion results

Y. Guan
Simulation of dispersion in open channels

Thanks!
1、1D problems:

One rectangular channel,B = 8 m,H = 0.4 m,S0 = 0.00005, L =


150 km. Assuming the channel bed is concrete. To simulate the
concentration using finite difference schemes at sections 50 km
and 100 km.

The boundary conditions are given :

C(x, 0) = 10
for 5Δx < x < 15Δx
πx
C(x, 0) = 10sin (
2
)
20Δx
for 40Δx < x < 60Δx
Y. GUAN Solution of advection dispersion
equation

•  Using MATLAB to write computer code



•  Using the Lax-Wendroff scheme (LW) to solve the 1D
Advection Dispersion Equation

α n α2 n
C = C − (Ci +1 − Ci −1 ) + (Ci +1 − 2Cin + Cin−1 ) + β (Cin+1 − 2Cin + Cin−1 )
i
n +1
i
n n

2 2
U Δt K Δt
α= , β= x 2
Δx (Δx)

You might also like