Vous êtes sur la page 1sur 312

Flemish Administration - Department of Mobility and

Public Works

r>

departement

/a

Maritime Access Division

Expansion of the numerical modeling tools for the North Sea


harbours

Task order 4: Design of the implicit scheme in COHERENS

COHERENS 11

M o b ilite it en
Openbare Werken

Colophon
Cover picture: sediment plumes at the Port of Zeebrugge (Bing Maps)

THV IMDC - Soresma


Adress: Coveliersstraat 15, 2600 Antwerp, Belgium
S : + 32 3 270 92 95

i: + 32 3 235 67

11

Email: info@imdc.be
Website: www.imdc.be

T H V IM D C -S o resm a

Expansion of num erical m odeling fools

in coi. with KU Leuven, UGent, BMW en W LB

Task order 4: Design of the implicit schem e in C O H E R E N S

D ocum ent Identification

Title
Project
Client
Document name
Document ref

Task order 4: Design of the implicit scheme in COHERENS


Expansion of numerical modeling tools
Afdeling Maritime Toegang
cr/11339.opl_repv2.pdf
l/RA/11339/10.072/G VH

Revision

Version
1.0
2.0

Date
Description
Author
C hecked / Approvf
14/09/2011 Draft
TVO/PRW
PRW /
GVh
09/08/2012 Final reportTVO/PRW
PRW

Distribution list

12
X

Hard Copy
Digital

Recipient digital report


Recipient analog report

Abstract

In this document, we first describe the physical set of equations and the numerical algorithm
implemented in COHERENS version 3.0.0. Next, an overview of the architecture and structure of
the final Implementation Is provided. Subsequently, we list the output of the subtask. In the final
Chapters, the testing of the code is discussed and recommendations for further development are
formulated.

l/RA/11339/10.072/G VH
Version 2.0 09/08/2012

T H V IM D C -S o resm a
in coi. w ith KU Leuven, UG ent, BM M en W LB

l/RA/11339/10.072/GVH
Version 2.0 09 /08/2012

E xpansion of num erical m odeling tools


Task ord er 4: Design of th e im plicit schem e in C O H E R E N S

T H V IM D C -S o resm a
in coi. w ith KU Leuven, UG ent, BM M en W LB

Contents

Table of contents
1

Introduction
1.1
1.2
1.3
1.4

The assignment
Objective of the
Overview of the
Structure of this

1
...............................................................................................................
s t u d y .................................................................................................
s t u d y .................................................................................................
r e p o r t.................................................................................................

1
1
2
3

Implementation

2.1
2.2
2.3

In tro d u c tio n ........................................................................................................................


Overview of the
equations describing dynamics of coastal flo w s ..........................
Overview numerical implementation .............................................................................
2.3.1 Algorithm o v e rv ie w .................................................................................................
2.3.2 Changes with respect to concept r e p o r t ............................................................

5
5
6
6
8

Architecture and structure


3.1
3.2
3.3

iv

In tro d u c tio n ........................................................................................................................


Im p le m e n ta tio n ..................................................................................................................
Structure d ia g ra m s ............................................................................................................

9
9
15
16

Output of subtask 5

19

4.1
4.2
4.3
4.4

Report
internal discussion at BMM on 11/05/2011..................................................
Report
first follow-up meeting Ugent-IMDC-SORESMA on 17/05/2011...............
Conceptreport distributed for the expert workshop........................................................
Expert
w o r k s h o p .........................................................................................................
4.4.1 Presentation at the expert w o rk s h o p ..................................................................
4.4.2 Report expert w o rk s h o p ........................................................................................
4.4.3 Report meeting Prof. S te llin g ...............................................................................
4.5 Final conce ptre p o rt............................................................................................................
4.6 Note on hydrodynamic a lg o r ith m ...................................................................................
4.7 Report on meeting between Pieter Rauwoens and Patrick L u y te n ...........................
4.8 Presentation on the Technical W o rk g ro u p ....................................................................
4.9 ACOMEN congress ........................................................................................................
4.9.1 ACOMEN p a p e r ....................................................................................................
4.9.2 ACOMEN presentation .......................................................................................
4.10 Test cases for v a lid a tio n ...................................................................................................
4.11 Revised manual ................................................................................................................

19
19
19
19
19
19
19
20
20
20
20
20
20
20
20
20

Testing the code

21

5.1
5.2

21
21
21
22
22
24
24

5.3

Verification and validation test c a s e s .............................................................................


F in d in g s ..............................................................................................................................
5.2.1
Illustration of the findings for the river test c a s e ...............................................
5.2.2 Findings for the optos test c a s e ...........................................................................
5.2.3 Boundary condition issues .................................................................................
5.2.4 General c o m m e n ts.................................................................................................
Comments and reactions on alta testings ...................................................................

T H V IM D C -S o resm a
in coi. w ith KU Leuven, UG ent, BM M en W LB

5.4

E xpansion of num erical m odeling tools


Task ord er 4: Design of th e im plicit schem e in C O H E R E N S

Modifications and improvements from fe e d b a c k ...........................................................

24

Conclusions and recommendations for further developments

27

Report internal discussion at BMM on 11/05/2011

31

Report first follow-up meetingUgent-IMDC-SORESMA on 17/05/2011

35

Presentation at the expert workshop

39

Report expert workshop

99

Report meeting Prof. Stelling

131

Final conceptreport

133

Note on hydrodynamic algorithm

237

Report on meeting between Pieter Rauwoens and Patrick Luyten

249

Presentation on the Technical Workgroup

253

Acomen Paper

269

Acomen presentation

279

Test cases for validation

295

Revised manual (extracts)

299

l/RA/11339/10.072/GVH
Version 2.0 09 /08/2012

T H V IM D C -S o resm a
in coi. w ith KU Leuven, UG ent, BM M en W LB

List of Figures

3.1
3.2

5.1

5.2
5.3

Structure diagram of the time loop...................................................................................


Diagram of routine correct_free_surf which solves the 2-D depth integrated continu
ity equation............................................................................................................................
The time development of the distance between the left boundary and the point
where the salinity front outcrops the surface considering the free surface gradient
implicitly (full line) and explicitly (dashed line).................................................................
Sensitivity of the model results with respect to the treshold value e[m]......................
The time necessary to complete the simulation for different values of e[m]. The
necessary computational time, using the explicit scheme, is represented by the red
line..........................................................................................................................................

17
18

22
23

23

T H V IM D C -S o resm a
in coi. w ith KU Leuven, UG ent, BM M en W LB

l/RA/11339/10.072/GVH
Version 2.0 09 /08/2012

E xpansion of num erical m odeling tools


Task ord er 4: Design of th e im plicit schem e in C O H E R E N S

vi

T H V IM D C -S o resm a
in coi. w ith KU Leuven, UG ent, BM M en W LB

List of Tables

5.1

Comparison of CPU times for the COHERENS test cases: semi-implicit scheme,
semi-implicit scheme with 1 SIMPLE-iteration and explicit (mode-splitting) scheme.

25

T H V IM D C -S o resm a
in coi. w ith KU Leuven, UG ent, BM M en W LB

Chapter 1
Introduction

1.1

The assignm ent

In the framework of the study Uitbouw numeriek modelinstrument voor de Noordzeehavens,


Bestek 16EF/2008/02 (Expansion of the numerical modeling tools for the North Sea harbors)
assigned by the Maritime Access division (aMT) of the Department of Mobility and Public Works
of the Flemish Government, various software developments will be carried out by THV IMDC Soresma, supported by the universities of Gent and Leuven.
The assignment consists of the development of mathematical hydrodynamica! and morphological
software in collaboration with Flanders Hydraulics Laboratory (WLB, Flemish government) and
the Management Unit of the North Sea Mathematical Models (BMM, federal government). The
point of departure for the developments in this study is the current version of the COHERENS
version 2 hydrodynamic model that has been developed by the BMM (Luyten (2009), version 1
user manual: see Luyten et al. (1999)).
The study was assigned to the trading association THV IMDC - Soresma based on the moti
vated assignment order of November 24th, 2008 and communicated by aMT with reference B 544
16EFS-U-09-0013, on January 15th, 2009.
This report is the final report that is submitted as part of Task Order 4 - Development of an implicit
hydrodynamica! scheme. In this report, the final implementation and validation of the developed
numerical code is described. All descriptions refer to revision 376 of the COHERENS source
code.

1.2

Objective of the study

The goal of the study is threefold:


The development of software in collaboration with Flanders Hydraulics Laboratory (WLB)
and the Management Unit of the North Sea Mathematical Models (BMM) for the simulation
of currents and tidal propagation in seas, estuaries and rivers, including the simulation of
sediment transport and morphological bed changes caused by these currents or human
interference.
The developed software should enable studies (not part of this project) to be conducted with
respect to hydrodynamic and morphologic challenges during the development of harbor ex
tension projects, alternative dredging- and dumping strategies and sediment influx reducing
measures for the Flemish North Sea Ports.
The development of software for the modeling of sediment transport and morphological
processes that will use the models developed by the BMM (COHERENS V2) as a point of
departure and that will exploit the knowledge available in Flanders as much as possible.

T H V IM D C -S o resm a
in coi. w ith KU Leuven, UG ent, BM M en W LB

E xpansion of num erical m odeling tools


Task ord er 4: Design of th e im plicit schem e in C O H E R E N S

The main focus of the client is the application of the tool in the optimization of the maritime access
of the various Flemish harbors, more particular to the complex fine sediments behavior in the
Port of Zeebrugge, the tidal dock Deurganckdok in the Port of Antwerp, the influence of geometri
cally complex infrastructures on water movement (such as the Current Deflection Wall, CDW), the
morphological impact of large scale use of dredged material and the influence of marshes and
dredge/dump activities on water quality of North Sea and River Scheldt. Based on this presump
tion, priorities have been given to the various required functionalities that have been identified in
the Inception Strategy (THV IMDC - Soresma, 2009).
From the Inception Strategy the following functionalities have been identified that support the main
goals for the development of the morphological module:
Implementation of an online suspension transport module (sand and silt)
a. Graded sediments
b. Hindered settling
c. Flocculation
d. Sediment turbulence interaction: Adjustment of turbulence damping for high concen
trations of suspended sediments
e. Effect of non-breaking waves on the bed shear stress
Transport formulae for sand
Implementation of the morphological module
a. Morphological acceleration
b. Non-erodable layers
c. Scenarios (of e.g. wind and waves)
d. Dredging- and dumping routines
The following functionalities were identified as of lower priority, but would have a surplus value:
(Dynamic) bed roughness predictors for hydrodynamics and / or sediment transport
Fluid Mud model KU-Leuven
Sand-silt mixtures and bed (consolidation) model
Effect breaking waves, wave-driven longshore transport
Besides these points, within the study, the development of an implicit numerical scheme for the
hydrodynamica! equations is put forward as an important achievement in order to realize large
gain in computational calculation time.
The goals of this specific task are:
1. Design of an implicit scheme in COHERENS
2. Implementation of the implicit scheme
3. Validation of the code

1.3

Overview of the study

Based on the Inception Strategy a selection of seven tasks has been assigned to the THV IMDC
- Soresma to commence the study with. These are:
Task order 1 : Course COHERENS V2
Task order 2: Update and expansion of the manuals of COHERENS V2

l/RA/11339/10.072/GVH
Version 2.0 09 /08/2012

T H V IM D C -S o resm a
in coi. w ith KU Leuven, UG ent, BM M en W LB

E xpansion of num erical m odeling tools


Task ord er 4: Design of th e im plicit schem e in C O H E R E N S

Task order 3: Implementation of a verification procedure


Task order 4: Conversion of the code from an explicit to an implicit numerical scheme
Task order 5: Development of an online sediment transport module
Task order 6: Development of a central input strategy, and
Task order 7: Development of inundation schemes.
During the course of this study for each of the various task orders (deelopdrachten) reports have
been submitted that together cover all the activities.

1.4

Structure of this report

In this report, the final implementation and validation of the semi-implicit numerical algorithm is
described. The structure of this report is as follows: in Chapter 2, the physical equations and
numerical scheme implemented in COHERENS version 3.0.0. is reported. Chapter 3 provides
an overview of the achitecture and structure of the final implementation. Then, the output of the
validation tests of the numerical code is described. Concluding remarks and recommendations
for future prospective developments are formulated in Chapter 6.

l/RA/11339/10.072/GVH
Version 2.0 09 /08/2012

T H V IM D C -S o resm a
in coi. w ith KU Leuven, UG ent, BM M en W LB

l/RA/11339/10.072/GVH
Version 2.0 09 /08/2012

E xpansion of num erical m odeling tools


Task ord er 4: Design of th e im plicit schem e in C O H E R E N S

T H V IM D C -S o resm a
in coi. w ith KU Leuven, UG ent, BM M en W LB

Chapter 2
Implementation

2.1

Introduction

The aim of this chapter is to provide a brief overview of (1) the physical equations solved in
COHERENS version 3.0.0. together with the consequences of the introduced approximations
and (2) the adopted method to solve these equations numerically. By no means, this chapter
intends to describe all the physical and numerical details of the implemented equations which
have yet been documented in the concept report (Van Oyen et al. , 2011). We merely aim to
emphasize the highlights, and point out the differences that have occured between the Concept
Report and the final version.

2.2

Overview of the equations describing dynam ics of coastal flows

The dynamics of the flow field in coasts, estuaries and the ocean can be described by considering
the Reynolds averaged equations of motion and continuity; coupled with transport equations for
potential temperature, salinity and an equation of state. Three approximations have been con
sidered to obtain the model equations which are implemented into COHERENS version 3.0.0.:
(1) the Boussinesq approximation, (2) the traditional approximation and (3) the hydrostatic ap
proximation. The first two approximations do not impose severe limitations on the capacity of
COHERENS to describe physical phenomena. In particular, the first approximation only filters
out the acoustic modes as natural modes of the system; while the second approximation implies
that the model provides only a crude description of the dynamics in regions close to the equa
tor. The hydrostatic approximation means that inertial accelerations in the vertical momentum
equation are neglected, leading to a direct relation between pressure and gravitational acceler
ation. Consequently, the vertical velocity is enslaved to the horizontal velocity field through the
continuity equation. The hydrostatic approximation can sometimes impose a substantial limitation
to describe physical phenomena, mainly when relatively steep depth variations are considered.
Therefore, as example, the ability of describing the flow field over tidally generated bed forms with
small wavelengths is limited (e.g. Blondeaux & Vittori, 2011).
Applying these three approximations, the equations governing the dynamics of the flow field are
given by

du

du

dv

dv

dx

dy

dv,

dx

dv

du

du

dy

dz

div

1 d P n.
d C.
= -g----------------

dx

po

9R l

9 R 12

9 R 13

Po

dx

dy

dz

dv

dv

(2.1)

dz

d C

m + u Tx + v d -y+ w Yz = - 9T

+ t; /
dx

dx

bdz

(2.2)

bdz

(2.3)

fv

1 d P atm

x - ^ ^ r

+ tt- /
dy

T H V IM D C -S o resm a
in coi. w ith KU Leuven, UG ent, BM M en W LB
,

[ R 21

p0

dx

E xpansion of num erical m odeling tools


Task ord er 4: Design of th e im plicit schem e in C O H E R E N S
| 9 R .2 2 , R 2 3 ]

------ 1

-----1

ay

= -

dz

J u ;

(2.4)

Here, the x axis is along


the parallels, pointing east, while the y axis points North along the merid
ian lines. The axis is vertical, pointing upward. We assume = 0 describes the mean water
level. Furthermore, is the Coriolis parameter and p denotes the pressure. The variable p is
the sea water density (p0 is the mean density) and (u, v, w) represent the velocity components
along the x , y and axes, respectively. The tensor
(with i , j = 1,2, 3) denotes the Reynolds
stress tensor and represents correlations between velocity fluctuations; i.e. denotes the turbulent
diffusion of momentum. In addition, g is the gravitational accelaration, P atm describes the atmo
spheric pressure, C is the free surface elevation and b represents the buoyancy. To account for the
variations in the density, equations (2.1) - (2.4) are coupled with transportequations for potential
temperature 6P and salinity S and an equation of state which describes density as funtion of 6P
and S. Moreover, by integrating relation (2.1) over the depth and using the kinematic boundary
condition at the free surface, an equation which describes the dynamics of C, can be obtained,
d

dU

dV

(2'5)

in which (U,V) are the depth-integrated velocity components in the x and y- directions. The
equations implemented in COHERENS version 3.0.0. and summarized above (eqs. (2.1) - (2.5))
do not differ from the set of equations described in the concept report (Van Oyen et a l. , 2011).

2.3

Overview numerical im plementation

2.3.1

Algorithm overview

Before discussing the numerical scheme implemented in COHERENS version 3.0.0., we simplify
first the notation in (2.2) - (2.3) by introducing A v {), D v {), A h {) and D h {) to denote the vertical and
horizontal advective and diffusive terms, respectively. Moreover, we represent the source terms
related to gradients in the atmospheric and the baroclinie pressure by S.
Considering the vertical advection and diffusion terms as well as the free surface gradient implic
itly, the semi-discretized (only in time) governing equations read
d u n+1

d v n+1

d i u n+1

dx

dy

dz

An + 1 _

At
/7l+1?/n+l h n i i n

At

Q jjn + 1

An

dx

0,

(2 .6)

d V n+ 1

1
----------dy

(2.7)
d f n+1

= A v(un,u n+1) + D v(un, un+1) + A h{ v n ) + D h(un) + Sx - h^+1g A ,


ox
(2.8)

f e g + / , g t n = M v n, vn+1) + D v(vn, vn+1) + A h(vn ) + D h(vn ) + Sy - ht+1g ^ A .


V (2-9)
Here, A t denotes the time step, h 3 represents the time-dependent grid spacing in the vertical
direction and the superscripts n and n + 1 are the old and new time levels, respectively.
From (2.6) - (2.9), we cleary see that equation (2.6) decouples from the other equations and
merely serves as a post-processing step to evaluate the vertical velocity component after each
time step. Taking the free surface gradient implicitly into account, introduces a non-linearity in
the time-discretized momentum equations due to h%+1u n+1 and /?g+ V l+1. Moreover, it induces
a coupling between the momentum and continuity equations. To solve the former problem, an
iterative algorithm is adopted in which the depth H (and therefore also the vertical grid spacing)
is set to the old iteration value. By doing this, the equations are thought to be solved on a fixed

l/RA/11339/10.072/GVH
Version 2.0 09 /08/2012

T H V IM D C -S o resm a
in coi. w ith KU Leuven, UG ent, BM M en W LB

E xpansion of num erical m odeling tools


Task ord er 4: Design of th e im plicit schem e in C O H E R E N S

computational mesh. After each iteration step, the mesh is adjusted, according to the newly
calculated free surface height. For clarity, we introduce a new superscript indicating the iteration
level; i.e. </>n+ 1-i i + 1 denotes the value of the variable <f> at the new time step n + 1 obtained after
performing iteration it. To circumvent the coupling between the momentum equations and the
free surface evolution equation, we adopt a predictor-corrector scheme. Flereto, we introduce the
free surface correction
/ _

n+l,it+l _ n + l , i t

(2

10)

and compute first a predicted velocity ( u * , v * ) considering:


,n + l,it

'

n+l,it

f)/-n + l, i t

3 '

At

i n n

in

Af

= A v (u n,

) + D v (u n,

) + A h (u n ) + D h (u n ) + Sx -

dx

(2 .11)

f ) f n + l,it

= A v( v '\ v*) + D v(vn, v * ) + A h(vn) + D h(vn ) + Sy (2 .12)

Both (2.11) and (2.12) consist of a tridiagonal system that is readily solved using the Thom as
algorithm. The horizontal velocities are then corrected as
hn+ l,it+ lu n+ l,it+l

h n + l,it+ iv n+ l,it+l

h n+ l,itv * _

/7 + M i +

(2.13)

lg A t ^ ,

h%+ 1 U + 1 g

A t ^ -

(2.14)

Here, h%+1,tt+1 = h^+1,ttH n+1it+1 / H n+1it with H n+1it+ 1 = H n+1u +


In order to compute
the horizontal fluid velocities from equations (2.13) and (2.14), the free surface correction needs
to be evaluated. The latter is obtained by substitution of (2.13) and (2.14) into the free surface
elevation equation leading to a positive definite, five diagonal symmetric system for the unknowns
C':
Cn + M i - C n

At

C'

, OU*

At '

dx

, 91/ *

'

dy

9^

) + y

The inversion of (2.15) is computed using preconditioned Krylov methods, taking advantage of
the open source scientific computation library PETSc (Balay et a l. , 1997). Once C' is determined,
u n + i , i t + i anc| v n + i , i t + i are reaq|y obtained from relations (2.13) and (2.14).
To check if the
computation can be proceeded to the next time leve, the L ^ -n o rm of C' is compared to a threshold
value e. If He'll < e, a next time step is computed setting Cn+1 = en+ 1,ii+1, u n+1 = u " + M t+ i;
otherwise a new iteration is performed.
In summary, the iterative algorithm consists of:
for ntimesteps do:

n = n + 1, Cn+1 = C" , H n + 1,it = H n and h%+1u = h%


for niterations do:
it = it + 1

(u,v)-predictor (eq.2.12 & 2.11)


solve free surface correction (eq.
i+ l,it+ l

n + l,it +

1 t

(u,v)-corrector (eq.
if(converged) return
end do

H n+ l,it+l

2.15)

H n + 1,it +

and

/?n + l,+l =

H lA A } 1^ + i t

2.13 & 2.14)

u n+1 = u n + 1 i t + 1 , v n+1 = v n + 1 'i t + 1 , H n+1 = H n+ d + 1 > /7 + 1 = /7 + 1-i i + 1

and Cn+1 = en+1it+1


end do

In the convergence check the norm of C' is compared with a treshold value e: ||C'|| < e.

l/RA/11339/10.072/GVH
Version 2.0 09 /08/2012

T H V IM D C -S o resm a
in coi. w ith KU Leuven, UG ent, BM M en W LB

2.3.2

E xpansion of num erical m odeling tools


Task ord er 4: Design of th e im plicit schem e in C O H E R E N S

Changes with respect to concept report

The numerical algorithm described above and implemented in COHERENS version 3.0.0. slightly
differs from the scheme presented in the conceptrapport Van Oyen et al. (2011):
2.3.2.1

From free surface projection to free surface correction

In the concept report, a splitting of the velocity field was proposed in a value related to the full
free surface gradient, and the remainder (equation 6.17, from Van Oyen et al. (2011)). The
actually implemented splitting was performed on the basis of the free surface correction (equation
2.13). This adjustment was made because as such, their is a gain in accuracy, without extra
computational cost (see also Chen (2003)). The adjustment is also convenient for the linear
solver, since the solution for ' automatically starts from the initial guess C' = 0.
2.3.2.2

predictor-corrector with fixed

Following the concept report, two tridiagonal matrix inversions were needed. Here, one of them is
eliminated by applying a constant coefficient in front of the free surface correction gradient in the
velocity splitting (2.13). This means that the vertical advection and diffusion terms are only implicit
at predictor level. This modification is justified because of the free surface correction adjustment
described above. By means of this adjustment, there is an increase in computational efficiency,
by removal of one tri-diagonal matrix inversion. More importantly, the adjustment provides that the
algorithm is now capable of dealing with the time splitting method, accompagnying hte TVD space
discretization scheme. Also, it is not clear which boundary conditions apply at the bottom and
surface for , because the physical boundaries act on u as a whole. If needed, the full implicitness
of vertical advection and diffusion can be taken into account by using the outer iteration loop, which
is needed for the variation of h3 anyway.
2.3.2.3

extra iteration loop

Although the iteration loop to account for the variability of h3 was already mentioned in the concept
report (Van Oyen et al. (2011), section 6.1.3), it is now inherently part of the algorithm. The extra
loop is the only way possible to reach an implicit /?3-term. It will be proven considerably useful
when also horizontal advection and diffusion are discretized implicitly.
2.3.2.4

boundary conditions

With respect to the concept report more boundary conditions are implemented than first proposed.
In particular, Van Oyen et al. (2011) suggested to implement only the four barotropic and two
baroclinie boundary conditions. In the release of the implicit code (V3.0.0), all available boundary
conditions are adjusted to suitably perform in combination with the implicit scheme. In particular,
the effect of the barotropic open boundary conditions has to be considered when building the
linear system 2.15, providing different matrix entries, depending on the open boundary type.

l/R A /1 1339/10.072/GVH

Version 2.0 09 /08/2012

T H V IM D C -S o resm a
in coi. w ith KU Leuven, UG ent, BM M en W LB

Chapter 3
Architecture and structure

3.1

Introduction

When implementing the semi-implicit code within COHERENS, we tried to change as little as
possible to the original structure and implementation. Indeed: the mode-splitting scheme, which is
currently the only scheme available in COHERENS, had to be retained. Also, since the equations
to be solved are essentially the same, several subroutines could be used both by the semi-implicit
scheme and the mode-splitting scheme. Hereto, some (technical) modifications to the routines
were needed.
The major adjustments to the existing code are found in the files:
1. currents.f90, where extra arrays are declared
2. depths.f90, where extra arrays are declared
3. solverpars.f90, a new file, defining parameters needed for the linear solver, and the outer
iteration loop.
4. gen_inversion.f90, a generic file for not-implemented linear solver output and routines.
5. mat_inversion.f90, describing the linear solver output and routines. This file links to gen_inversion.f90
or petsc_inverstion.f90.
6. petsc_inversion.f90, linear solver output and routines, linked to PETSc.
7. Hydrodynamic_Equations.F90, major additions due to the implicit scheme.
8. Open_Boundary_Conditions.f90, with additional subroutine to incorporate the effect of open
boundary conditions on the free surface correction matrix entries.
The following routines have been created:
correct_free_surf
SUBROUTINE correct_free_surf (residual)
REAL, INTENT(OUT) :: residual

File
Hydrodynamic-Equations. F90
Type
Subroutine
Purpose
Corrector step to determine (implicit) free surface elevation
Called external procedures
mat_add, mat.create, mat_destroy, solution_create, solution_destroy, vec.add, vec.create,
vec_destroy, open_boundary_conds_cont, open_boundary_conds_2d, water.depths

T H V IM D C -S o resm a
in coi. w ith KU Leuven, UG ent, BM M en W LB

E xpansion of num erical m odeling tools


Task ord er 4: Design of th e im plicit schem e in C O H E R E N S

Arguments
residual

Norm of free surface correction vector

Calling procedures
hydrodynamic_equations

store_old_time_2d
SUBROUTINE store_old_time_2d

File
Hydrodynamic-Equations. F90
Type
Subroutine
Purpose
Store old time level of 2-D velocity fields.
Calling procedures
hydrodynamic_equations

store_old_time_3d
SUBROUTINE store_old_time_3d

File
Hydrodynamic-Equations. F90
Type
Subroutine
Purpose
Store old time level of 3-D velocity fields.
Calling procedures
hydrodynamic_equations

store_zeta_old
SUBROUTINE store_zeta_old

File
Hydrodynamic-Equations. F90
Type
Subroutine
Purpose
Store old time level of CCalling procedures
hydrodynamic_equations

l/RA/11339/10.072/GVH
Version 2.0 09 /08/2012

10

T H V IM D C -S o resm a
in coi. w ith KU Leuven, UG ent, BM M en W LB

E xpansion of num erical m odeling tools


Task ord er 4: Design of th e im plicit schem e in C O H E R E N S

open_boundary_conds_cont
SUBROUTINE open_boundary_conds_cont

File
Open.Boundary.Conditions. f90
Type
Subroutine
Purpose
Apply the open boundary conditions for the 2-D continuity equation (free surface implicit).
Calling procedures
correct_free_surf
store_old_obc_arrays
SUBROUTINE store_old_obc_arrays

File
Open_Boundary_Conditions. f90
Type
Subroutine
Purpose
Store old time level value of arrays for 2-D Orlanski and characteristic open boundary con
ditions.
Calling procedures
hydrodynamic_equations
mat_initialize
SUBROUTINE mat_initialize

File
petscJnversion. F90
Type
Module subroutine
Purpose
Initializes PETSc solver variables.
PETSc call
Petsclnitialize
mat_finalize
SUBROUTINE mat_finalize

File
petscJnversion. F90
Type
Module subroutine
Purpose
Finalizes PETSc solver variables.
PETSc call
PetscFinalize

l/RA/11339/10.072/GVH
Version 2.0 09 /08/2012

11

T H V IM D C -S o resm a
in coi. w ith KU Leuven, UG ent, BM M en W LB

E xpansion of num erical m odeling tools


Task ord er 4: Design of th e im plicit schem e in C O H E R E N S

m atxreate
SUBROUTINE mat_create

File
petscJnversion. F90
Type
Module subroutine
Purpose
Creates a 5-point stencil matrix.
PETSc call
MatCreateMPIAIJ

mat_destroy
SUBROUTINE mat_destroy

File
petscJnversion. F90
Type
Module subroutine
Purpose
Destroys the created matrix.
PETSc call
MatDestroy
mat.add
SUBROUTINE mat_add(ieqn,j e q n ,ivar,j v a r ,val)
INTEGER :: ieqn, jeqn, ivar, jvar
PetscScalar : : val

File
petscJnversion. F90
Type
Module subroutine
Purpose
Adds a value to the present value in the matrix at the row and column position defined by
the indices.
Arguments
ieqn

X-index of C -node of the discretized equation,

jeqn

Y-index of C-node of the discretized equation,

ivar

X-index of C -node variable involved in the disretization.

jvar

Y-index of C-node variable involved in the disretization.

val

Value to be added in the matrix.

PETSc call
MatSetValues

l/RA/11339/10.072/GVH
Version 2.0 09 /08/2012

12

T H V IM D C -S o resm a
in coi. w ith KU Leuven, UG ent, BM M en W LB

E xpansion of num erical m odeling tools


Task ord er 4: Design of th e im plicit schem e in C O H E R E N S

mat-insert
SUBROUTINE mat_insert(ieqn,je q n ,ivar,jva r ,val)
INTEGER :: ieqn, jeqn, ivar, jvar
PetscScalar : : val

File
petscJnversion. F90
Type
Module subroutine
Purpose
Overwrites a value in the matrix at the row and column position defined by the indices.
Arguments
ieqn

X-index of C -node of the discretized equation,

jeqn

Y-index of C-node of the discretized equation,

ivar

X-index of C -node variable involved in the disretization.

jvar

Y-index of C-node variable involved in the disretization.

val

Value to be inserted in the matrix.

PETSc call
MatSetValues

vec_create
SUBROUTINE vec_create

File
petscJnversion. F90
Type
Module subroutine
Purpose
Creates a right hand side in vector format.
PETSc call
VecCreateMPI

vec_destroy
SUBROUTINE vec_destroy

File
petscJnversion. F90
Type
Module subroutine
Purpose
Destroys the created vector.
PETSc call
VecDestroy

l/RA/11339/10.072/GVH
Version 2.0 09 /08/2012

13

T H V IM D C -S o resm a
in coi. w ith KU Leuven, UG ent, BM M en W LB

E xpansion of num erical m odeling tools


Task ord er 4: Design of th e im plicit schem e in C O H E R E N S

vec.add
SUBROUTINE vec_add(i,j,val)
INTEGER :: i , j
PetscScalar : : val

File
petscJnversion. F90
Type
Module subroutine
Purpose
Adds a value to the present value in the vector at the position defined by the indices.
Arguments
i

X-index of C -node of the discretized equation,

Y-index of C-node of the discretized equation,

val

Value to be added in the vector.

PETSc call
VecSetValue
vecJnsert
SUBROUTINE vec_insert(i,j,val)
INTEGER :: i , j
PetscScalar : : val

File
petscJnversion. F90
Type
Module subroutine
Purpose
Overwrites a value in the vector at the position defined by the indices.
Arguments
i

X-index of C -node of the discretized equation,

Y-index of C-node of the discretized equation,

val

Value to be inserted in the vector.

PETSc call
VecSetValue
solution_create
SUBROUTINE solution_create

File
petscJnversion. F90
Type
Module subroutine
Purpose
Creates the solution in COHERENS format of the linear system. Solver, preconditioner and
tolerance can be user defined.

l/RA/11339/10.072/GVH
Version 2.0 09 /08/2012

14

T H V IM D C -S o resm a
in coi. w ith KU Leuven, UG ent, BM M en W LB

E xpansion of num erical m odeling tools


Task ord er 4: Design of th e im plicit schem e in C O H E R E N S

PETSc calls
KSPCreate, KSPDestroy, KSPGetPC, KSPSetOperators, KSPSetTolerances, KSPSetType,
KSPSolve, MatAssemblyBegin, MatAssemblyEnd, PCSetType, VecAssemblyBegin, VecAssemblyEnd, VecCreateMPI, VecDestroy, VecGetArray, VecRestoreArray

solution.destroy
SUBROUTINE solution_destroy

File
petscJnversion. F90
Type
Module subroutine
Purpose
Destroys (deallocates) the created solution array.

3.2

Implementation

The algorithm is implemented in the routine Hydrodynamic_Equations, where a switch (iopt_hydr_scheme)


distinguishes between the mode-splitting scheme (1) and the semi-implicit algorithm (2): (descri
bed for 3D mode)
IF (ioptJiydr_scheme.E Q .1) THEN
IF (predstep) THEN
CALL store_old_time_3d
CALL current_pred
ENDIF
CALL store_old_time_2d
CALL current_2d
IF (corrstep) THEN
CALL current_corr(0)
ENDIF
ELSEIF (iopt_hydr.scheme.GE.1) THEN
CALL store_zeta_old
CALL store_old_time_3d
CALL store_old_time_2d
DO SIMPLE_it=l,max_SIMPLE_it
CALL current.pred
CALL correct_free_surf(residual)
CALL current.corr
IF (residual.LT.convcrit) GOTO 2000
ENDDO
2000 CONTINUE
ENDIF

l/RA/11339/10.072/GVH
Version 2.0 09 /08/2012

15

T H V IM D C -S o resm a
in coi. w ith KU Leuven, UG ent, BM M en W LB

E xpansion of num erical m odeling tools


Task ord er 4: Design of th e im plicit schem e in C O H E R E N S

In order to allow for the iteration loop, the storage of values at previous time levels had to be
removed from within the routines themselves. As such, both the mode-splitting scheme and the
semi-implicit scheme can make use of the routines current_pred and current.cor. The current.cor
routine is not essential for the algorithm desrciption. The current_pred routine could be retained
because of the free surface correction method (instead of the projection method).
A new routine, correct_free_surface, solves for the 2D continuity equation and builds up an implicit
system, yielding a matrix which has to be inverted. The calculation of the matrix entries happens
inside this routine. It is stored at the right place in the matrix by calling the routines mat_add and
vec_add, from within petsc_inversion.f90. Once the matrix is entirely filled, it can be inverted by
calling solution.create, which provides the solution-array, i.e. the two-dimensional free surface
correction array. All matrix handling is left for the petscJnversion module and is deliberately kept
out of the Hydrodynamic-Equations.F90 file, so that a later change in linear solver is made less
invasive for the source code.
The addition of matrix entries at the open boundaries is handled by the routine open_boundary_conds_cont
in the Open_Boundary_Conditions.f90 file. Also there the same calls mat.add and vec_add are
found. Entries are calculated differently, depending on the type of boundary condition.

3.3

Structure diagrams

Structure diagrams for the time loop and the added routine correct_free_surf are provided in the
figures below.

l/RA/11339/10.072/GVH
Version 2.0 09 /08/2012

16

T H V IM D C -S o resm a
in coi. w ith KU Leuven, UG ent, BM M en W LB

E xpansion of num erical m odeling tools


Task ord er 4: Design of th e im plicit schem e in C O H E R E N S

nt=0

tim e loop
n t= n t+ l

up date_tim e

predictor
step

nt-1 m u ltip le
o f ic3d

m e te o jn p u t

equ at io n_of_state

vertical d iff coefs

baroclinic_g radient

horizontal d iff coefs

s t o r e z e t a o ld
hydrodynam ic_equations

st o re o Id_t i m e_2d
store old tim e 3d

it = o
pre d icto r

it = it+1

step

nt-1 m u ltip le
o f ic3d

cu r r e n tp r e d

current 2d o r correct fre e surf

NO

co rre cto r
step

YES

correcto r
step

nt m u ltip le
o f ic3d

current corr

converged?

tem perature_e quatio n

salinity_equation

user o u tp u t

fina l conditions

nt<nstep

Figure 3.1: Structure diagram o f the time loop.

I/RA/11339/10.072/GVH
Version 2.0 09 /08/2012

17

T H V IM D C -S o resm a
in coi. w ith KU Leuven, UG ent, BM M en W LB

E xpansion of num erical m odeling tools


Task ord er 4: Design of th e im plicit schem e in C O H E R E N S

correct free surf

initialisation

build th e linear system

m at add

c on tributio ns

vec add

Tim e derivative

U -velocity fluxes

V -velocity fluxes

Boundary conditions

o p e n b o u n d a ry c o n d s c o n t

solution create

solve th e linear system

use solution

Free surface elevation

Depth integrated currents

open_boundary_conds_2d

w ater_depths

open boundary conditions

w a te r depths

mean currents

finalise

exit

Figure 3.2: Diagram o f routine c o rre c tJ re e s u rf which solves the 2-D depth integrated continuity equation.

I/RA/11339/10.072/GVH
Version 2.0 09 /08/2012

18

T H V IM D C -S o resm a
in coi. w ith KU Leuven, UG ent, BM M en W LB

Chapter 4
Output of subtask 5

In this chapter, the output and submitted reports produced in subtask 5 are summarized. The
reports themself are enclosed as appendix.

4.1

Report internal discussion at BMM on 11/05/2011.

This document describes an internal discussion meeting between Patrick Luyten, Jose Ozer,
Tomas Van Oyen and Peter Troch on methods to implement an implicit scheme. The report is
given in appendix A.

4.2

Report first follow-up meeting Ugent-IM DC-SORESM A on 17/05/2011.

This report describes a meeting between Ugent-IMDC-SOMESMA in which the state of the conceptreport is discussed. The report is given in appendix B.

4.3

Conceptreport distributed for the expert workshop.

The conceptreport that was distributed for the expert workshop is not included here, since it is
mostly identical to the final concept report.

4.4
4.4.1

Expert w orkshop
Presentation at the expert workshop

The presentation given by Tomas Van Oyen is reported in appendix C.

4.4.2

Report expert workshop

A summary of the presentations and discussions presented on the expert workshop is given in
appendix D.

4.4.3

Report meeting Prof. Stelling

In appendix E, the meeting between Prof. Stelling, Marcelo Heredia and Alexander Breugem is
reported.

T H V IM D C -S o resm a
in coi. w ith KU Leuven, UG ent, BM M en W LB

4.5

E xpansion of num erical m odeling tools


Task ord er 4: Design of th e im plicit schem e in C O H E R E N S

Final conceptreport

The final conceptreport which takes into account the comments formulated by the experts at the
expert workshop is given in appendix F.

4.6

Note on hydrodynamic algorithm

In appendix G, a note on the hydrodynamic algorithm presented in the final conceptreport is given.

4.7

Report on meeting between Pieter Rauwoens and Patrick Luyten

The report provided in appendix FI describes a meeting between Patrick Luyten and Pieter Rau
woens on 23/03/2011.

4.8

Presentation on the Technical W orkgroup

The presentation given by Pieter Rauwoens at the Technical Workgroup is given in appendix I.

4.9
4.9.1

ACOMEN congress
ACOMEN paper

The paper, written for the ACOMEN congress in Lige in November 2011 is given in appendix J.
4.9.2

ACOMEN presentation

The powerpoint presentation, given at the congress, is reproduced in appendix K.

4.10

Test cases for validation

In appendix L, test cases are suggested to validate the implicit code. The proposed test cases
were not retained.

4.11

Revised manual

In appendix M, extracts from the revised COHERENS manual are provided.

l/RA/11339/10.072/GVH
Version 2.0 09 /08/2012

20

T H V IM D C -S o resm a
in coi. w ith KU Leuven, UG ent, BM M en W LB

Chapter 5
Testing the code

5.1

Verification and validation test cases

Since the developent of the implicit scheme does not add new physics into the code, no new
validation tests had to be found. Therefore, we restricted the testing of the code to the standard
test cases, included in COHERENS. Test cases of importance are: seich, fredy, river, plume,
rhone, bohai and optos.
The specific improvement following from the implicit scheme is that greater time steps can be
taken without running into stability problems. As such, all tests were done with time steps equal
to the 3D time step, as used in the original tests. The optos test was run with a larger time step,
to test the stability close to CFL=1.

5.2

Findings

It seemed that all tests went well. A general finding is that the larger the time step, the more
(SIMPLE) iterations are needed per time step in order to meet the convergence criterion.
5.2.1

Illustration of the findings for the river test case

Figure 5.1 plots the location of the point where the salinity front outcrops the surface, hf r , during
the tidal cycle. hf r is measured by the distance i km of the 34 PSU contour line (taken at the
first grid cell below the surface) to the left boundary. It is found that the front moves to the right
with an almost uniform speed on which tidal modulations are superimposed. The position of the
outcrop is presented in figure 5.1 considering the free surface gradient implicitly (full line) and
explicitly (dashed line). A good agreement is found indicating the equivalence of both algorithmic
approaches.
The sensitivy of the results and the performance of the model with respect to the treshold value e
is analysed in figures 5.2 and 5.3. In figure 5.2, A hfront and A res velocity is plotted for several
treshold values with
A hfront = lfe/r(f

~ /,/r cont1 and


fr,c o n v

A res velocity =

(5.i)
'U'res ,c o n v

In (5.1), ures represents the residual surface horizontal current and the underscript 'conv' denotes
the value to which hf r and ures converge descreasing the treshold value. It is found that the
relative difference for both output parameters is smaller than 2%, indicating that the obtained
accuracy by decreasing the treshold value is not substantial. Here, it is worth to point out that for
the largest value of e considered (e = 0.1), the norm of C' turns out smaller than the treshold value
at the first check; i.e. only one iteration is performed. Considering that a decrease from e equal
0.1 to l.0 ~ 5 triples the computational time (see figure 5.3), the results suggest that the use of a
very small value of e is not necessary. Depending on the desired accuracy, for these simulations
a value of e equal to 0.01 or 0.07 seems appropriate.
Finally, in figure 5.3, also the computational time to complete the simulation using the explicit
(mode-splitting) scheme is presented (red horizontal line). For stability, the mode splitting scheme

T H V IM D C -S o resm a
in coi. w ith KU Leuven, UG ent, BM M en W LB

E xpansion of num erical m odeling tools


Task ord er 4: Design of th e im plicit schem e in C O H E R E N S

90
E x p lic it
Im p licit

80

70

60

1
</)

50

13
0
o
Q_

40

30
0

10

20

30

40

50

60

70

80

tim e [h o u rs]

Figure 5.1: The time developm ent o f the distance between the left boundary and the po in t where the salinity
front outcrops the surface considering the free surface gradient im plicitly (full line) and explicitly (dashed
line).

requires 10 2-D substeps, each time step. It is found that the implementation of the implicit
algorithm sligthly decreases the computational cost of the numerical model when the treshold
value is large. For decreasing values of e, it turns out that the numerical simulation with the free
surface gradient implicit becomes more expensive than using the mode-splitting scheme. The
only slight increase in efficiency does not correspond to the expectations and is probably due to
the way PETSc is coupled to the main source code. It is expected that a more efficiently coded
matrix fill-up will result in higher efficiencies. In the future, a linear solver will be coded within the
source code, yielding faster calculations.

5.2.2

Findings for the optos test case

It was found that for the optos.csm case, the time step could be raised with a factor 90 in the
semi-implicit mode to reach the stability limit. A factor 3 in gain in CPU time was found.
As a result, one can conclude that the semi-implicit scheme yields faster simulations in 2D-mode
(cf. optos). Flowever, in 3D-mode, the amount of outer (SIMPLE) iterations has strong repercus
sions on the codes efficiency.

5.2.3

Boundary condition issues

A problem was found with respect to boundary condition 13 (characteristic method without im
posed water levels and transports). We found that the instability arose due to the incoming cha
racteristic. First, the problem was circumvented by the following advice: The user is decouraged
to use the m ethod o f characteristics as a boundary condition in the corner points where these
boundary conditions meet. Doing this, the problem seemed resolved for the first test cases. How
ever, sometimes we ran into problems.
A closer look into the boundary conditions revealed that the transverse transports for the incoming
characteristic are causing the instability. By setting them to zero, the results seemed unaltered, but
instabilies were no longer encountered. A possible explanation is this: the incoming characteristic
is fully determined by what happens outside of the domain, such that transverse components from
within the domain are downwind located and hence may result in instability.

l/RA/11339/10.072/GVH
Version 2.0 09 /08/2012

22

T H V IM D C -S o resm a
in coi. w ith KU Leuven, UG ent, BM M en W LB

E xpansion of num erical m odeling tools


Task ord er 4: Design of th e im plicit schem e in C O H E R E N S

0.02
A hfront
Ares ve lo city
0.015
a)

o
c

0.01

CD
i_
CD

0.005
CD

-0.005
1e-06

1e-05

0.0001

0.01

0.001

0.1

convergence criterium
Figure 5.2: Sensitivity o f the model results with respect to the treshold value e[m].

32
tim e
explicit

30
28
26
24

22
20
18
16
14

12

10 1
1e-06

1e-05

0.0001

0.001

0.01

0.1

convergence criterium
Figure 5.3: The time necessary to complete the simulation for different values o f e[m].
com putational time, using the explicit scheme, is represented by the red line.

I/RA/11339/10.072/GVH
Version 2.0 09 /08/2012

The necessary

23

T H V IM D C -S o resm a
in coi. w ith KU Leuven, UG ent, BM M en W LB

E xpansion of num erical m odeling tools


Task ord er 4: Design of th e im plicit schem e in C O H E R E N S

Following this route, also the outgoing characteristics are expected to be unstable, since the cfllimit related to the surface gravity wave speed, is exceeded. We did not encounter instabilities
in this respect, perhaps because the outgoing characteristic goes outwards and does not really
influence the inner domain. It would be better to consider these terms implicitly, but doing this,
would result in a boundary condition with greatest complexity ever seen. Moreover: at corners (or
jigsaw boundaries), boundary conditions would become coupled, requiring much more program
ming effort and computational overhead.
5.2.4

General comments

Following table (tab. 5.1) presents the CPU-time comparison between the implicit sheme and the
explicit scheme, performed with the released version (rev. 476), leaving the test case parameters
unchanged:
Gererally speaking, the results with the implicit scheme are promising, but the expected gain in
computational time is not reached. This is due to the programming inefficiency with respect to
the coupling with PETSc. Implementation of a solver within the code is exptected to resolve this
problem.

5.3

Com m ents and reactions on alta testings

The implementation of the semi-implicit scheme was regularly checked by the BMM. Also, the
BMM has tested the code on the regular suit of testcases, that come with the COFIERENS source
code. No issues were found: results are reproduced as expected; this means: there is a slight de
viation of the numerical results, compared to the explicit runs, which is normal, since the solution
algorithm has changed. Deviations are, however, within acceptable limits.
Specific comments concerning boundary conditions have resulted in the replacement of the cha
racteristic boundary condition into an Orlanski boundary condition for the plume test case by
BMM.
The observation that the semi-implicit code runs slower than the mode-splitting algorithm for 3D
simulations is one of the reasons to start the implemenation of a multigrid solver in a new subtask.

5.4

Modifications and improvem ents from feedback

Since feedback was given during the implementation stage, no modifications have been made
with respect to the alpha version of the code. The merging procedure (by BMM) into the trunk
has led to a major modification of the alpha code in terms of code structure and organization
and variable declaration. These modification are technical and deliver the exact same solution
algorithm as presented in this report.

l/RA/11339/10.072/GVH
Version 2.0 09 /08/2012

24

T H V IM D C -S o resm a
in coi. w ith KU Leuven, UG ent, BM M en W LB

testcase

river

plume

rhone

boh ai

optcsm
optnos
optbcz

0A
1A
OB
1B
OC
1C
0D
1D
0A
1A
OB
1B
OC
1C
0D
1D
0E
1E
OF
1F
0G
1G
A
B
C
D
E
F
G
A
B
C
D
E
F

E xpansion of num erical m odeling tools


Task ord er 4: Design of th e im plicit schem e in C O H E R E N S

im plicit
default max_it=1
10.7
6.9
14.4
21.0
4.2
9.1
19.1
11.6
6.4
9.0
21.7
12.4
18.4
10.7
36.4
19.1
384
194
722
451
172
125
371
339
144
196
410
376
187
134
399
359
224
133
357
470
182
133
397
355
150
191
434
523
1931
1465
1988
1461
1856
1370
1918
1459
1916
1455
1925
1455
1914
1458
445
161
167
436
443
178
3926
1809
1807
3820
3820
1813
5305
5305
35094
7768
39063
13206

explicit
6.8
12.1
6.2
11.1
4.2
11.4
9.1
20.4
162
377
94
271
114
302
102
269
97
270
97
268
152
346
1410
1372
1292
1366
1368
1364
1366
616
573
569
1697
1693
1695
28617
10115
13670

Table 5.1: Comparison o f CPU times for the COHERENS test cases: sem i-im plicit scheme, sem i-implicit
scheme with 1 SIMPLE-iteration and explicit (mode-splitting) scheme.

I/RA/11339/10.072/GVH
Version 2.0 09 /08/2012

25

T H V IM D C -S o resm a
in coi. w ith KU Leuven, UG ent, BM M en W LB

l/RA/11339/10.072/GVH
Version 2.0 09 /08/2012

E xpansion of num erical m odeling tools


Task ord er 4: Design of th e im plicit schem e in C O H E R E N S

26

T H V IM D C -S o resm a
in coi. w ith KU Leuven, UG ent, BM M en W LB

Chapter 6
Conclusions and recommendations for further developments

The explicit COHERENS code has been converted into a (semi-) implicit code to yield faster cal
culations. Although the implementation is done well (as proven with the verification test cases)
the expected gain in computational time is not yet obtained. As to resolve this matter, the imple
mentation of a fast solver within COHERENS will be a key issue. In order to really obtain fast
calculations, a multigrid solver is the best option.
The code is no longer parallel in the implicit version. This problem is related to the coupling with
PETSc. Also here, the development of an in-code solver, will be the solution.
With the semi-implicit version of the algorithm, the time step size is greatly increased, but still
suffers from a stability criterion: For convection dominated flows, the time step has to satisfy
C F L < 1, with the Courant number based on the convective flow velocity. For diffusion dominated
flows, the Neumann stability criterion comes into play. To achieve a code without restrictions
upon the time step (apart from the restrictions related to accuracy), a full implicit scheme has
to be implemented, including the implicitness of advection and diffusion terms in the horizontal
direction.

T H V IM D C -S o resm a
in coi. w ith KU Leuven, UG ent, BM M en W LB

l/RA/11339/10.072/GVH
Version 2.0 09 /08/2012

E xpansion of num erical m odeling tools


Task ord er 4: Design of th e im plicit schem e in C O H E R E N S

28

T H V IM D C -S o resm a
in coi. w ith KU Leuven, UG ent, BM M en W LB

Bibliography

Balay, Satish, Gropp, William D., Mclnnes, Lois Curfman, & Smith, Barry F. 1997. Efficient Man
agement of Parallelism in Object Oriented Numerical Software Libraries. Pages 163-202 of:
Arge, E., Bruaset, A. M., & Langtangen, H. P. (eds), Modern Software Tools in Scientific Com
puting. Birkhuser Press.
Blondeaux, P., & Vittori, G. 2011. The formation of tidal sand waves: Fully three-dimensional
versus shallow water approaches. Continentel Shelf Research, 31, 990-996.
Chen, X. 2003. A free surface correction method for simulating shallow water flows. Journal o f
Computational Physics, 189, 567-578.
Luyten, P. 2009. Coherens version 2, user manual (in prep.).
Luyten, P., Jones, E., Proctor, R., Tabor, A., Tett, P., & Wild-Allen, K. 1999. Coherens, a coupled
hydrodynamical-ecological model for regional and shelf seas. MAS3-CT97-0088, pp914.
THV IMDC - Soresma. 2009. Uitbouw numeriek modelinstrument voor de Noordzeehavens Deelrapport 1 - Aanvangsstrategie, opgesteld voor afdeling Maritieme Toegang, Departement
Mobiliteit en Openbare Werken, Vlaamse Overheid, l/R A/11339/09.059/GVH, september 2009.
Van Oyen, T., Breugem, A., & Heredia, M. 2011. Design o f the implicit scheme in COHERENS.
Tech. rept. THV IMDC-Soresma. 91 pp.

T H V IM D C -S o resm a
in coi. w ith KU Leuven, UG ent, BM M en W LB

l/RA/11339/10.072/GVH
Version 2.0 09 /08/2012

E xpansion of num erical m odeling tools


Task ord er 4: Design of th e im plicit schem e in C O H E R E N S

30

T H V IM D C -S o resm a
in coi. w ith KU Leuven, UG ent, BM M en W LB

Appendix A
Report internal discussion at BMM on 11/05/2011

R eport on th e in te rn a l discussion m eetin g


BMM - UG ent, M ay 11, 200 1 (9 h 3 0 -1 2 h 0 0 )
Present: Patrick Luyten (BMM), Jos Ozer (BMM), Tom as Van Oyen (UGent),
Peter Troch (UGent)
Location: BMM, Brussels

In th e planning fo r th e co n cep t re p o rt on Task 5 (im p lic it schem e


im p le m e n ta tio n ), an inte rna l discussion m eeting betw een UGent and BMM has
been scheduled in o rd e r to g e t basic in fo rm a tio n on th e COHERENS code and
e xp ertise and advice fro m th e BMM staff. D uring th e discussion m eeting, th e
fo llo w in g to p ics have been discussed.
1. Tom as re ports on th e co n te n ts and th e progress m ade w ith regard to th e
co n cep t re p o rt on task 5.
2. Jos presents a short o ve rvie w o f BMM's e xperience w ith ADI schemes,
both in 2D (the OMNECS code running in operational co n ditio n s a t MDK)
and 3D (the PhD research by Yang, KULeuven). He shows d e ta ils on how
th e im p lic it schem es have been w orked out, and points a t several
im p o rta n t aspects.

3. Tom as and Peter raise several questions related to th e im p le m e n ta tio n of


ADI schem es. Patrick and Jos provide d e tailed answers related to
num erics, code im p le m e n ta tio n , lite ra tu re etc... They hand o ve r th e PhD
m a n u scrip t o f Yang and several paper references. The fo llo w in g topics
have been tre a te d .
Patrick indicates th a t Part III o f th e COHERENS m anual w ill becom e
a va ila ble soon (e stim ate d a t end o f May) w ith a description o f dom ain
decom position and paral lei lis a tio n . For th e ADI schem e, th is is not
stra ig h tfo rw a rd to be used. It is decided th a t th e actual ADI schem e
im p le m e n ta tio n w ill be carried o u t fo r th e serial version only a t th is stage
of th e code d e velopm ent.
A discussion on th e choice betw een ADI schem es or ite ra tiv e schem es fo r
im p lic it-m a k in g is organized. From th e practical experiences provided, it is
suggested to focus on ADI schem es. It is th e in te n tio n to im p le m e n t an
ADI im p lic it schem e fo r th e fu ll 3D flo w and rem ove th e m ode s p littin g . A t
th e sam e tim e , th e option in th e code fo r running th e m o d e-sp littin g
should rem ain. This choice w ill be presented to th e p ro je ct consortium .
H ow ever it is not clear how m any e ffo rts w ill be required to achieve good

results by th e end o f th e p ro je ct d u ration. None of th e experienced


COHERENS developers is able to m ake a pro pe r q u a n tifia b le e stim a tion .
Most e xistin g ocean m odels seem to use th e m o d e -sp littin g , a lthough th e re
is not really a good reason fo r th is - it is re a lity. It m ig h t be due to th e fa c t
th a t developers usually w a n t to develop fa s t ra th e r than optim al.
The open boundary co n ditio n s fo r th e 2D case and 3D case m ig h t be ve ry
d iffe re n t, and th is tra n s fo rm a tio n m ig h t be d ifficu lt.
It is suggested th a t Tom as can have a personal in tro d u ctio n into th e code
by Patrick, a t th e s ta rt of code im p le m e n ta tio n , in o rd e r to avoid critical
errors and In o rd e r to speed up th e im p le m e n ta tio n work.
Patrick provides an o ld e r version o f th e code w hich has a d ra ft tria l ADI
schem e, b u t still w ith m a jo r bugs. It is useful ho w e ve r fo r gaining b e tte r
in sig h t in th e im p le m e n ta tio n .
It is agreed th a t th e 3D im p lic it schem e im p le m e n ta tio n w ill be carried out
w ith o u t ta kin g into account th e w e ttin g -d ry in g procedures th a t are being
developed in o th e r tasks. The im p le m e n ta tio n o f w e ttin g -d ry in g schem es
w ill be carried o u t afterw ards.
4. A sh o rt discussion on th e m e th o d o lo g y fo r th e e x p e rt w orkshop is
organized.
5. Tom as and Jos continue in fo rm a lly a fte r th e m e e ting w ith a detailed
discussion o f th e ADI schem e details.

M eeting re p o rt by P. Troch, May 15, 2010

T H V IM D C -S o resm a
in coi. w ith KU Leuven, UG ent, BM M en W LB

l/RA/11339/10.072/GVH
Version 2.0 09 /08/2012

E xpansion of num erical m odeling tools


Task ord er 4: Design of th e im plicit schem e in C O H E R E N S

34

T H V IM D C -S o resm a
in coi. w ith KU Leuven, UG ent, BM M en W LB

Appendix B
Report first follow-up meeting Ugent-IMDC-SORESMA on
17/05/2011

R eport on th e firs t fo llo w -u p m eetin g fo r Task 5


U G ent-IM D C -S oresm a, M ay 17, 2 0 1 0 (1 5 h -1 7 h 3 0 )
Present: Ivan Rocabado (Soresma), M arcelo Heredia Gomez (Soresma),
A le xa n d e r Breugem (IMDC), Fernando Toro (IMDC), Tom as Van Oyen (UGent),
Peter Troch (UGent)
Location: AW W-UGent. Z w ijnaarde

In th e planning fo r th e co n cep t re p o rt on Task 5 (im p lic it schem e


im p le m e n ta tio n ), a firs t fo llo w -u p m e e ting betw een UGent, IMDC and Soresma
has been scheduled in o rd e r to discuss th e s u b m itte d re ports on sections 1
(lite ra tu re review ) and 2 (d e scrip tio n o f th e c u rre n t e x p lic it a lg o rith m in
Coherens) o f th e concept re p o rt and prepare th e re p o rtin g o f sections 3
(selection o f p o te n tia l a lg o rith m (s) fo r im p le m e n ta tio n ) and 4 (d e scrip tio n o f code
im p le m e n ta tio n ). D uring th e fo llo w -u p m eeting, th e fo llo w in g to p ics have been
discussed. Conclusions fro m these discussions
1. Tom as re ports on th e co n te n ts and th e progress m ade w ith regard to
section 1 o f th e co n cep t re p o rt on task 5. There has been a w orkshop
m e e ting w ith BMM on May 11, 2010, fo r discussion o f schem e and code
issues: a separate re p o rt o f th e m eeting is un de r p re paration. The UGent
a c tiv itie s as proposed and agreed a t th e s ta rt of his co n tra c t are according
to th e schedule.
2. A le xa n d e r suggests to add a section on th e description o f th e purpose of
th is task 5, and on th e s ta rtin g points w hich have been ta ke n into account
in o rd e r to propose th e final choice o f schem e etc...
3. A discussion is organized on th e m o d e -sp littin g option. It should rem ain in
th e code as an option to th e user (backw ard c o m p a tib ility ), and fo r the
im p le m e n ta tio n o f th e im p lic it schem e it is suggested stro n g ly to m ove to
a fu ll 3D schem e and rem ove m o d e -sp littin g a t th a t occasion.
4. A discussion is organized on th e choice betw een ADI or con ju g a te g ra d ie n t
m ethods. A n u m b e r o f a rg u m e n ts are id e n tifie d in fa v o r o f th e ADI scheme.
These w ill be presented in th e report.
5. It is n o t necessary to ta ke all e xisting (14?!) boundary co n dition typ e s into
account fo r th e im p lic it schem e im p le m e n ta tio n . A fe w w id e ly used
boundary co n dition typ e s fo r estu a rin e and riv e r flo w situ a tio n s w ill be
selected to becom e im m e d ia te ly available in th e im p lic it version o f th e
code. It is noted th a t im p le m e n tin g an open boundary co n dition fo r th e 3D
im p lic it schem e is not a triv ia l task.
6. A n u m b e r of fe a tu re s o f th e code th a t are now u n de r d e ve lo p m e n t
(w e ttin g -d ry in g ) or existing, w ill not y e t becom e o p erational in th e im p lic it
schem e version of th e code. H ow ever these w ill be taken into account
during im p le m e n ta tio n fo r la te r addition.

7. The 3D ADI schem e can be parallelized (w hereas th e version w ith m odesp littin g cannot). However, in th e "a a n v a n g s s tra te g ie " is has been decided
not to im p le m e n t th is p a rallellisa tio n during th is project. If e xp ertise on th is
to p ic becom es available, it w ill be added as a c o m m e n t in th e final re p o rt .
8. A le xa n d e r re ports on th e co n te n ts and th e progress m ade w ith regard to
section 2 o f th e co n cep t re p o rt on task 5. A n u m b e r o f s m a lle r suggestions
are m ade w ith regard to th e te x t (add references to th e Coherens Manual,
if feasible; s p lit up th e d e scriptions betw een scalars and tu rb u le n ce ).
9. Tom as states e x p lic itly th a t he appreciated th e re p o rt fo r its c la rity and
com pleteness.
10.The co n te n ts o f sections 3 and 4 is discussed in som e detail and th e tim in g
is repeated. It is decided not to w rite in section 4 th e " firs t user
e xperiences" as described in th e co n te n ts note o f th e report. Instead,
Tom as w ill add th is section a fte r he sta rts using th e code.

M eeting re p o rt by P. Troch and T. Van Oyen, May 18, 2010

T H V IM D C -S o resm a
in coi. w ith KU Leuven, UG ent, BM M en W LB

l/RA/11339/10.072/GVH
Version 2.0 09 /08/2012

E xpansion of num erical m odeling tools


Task ord er 4: Design of th e im plicit schem e in C O H E R E N S

38

T H V IM D C -S o resm a
in coi. w ith KU Leuven, UG ent, BM M en W LB

Appendix C
Presentation at the expert workshop

In tro d u c tio n
P h y s ic a l d e s c r i p t i o n o f t h e f l o w fie ld
N u m e ric a l im p le m e n ta tio n
C o n c lu s i o n s

On the design o f a (new) numrica


algorithm for COHERENS

Tomas Van Oyen, Alexander Breugem


and Marcelo Heredia Gomez
Coastal Engineering, Ghent U niversity - IM D C - Soresma

6 July 2010, Ghent

T . V a n O y e n , A . B re u g e m

&

M . H. G om ez

4 SP

N e w n u m e ric a l s c h e m e

a O

Introduction
W hat is our aim?

Physical description of the flow field


Prim itive equations
Approximations applied
9 Turbulence

Numerical implementation
9 The grid
9 Numerical discretizations
9 The algorithm

Conclusions
4 4SP4 ~ 4 == -E Gao

Model the hydrodynamics


(and morphodynamics) of
coastal seas, estuaries and
harbours

Decrease the computational


time of present COHERENS
scheme

4
T . V a n O y e n , A . B re u g e m

&

M . H. G om ez

<*g

N e w n u m e ric a l s c h e m e

>

^ O

Model the hydrodynamics


(and morphodynamics) of
coastal seas, estuaries and
harbours

Decrease the computational


time of present COHERENS
scheme

T . V a n O y e n , A . B re u g e m

&

M . H. G om ez

< *g

N e w n u m e ric a l s c h e m e

4 'f

>

FF

*T)

In tro d u c tio n
P h y s ic a l d e s c r i p t i o n o f t h e f l o w fie ld
J
m
i
i
N u m e ric a l im p le m e n ta tio n
C o n c lu s i o n s

....
.
.
W h a t is o u r a i m ;

The aim o f presentation:

T . V a n O y e n , A . B re u g e m

&

M . H. G om ez

we have in mind the


menu

the ingredients are listed

are we forgetting
something?
maybe the salt?

and what about desert?

< *g

N e w n u m e ric a l s c h e m e

>

HE

-0 0 . 0

dp

dpu

dt

dx

dpw

- 77

dy

dz

(i)

dpu

dpu2

0 /01/V

dpuw

dp_

dRn

dt

dx

dy

dz

<9x

dx

R12

dy

<9Ri3

dpv

dpuv

dpv2

dpvw

dt

dx

dy

dz

dy
dpw

dpuw
+

R 23

dz

dpvw

dx

dy

t R 32
T . V a n O y e n , A . B re u g e m

&

(2)

.
2 p\l[c o s {(p )w s i n ( 0 ) v ] ,

dz

R 22

dt

dpv

- 77

M . H. G om ez

dy

(3)

dx

2pls\n((/))u ,

dpw2
dz

R 33

dp + d R 2i

d p + <9R3i
= -p g

dz

2 oQ eos( ) u .
N e w n u m e ric a l s c h e m e

dx

(4)
JF

~T)

In tro d u c tio n
P h y s ic a l d e s c r i p t i o n o f t h e f l o w fie ld
N u m e ric a l im p le m e n ta tio n
C o n c lu s i o n s

P rim itiv e e q u a tio n s


A p p r o x i m a t i o n s a p p lie d
T u rb u le n c e

Approximations to the physical description

Boussinesq approximation
density is taken constant except for the term related to gravitational
acceleration
filte r out the acoustic modes

Traditional approximation

neglect horizontal Coriolis terms


crude description of flow field near the equator

T . V a n O y e n , A . B re u g e m

&

M . H. G om ez

N e w n u m e ric a l s c h e m e

In tro d u c tio n
i-, i
it
. .
j- i r .
r- i .
P h y s ic a l d e s c r i p t i o n o t t h e f l o w fie ld
J
N u m e ric a l im p le m e n ta tio n
i
C o n c lu s i o n s

. . .
P rim itiv e e q u a tio n s

J
...
A p p r o x i m a t i o n s a p p lie d
-i- i i
T u rb u le n c e

Approximations to the physical description

Hydrostatic approximation
Inertial accelerations can be neglected in the vertical momentum
balance such th at
dp
dz

^ _
PS

Implications 71

T . V a n O y e n , A . B re u g e m

&

M . H. G om ez

< *g

N e w n u m e ric a l s c h e m e

4 'f

4 =

HE

0 0 ,0 '

In tro d u c tio n
P h y s ic a l d e s c r i p t i o n o f t h e f l o w fie ld
N u m e ric a l im p le m e n ta tio n
C o n c lu s i o n s

P rim itiv e e q u a tio n s


A p p r o x i m a t i o n s a p p lie d
T u rb u le n c e

Physical description w ith approximations:

du

du
+ u h
dt
dx

du

dv

dx

dy

du
V

du
h wdz
dy

dw
dz
1 d P at m

po

dx

d R n ^ d R 12 ^ d Ri3
Po

dv
m

dv
+ u d

dv
+

v d

dv
+

dz

dy

dx

(5)

1 d P atm

w ~dz

po

R21

d R 22

Po

dx

dy

dy
<9^23
dz

d
- g ~ z -

dx

d
bdz

dx

+2Qsin((/>)v
d
d
g +
dy
dy

bdz (7)

2 Q sin((/>)v

dp
dz
T . V a n O y e n , A . B re u g e m

&

M . H. G om ez

P g

(6 )

( 8)

4 S 1

N e w n u m e ric a l s c h e m e

- 0 0 , 0

Dynamical evolution of the free surface elevation

d
dt

dU
dx

dV
dy

=0

(9)

in which U and V are the depth-integrated horizontal velocities:


U =

I udz
J h

and

V=

vdz
J h

< 5P

T . V a n O y e n , A . B re u g e m

&

M . H. G om ez

(10)

N e w n u m e ric a l s c h e m e

< =

JF

-T )

Reynolds stress tensor is described by introducing an eddy viscosity


Choices for the eddy viscosity
9

a constant

algebraic scheme

as function of turbulence energy k and its dissipation rate e or


mixing length I

T . V a n O y e n , A . B re u g e m & M . H . G o m e z

< *g

N e w n u m e ric a l s c h e m e

>

u s a
Adaptions of the grid to the physics
9

horizontal directions:
=> orthogonal curvilinear coordinates ( 1 ,^ 2 )

vertical direction:
s coordinates, which are spatially varying a coordinates
z + h
(J =

---------

h+

T . V a n O y e n , A . B re u g e m & M . H . G o m e z

< *g

N e w n u m e ric a l s c h e m e

>

In tro d u c tio n
P h y s ic a l d e s c r i p t i o n o f t h e f l o w fie ld
J
m
i i
N u m e ric a l im p le m e n ta tio n
^
C o n c lu s i o n s

The
rid

, ..
N u m e ric a l d is c re tiz a tio n s
T h e a lg o rith m

Transformed equations

1 d /73

/3

'

1 d

(h 2h3u) +
/ 71 / 72/73

( h i h 3v)

d hi

h i d g i

ta ;

+ 7 9s
dh2

h t {h 3 ) + A ( u ) + A ( u ) +
_ g _9 C _ _______________

2Q vsin (j)

+ Fi +

T>v{u)

+ T>mf,i () + 2^01/

d i

dh2

d hi ,

vW i ~ uW 2 l + 2 f s m ^
g

1
<9P;
d _______________

/2 <9^2

PO^2 <9^2

T . V a n O y e n , A . B re u g e m & M . H . G o m e z

N e w n u m e ric a l s c h e m e

In tro d u c tio n
P h y s ic a l d e s c r i p t i o n o f t h e f l o w fie ld
J
m
i i
N u m e ric a l im p le m e n ta tio n
^
C o n c lu s i o n s

The
rid

, ..
N u m e ric a l d is c re tiz a tio n s
T h e a lg o rith m

Transformed equations

d t ' h \h 2

d ( h 2U)

d (h iV )^

= 0

di

T . V a n O y e n , A . B re u g e m & M . H . G o m e z

< *g

N e w n u m e ric a l s c h e m e

>

Implications
9 Grid size changes in tim e

<% 3

/3

d t

/l/2 ^ 3

(h2h3u) +
%

T . V a n O y e n , A . B re u g e m & M . H . G o m e z

(h ih v )

4 51 4 -

N e w n u m e ric a l s c h e m e

dj
~h~ds

4 =

O a O

Implications

Grid has a velocity

1
-

<9
-

( M

+ A W

+ A

d h i

dh2

- 2fivsin*

S /g"

h i d i

F1

T>v ( u )

+ T >m h l

{') +

d i

T . V a n O y e n , A . B re u g e m & M . H . G o m e z

4 S1 4 4 =

N e w n u m e ric a l s c h e m e

O a O

Implications

Grid has a velocity


Extra (m etric) terms

<9

d h i

dh2

(h3u) + A h(u) + M u ) + ] ^ - A U9 f 2 - VW i ] ~

Sm *

S /g"

h i d i

F1

T>v ( u )

+ T >m h l

{') +

d i

T . V a n O y e n , A . B re u g e m & M . H . G o m e z

N e w n u m e ric a l s c h e m e

4 'f

4 J?

HE

~ 0 Qv O

Implications
Grid has a velocity
Extra (m etric) terms

- A t (h3u) + A h( u ) + A v(u) + Ah-2


g

1
< 9 _______________

hi di

pohi di

dhi

dh2

d^2

d i

00

I ziZvsin <fi

+ Fi + T)v(u) + ^m /7l(Tl l ) + F>mh2 ( r i 2 )

T . V a n O y e n , A . B re u g e m & M . H . G o m e z

4 s 1 4 4 =

N e w n u m e ric a l s c h e m e

o a o

Implications
Grid has a velocity
Extra (m etric) terms
Extra non-linearities

- A t (h3u) + A h( u ) + A v(u) + Ah-2


g

1
d _______________

h i d i

p o h i

dhi

dh2

d^2

d i

00

I ziZvsin <fi

+ Fi + T)v(u) + ^m /7l(Tl l ) + F>mh2 ( r i 2 )

d i

T . V a n O y e n , A . B re u g e m & M . H . G o m e z

4 S1 4 -

N e w n u m e ric a l s c h e m e

4 =

O a O

In tro d u c tio n
P h y s ic a l d e s c r i p t i o n o f t h e f l o w fie ld
N u m e ric a l im p le m e n ta tio n
C o n c lu s i o n s

T h e g rid
N u m e ric a l d is c r e tiz a tio n s
T h e a lg o r ith m

Model Grid

Vertical

Horizontal
UV(i,j+l)

VCij+1)

UfH-lj)

U(1J)

UV(ij)

9
9
9

UV+lj+l)

V (ij)

UV(i+lj)

sea surface

w
c
w
c
w
c
w
c
w
c
w
c
w

nz+1
tiz

seabed

C - nodes: scalar-quantities + wind


U - nodes: x - component of vectors
UV - nodes: location of grid
4

T . V a n O y e n , A . B re u g e m & M . H . G o m e z

4 S 1

N e w n u m e ric a l s c h e m e

4 "Si >

4 .=?

In tro d u c tio n
P h y s ic a l d e s c r i p t i o n o f t h e f l o w fie ld
N u m e ric a l im p le m e n ta tio n
C o n c lu s i o n s

T h e g rid
N u m e ric a l d is c r e tiz a tio n s
T h e a lg o r ith m

Discussion on the terms in the momentum balance

du
d i +

du
u d

du
^

V ert. A dv

Hor. Adv.

po

Free Surf.

(9 R n

< 9 R i2

PO

dx

dy

Hor. D iff.

1 dP.atm
Po

dx

A tm . Pres

d_
dx

Baroclin. Pres.

dR i3

V ert. D iff.

+ 2Q sin (0 )v ,
Coriolis

explicit

dx

T . V a n O y e n , A . B re u g e m & M . H . G o m e z

bdz +

o ^ o

N e w n u m e ric a l s c h e m e

In tro d u c tio n
P h y s ic a l d e s c r i p t i o n o f t h e f l o w fie ld
N u m e ric a l im p le m e n ta tio n
C o n c lu s i o n s

T h e g rid
N u m e ric a l d is c r e tiz a tio n s
T h e a lg o r ith m

Discussion on the terms in the momentum balance

du
d i +

du
u d

du
^

V ert. A dv

Hor. Adv.

S
Free Surf.

A tm . Pres.

(9 R n

< 9 R i2

PO

dx

dy

Hor. D iff.

d
g

dx

( A t ) restr

Ax

d_
dx

B aroclin. Pres.

dR i3

V ert. D iff.

+ 2Q sin (0 )v ,
Coriolis

0 ( 1 . Os) im plicit

gH

T . V a n O y e n , A . B re u g e m & M . H . G o m e z

bdz +

o ^ o

N e w n u m e ric a l s c h e m e

In tro d u c tio n
P h y s ic a l d e s c r i p t i o n o f t h e f l o w fie ld
N u m e ric a l im p le m e n ta tio n
C o n c lu s i o n s

T h e g rid
N u m e ric a l d is c r e tiz a tio n s
T h e a lg o r ith m

Discussion on the terms in the momentum balance

du

du

d i + ud

du

^ %

du

V ert. A dv

Hor. Adv.

d
Po

dx

<9R n

PO

dx

0 R i2

dy

Hor. D iff.

d_
dx

Ax

bdz : ( A t )
J

dx

Free Surf.

A tm . Pres.

d
dx

Baroclin. Pres.

d R i3

dz
V ert. D iff.

+ 2Q sin (0 )v ,
Coriolis

(1 0 0 s ) > explicit

Ap !

T . V a n O y e n , A . B re u g e m & M . H . G o m e z

bdz +

0 ^ 0

N e w n u m e ric a l s c h e m e

In tro d u c tio n
P h y s ic a l d e s c r i p t i o n o f t h e f l o w fie ld
Ki
. . .
. ^.
N u m e ric a l im p le m e n ta tio n
~
C o n c lu s i o n s

The
rid
..
. ,
N u m e ric a l d is c re tiz a tio n s
.
T h e a lg o rith m

Discussion on the terms in the momentum balance

du

du

d i + ud

du
^ %

du
+

V ert. Adv.

Hor. Adv.

d
po

dx

<9R n

PO

dx

d
dx

bdz +

Free Surf.

A tm . Pres.

0 R i2

dy

Hor. D iff.

Baroclin. Pres.

d R i3

dz
V ert. D iff.

+ 2Q sin (0 )v ,
Coriolis

2 Q s in (0 )v explicit w ith im plicit corrector (due to C-grid)


w-T)
T . V a n O y e n , A . B re u g e m & M . H . G o m e z

N e w n u m e ric a l s c h e m e

In tro d u c tio n
P h y s ic a l d e s c r i p t i o n o f t h e f l o w fie ld
N u m e ric a l im p le m e n ta tio n
C o n c lu s i o n s

T h e g rid
N u m e ric a l d is c r e tiz a tio n s
T h e a lg o r ith m

Discussion on the terms in the momentum balance

du
d i +

du
u d

du
^

V ert. A dv

Hor. Adv.

S
Free Surf.

A tm . Pres.

(9 R n

< 9 R i2

PO

dx

dy

Hor. D iff.

du
W

dz

(A t)

Az
w\

T . V a n O y e n , A . B re u g e m & M . H . G o m e z

d_
dx

bdz +

Baroclin. Pres.

dR i3

V ert. D iff.

+ 2Q sin (0 )v ,
Coriolis

0 ( 1 . Os) im plicit
o ^ o

N e w n u m e ric a l s c h e m e

In tro d u c tio n
P h y s ic a l d e s c r i p t i o n o f t h e f l o w fie ld
Ki
. . .
. ^.
N u m e ric a l im p le m e n ta tio n
~
C o n c lu s i o n s

The
rid
..
. ,
N u m e ric a l d is c re tiz a tio n s
.
T h e a lg o rith m

Discussion on the terms in the momentum balance

du
d i +

du
u d

du
^

V ert. A dv

Hor. Adv.

S
Free Surf.

A tm . Pres.

(9 R n

< 9 R i2

PO

dx

dy

Hor. D iff.

* 3 _ (Af)
dz

d_
dx

bdz +

B aroclin. Pres.

dR i3

V e rt. D iff.

+ 2 Q s in (0 )v ,
Coriolis

\
(A ,)=
- ~ 0 ( 1 . Os) im plicit
v ver

jo Vo

In tro d u c tio n
P h y s ic a l d e s c r i p t i o n o f t h e f l o w fie ld
Ki
. . .
. ^.
N u m e ric a l im p le m e n ta tio n
~
C o n c lu s i o n s

The
rid
..
. ,
N u m e ric a l d is c re tiz a tio n s
.
T h e a lg o rith m

Discussion on the terms in the momentum balance

du

du
du
+ u + v +
dx
dt
dy
V ert. A dv

Hor. Adv.

dx

dx

> ( A t ) ~

(A x )2
Vhor

bdz +

Baroclin. Pres.

dy

Hor. D iff.

9R n

dx

dR i3

PO

Free Surf.

A tm . Pres.

d_

V ert. D iff.

+ 2Q s in (0 )v ,
Coriolis

~ O (50s) > im plicit ?

|0Q.C

In tro d u c tio n
P h y s ic a l d e s c r i p t i o n o f t h e f l o w fie ld
Ki
. . .
. ^.
N u m e ric a l im p le m e n ta tio n
~
C o n c lu s i o n s

The
rid
..
. ,
N u m e ric a l d is c re tiz a tio n s
.
T h e a lg o rith m

Discussion on the terms in the momentum balance

du
d i +

du
u d

du
^

V ert. A dv

Hor. Adv.

<9

S
Free Surf.

A tm . Pres.

(9 R n

< 9 R i2

PO

dx

dy

Hor. D iff.

du
Ax
u ------- > ( A t ) ~
~
dx
u

d_
dx

Baroclin. Pres.

dR i3

V ert. D iff.

O (3 0 s )

bdz +

+ 2Q sin(0)v ,
Coriolis

- im p lic it ?

|o^o

In tro d u c tio n
P h y s ic a l d e s c r i p t i o n o f t h e f l o w fie ld
N u m e ric a l im p le m e n ta tio n
C o n c lu s i o n s

T h e g rid
N u m e ric a l d is c r e tiz a tio n s
T h e a lg o r ith m

Spatial discretizations

Spatial discretizations

free surface gradient,

central scheme

vertical dissipation of momentum

vertical advection
horizontal advection

=>-

upwind - central - TV D
=>-

upwind - Lax-Wendroff - T V D

horizontal dissipation of momentum

=>-

T . V a n O y e n , A . B re u g e m & M . H . G o m e z

central

4 S 1

N e w n u m e ric a l s c h e m e

4 "Si >

4 .=?

In tro d u c tio n
P h y s ic a l d e s c r i p t i o n o f t h e f l o w fie ld
N u m e ric a l im p le m e n ta tio n
C o n c lu s i o n s

T h e g rid
N u m e ric a l d is c r e tiz a tio n s
T h e a lg o r ith m

Spatial discretizations

Spatial discretizations

free surface gradient,

central scheme

vertical dissipation of momentum

vertical advection

=>

upwind - central - TV D

horizontal advection

=>-

upwind - Lax-Wendroff - T V D

horizontal dissipation of momentum

=>-

T . V a n O y e n , A . B re u g e m & M . H . G o m e z

central

4 S 1

N e w n u m e ric a l s c h e m e

4 "Si >

4 .=?

In tro d u c tio n
P h y s ic a l d e s c r i p t i o n o f t h e f l o w fie ld
N u m e ric a l im p le m e n ta tio n
C o n c lu s i o n s

T h e g rid
N u m e ric a l d is c r e tiz a tio n s
T h e a lg o r ith m

Spatial discretizations

Spatial discretizations

free surface gradient,

central scheme

vertical dissipation of momentum

vertical advection
horizontal advection
9

=>

upwind - central - TV D

=>

upwind - Lax-Wendroff - T V D

horizontal dissipation of momentum

=>-

T . V a n O y e n , A . B re u g e m & M . H . G o m e z

central

4 S 1

N e w n u m e ric a l s c h e m e

4 "Si >

4 .=?

In tro d u c tio n
P h y s ic a l d e s c r i p t i o n o f t h e f l o w fie ld
N u m e ric a l im p le m e n ta tio n
C o n c lu s i o n s

T h e g rid
N u m e ric a l d is c r e tiz a tio n s
T h e a lg o r ith m

Spatial discretizations

Spatial discretizations

free surface gradient,

central scheme

vertical dissipation of momentum

vertical advection
horizontal advection
9

=>

upwind - central - TV D

=>

upwind - Lax-Wendroff - T V D

horizontal dissipation of momentum

=>

T . V a n O y e n , A . B re u g e m & M . H . G o m e z

central

4 S 1

N e w n u m e ric a l s c h e m e

4 "Si >

4 .=?

The rid
.
.
N u m e ric a l d is c re tiz a tio n s
i
T h e a lg o rith m

In t r o d u c t io n
P h y s ic a l d e s c rip tio n o f th e flo w fie ld
J
m
i i
N u m e ric a l im p le m e n ta tio n
^
C o n c lu s i o n s

W h a t is the approach?

First goal: horizontal advection and diffusion terms explicit

du

dv

dx
d

dy
d il

d i

du
dt
dv
dt

+
+

d
dz
d
dz

^d x

du
uw V
v ~dz
wv V

T . V a n O y e n , A . B re u g e m & M . H . G o m e z

dv
dz

dw
~

dz
dV
dy

+
,

+ g dx

+ g

dy

exp

V,e xp

N e w n u m e ric a l s c h e m e

In t r o d u c t io n
P h y s ic a l d e s c rip tio n o f th e flo w fie ld
J
m
i i
N u m e ric a l im p le m e n ta tio n
^
C o n c lu s i o n s

The rid
.
.
N u m e ric a l d is c re tiz a tio n s
i
T h e a lg o rith m

W h a t is the approach?

Solve w ith Alternating Direction Im plicit - approach

Step 1: n ^

n + 1/2
im plicit in

Free surface gradient is

momentum

explicit in the y momentum


9 Step 2: n T 1/2 > n + 1
Free surface gradient is

explicit in

momentum

im plicit in the y momentum

T . V a n O y e n , A . B re u g e m & M . H . G o m e z

< *g

N e w n u m e ric a l s c h e m e

4 'f

4 =

HE

Qv O

In t r o d u c t io n
P h y s ic a l d e s c rip tio n o f th e flo w fie ld
J
m
i i
N u m e ric a l im p le m e n ta tio n
^
C o n c lu s i o n s

The rid
.
.
N u m e ric a l d is c re tiz a tio n s
i
T h e a lg o rith m

W h a t is the approach?

Step 1: n > n T 1/2


y - momentum:
n+1/2

^ n + I/2

_|_ ^

At d
_ _

vm r;

, 1/2

n d v n+1/ 2 ]

At

=> Tridiagonal matrix: > v n+1/ 2

T . V a n O y e n , A . B re u g e m & M . H . G o m e z

< *g

N e w n u m e ric a l s c h e m e

4 'f

4 =

he

O 'tO

In t r o d u c t io n
P h y s ic a l d e s c rip tio n o f th e flo w fie ld
J
m
i i
N u m e ric a l im p le m e n ta tio n
^
C o n c lu s i o n s

The rid
.
.
N u m e ric a l d is c re tiz a tio n s
i
T h e a lg o rith m

W h a t is the approach?
Step 1: n > /? T 1/2
X - momentum:
n+1/ 2
u

n At d
+

, 1/2

v_2" 9

n <9vn+1/ 2 l

At

| +

<9n+1/ 2

At
=

n
e x p /

W ritin g un+1/2 =
n + i/2 +

A t

" + l / 2 + 0v A t

| ( W' ) n + 1 / 2 -

/; ^ i

( w S ) n + l/ 2 _ " ^

un
2
expl
=

1
o a o

T . V a n O y e n , A . B re u g e m & M . H . G o m e z

N e w n u m e ric a l s c h e m e

The rid
.
.
N u m e ric a l d is c re tiz a tio n s
i
T h e a lg o rith m

In t r o d u c t io n
P h y s ic a l d e s c rip tio n o f th e flo w fie ld
J
m
i i
N u m e ric a l im p le m e n ta tio n
^
C o n c lu s i o n s

W h a t is the approach?

Step 1: n > n + 1/2


free - surface elevation equation:

n + 1 /2

At

1 dx

At d
2 dy

dx

n + l/2
V

L k

Tridiagonal matrix: > n + 1 / 2


yn+ l / 2
4

T . V a n O y e n , A . B re u g e m & M . H . G o m e z

^ n+ l / 2

4 51 4 -

N e w n u m e ric a l s c h e m e

4 =

O a O

In tro d u c tio n
P h y s ic a l d e s c r i p t i o n o f t h e f l o w fie ld
N u m e ric a l im p le m e n ta tio n
C o n c lu s i o n s

T h e g rid
N u m e ric a l d is c r e tiz a tio n s
T h e a lg o r ith m

W h a t is the approach?

Step 2: n + 1 /2 > n + 1

momentum w ith Free surface gradient explicit


u

,A 7+ 1

O y momentum w ith Free surface gradient im plicit


v n+1 and v n+1
Q free surface elevation equation w ith substituted
i/n+1, v n+1 and v n+1 > n+1
Q Evaluation of w n+1 w ith continuity equation

T . V a n O y e n , A . B re u g e m & M . H . G o m e z

4 5P 4 4 =

N e w n u m e ric a l s c h e m e

O a O

Some remarks/questions

w ithin the half - tim e stepping approach,


* the newest value of u, v and is taken
* other variables: w, baroclinie press, gradient, ... dont change ?

non-linear terms:
d ( w u ) n+l
dz
iterate on

d w nun+1
<9(/73L/)n+1
- and dz
dt

d h ^u n+1
dt

and w until certain convergence is obtained ?

T . V a n O y e n , A . B re u g e m & M . H . G o m e z

< *g

N e w n u m e ric a l s c h e m e

>

^ O

The rid
.
.
N u m e ric a l d is c re tiz a tio n s
i
T h e a lg o rith m

In t r o d u c t io n
P h y s ic a l d e s c rip tio n o f th e flo w fie ld
J
m
i i
N u m e ric a l im p le m e n ta tio n
^
C o n c lu s i o n s

W h a t is the approach?

Second goal: horizontal advection and diffusion terms im plicit

du

dt

dz

uw
d
dx

dv

dt

dz
d
dx

du
dz

uu - 2vh

wv
-

uv

du
dx

du

dy

dy

d
Tj

dx

U ,e xp 5

dv
dz
dv
'" a *

d_

dv

dy

dy

T . V a n O y e n , A . B re u g e m & M . H . G o m e z

+ g ~ V,exp
dy

N e w n u m e ric a l s c h e m e

In t r o d u c t io n
P h y s ic a l d e s c rip tio n o f th e flo w fie ld
J
m
i i
N u m e ric a l im p le m e n ta tio n
^
C o n c lu s i o n s

The rid
.
.
N u m e ric a l d is c re tiz a tio n s
i
T h e a lg o rith m

W h a t is the approach?

Second goal: horizontal advection and diffusion terms im plicit

First halftime step

Second halftime step

horizontal
adv./diff.

explicit

im plicit

horizontal
adv./diff.

im plicit

explicit

free surface
gradient

im plicit

explicit

free surface
gradient

explicit

im plicit

T . V a n O y e n , A . B re u g e m & M . H . G o m e z

< *g

N e w n u m e ric a l s c h e m e

4 'f

4 =

HE

O Qv O

In t r o d u c t io n
P h y s ic a l d e s c rip tio n o f th e flo w fie ld
J
m
i i
N u m e ric a l im p le m e n ta tio n
^
C o n c lu s i o n s

The rid
.
.
N u m e ric a l d is c re tiz a tio n s
i
T h e a lg o rith m

W h a t is the approach?

Second goal: horizontal advection and diffusion terms im plicit

At

n+l/2
+

$/7

& I ( \n + 1/2
n d v n+1/ 2
(.u v)n+1/2 - v n
h
------ > +
dx
dx
I ( \n + 1/2
( w )
7
dy

At d
V

2 dz

o nd v n+1/ 2
-

( w v ) n+1' 2

v"v

d v nJr 1/2

At

dz

T . V a n O y e n , A . B re u g e m & M . H . G o m e z

+
n
Ve x p l i

4 5P 4 4 =

N e w n u m e ric a l s c h e m e

O a O

In t r o d u c t io n
P h y s ic a l d e s c rip tio n o f th e flo w fie ld
J
m
i i
N u m e ric a l im p le m e n ta tio n
^
C o n c lu s i o n s

The rid
.
.
N u m e ric a l d is c re tiz a tio n s
i
T h e a lg o rith m

W h a t is the approach?

Horizontal advection and diffusion terms im plicit: How to solve ??


9

Iterative method
Red-Black Jacobi
Successive Over Relaxation
Gauss-Seidel iteration

T . V a n O y e n , A . B re u g e m & M . H . G o m e z

< *g

N e w n u m e ric a l s c h e m e

>

In t r o d u c t io n
P h y s ic a l d e s c rip tio n o f th e flo w fie ld
J
m
i i
N u m e ric a l im p le m e n ta tio n
^
C o n c lu s i o n s

The rid
.
.
N u m e ric a l d is c re tiz a tio n s
i
T h e a lg o rith m

W h a t is the approach?

Horizontal advection and diffusion terms im plicit: How to solve ??


9

Iterative method
Red-Black Jacobi
Successive Over Relaxation
Gauss-Seidel iteration

Eulerian-Lagrangian Discretization [Casulli and Cheng, 1992]

T . V a n O y e n , A . B re u g e m & M . H . G o m e z

< *g

N e w n u m e ric a l s c h e m e

>

Another option:

du
dx

dv
+

dy
dU

d
dt
du

TT

dx
du

dt

dz

dv

dt

dz

v ldz
dv

VV

dz

dw
+

dz

= 0

dV
+

dy
_i_

+ edx

- a

exp
d

dy

exp

All convective terms with Eulerian - Lagrangian discretization


SP

T . V a n O y e n , A . B re u g e m & M . H . G o m e z

N e w n u m e ric a l s c h e m e

'0 0 ,0 '

In tro d u c tio n
P h y s ic a l d e s c r i p t i o n o f t h e f l o w fie ld
N u m e ric a l im p le m e n ta tio n
C o n c lu s i o n s

T h e g rid
N u m e ric a l d is c r e tiz a tio n s
T h e a lg o r ith m

Stirring up the discussion - an alternative

W rite un+1 and v n+1 as function of n+1

un+1
v n+1

A t

n<9i/n+1]

<9n+1

A t
g-

A t

dx

A t

A t <9n+1

A t
2

u n+ i

n+1

dy

+ 4-1
4

T . V a n O y e n , A . B re u g e m & M . H . G o m e z

u
~ expl i
n
Ve x p l

exp
exp

4 S 1

N e w n u m e ric a l s c h e m e

4 "Si >

4 .=?

JF

-T ) < \ V

Substitution into free surface elevation equation

Five-diagonal system, symmetric and strickly diagonally dominant with


positive elements on diagonal and negative ones elsewhere
> solve with Conjugent Gradient Method
< 5P

T . V a n O y e n , A . B re u g e m & M . H . G o m e z

N e w n u m e ric a l s c h e m e

==

~T)

In tro d u c tio n
P h y s ic a l d e s c r i p t i o n o f t h e f l o w fie ld
N u m e ric a l im p le m e n ta tio n
C o n c lu s i o n s

Some finishing thoughts - questions ?

Discussion on the physical description: approximations


> Hydrostatic

Consideration of terms:
Free surface gradient > im plicit
Baroclinie > explicit
Horizontal adv./diff. explicf
Convective terms > non
A D I/tw o-step scheme: Updati
A dv./diff. implicit: Large banded matrix
Other view: one step > conjugent gradient solution
/

< - < =
T . V a n O y e n , A . B re u g e m & M . H . G o m e z

N e w n u m e ric a l s c h e m e

-0 0 , 0 '

In tro d u c tio n
P h y s ic a l d e s c r i p t i o n o f t h e f l o w fie ld
N u m e ric a l im p le m e n ta tio n
C o n c lu s i o n s

Some finishing thoughts - questions ?

Discussion on the physical description: approximations


> Hydrostatic

Consideration of terms:
Free surface gradient > im plicit
Baroclinie > explicit
Horizontal adv./diff. explicit?

Convective terms > non-linearities

A D I/tw o-step scheme: Updating of w, hs


A dv./diff. implicit: Large banded matrix

Other view: one step > conjugent gradient solution

T . V a n O y e n , A . B re u g e m & M . H . G o m e z

< *g

N e w n u m e ric a l s c h e m e

>

HE

-0 0 . 0

In tro d u c tio n
P h y s ic a l d e s c r i p t i o n o f t h e f l o w fie ld
N u m e ric a l im p le m e n ta tio n
C o n c lu s i o n s

Some finishing thoughts - questions ?

Discussion on the physical description: approximations


> Hydrostatic

Consideration of terms:
Free surface gradient > im plicit
Baroclinie > explicit
Horizontal adv./diff. explicit?

Convective terms > non-linearities

A D I/tw o-step scheme: Updating of w, hs


A dv./diff. implicit: Large banded matrix

Other view: one step > conjugent gradient solution

T . V a n O y e n , A . B re u g e m & M . H . G o m e z

< *g

N e w n u m e ric a l s c h e m e

>

HE

-0 0 . 0

In tro d u c tio n
P h y s ic a l d e s c r i p t i o n o f t h e f l o w fie ld
N u m e ric a l im p le m e n ta tio n
C o n c lu s i o n s

Some finishing thoughts - questions ?

Discussion on the physical description: approximations


> Hydrostatic

Consideration of terms:
Free surface gradient > im plicit
Baroclinie > explicit
Horizontal adv./diff. explicit?

Convective terms > non-linearities

A D I/tw o-step scheme: Updating of w, hs


A dv./diff. implicit: Large banded matrix

Other view: one step > conjugent gradient solution

T . V a n O y e n , A . B re u g e m & M . H . G o m e z

< *g

N e w n u m e ric a l s c h e m e

>

HE

-0 0 . 0

In tro d u c tio n
P h y s ic a l d e s c r i p t i o n o f t h e f l o w fie ld
N u m e ric a l im p le m e n ta tio n
C o n c lu s i o n s

Some finishing thoughts - questions ?

Discussion on the physical description: approximations


> Hydrostatic

Consideration of terms:
Free surface gradient > im plicit
Baroclinie > explicit
Horizontal adv./diff. explicit?

Convective terms > non-linearities

A D I/tw o-step scheme: Updating of w, h$


A dv./diff. implicit: Large banded matrix

Other view: one step > conjugent gradient solution


/

< - < =
T . V a n O y e n , A . B re u g e m & M . H . G o m e z

N e w n u m e ric a l s c h e m e

-0 0 ,0 '

In tro d u c tio n
P h y s ic a l d e s c r i p t i o n o f t h e f l o w fie ld
N u m e ric a l im p le m e n ta tio n
C o n c lu s i o n s

Some finishing thoughts - questions ?

Discussion on the physical description: approximations


> Hydrostatic

Consideration of terms:
Free surface gradient > im plicit
Baroclinie > explicit
Horizontal adv./diff. explicit?

Convective terms > non-linearities

A D I/tw o-step scheme: Updating of w, hs


A dv./diff. implicit: Large banded matrix

9
9

Other view: one step > conjugent gradient solution


Para Ilelization

T . V a n O y e n , A . B re u g e m & M . H . G o m e z

< *g

N e w n u m e ric a l s c h e m e

>

HE

-0 0 . 0

In tro d u c tio n
P h y s ic a l d e s c r i p t i o n o f t h e f l o w fie ld
N u m e ric a l im p le m e n ta tio n
C o n c lu s i o n s

Some finishing thoughts - questions - and more

Im plicit/explicit: Shall we make the scalar advection equation


im plicit (also horizontally)
How feasible is the
approach using a baroclinie gradient in combination with the
hydrostatic pressure distribution?
tions: W hat are the implications of im plicit code for
the open boundary conditions? Is there a possibility to use explicit
boundary conditions in combination with an im plicit scheme?

ilosophicaI question (with respect to robustness): W hat is better:


an inaccurate/wrong answer or no answer at all?

SP < ' - < =


T . V a n O y e n , A . B re u g e m & M . H . G o m e z

N e w n u m e ric a l s c h e m e

-0 0 ,0 '

In tro d u c tio n
P h y s ic a l d e s c r i p t i o n o f t h e f l o w fie ld
N u m e ric a l im p le m e n ta tio n
C o n c lu s i o n s

Some finishing thoughts - questions - and more

Im plicit/explicit: Shall we make the scalar advection equation


im plicit (also horizontally)

Density stra tificatio n / baroclinie gradient: How feasible is the


approach using a baroclinie gradient in combination with the
hydrostatic pressure distribution?
tions: W hat are the implications of im plicit code for
the open boundary conditions? Is there a possibility to use explicit
boundary conditions in combination with an im plicit scheme?

ilosophicaI question (with respect to robustness): W hat is better:


an inaccurate/wrong answer or no answer at all?

SP < ' - < =


T . V a n O y e n , A . B re u g e m & M . H . G o m e z

N e w n u m e ric a l s c h e m e

-0 0 ,0 '

In tro d u c tio n
P h y s ic a l d e s c r i p t i o n o f t h e f l o w fie ld
N u m e ric a l im p le m e n ta tio n
C o n c lu s i o n s

Some finishing thoughts - questions - and more

Im plicit/explicit: Shall we make the scalar advection equation


im plicit (also horizontally)

Density stra tificatio n / baroclinie gradient: How feasible is the


approach using a baroclinie gradient in combination with the
hydrostatic pressure distribution?

Boundary conditions: W hat are the implications of im plicit code for


the open boundary conditions? Is there a possibility to use explicit
boundary conditions in combination with an im plicit scheme?

ilosophicaI question (with respect to robustness): W hat is better:


an inaccurate/wrong answer or no answer at all?

SP < ' - < =


T . V a n O y e n , A . B re u g e m & M . H . G o m e z

N e w n u m e ric a l s c h e m e

-0 0 ,0 '

In tro d u c tio n
P h y s ic a l d e s c r i p t i o n o f t h e f l o w fie ld
N u m e ric a l im p le m e n ta tio n
C o n c lu s i o n s

Some finishing thoughts - questions - and more

Im plicit/explicit: Shall we make the scalar advection equation


im plicit (also horizontally)

Density stra tificatio n / baroclinie gradient: How feasible is the


approach using a baroclinie gradient in combination with the
hydrostatic pressure distribution?

Boundary conditions: W hat are the implications of im plicit code for


the open boundary conditions? Is there a possibility to use explicit
boundary conditions in combination with an im plicit scheme?

Para Ilei lization


ilosophicaI question (with respect to robustness): W hat is better:
an inaccurate/wrong answer or no answer at all?

SP < ' - < =


T . V a n O y e n , A . B re u g e m & M . H . G o m e z

N e w n u m e ric a l s c h e m e

-0 0 ,0 '

In tro d u c tio n
P h y s ic a l d e s c r i p t i o n o f t h e f l o w fie ld
N u m e ric a l im p le m e n ta tio n
C o n c lu s i o n s

Some finishing thoughts - questions - and more

Im plicit/explicit: Shall we make the scalar advection equation


im plicit (also horizontally)

Density stra tificatio n / baroclinie gradient: How feasible is the


approach using a baroclinie gradient in combination with the
hydrostatic pressure distribution?

Boundary conditions: W hat are the implications of im plicit code for


the open boundary conditions? Is there a possibility to use explicit
boundary conditions in combination with an im plicit scheme?

Para Ilei lization

Philosophical question (with respect to robustness): W hat is better:


an inaccurate/wrong answer or no answer at all?

T . V a n O y e n , A . B re u g e m & M . H . G o m e z

< *g

N e w n u m e ric a l s c h e m e

>

- o Qv o

T H V IM D C -S o resm a
in coi. w ith KU Leuven, UG ent, BM M en W LB

l/RA/11339/10.072/GVH
Version 2.0 09/08/2012

E xpansion of num erical m odeling tools


Task ord er 4: Design of th e im plicit schem e in C O H E R E N S

98

T H V IM D C -S o resm a
in coi. w ith KU Leuven, UG ent, BM M en W LB

Appendix D
Report expert workshop

COHERENS II Expert workshop


D ra ft
Version 1.0, July 9, 2010

Marcelo Heredia, A lexander Breugem and Tomas Van Oyen

C o n ten ts

1
2

P r e s e n t COHERENS h y d r o d y n a m ic a l a lg o r it h m

P r e s e n ta tio n o f T o m a s V a n O y e n - G e n t U n iv e r s it y

2.1

I n t r o d u c t io n ...............................................................................................

2.2

P h ysica l d e s c rip tio n o f th e flo w f i e l d .................................................

2.3

N u m e ric a l im p le m e n ta tio n (n u m e rica l a lg o rith m )

....................

2.4

C o n c lu s io n s ...............................................................................................

C o n s e q u en ce s COHERENS h y d r o d y n a m ic a l a lg o r it h m

E x p e r t e v a lu a tio n

13

4.1

Im p lic it code

4.2

H y d ro s ta tic a ssum ptio n

......................................................................

14

4.3

Suggestion fo r im p lic it c o d e ...............................................................

14

4.4

P a r a lle liz a tio n ...........................................................................................

15

4.5

R e c o m m e n d a tio n s ....................................................................................

15

...........................................................................................

13

P r e s e n ta tio n o f S e b a s tie n B o u r b a n - H R W a llin g f o r d

17

5.1

I n t r o d u c t io n ...............................................................................................

17

Concepts and N u m e ric a l A p p lic a t io n s .............................................

17

5.2.1

F lo w over tr e n c h e s /b u m p s .....................................................

17

C o n c lu s io n s ...............................................................................................

18

5.2
5.3
6

P r e s e n ta tio n o f J a n V ie r e n d e e ls - G e n t U n iv e r s it y

19

6.1

I n t r o d u c t io n ...............................................................................................

19

6.2

P h ysica l a p p r o x im a t io n s ......................................................................

19

6.3

A D I versus Ite ra tiv e m e t h o d ...............................................................

19

6.4

H o riz o n ta l a d v e c tio n /d iffu s io n ...........................................................

19

6.5

F u tu re p a r a ll lis a tio n .............................................................................

20

6.6

A c c u r a c y ......................................................................................................

20

6.7

N o n h y d ro s ta tic n u m e rica l c o d e ........................................................

21

CO NTEN TS
6.8
7

P a r a ll lis a tio n ............................................................................................

21

P r e s e n ta tio n o f J e a n M a r i e B e c k e rs - L ie g e U n iv e r s it y

23

7.1

I n t r o d u c t io n ...............................................................................................

23

7.2

R em arks and s u g g e s tio n s ......................................................................

23

E x p e r ts p re s e n ta tio n s

25

D is c u s s io n Session

27

9.1

I n t r o d u c t io n ...............................................................................................

27

9.2

H y d ro s ta tic a ssum ptio n

......................................................................

27

9.3

A d v e c tio n /d iffu s io n i m p l i c i t ...............................................................

28

9.4

Im p lic it s c h e m e ........................................................................................

28

CO NTEN TS

C h a p te r 1
P resen t COHERENS
h y d ro d y n a m ic a ! a lg o rith m
Jose O zer gives a p re se n ta tio n w ith th e purpose to give an o verview o f the
n u m e ric a l schemes th a t are c u rre n tly present in COHERENS . COHERENS
is th e code, in w h ic h pre viou s research in th e M a st p ro je c t is in clu de d . As
th e nam e says (C o u pled H y d ro d y n a m ic a l-E c o lo g ic a l M o d e l fo r R egional and
S helf Seas), COHERENS was developed especially fo r re g ion a l and shelf seas
(th us fo r d iffe re n t a p p lic a tio n s th a n are in te n d e d in th e present p ro je c t).
T h e ch ara cte ristics o f th e COHERENS code are given:
F o rtra n 90
H y d ro s ta tic equations (using Boussinesq a p p ro x im a tio n )
C u rv ilin e a r o rth o g o n a l g rid h o riz o n ta lly , s-coordinates v e rtic a lly .
M o d e s p littin g (b a ro tro p ic equations are solved w ith sm a ll tim e step,
b a ro c lin ie equations w ith a large tim e step).
P a ra lle liz a tio n using M P I
N u m e ric a lly , COHERENS uses an s e m i-im p lic it scheme v e rtic a lly and an
e x p lic it scheme h o riz o n ta lly . A p re d ic to r c o rre cto r m e th o d is used, in w h ich
th e fu n c tio n o f th e co rre cto r step is to ensure th a t th e mass fluxes in th e 2D
and 3D c a lc u la tio n are equal. T h e C o rio lis force has an im p lic it co rre ctio n
te rm (second o rd e r), w h ic h is necessary fo r s ta b ility .

D iffe re n t tim e step

p in g a lg o rith m s are used, d epending on th e ty p e o f a dve ctio n scheme. For


scalar tra n s p o rt, a filte re d v e lo c ity is used, w h ich is a tim e average o f a ll 2D
tim e steps d u rin g a 3D tim e step .

T h is is necessary to have a conservative

scheme. In case m ode s p littin g is rem oved, these filte re d ve locities disappear,

4 CHAPTER 1. PRESENT COHERENS HYDRODYNAM ICAE A LG O R ITH M


and scalar a dve ctio n can be ca lcu la te d u sing th e velo cities ca lcu la te d fro m
th e m o m e n tu m equations. T h e v e rtic a l v e lo c ity follow s fro m th e c o n tin u ity
equ a tion . T h erefo re a t th e surface, i t is equal to th e rise o f th e free surface.

C h a p te r 2
P re s e n ta tio n o f Tom as V a n
O yen - G e n t U n iv e rs ity
2.1

In tro d u ctio n

Tom as V an O yen m ade a p re se n ta tio n o f th e concept n o ta d ocum ent e n title d


0 n th e design o f a (new) n u m e rica l a lg o rith m fo r C O H E R E N S . T h e m a in
p o in ts th a t were presented are o u tlin e d below:

In tro d u c tio n
P h ysica l d e s c rip tio n o f th e flo w fie ld
N u m e ric a l im p le m e n ta tio n (n u m e rica l a lg o rith m )
C onclusions

2.2

P h y sica l d escrip tio n o f th e flow field

T h is p a rt was focused on: th e p rim itiv e equations, th e a p p lie d a p p ro x im a


tio n s and tu rb u le n c e m o d e llin g . T h e p rim itiv e equations o f flo w are based
on th e R A N S equations fo r th e conservation o f m o m e n tu m and mass, it was
m e n tio n e d th a t a d d itio n a l a p p ro x im a tio n s are considered: Boussinesq, h y
d ro s ta tic a p p ro x im a tio n , etc.

For tu rb u le n c e m o d e llin g , i t was m e n tion e d

th a t th e R eynolds stress tensor is described b y in tro d u c in g an eddy visco sity


te rm th a t w ill be ca lcu la te d fro m algebraic o r tra n s p o rt equations.

6 CHAPTER 2. PRESENTATION OF TOMAS VAN OYEN - GENT UNIVERSITY

2.3

N u m erica l im p lem en ta tio n (num erical al


gorith m )

F o r th e n u m e rica l im p le m e n ta tio n , th e p rim itiv e equations are tra n sfo rm e d


b y a g rid a d a p ta tio n (o rth o g o n a l c u rv ilin e a r grid s and s o r a co ordin a tes),
these tra n s fo rm e d equations are th e basis fo r th e n u m e rica l so lu tio n . T h is
tra n s fo rm a tio n leads to some im p lic a tio n s th a t were m e n tion e d, th e y are:
grid s have ve lo city, e x tra m e tric te rm s have to be considered and e x tra nonlin e a ritie s .
T h e n u m e rica l d is c re tiz a tio n was m e n tion e d, where a ll th e term s o f the
tra n s fo rm e d equations are assessed in o rd e r to d ete rm ine i f th e y can be solved
b y an e x p lic it o r im p lic it m e th o d . T h e discussion sta rts w hen a que stio n was
p o in te d : th e h o riz o n ta l a dve ctio n and d iffu s io n term s can be solved by an
im p lic it m e thod?
For th e s p a tia l d is c re tiz a tio n , 3 schemes were m entioned. For th e ve r
tic a l a dve ctio n, u p w in d -c e n tra l-T V D scheme. For th e h o riz o n ta l advection,
u p w in d -L a x -W e n d ro ff-T V D scheme. F o r h o riz o n ta l d iffu sio n , ce n tra l scheme.
For th e im p lic it scheme, tw o goals are id e n tifie d :
F irs t goal: h o riz o n ta l a dve ctio n and d iffu s io n te rm s e x p lic it
Second goal: h o riz o n ta l a dve ctio n and d iffu s io n term s im p lic it
For th e firs t one, th e A D I approach was m e n tion e d, w h ich is a p p lie d in
tw o steps (fo r th e X -m o m e n tu m and Y -m o m e n tu m equations re sp e ctive ly).
F o r th e second one, th e que stio n is open, on how to solve??, some suggestions
were m e ntioned: Ite ra tiv e m e thods w ith R e d -black Jacobi, successive o rd er
re la x a tio n and Gauss-Seidel ite ra tio n , and E u le ri an-Lagrange d isc re tiz a tio n .
A n o th e r o p tio n was proposed, to solve a ll convective te rm s w ith E u le ria n L a g ra n g ia n d is c re tiz a tio n , where flo w ve lo cities w ill be ca lcu la te d as a fu n c
tio n o f th e surface level ca lcu la te d a t th e same tim e step, o b ta in in g a fived ia go n al system , s y m m e tric and s tr ic tly d ia g o n a lly d o m in a n t w ith p o sitive
elements.

2.4

C on clu sion s

A s a conclusion some questions were p o in te d in o rd e r to open a discussion,


th e y are o u tlin e d below:
D iscussion on th e p hysical d e scrip tio n

C O N C LU S IO N S

C onsiderations: free surface g ra d ie n t ( im p lic it), b a ro c lin ie (e x p lic it),


h o riz o n ta l a d v /d iff (e x p lic it? )
C onvective term s present n o n -lin e a ritie s
A D I tw o step scheme: a d v /d iff im p lic it (large banded m a trix )
O th e r view : one step (co n ju g a n t g ra d ie n t so lu tio n )
P a ra lle liz a tio n
M ake th e scalar a dve ctio n e q u a tio n im p lic it?
B o u n d a ry co n d itio n s: Is it possible to use e x p lic it o.b.c in co m b in a tio n
w ith an im p lic it scheme?
D e n sity s tra tific a tio n : Is i t feasible to use a b a ro c lin ie g ra d ie n t in com
b in a tio n w ith a h y d ro s ta tic pressure d is trib u tio n ?

8 C H A P T E R 2. P R E S E N T A T IO N O F T O M A S V A N O Y E N - G E N T U N IV E R S IT Y

C hapter 3
Consequences COHERENS
h y d ro d y n a m ic a l a lg o rith m
A p re s e n ta tio n is given by M a rce lo and A le x a n d e r on th e consequences o f
th e im p lic it scheme fo r th e o th e r subtasks.
M a rce lo his p re se n ta tio n concerns three m a in p arts:
c e n tra l in p u t file fu n c tio n a lity
in u n d a tio n schemes
s tru ctu re s m o d ule

- Central input file


P re se n tly COHERENS makes use o f a set o f User defined files, fo r instance:
1. m odel: o p e ra tio n a l s e ttin g , b a th y m e try
2. d a ta in p u t.
T h e a im o f th e w o rk is to derive a fra m e w o rk in w h ic h a ll e x te rn a l in p u t d a ta
is in one file.

- D rying/w etting schemes


T h e d r y in g /w e ttin g schemes now use a m ask fu n c tio n (a fu n c tio n ) to remove
th e coastal b o u n d a ry fro m th e d om ain. T h is a fu n c tio n m u ltip lie s w ith the
term s in th e m o m e n tu m equations, a b e in g u n ity in regions where th e to ta l
w a te r d e p th approaches to zero. T h e a im is to have a d yn a m ic m ask fu n c tio n .

10CHAPTER 3. CONSEQUENCES COHERENS H YDR O D YN AM IC AL A LG O R ITH M

- Structures
D iffe re n t b o u n d a ry c o n d itio n s are developed to m o d el th e influence o f s tru c
tures.

- Comments made
P ro f. Beckers asks i f th e in u n d a tio n scheme is now d iffe re n t fro m the
flo o d in g scheme.
I t is questioned b y D r.

B o u rb o n i f a t th e b e g in n in g a ll p o in ts th a t

are w e t/d r y are a llo cate d in arrays where th e p o in ts are d ry /w e t.

It

is re m a rke d th a t now c o m p u ta tio n a l tim e is lo st because a ll p o in ts o f


th e g rid should be m em orized.

T ru e c u rv ilin e a r g rid tra n s fo rm a tio n

co uld be b en e ficia l fo r th is p ro b le m , however, u n s tru c tu re d g rid s are


even m ore advisable.

T h e p re se n ta tio n o f A le x a n d e r discusses m a in ly
an o verview o f th e o th e r subtasks
suspended sedim ent tra n s p o rt m o d ule
bed load
bed m o rp h o lo g y m o d ule
b o tto m roughness
flu id -m u d
describe im p lic a tio n s o f im p lic it code on subtasks
v e rific a tio n process

- Suspended sediment transport


T h e a im is to m o d el sedim ent co n ce n tra tio n . W ith an im p lic it sca lar-advection
e qu a tion , th is has s u b s ta n tia l im p lic a tio n s due to a d v e c tio n /d iffu s io n term s
b e in g th e im p lic itn e s s o f th e source te rm .

- Bed load module

11

N o t so m uch effect since th is is m odeled w ith algebraic equations.

- Bed roughness
I t is re m a rke d th a t th e bed roughness is fu n c tio n o f th e flo w c o n d itio n s such
th a t w ith an im p lic it code th is induces e x tra n o n -lin e a ritie s.

- A utom atic verification


T h is is te st how new code p erfo rm s w ith respect to o ld code.

- Comments made
Is i t a tw o -w a y c o u p lin g between th e flu id and th e sedim ent? Yes, in
th e sense th a t th e sedim ent can influence th e flu id tro u g h th e eddy v is
cosity; i.e. th e m ore sedim ent, th e m ore th e flu id is dam ped. However,
th is is n o t coupled in tim e b u t staired.
T h ere are d iffe re n t tim e steps in th e m odel; i.e. m o rp h olo g y, 3D, scalara dvection. I t is discussed th a t th e sca la r-a dve ctio n does n o t have to be
w ith th e same step as th e h yd ro d yn a m ics. F u rth e rm o re , i t is rem arked
th a t m o rp h o lo g y tim e -s te p p in g depends on th e phenom ena, however
i t should be ta ke n in m in d n o t to u p d a te to o sm a ll values o r to tra c k
differences between new and o ld in stea d o f su m m in g ju s t o ld w ith e xtra ,
as th is e x tra co uld be to o sm all.

- Suggestions to keep in mind


S w itch to tru e c u rv ilin e a r g rid

12 C H A P T E R 3. CO N S EQ U E N C E S COHERENS H Y D R O D Y N A M IC A L A L G O R IT H M

C h a p te r 4
E x p e rt e v a lu a tio n
S. B o u rb a n (H R W a llin g fo rd ) presents a c ritic a l re vie w o f th e re p o rt. In th is
re vie w he goes in p a rtic u la r d e ta il w ith respect to th e fo llo w in g subjects: the
use o f th e h y d ro s ta tic a ssum ptio n , th e use o f im p lic it code (using ite ra tiv e
m a tr ix solvers), and p a ra lle liz a tio n o f th e code.

4.1

Im p licit cod e

S. B o u rb a n re m a rks th a t th e purpose o f an im p lic it code is im p o rta n t fo r


robustness, n o t fo r a decrease in c a lc u la tio n tim e . F or th a t reason, he believes
th a t m ore im p lic itn e s s is necessary. In o rd e r to decrease th e c a lc u la tio n tim e ,
p a ra lle liz a tio n sh ould be used. T h e fo llo w in g rem arks are made:
Ite ra tiv e solvers deserve a second look.
g ra d ie n t vs.

A D I is n o t strong.

T h e a rg u m e n ta tio n conjugate

T h ere are m a n y m ore sorts o f ite ra tiv e

solvers. In p ra ctice , convergence o f th e ite ra tiv e solvers is ve ry fast (a lre a dy


w ith 5 ite ra tio n s ). F u rth e r, th e y are n o t th a t d iffic u lt to im p le m e n t (ty p ic a lly ,
th e y o n ly occupy one page o f source code).

W it h respect to these solvers

conjug a te g ra d ie n t is 10 to 50 tim es faste r th a n Gauss-Seidel, b u t m u ltig rid


m e thods are even faster. He also states th a t fo r th e im p lic it code, second
o rd e r accuracy in tim e is necessary.
W it h respect to th e c u rre n t concept, he th in k s th a t s-coordinates are the
w ay to go. T h e p ro b le m w ith th e m is th e h y d ro s ta tic inconsistency, where
eddies are generated in deep reservoirs in s till w ater.

T h e y solved th a t by

tu r n in g o ff m ix in g in these areas. He suggests th a t th e h o riz o n ta l adve ctio n


term s should also be made im p lic it. He does n o t have any experience w ith
th e E u le ria n -L a g ra n g ia n m e th o d fo r d is c re tiz in g th e a dve ctio n term s. I t
m ig h t be s im ila r to th e m e th o d o f characteristics. W ith th a t m e th o d , th e y
experienced problem s w ith th e mass balance, w h ic h is n o t an issue w hen

13

CHAPTER 4. EXPERT EVALUATIO N

14

open b ou ndaries are present, b u t can be an issue w ith a closed dom ain.
He also suggests th a t h o riz o n ta lly , u n s tru c tu re d meshes are preferable to
re g u la r grids, b u t th a t the re is no necessity to im p le m e n t these.

4.2

H y d ro sta tic a ssu m p tio n

S. B o u rb a n compares th e re sults o f a h y d ro s ta tic c a lc u la tio n w ith a n on


h y d ro s ta tic c a lc u la tio n fo r a few p ra c tic a l s itu a tio n s , viz. a tre n c h (w ith a
1:5 slope) a source and sin k flo w and lo ck exchange. In a ll these exam ples,
th e differences between th e h y d ro s ta tic and n o n -h y d ro s ta tic c a lc u la tio n are
d ra m a tic . F or exam ple, a t th e slopes o f th e trenches, th e h y d ro s ta tic m odels
are n o t able to p re d ic t re c irc u la tio n . T h is m ig h t have d ra m a tic consequences
fo r sedim ent tra n s p o rt (since th e d ire c tio n o f th e bed shear stresses, and
hence th e bed load d ire c tio n is d iffe re n t in b o th cases). T h e o th e r exam ples
show a sm o o th e r s o lu tio n fo r th e n o n -h y d ro s ta tic th a n fo r th e h y d ro s ta tic
c a lc u la tio n (due to th e added in e rtia ). T h e increase in th e c a lc u la tio n tim e
in a n o n -h y d ro s ta tic c a lc u la tio n is ra th e r m odest (in his experience th e in
crease is a b o u t 20%). In alm o st every code, th e n o n -h y d ro s ta tic e q u a tio n is
ca lcu la te d as a co rre c tio n to th e h y d ro s ta tic pressure, th u s i t seems possible
to firs t im p le m e n t a h y d ro s ta tic code and th e n e xte n d i t to a n o n -h y d ro s ta tic
one. He suggests th a t m a k in g th e code im p lic it should be done in such a way
th a t an extension to a n o n -h y d ro s ta tic code is possible.

4.3

S u g g estio n for im p licit co d e

He presents tw o suggestions w ith respect to th e co u p lin g o f th e equations,


one u sing th e h y d ro s ta tic flo w a ssum ptio n and one using th e n o n -h y d ro s ta tic
flo w a ssum ption. F o r th e h y d ro s ta tic a ssum ptio n , a suggestion is to use the
c o n tin u ity e q u a tio n (d iv tq = 0 in co m b in a tio n w ith w(z = h) = dh/dt)
in o rd e r to ca lcu late th e surface g ra d ie n t (and thu s th e pressure g ra d ie n t in
th e m o m e n tu m e quations).

T h e advantage o f th is approach (com pared to

th e tra d itio n a l approaches) is th a t th e m o m e n tu m equations in th e x and y


d ire c tio n do n o t depend on th e w a te r level ele vatio n anym ore (th us th e y are
u nco u pled fro m th e d e p th in te g ra te d c o n tin u ity e q u a tio n ).
T h e n o n -h y d ro s ta tic term s m ig h t be in tro d u c e d in th e equations o f m o
tio n in a d iffe re n t w ay th a t is n o rm a lly done. T h e n o rm a l approach leads to
a pressure-Poisson e qu a tion , w h ic h has th e disadvantage th a t mass conser
v a tio n and pressure are o u t o f phase. H is suggestion is to solve th e pressure
fro m th e v e rtic a l m o m e n tu m e q u a tio n and th e n th e v e rtic a l v e lo c ity fro m

4.4. PAR ALLELIZATIO N

15

th e c o n tin u ity e q u a tio n (ra th e r th a n th e o th e r w ay ro u n d as is done in the


pressure co rre c tio n m e th o d ).

4.4

P ara lleliza tio n

He presents his experience w ith p a ra lle liz a tio n (in Telem ac). In th is m odel,
i t is done w ith o u t a m a ster node (w h ich m ig h t be w a itin g fo r th e o th e r
processes to fin is h ) using M P I. T h e y experienced speed-up o f th e c a lc u la tio n
u p to a ve ry large n u m b e r o f processors (4000). O n ly a fte r th is n u m b e r was
reached, th e c a lc u la tio n slowed dow n. T h e g ain in speed was super lin e a r.
T h e reasons fo r th is are:
T h e m a trix size decreases w ith an increasing n u m b e r o f dom ains and
th e increase in speed because o f sm a lle r m a trix is solved is la rg e r th a n
th e decrease because ite ra tio n s are necessary.
Less cache e rro r o ccur fo r a sm a lle r a m o u n t o f d a ta (w ith an increas
in g n u m b e r o f d o m a in s ), w h ic h gives a stro n g increase in c o m p u ta tio n
speed.
P a ra lle liz a tio n w ill n o t be a p ro b le m in th e c u rre n t concept, as lo n g as
halos are used. Ite ra tiv e m a trix solvers are an advantage w ith p a ra lle liz a tio n ,
because th e ite ra tio n is necessary in o rd e r to couple th e d iffe re n t dom ains.

4.5

R eco m m en d a tio n s

H is re co m m endations are:
A im a t developing a n o n -h y d ro s ta tic code eventually.
Use ite ra tiv e m a tr ix solvers.
M ake th e code p a ra lle l to increase c o m p u ta tio n speeds.

C H A P T E R 4. E X P E R T E V A L U A T IO N

C hapter 5
P re s e n ta tio n o f Sebastien
B o u rb a n - H R W a llin g fo rd
5.1

In tro d u ctio n

T h e p re s e n ta tio n was e n title d A w o rd on th e (non) h y d ro s ta tic a ssu m p tio n ,


presented b y Sebastien B o u rb a n (H R W a llin g fo rd )
Here a general assessment was presented a b o u t th e in fluence o f th e use
o f n o n -h y d ro s ta tic approaches fo r m o d e llin g purposes, a general com parison
o f tw o approaches is d eta ile d : h y d ro s ta tic and n o n -h y d ro s ta tic approaches.
T h e fo llo w in g elem ents were o u tlin e d :

5.2

C o n cep ts and N u m erica l A p p lica tio n s

T h e basic d e fin itio n o f h y d ro s ta tic pressure is defined here, in d ic a tin g th a t


fo r n o n -s ta tic co n d itio n s, th e h y d ro s ta tic pressure s til exists and should be
considered.

M o re vo er, a d y n a m ic pressure has to be considered as well.

T herefore, some specific a p p lica tio n s are re p o rte d in o rd e r to d is tin g u is h


betw een h y d ro s ta tic and n o n -h y d ro s ta tic approaches.

5 .2 .1

F lo w over tre n c h e s /b u m p s

In flo w over trenches /b u m p s , th e n o n -h y d ro s ta tic approach presents b e t


te r results, a re c irc u la tio n process can be observed, w h ile fo r h y d ro s ta tic
approaches, th e re is no re c irc u la tio n .

I t is possible to conclude th a t n o n

h y d ro s ta tic approaches can produce re su lts closer to re a lity.


O n th e o th e r hand, fo r sim u la tio n s o f a h y d ra u lic ju m p , th e best s o lu tio n
is o b ta in e d also b y a n o n -h y d ro s ta tic approach, i t was com pared w ith a

17

18 CHAPTER 5. PRESENTATION OF SEBASTIEN BOURBAN - HR WALLINGFORD


h y d ro s ta tic approach and a 2D m odel, p ro d u c in g th e best solutions.

5.3

C on clu sion s

Some o f th e conclusions and suggestions p o in te d b y B o u rb a n are d e ta ile d as


follow s:
H o riz o n ta l u n s tru c tu re d meshes are prefered. However, in th e c u rre n t
concept th e re is no necessity to im p le m e n t such k in d o f meshes.
Second o rd e r tim e differences are necessary.
P ush on p a ra ll lis a tio n , i f th e o b je c tiv e is to g a in c o m p u ta tio n speed,
i t is advisable to push on p a ra ll lis a tio n , it is possible to im p le m e n t
based on th e c u rre n t status o f th e p a ra lle l m ode o f COHERENS , i t was
suggested th e use o f halos.
T E L E M A C uses M P I, the re is no m aster, o n ly in d iv id u a l sim u la tio n s
th a t connect each o th e r. T h is sugestin was presented to consider the
effectiveness o f p a ra ll lis a tio n .

C hapter 6
P re s e n ta tio n o f Jan V ie re n d e e ls
- G e n t U n iv e rs ity
6.1

In tro d u ctio n

Jan V ierelndeels o f th e D e p a rtm e n t o f F lo w , H eat and C o m b u stio n M echanics


o f th e G ent U n iv e rs ity , m ade a p re se n ta tio n a b o u t th e im p le m e n ta tio n o f an
im p lic it scheme in to th e COHERENS code. T hus, th e fo llo w in g rem a rks are
o u tlin e d

6.2

P h y sica l ap p rox im a tio n s

N o com m ents were m e n tion e d, th e b a ckg ro u n d o f th e e xp e rt is on gas d y


nam ics, no re la tio n w ith coastal and ocean m o d e llin g .

6.3

A D I versu s Itera tiv e m eth o d

One o f th e im p o rta n t issues is th e C P U tim e in A D I m e th o d . A n y h o w , it


is expected th a t th e o b je c tiv e o f th e im p le m e n ta tio n is robustness and n o t
c o m p u ta tio n speed. M oreover, p a ra ll lis a tio n can be an o p tio n . Nevertheless,
its im p le m e n ta tio n in A D I schemes is d iffic u lt.

6.4

H orizon tal a d v e c tio n /d iffu sio n

For th e c a lc u la tio n o f th e h o riz o n ta l a d v e c tio n /d iffu s io n term s, th e fo llo w in g


issues have to be considered:

19

20 CHAPTER 6. PRESENTATION OF JA N VIERENDEELS - GENT U NIVERSITY


A ccuracy, w avelength o f th e s tru ctu re s to be resolved. C onvective C F L
num ber.
T h e use o f an ite ra tiv e solver w ill re su lt in a gain in o ve ra ll C P U tim e .

6.5

F uture p ara lllisa tio n

T h e fo llo w in g elem ents should be considered fo r fu rth e r p a ra ll lis a tio n in


im p lic it schemes:
shared m e m o ry / d is trib u te d m e m o ry
T h om as a lg o rith m vs. p a ra lle l solvers fo r trid ia g o n a l systems
Ite ra tiv e solver (m u ltig rid ? )

6.6

A ccu racy

T o d ete rm in e th e accuracy o f a n u m e rica l so lu tio n , th e fo llo w in g item s should


be considered:
O rd e r o f th e s p a tia l and te m p o ra l d is c re tiz a tio n
N u m b e r o f g rid cells p e r wave le n g th (la m b d a)
C F L n um b e r
T V D p ro p e rty w ith im p lic it solver
N o tim e step re s tric tio n fo r s ta b ility
P e rfo rm tests in I D to check
Some te st were p e rfo rm e d in a I D m o d el ( M A T L A B ) in o rd e r to assess
th e acuracy o f some approaches, th e re su lts are sum arized as follow s:
F o rw a rd E u le r w ith 1st o rd e r u p w in d s p a tia l d is c re tiz a tio n : C F L should
be a ro u n d 1, la m b d a should n o t be to o lo w
B a ckw a rd E u le r w ith 1st o rd e r u p w in d sp a tia l d isc re tiz a tio n :

to be

avoided
C ra ck-N ico lso n 2nd o rd e r ce n tra l sp a tia l d is c re tiz a tio n : accurate i f C F L
is a ro u n d 1, o r fo r h ig h e r C F L n u m b e r i f la m b d a is la rg e r enough
(la m b d a = n u m b e r o f g rid cells p e r wave le n g th )

6.7. NON HYDROSTATIC NUM ERICAL CODE

6.7

21

N o n h y d ro sta tic n um erical cod e

T h e pressure m e th o d , th e m a in b o ttle n e c k is to solve th e Poisson e quation.


M u ltig r id can be used here.

6.8

P a ra lllisa tio n

C o n cern in g th e p a ra ll lis a tio n o f th e im p lic it scheme, th e fo llo w in g rem arks


were m entioned:
T h om as a lg o rith m is easy to p a ra lle lize on shared m e m o ry co m p u te r
P a ra ll lis a tio n on d is trib u te d m e m o ry co m p u te r is n o t s tra ig h tfo rw a rd
Ite ra tiv e solve o f decoupled T h om as a lg o rith m (p e r C P U ) is a possible
s o lu tio n
M u ltig r id a lg o rith m (e.g. Poisson e q u a tio n ): sm o o th in g steps are easy
to p arallelize, re sid ua l sm o o th in g a n d /o r re s tric tiv e to o

22 CHAPTER 6. PRESENTATION OF JA N VIERENDEELS - GENT U NIVERSITY

C hapter 7
P re s e n ta tio n o f Jean M a r ie
Beckers - Liege U n iv e rs ity
7.1

In tro d u ctio n

Jean M a rie Becker fro m th e G eo H yd ro d yn a m ics and E n v iro n m e n t Research


G ro u p o f th e Liege U n iv e rs ity , c o n trib u te d w ith a pre sen tatio n . Some general
rem arks and recom endations re la te d w ith th e im p le m e n ta tio n o f an im p lic it
scheme were m e n tio n e d as a p ro po sa l fo r fu rth e r discussions, here are o u tlin e d
th e m ost relevant issues.

7.2

R em ark s and su g g estio n s

P a ra ll lis a tio n m ake m ore d iffic u lt. He in d icate s th a t im p lic it m ethods


gen e ra lly m ake d o m a in d eco m p o sitio n m ore co m p lica te d w ith d ire c t
solvers. T h ere is no effective gain in c o m p u ta tio n tim e .
S ta b ility is n o t precision, th e robustness sh ould n o t be th e o n ly goal o f
th e im p le m e n ta tio n o f im p lic it schemes. P re cisio n should be considered
in o rd e r to reach a n o th e r im p o rta n t goal: good re s u lts
Im p lic itn e s s in best case should ju s t be a cure o f occasional v io la tio n
o f C F L rule. Before ta k in g a decision in u sing an im p lic it scheme, i t is
advisable to v e rify i f an e x p lic it scheme can be used.
C o n cern in g th e c a lc u la tio n o f th e surface elevation, He m entions th a t
he is n o t convinced th a t im p lic it is needed (unless n o n -h y d ro s ta tic ),
suggesting to take a lo o k a t lib ra rie s fo r solvers (in c lu d in g p a ra lle l ver-

23

24 CHAPTER 7. PRESENTATION OF JEAN M A R IE BECKERS - LIEG E UNIVERSITY


sion). M oreover, it was also m e n tio n e d th a t p re c o n d itio n in g m ig h t be
a p ro b le m w ith changing d om ain.
F o r a dve ctio n, w h y do n o t use o p e ra to r s p littin g ? , as easy as A D I b u t
m uch easier
F o r d iffu sio n , H o riz o n ta lly gen e ra lly ve ry crude p a ra m e tris a tio n . T h e
te rm should never be d o m in a n t and hence n o t need im p lic it tre a tm e n t,
th e n i t is n o t recom m ended
F o r m o rp h olo g y, th e que stio n is, Slow process do re a lly need fo r im p lic it
E x n e r e qu a tion , th e same fo r z0 w h ic h changes p ro b a b ly s u ffic ie n tly
slo w ly to re m a in e x p lic it

C hapter 8
E x p e rts presentations
E x tra in fo rm a tio n on some specific to p ics is presented in a sh ort p re se n ta tio n
b y th e experts.
D r. S. B o u rb a n
Describes problem s th a t were e nco u ntu re d in th e developm ent o f d ry in g /w e ttin g
schemes in T E L E M A C . A lso differences th a t o ccur w h ile changing between
conservative and non-conservative fo rm are discussed. I t is recom m ended to
use th e conservative form .
P ro f. V ierendeels
N o n -h y d ro s ta tic extension
P ro f. Vierendeels discusses th a t using th e pressure m e th o d to handle
th e d y n a m ic pressure leads to a poisson e q u a tio n w h ich is u s u a lly con
sidered as a b o ttle -n e ck. E xperience, however, has show n th a t th is can
be solved b y means o f m u ltig rid m ethods. A tte n tio n sh ould be p u t on
th e d iffe re n t g rid sizes in th e v e rtic a l and h o riz o n ta l, nevertheless.
P a ra lle lliz a tio n
C om m ents are m ade on th e p a ra lle lliz a tio n o f th e T h o m a s A lg o rith m
a nd th e differences i f th e co m p u te r uses a shared o r a d is trib u te d m em
ory.
P ro f. Beckers
P ro f. Beckers discusses a recent developm ent th a t was im p le m e n te d in the
G E T M -m o d e l to a d a p t th e g rid in fu n c tio n o f th e so lu tio n .

25

CHAPTER 8. EXPERTS PRESENTATIONS

C h a p te r 9
Discussion Session
9.1

In tro d u ctio n

T h e discussion session was focused in th e fo llo w in g issues:


H y d ro s ta tic assum ptio n
A d v e c tio n /d ifu s s io n im p lic it
Im p lic it scheme

9.2

H y d ro sta tic a ssu m p tio n

T h e fo llo w in g re m a rks and open questions were o u tlin e d :


I t is advisable o n ly fo r fu ll im p lic it
Sebastien B o u rb a n p o in ts th a t th e re is n o t m uch m ore cost in th e im
p le m e n ta tio n o f th e n o n -h y d ro s ta tic approach
H ow to m anage free surface?
For th e im p le m e n ta tio n o f th e n o n -h y d ro s ta tic approach, i t w ill be nec
essary to add th e fo llo w in g te rm s in to th e s o lu tio n o f th e h y d ro d y n a m ic
equations: dp/dx, dp/dy (re s u ltin g in one m ore e q u a tio n )
C an be done e x p lic itly o r im p lic itly
I t is advisable fo r h a rb o u r a p p lic a tio n s (n a v ig a tio n channels)

27

CHAPTER 9. DISCUSSION SESSION

28

9.3

A d v e c tio n /d iffu sio n im p licit

T h e fo llo w in g rem arks and open questions were o u tlin e d :


F o r d ry in g and w e ttin g areas, an im p lic it scheme is ju s tifie d fo r a ll
h o riz o n ta l term s
R e d u c tio n o f tim e step
A d v e c tio n is m ore ro b u s t (o p e ra to r s p littin g ? )
I t is n o t a gain o f c o m p u ta tio n a l tim e (m ore ite ra tio n s are necessary)
W h a t g rid size and tim e step do I need?, th e n

we decide i f I tu r n in to

an im p lic it scheme
A D I im p le m e n te d as an ite ra tiv e solver

9.4

Im p licit sch em e

I t was concluded th a t the re w ill be no p ro b le m in th e im p le m e n ta tio n o f


p a ra ll lis a tio n in to th e im p lic it scheme, it is possible to use th e c u rre n t fu n c
tio n a litie s (e.g. halos).
O n th e o th e r hand, th e prefered im p lic it m e th o d is th e a lte rn a tiv e one
where a ll convective term s are discre tized im p lic itly w ith E u le ria n - Lag ra n g ia n d isc re tiz a tio n .

T H V IM D C -S o resm a
in coi. w ith KU Leuven, UG ent, BM M en W LB

Appendix E
Report meeting Prof. Stelling

Report meeting with Prof. dr. ir. G. Stelling on the 2th of September 2010:

Attendees: Tomas Van Oyen, Marcelo Heredia Gomez and Alexander Breugem. Dr. ir. Marcel Zijlema
attended almost half of the meeting.
A meeting has been organized with Prof. Stelling in Delft, The Netherlands on the 2th of September
2010. The objective was to discuss the concept note on the design of the implicit scheme in
COHERENS. The following points summarize the main discussion points:
-

The method to describe the free surface gradient implicitly is discussed. It is commented that the
method we decided to follow, after the workshop, is a good method. Although also the ADImethod, proposed initially, would be a plausible path; it is considered to be less appropriate due to
the inherent limitation to a CFL number of 10 which occurs due to the splitting of the implicitness
of the free surface into two independent steps. Even worse, for calculations with CFL above 10, this
approach can provide results, however incorrect results.

The proposed implicitness of the vertical advection and diffusion terms is a necessity; as proposed
in the concept note. Horizontal advection and diffusion terms, on the other hand, need not to be
considered fully implicit for all cells. Nevertheless, to remove instabilities which can occur in the
domain, Prof. Stelling advises to consider the method he presents in the article of Kramer and
Stelling (2008) which is based on the method of Carlson. This approach considers to integrate
locally implicit in time, allowing an explicit calculation in most of the domain, while maintaining
unconditional stability (by implicit calculations) only where necessary.

A slight preference is expressed by Prof. Stelling to the Conjugent Gradient method as iteratieve
solution procedure as this guarantees conversion and is most of the time the fastest iteratieve solver.
However, Dr. Zijlema remarked that this does not close the door to other methods (like GMRES,
BiCG) as these also (almost) always lead to the solution and have as advantage that the matrix does
not have to be symmtric.
Furthermore, it is discussed that using an Incomplete LU factorization (ILU 2) as precontioner is an
efficient approach, as was foreseen in the method considered after the workshop.

Prof. Stelling remarks that using the ADI method, it does not matter when the vertical velocity is
updated, as this, considering the hydrostatic assumption, in any case will not provide correct results.
Nevertheless, he would suggest to update everything as much as possible. Furthermore, it is
remarked that results considering non-hydrostatic pressure are only reasonble when the horizontal
grid spacing is of similar dimensions with the vertical grid spacing.

Prof. Stelling thinks that multigrid methods will not lead to considerable advantages for the shallow
water equations, altough subgrid methods could. Reference is made to Casulli and Stelling (2010).

It is remarked that, considering the equations in weak form, attention should be made to discretize
the equations conservative; i.e. preference is given to a strict finite volume approach.

T H V IM D C -S o resm a
in coi. w ith KU Leuven, UG ent, BM M en W LB

Appendix F
Final conceptreport

Flemish Administration - Department of Mobility and


Public Works

r>

departement

/a

Maritime Access Division

Expansion of the numerical modeling tools for the North Sea


harbours

Report n4.1 - Design of the implicit scheme in CO HERENS

COHERENS l

M o b ilite it en
Openbare Werken

Colophon
Cover picture: sediment plumes at the Port of Zeebrugge (Bing Maps)

THV IMDC - Soresma


Adress: Coveliersstraat 15, 2600 Antwerp, Belgium
S : + 32 3 270 92 95

i:+ 32 3 235 67 11
Email: info@imdc.be
Website: www.imdc.be

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

Document Identificatie

Titel
Project
Opdrachtgever
Documentnaam
Documentref

Design of the implicit scheme in COHERENS


Uitbouw numeriek modelinstrumentarium
Afdeling Maritime Toegang
c:/11339_concept_report
l/RA/11339/10.072/GVH

Revisies/ Goedkeuring

Versie
1.0

Datum
September 14,2011

Omschrijving
Draft

Auteur
TVO/ABR/MHE

Nazicht
GVH

Goedgekeurd

Verdeellijst

0
X

Analoog
Digitaal

Recipient digital report


Recipient analog report

Abstract

In this document, we describe the process leading to a framework within an implicit numerical
scheme can be implemented in COHERENS . In a first part, an overview is provided of the phys
ical and numerical description of the dynamical equations describing the flow field in the ocean,
coastal zone and estuary. Using this overview, we list several possibilities to implement an im
plicit numerical scheme in COHERENS . Next, we describe the numerical and physical approach
presently used in COHERENS . Based on both the overview and the present formulation, we sug
gest a framework to develop an implicit code to model coastal and estuarine flow. Implications for
current users are listed.

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

T H V IM D C -S o resm a
i.s .m. KU Leuven, UG ent, BMM en W LB

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

Contents

Table of contents

Introduction

1.1
1.2
1.3
1.4

1
1
2
3

Introduction to the numerical modeling ofOcean/Coastal flow


2.1
2.2

2.3
2.4
2.5
2.6

2.7
2.8

The assignment ..............................................................................................................


Objective of the s t u d y .....................................................................................................
Overview of the s t u d y .....................................................................................................
Structure of this r e p o r t.....................................................................................................

In tro d u c tio n ........................................................................................................................


Ocean m o d e lin g ..............................................................................................................
2.2.1 Boussinesq approximation .................................................................................
2.2.2 Traditional approximation ....................................................................................
2.2.3 Hydrostatic ap proxim atio n....................................................................................
Nearshore current circulation m o d e lin g .........................................................................
Numerical m o d e lin g ........................................................................................................
2.4.1 Mode s p littin g .........................................................................................................
The pressure method .....................................................................................................
(Semi-)implicit m e th o d .....................................................................................................
2.6.1 Iterative m e th o d s ...................................................................................................
2.6.2 ADI .........................................................................................................................
Some comments on the use of vertical or a vertical c o o rd in a te s..............................
Open community Models - Commercial M o d e ls ..........................................................
2.8.1 S U N TAN S................................................................................................................
2.8.2 P O M .........................................................................................................................
2.8.3 R O M S ......................................................................................................................
2.8.4 F IN E L 3 D ................................................................................................................
2.8.5 M IT g c m ...................................................................................................................
2.8.6 I C O M ......................................................................................................................
2.8.7 SELFE ...................................................................................................................
2.8.8 F V C O M ...................................................................................................................
2.8.9 D e lf t 3 D ...................................................................................................................
2.8.10 TELEMAC ............................................................................................................
2.8.11 M IK E 3 ......................................................................................................................

An overview of the numerical schemes in Coherens V2


3.1
3.2
3.3
3.4

3.5
3.6
3.7

In tro d u c tio n ........................................................................................................................


Description mode s p littin g ...............................................................................................
Description of 2D hydrodynamics schemes .................................................................
3.3.1 Drying and flooding .............................................................................................
Description of 3D hydrodynamics schemes ................................................................
3.4.1 Predictor s te p .........................................................................................................
3.4.2 Corrector step ......................................................................................................
Description of scalar a dve ctio n -d iffu sio n ......................................................................
Turbulence m o d e ls ...........................................................................................................
Details of the im p le m e n ta tio n .........................................................................................

5
5
5
6
7
7
8
10
11
11
12
12
13
13
14
14
14
15
15
15
16
16
16
16
17
17

19
19
20
22
24
24
24
25
26
28
28

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

3.7.1

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

Operator s p littin g ..................................................................................................

28

3.7.2 Semi-implicit vertical time in te g ra tio n ................................................................


Description of the lateral boundary c o n d itio n s .............................................................
3.8.1 Two-dimensional boundary c o n d itio n s ..............................................................
3.8.2 Three-dimensional boundary c o n d itio n s ..........................................................
3.9 Description of mathematical lib ra rie s .............................................................................
3.10 Conclusions and recom m endations.................................................................................

29
30
30
31
31
32

3.8

Towards an implicit scheme

35

4.1
4.2

Physical e q u a tio n s ............................................................................................................


Numerical a p p r o a c h .........................................................................................................
4.2.1
(Un)structured grid - general discretization m e th o d .......................................
4.2.2 Mode-splitting or n o t ............................................................................................

35
36
36
37

4.2.3 (Semi-) implicit method ......................................................................................


Conclusions and o u tlo o k ..................................................................................................

37
38

4.3

An overview of the code implementation in Coherens V2

39

5.1
5.2

In tro d u c tio n ........................................................................................................................


Description of the code s tr u c tu r e ...................................................................................
5.2.1
Coherens main p ro g ra m ......................................................................................

39
39
39

5.2.2 Subroutine
5.2.3 Structure of
5.2.4 Structure of
5.2.5 Structure of
Subroutines of the
5.3.1
Subroutine
5.3.2 Subroutine
5.3.3 Subroutine
5.3.4 Subroutine

hydrodynam ic_equations................................................................
the 2D hydrodyna m ics.....................................................................
the Predictor step ...........................................................................
the Corrector s t e p ...........................................................................
numerical scheme ..........................................................................
for 2D hydrodynam ics......................................................................
for the Predictor s t e p ......................................................................
for Corrector s t e p .............................................................................
for Scalar advection diffusion .......................................................

41
42
43
44
46
46
49
52
52

5.3.5 Subroutine for tu r b u le n c e ...................................................................................


Implementation of open boundary conditions .............................................................
5.4.1
Definition
of general p a ra m e te rs ...........................................................
5.4.2 Definition
of open boundary conditions for 2 D .....................................
5.4.3 Definition
of open boundary conditions for 3 D .....................................
5.4.4 Definition
of coastal boun d a rie s..............................................................
Basic elements for parallel computing ..........................................................................
5.5.1
Domain decomposition ......................................................................................

54
55
55
56
58
59
60
60

5.5.2 H a l o s .....................................................................................................................
5.5.3 C o m m u n ic a tio n s ..................................................................................................
5.5.4 Parallel processing implemented in numerical s c h e m e s ..............................
Conclusions and recom m endations................................................................................

61
62
64
64

5.3

5.4

5.5

5.6

Numerical framework

67

6.1

Three-dimensional flow f ie ld ............................................................................................


6.1.1
Physical e q u a tio n s ...............................................................................................
6.1.2 Temporal and spatial d is c re tiz a tio n ...................................................................

67
67
68

6.1.3 Details of the numerical s c h e m e .......................................................................


Depth-integrated flow f ie ld ...............................................................................................
6.2.1
The equations .....................................................................................................
Testing the implicit s c h e m e .............................................................................................
Conclusions and o u tlo o k ..................................................................................................

71
76
76
77
77

6.2
6.3
6.4

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

Impact on current users/modules

79

7.1
7.2
7.3
7.4
7.5
7.6
7.7
7.8
7.9
7.10
7.11

79
79
80
80
80
80
81
81
81
82
83

In tro d u c tio n ........................................................................................................................


Suspended sediment transport m o d u le .........................................................................
Bed load m o d u le ..............................................................................................................
Bed morphology m o d u le ..................................................................................................
Bottom roughness m o d u le ...............................................................................................
Fluid-mud module ...........................................................................................................
Sand-mud mixtures and c o n s o lid a tio n .........................................................................
Verification p r o c e d u r e .....................................................................................................
Central input file facility ..................................................................................................
Inundation s c h e m e s ........................................................................................................
Structures m o d u le ...........................................................................................................

Conclusions and outlook

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

85

T H V IM D C -S o resm a
i.s .m. KU Leuven, UG ent, BMM en W LB

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

List of Figures

3.1

5.1
5.2
5.3
5.4
5.5
5.6
5.7
5.8
5.9
5.10
5.11
5.12
5.13

Schematic overview of the indexing of the computational grid. Left: horizontal;


Right: vertical.......................................................................................................................

20

Structure of
subroutines in C O H E R E N S ...........................................................
40
Structure of
coherens_main ro u tin e ....................................................................
40
Structure of
coherens_main routine with definitions of arrays and the specification
of the dynamic mask f u n c tio n ..........................................................................................
41
Structure of
hydrodynamic_equations s u b r o u tin e ............................................
42
Structure of
current_2d subroutine ....................................................................
43
Structure of
current_pred s u b ro u tin e .................................................................
44
Structure of
current.corr su b ro u tin e ....................................................................
45
Structure of the
implementation of open boundary
conditions in
2D m o d e
Structure of the
subroutine update _2dobc_data.....................................................
57
Structure of the
implementation of open boundary
conditions in
3D m o d e
Structure of the
subroutine update_profobc_data .....................................................
59
C grid indices........................................................................................................................
61
Structure of coherens_main routine where calls to communications for parallel pro
cessing take p l a c e ............................................................................................................
64

56
58

T H V IM D C -S o resm a
i.s .m. KU Leuven, UG ent, BMM en W LB

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

viii

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

List of Tables

4.1

6.1

Advantages and disadvantages of the ADI scheme and the Conjugent Gradient
m ethod...................................................................................................................................

38

Advantages and disadvantages of the explicit or implicit time discretizations

70

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

Chapter 1
Introduction

1.1

The assignm ent

In the framework of the study Uitbouw numeriek modelinstrument voor de Noordzeehavens,


Bestek 16EF/2008/02 (Expansion of the numerical modeling tools for the North Sea harbors)
assigned by the Maritime Access division (aMT) of the Department of Mobility and Public Works
of the Flemish Government, various software developments will be carried out by THV IMDC Soresma, supported by the universities of Gent and Leuven.
The assignment consists of the development of mathematical hydrodynamica! and morphological
software in collaboration with Flanders Hydraulics Laboratory (WLB, Flemish government) and
the Management Unit of the North Sea Mathematical Models (BMM, federal government). The
point of departure for the developments in this study is the current version of the COHERENS
version 2 hydrodynamic model that has been developed by the BMM (Luyten (2009), version 1
user manual: see Luyten et a i (1999a)).
The study was assigned to the trading association THV IMDC - Soresma based on the moti
vated assignment order of November 24th, 2008 and communicated by aMT with reference B 544
16EFS-U-09-0013, on January 15th, 2009.
This report is the first report that is submitted as part of Task Order 4 - Development of an implicit
hydrodynamica! scheme. In this report, the framework (and the process leading to this framework)
within the numerical code will be developed is described.

1.2

Objective of the study

The goal of the study is threefold:


The development of software in collaboration with Flanders Hydraulics Laboratory (WLB)
and the Management Unit of the North Sea Mathematical Models (BMM) for the simulation
of currents and tidal propagation in seas, estuaries and rivers, including the simulation of
sediment transport and morphological bed changes caused by these currents or human
interference.
The developed software should enable studies (not part of this project) to be conducted with
respect to hydrodynamic and morphologic challenges during the development of harbor ex
tension projects, alternative dredging- and dumping strategies and sediment influx reducing
measures for the Flemish North Sea Ports.
The development of software for the modeling of sediment transport and morphological
processes that will use the models developed by the BMM (COHERENS V2) as a point of
departure and that will exploit the knowledge available in Flanders as much as possible.
The main focus of the client is the application of the tool in the optimization of the maritime access
of the various Flemish harbors, more particular to the complex fine sediments behavior in the

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

Port of Zeebrugge, the tidal dock Deurganckdok in the Port of Antwerp, the influence of geometri
cally complex infrastructures on water movement (such as the Current Deflection Wall, CDW), the
morphological impact of large scale use of dredged material and the influence of marshes and
dredge/dump activities on water quality of North Sea and River Scheldt. Based on this presump
tion, priorities have been given to the various required functionalities that have been identified in
the Inception Strategy (THV IMDC - Soresma, 2009).
From the Inception Strategy the following functionalities have been identified that support the main
goals for the development of the morphological module:
Implementation of an online suspension transport module (sand and silt)
a. Graded sediments
b. Hindered settling
c. Flocculation
d. Sediment turbulence interaction: Adjustment of turbulence damping for high concen
trations of suspended sediments
e. Effect of non-breaking waves on the bed shear stress
Transport formulae for sand
Implementation of the morphological module
a. Morphological acceleration
b. Non-erodable layers
c. Scenarios (of e.g. wind and waves)
d. Dredging- and dumping routines
The following functionalities were identified as of lower priority, but would have a surplus value:
(Dynamic) bed roughness predictors for hydrodynamics and / or sediment transport
Fluid Mud model KU-Leuven
Sand-silt mixtures and bed (consolidation) model
Effect breaking waves, wave-driven longshore transport
Besides these points, within the study, the development of an implicit numerical scheme for the
hydrodynamica! equations is put forward as an important achievement in order to realize large
gain in computational calculation time.
The goals of this specific task are:
1. Design of an implicit scheme in COHERENS
2. Implementation of the implicit scheme
3. Validation of the code

1.3

Overview of the study

Based on the Inception Strategy a selection of seven tasks has been assigned to the THV IMDC
- Soresma to commence the study with. These are:
Task order 1 : Course COHERENS V2
Task order 2: Update and expansion of the manuals of COHERENS V2
Task order 3: Implementation of a verification procedure

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

Task order 4: Conversion of the code from an explicit to an implicit numerical scheme
Task order 5: Development of an online sediment transport module
Task order 6: Development of a central input strategy, and
Task order 7: Development of inundation schemes.
During the course of this study for each of the various task orders (deelopdrachten) reports will
be submitted that together will cover all the activities. The following reports have been completed
and submitted to the client:
Report 1 - Inception report (THV IMDC - Soresma, 2009). The report is the result of an
inventory of the desired developments of the COHERENS V2 software and presents the
various tasks that have been selected for implementation.
Report 4-1 : Design of the implicit scheme in COHERENS : this report
Report 5-1 : Literature review of suspended sediment transport, bottom transport and mor
phology.

1.4

Structure of this report

In this report, the design of implicit numerical scheme to be implemented in COHERENS is re


ported. In particular, the process leading to the framework within the implicit code will be devel
oped is described. The structure of this report is as follows: in Chapter 2, an overview of the
state-of-the-art physical and numerical approaches to describe the flow field in the ocean, coastal
zone and estuaries is presented. Chapter 3 considers the numerical schemes that are presently
available in COHERENS . Then in Chapter 4, based on the information presented in Chapters 2
and 3, the abundance of numerical and physical possibilities is narrowed down setting out a path
to follow. Chapter 5 presents the structure of the present code, leading to recommendations on
the implementation approach. Subsequently, we present in Chapter 6, the framework in which
we intend to develop the numerical implicit scheme and describe in Chapter 7 the impact of the
implicit implementation on the current users/modules. Concluding remarks and recommendations
for future prospective developments are formulated in Chapter 8.

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

T H V IM D C -S o resm a
i.s.m. KU Leuven, UG ent, BMM en W LB

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

T H V IM D C -S oresm a
i.s.m. KU Leuven, UG ent, BMM en W LB

Chapter 2
Introduction to the numerical modeling of Ocean/Coastal flow

2.1

Introduction

Physical and numerical modeling of the fluid-motion in the ocean and the coastal zone is an
appealing and demanding challenge. One of the main issues of this art follows from the large
extend of active length and time scales affecting the dynamics; ranging from global scales (e.g.
the thermohaline circulation, the Gulf Stream) to features with scales of tens of kilometers up
to kilometers, tens of meters and even meters; especially in the vertical (e.g. Agulhas rings,
tidal waves, internal wave breaking, wind and wave driven currents, convection). Furthermore,
important scale interactions occur over the entire spectrum giving rise to a complex nonlinear
system.
The aim of this Chapter is twofold. In the first part, we aim to provide the reader an overview of
the governing equations describing the addressed physical problem; formulating the main classes
of physical approximations applied to these basic (primitive) system of equations. A second part
concerns a description of the available numerical approaches to solve the equations, for non
commercial and commercial codes.
We will embark by discussing the main issues in ocean modeling after which the near-shore
hydrodynamic problem is addressed.

2.2

Ocean modeling

We start by considering the Reynolds averaged equations of motion and continuity, referred to a
Cartesian axis at rest relative to the rotating earth. The fluid is taken turbulent and viscous effects
are neglected, see e.g. Pedlosky (1979); Kowalik & Murty (1993).
^

dpu

dt
dpu

dpv?

dt

dx

dx

dpuv
^

dy

dpv

dw =

dy

dz

'

d p u iu

dp

UR ,1 1

dz

dx

dx

UR .1 2
^

dy

UR ,1 3
^

dz

'

(2.2)

2p il[co s(4 > )tu sin(<yi>)j] ,


dpv

dpuv

dt

dx

dpv2
^

dy

dpmv

dp

dz

dy

R .2 1
dx

R 2 2
^

dy

9R.23
^

dz

(2.3)

2pVLsm(4>)u ,
d p iu

dpmv

dpmv

d p i? 2

dp)

R 3 1

R 3 2

R 3 3

-w + ^ r + -ap + -a r = - f"J-Y, + ^ ir +^ p + -a r

l2A}

+ 2 p i l eos(4>)u.

Plere, the x axis is along the parallels, pointing east, while the y axis points North
meridian lines. The axis is vertical, pointing upward. We assume = 0 describes
water level. Furthermore, Q is the angular velocity of the Earths rotation and <f> is the
the origin of the coordinate system. The parameter p denotes the pressure, p is the

along the
the mean
latitude of
sea water

T H V IM D C -S oresm a
i.s.m. KU Leuven, UG ent, BMM en W LB

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

density and (u, v , w ) represent the velocity components along the x , y and axes, respectively.
The tensor R y (with i,j = 1,2,3) denotes the Reynolds stress tensor and represents correlations
between velocity fluctuations; i.e. denotes the turbulent mixing of momentum.
In addition, we consider conservation of salt (S is salinity), conservation of heat (0 is potential
temperature) and an equation of state

dpO

dpi!,S

dt

dx

dpuO
+

~dt

dpS

dpvS
^

dpvO

dx

dy

V J -g ,

(2.6)

= p (0 ,S ,p ),

(2.7)

dy
P

(2.5)

dprwO
1

dy

d p iv S

dy

cp

where T e are non-advective heat fluxes and cp represents the specific heat capacity at constant
pressure. Hence, our system describes the dynamics of seven dependent variables with seven
equations.
Note, that the system (2.1) - (2.7) does not exhibit a prognostic equation for pressure, though two
equations for density (one diagnostic and one prognostic). Reshuffling of the continuity equation
and the equation of state (see e.g. Marshall & Adcroft (2004)), we can write
D tp

= p V V + p a D t 9 - p D t S

(2.8)

cs

where cs = cs (0, S , p ) is the speed of sound, a = a ( 0 , S , p ) is the thermal expansion coefficient and
= (0 , S , p ) is the haline expansion coefficient; D t is the total derivative with respect to time t.
Relation (2.8) illustrates the presence of acoustic modes in the system. As these features are not
of main interest, and (due to the fast phase speed) impose a severe restriction from computational
view; all ocean modeling efforts filter these features out of the system. Two approaches can
be considered to remove the acoustic modes from the system. A first method is to make the
hydrostatic approximation. In section 2.2.3, we address this approximation. A second approach is
to remove the density dependence on pressure. This can be done by considering the well-known

Boussinesq approximation.
2.2.1

Boussinesq approximation

The idea of the Boussinesq approximation is to consider the fluid in rest defined by a mean density
Po and pressure po- Then, motion will arise due to variations in the density p' and pressure p ' such
that
p = p 0( z ) + p \
P =
( u , V, l u )

Po + p ' ,

= 0 + (/, v ' , /),

Substituting this expansion into the momentum equations and considering p' < p0, we find that
the only term which does not drop after linearization relates to the gravitational acceleration g p '.
Moreover, for consistency, also to the equation of state we apply this reasoning such that
(2.9)

p = p { 0 , S ,p o{z)).

Furthermore, continuity equation can now be written as


du

dv

dx

dy ^

d iu

(2 .10)

dz

while momentum, salinity and heat conservation become


du

du

dv,

dt

dx

dy

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

du

1 dp

9R l

9R ;12

9R ;13

dz

po d x

Po

dx

dy

dz

M =

(2 .11)

T H V IM D C -S oresm a
i.s.m. KU Leuven, UG ent, BMM en W LB

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

2L2[cos(</>)w sin(<yi>)j] ,

dv
dt

dv
dx

dv
1 dp
io - =
dz
Po dy

dv
dy

9R'21
dx

po

9R'2 2
dy

9R.23
dz

(2 .12)

21sm(<f))u ,

diu
~dt
1

I- - -

Po

dia

dia

div

dx

dy

'l h =

>R3 2

> r 33

dy

dz

9R.31
dx
dS

dS

TTT +

dt

d0
t

dt

de
u

I-

dx

dx

de
v

dy

(2.13)

po dz

21eos (<f>)u

dS
+

1 dp

P9_
Po

dS

dy

de
w =

dz

0,

(2.14)

Tg,

(2.15)

dz

poCp

Other than filtering out the acoustic modes as natural modes in the system, these set of equations
do not impose limitations on the physical description of the phenomena.
2.2.2

Traditional approximation

Next to the Boussinesq approximation, introduced above, a classical approximation is called the

traditional approximation. This approximation is closely related to the hydrostatic approxima


tion, and suggests to neglect the horizontal Coriolis terms (those involving 2Q eos </>). As described
by Marschall et al. (1997) and White & Bromley (1995), the omitted terms are not always neg
ligible. In particular, the approximated set of equations provides only a crude description of the
dynamics in regions close to the equator. Also, it appears that when these terms are neglected,
the angular momentum principle is not ensured.
2.2.3

Hydrostatic approximation

The hydrostatic approximation assumes that the inertial accelerations in the vertical momentum
equation can be neglected, leading to a direct relation between pressure and gravitational accel
eration. Hence, it is assumed that |f = -pg.
Applying the traditional and the hydrostatic approximation, in addition to the Boussinesq approxi
mation leads to a main stream set of equations, called HPEs, which consist of

du
dt

du
dx

du
dy

du

dv

dx

dy ^ dz

du
~d~z

diu

(2.16)

1 dp

Po dx

po

9R l
dx

9 R 12
dy

9 R 13
dz

9R'21
dx

<9R.2 2
dy

UR.23

(2.17)

+22 sm(<f))v ,

dv
dt

dv
dx

dv
dy

dv
W ~d~z

1 dp

Po dy

po

dz

(2.18)

21sm(<f))u ,
dp

(2.19)

T - = -p g ,

dz

dS
TTT +

dt

de
"777 +

dt

dS
U -

dx

de
de
U + V -

dx

dy

dS
H - +

dy

de
h lt77 - =

p = p (s,e ).

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

dz

dS
W

dz

= 0,

i ^

pocp

^
Tg

(2 .20)
(2 .21)

(2 .22)

T H V IM D C -S oresm a
i.s.m. KU Leuven, UG ent, BMM en W LB

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

Employing the hydrostatic approximation introduces a substantial set of limitations. Mainly the
flow field can be assumed hydrostatic if the hydrostatic parameter
(2.23)

^T) ^ 1 7
Ihi

where
denotes the aspect ratio of the flow ( ' , = h /L , with h and L the characteristic vertical
and horizontal length scale, respectively) and
is the Richardson number
= N 2h2/ U 2, with
U a characteristic velocity scale and N the Brunt-Vaisala frequency, providing a measure of the
stratification). Although, using the hydrostatic approximation a broad range of phenomena can be
described, the requirement (2.23) is not always satisfied. In particular, in regions where the fluid
is not strongly stratified on small horizontal scales; i.e. with this approximation it is not possible
to capture convection in neutral conditions. Also, where depth variations are significantly, the
hydrostatic approximation does not provide an accurate description of the flow field. Therefore, in
the context of bedform dynamics, this approximation could become even problematic. Finally, we
note that the neglect of time derivatives in the vertical momentum equation, causes the problem
to be ill-posed at open boundaries, we refer to Norbury & Cullen (1985) for a discussion of this
problem.
Considering the limitations intrinsically contained in the governing equations while exploiting the
hydrostatic approximation and the traditional approximation, several models relax one of the two
introduced approximations. In summary, models that aim to describe the flow field in the coastal
zone and in estuaries usually relax the hydrostatic approximation while neglecting the horizontal
Coriolis terms leading to
p = p{0,S,p0{z)),
(2.24)
du
dx
du
H i

du
dx

du
dy

dv
dy

diu
dz

diu
dz

(2.25)

9R l
dx

9 R 12
dy

9 R 13
dz

U R 21

UR

UR.23

po

dx

1 dp

po dx

po

(2.26)

+2L2 sm(<f))v ,

dv

dv

dv

dt

dx

dy

dv

1 dp

W ~d~z

Po dy

22

dy

dz

(2.27)

21sm(<f))u ,

diu
H i

dw
dx

dw
dw
=-? l
t-w
dy
dz
Po

U R 31

Po

dx
dS
dt

>r 32
dy
dS
dx

~K7 + u

d0

de

de

H i

dx

dy

1 dp

po dz

(2.28)

9 R 33

dz
dS
dy

+ V

dS

-w

dz

dS
dz

+ w

1 ^

p0Cp

0,

-r-

V T e.

(2.29)
(2.30)

Models developed to describe global oceanic and atmospheric fluid motion, on the other hand,
include the horizontal Coriolis terms while making use of the hydrostatic approximation, e.g. White
& Bromley (1995).

2.3

Nearshore current circulation modeling

Moving from the open ocean towards the continental shelf and nearshore region, the action of
free surface oscillations (wind waves or gravity waves) on the fluid motion intensifies.
In order to model the hydrodynamica! circulation in the nearshore zone, keeping track of the
computational costs, one main approach has been developed by I. A. Svendsen and co-workers

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

T H V IM D C -S o resm a
i.s.m. KU Leuven, UG ent, BMM en W LB

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

at the University of Delaware, following ideas on radiation stress introduced by Longuet-Higgins


& Stewart (1962, 1964). This approach considers the nearshore hydrodynamics by evaluating
the dynamics of quasi-3D depth-integrated short wave-averaged equations. This class of models
includes the effect of the vertical variation of the currents for both the current-current and wavecurrent interactions within a depth-integrated model (Svendsen, 2006).
A first step is to split the total instantaneous velocity u a in the horizontal a direction into 4 compo
nents, see e.g. Haas et at. (2003):
Ufy = Ua I ltwa I Vma I Vda

(2.31 )

where u a denote turbulent fluctuations, u wa is the wave orbital velocity, V da represents the depth
varying velocity and Vma the depth mean velocity. The latter is defined by considering the total
volume flux Q a and the wave volume flux Q w a:

= [

Qa

(2.32)

u a dz,
-tin

Qwa

I
j- c t

v ma =

^wadz,

(2.33)
(2.34)

where C is the crest amplitude, t is the wave trough amplitude, h 0 is the still water depth, h = h 0+
and the overbar denotes averaging over a wave period.
Conservation of momentum and mass, integrated over the depth, are now described by

X + da = o
at

d
dx.

dQ a

dt

dx

( Q a Q \

+
de

dxa

d x .k t

(2 35)

o x a_

u.

1 d
P dx

Sa -

I
71, l..
l-h o

(2.36)
P

where S a , T a , r f and r f represent radiation stresses, turbulent stresses, bottom and surface
shear stress, respectively. Also in (2.35) - (2.36), we make use of the Einstein summation con
vention.
To drive the circulation model, the short-wave propagation model should be specified. Wave
propagation models as REF/DIF or SWAN can be used to this end. We refer to Kirby & Dalrymple
(1994) and Booij et al. (1999) for more details, respectively.
A different approach to describe the nearshore hydrodynamics consists of wave-resolving mo
dels. Three groups can be identified which aim to model surface gravity wave hydrodynamics: the
Nonlinear Shallow Water Equations models, see Brocchini & Dodd (2008) for a recent overview,
Boussinesq models, e.g. Chen et al. (2003c) and a notable recent development proposed by Antuono e ta l. (2008) in which a hyperbolic dispersive model is proposed that is able to automatically
detect the breaker positions, without using any heuristic dissipative terms.
Finally, we discuss a recent development described by Warner et at. (2008) and Haas & Warner
(2009). Their approach consists of modifying the system of equations which has been derived to
describe ocean hydrodynamics, accounting for the effects of waves on the currents. In particular,
horizontal and vertical radiation stresses are included, coupling the governing set of equations
with a wave propagation model, see Warner et a!. (2008) for more details.

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

T H V IM D C -S oresm a
i.s.m. KU Leuven, UG ent, BMM en W LB

2.4

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

Numerical modeling

Several methods have been developed to numerically solve the above introduced set of equa
tions. Three distinct approaches are by means of Finite Element Methods (FEM), Finite Differ
ence Method (FDM) and Finite Volume Method (FVM). Each of these approaches has particular
advantages with respect to the other methods, but also disadvantages:
Theres no such thing as a free lunch".

Finite element method (FEM)


Finite element methods offer great flexibility providing an advantage in complex domains. The
flexibility follows from the choice to represent solutions as piecewise polynomials which are formed
by allowing a polynomial representation of the numerical solution over elements that define the
mesh. Therefore both structured and unstructured grids are well defined. Moreover, the method
allows (relatively easy) extensions to dynamically adapt the mesh. Nevertheless, the method is
not very popular as it involves usually an extensive large size matrix calculation at every time
step, limiting the efficiency. Also, the method does not provide an explicit way to check the mass
conservation in individual cells during the computation (Chen et al. , 2007).
State of the art numerical ocean models that use the finite element method are ICOM, (Ford etal.
, 2004, Imperial College Londen), FINEL3D (Labeur & Pietrzak, 2005, TU Delft - Svasek) and
SELFE (Zhang & Baptista, 2008).

Finite volume method (FVM)


The main advantage of finite volume methods follows from discretizing the integral form of the
governing set of equations, instead of the differential form, such that conservation laws are easier
met. Comparably with the FEM, this approach adopts unstructured grids, leading to geometric
flexibility. The integral equations can be solved numerically by flux calculation used in the finite
difference method over arbitrarily sized triangular meshes such that the simple discrete computa
tional efficiency of the finite difference method can be exploited.
State of the art numerical ocean models that use the finite volume method are FVCOM, Chen etal.
(2003a), MITgcm (Marschall e ta l. , 1997, Massachusetts Institute of Technology) and SUNTANS
(Fringer e ta l. , 2006, Stanford University).

Finite difference method (FDM)


The finite difference method is the simplest discrete scheme with the advantage of computational
efficiency. The disadvantage is that this method is not able to resolve highly irregular boundaries,
limiting the use.
State of the art numerical ocean models that use the finite difference method are ROMS, Haidvogel et al. (2008), POM, (Blumberg & Melior, 1987, Princeton Ocean Model) and extensions to
POM like the model presented by Kanarska & Maderich (2003).
As illustrated above, numerical modeling of ocean circulation, at scales ranging from estuaries to
ocean basins, is a mature research field. An abundance of codes, methods and approaches are
known and available for both research and consultancy tasks, the above cited work and the here
after presented overview does not, by any means, aim to analyze all the work done up till now.
Instead, first we will try to provide a sketch of the mainstream concepts of tackling this numerical
problem and secondly we will list several models and summarize their approach. In the latter, we
limit ourselves to the most well known and promising models. In the last part, we address how
the commercial codes DELFT3D, TELEMAC and Mike31 approach the problem.

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

10

T H V IM D C -S oresm a
i.s.m. KU Leuven, UG ent, BMM en W LB

2.4.1

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

Mode splitting

A well-known approach of solving numerically the governing set of equations consists of the splitexplicit - mode splitting approach. This method is mainly used while exploiting the hydrostatic
approximation. However, as described by Kanarska & Maderich (2003), the mode splitting tech
nique has also been used in the context of describing the non-hydrostatic flow field.
The mode splitting approach is motivated by the observation that the governing set of equations
allows for different internal modes which are characterized by distinct timescales. In particular,
surface gravity waves (external waves) propagate much faster than other phenomena like inter
nal waves or jets. As solving the full system of equations immediately, explicitly, would limit (for
stability) the time step too severely, the mode splitting technique suggests to split the governing
equations into subsystems that model the fast (barotropic) and slow (baroclinie) motions sepa
rately. Since the fast motions are approximately independent of the barotropic system is (quasi)
two-dimensional and can be solved by considering the depth-averaged horizontal momentum
equations together with the free surface equation which follows from integrating the divergencefree continuity equation over the vertical, leading to
du

Uytl/
dt(y
dv
d
m + % d
dv

(2.37)

K_s

dx

dy

Gy'

(2.38)
(2.39)

Here, (&,G) is the depth average of all the term s in the full momentum equations. Since, these
equations are less complex, the explicit time-stepping involved, even with a short time-step ( A s
due to the fast propagation of the free surface waves) still provides a reasonable competitive
scheme. Then, the free surface which is found after M time steps (n+1) should somehow be
coupled to the baroclinie equations which advance with a larger time-step (A ; = M A S). At this
point, care should be taken on the procedure.
First of all, simply using n+1 in the baroclinie equations essentially subsamples the high frequency
barotropic motions. Consequently, this would alias high frequency energy onto lower frequencies.
One solution is to average the free surface over the baroclinie timestep, for instance by moving
the barotropic equations forward over 2A and average over this period. This filters out the high
frequencies.
Moreover, integrating now the full equations using the long time step and the time averaged value
of , we would now find two different estimates of the depth-averaged velocities; i.e. one obtained
from the full equations with the long time step and one from the barotropic equations! The particu
lar details on the exact splitting depend from model to model, some of which have been intensively
studied, see e.g. Kamenkovich & Nechaev (2009). An approach to filter out the error associated
with this mode splitting is presented in Haidvogel e ta l. (2008), and applied to the ROM-model.
As mentioned above, this method has been consistently applied to the hydrostatic set of governing
equations. One notable exception is described in Kanarska & Maderich (2003). These authors
suggest to split the pressure in a hydrostatic and a non-hydrostatic part, writing p = p hy + p nhy,
solving first the hydrostatic three-dimensional flow and correcting afterwards the velocity com po
nents with the gradient of the non-hydrostatic pressure. Kanarska & Maderich (2003) obtain the
correction to the hydrostatic flow field by using the continuity equation to derive a poisson equa
tion for the non-hydrostatic pressure component p nhy. The latter approach is called the pressure
method and will be addressed in more detail below, see section 2.5.

2.5

The pressure method

As mentioned earlier, there is no prognostic equation for the pressure. Now, if the aim is to
derive a non-hydrostatic numerical code, with a divergence-free local velocity field, a prognostic
equation for the pressure can be derived which ensures the divergence-free character of the flow

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

11

T H V IM D C -S oresm a
i.s.m. KU Leuven, UG ent, BMM en W LB

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

field. Below, we provide a simple sketch of the method to illustrate the idea. Let us consider, the
three-dimensional momentum equations, for instance written as
du
1 dp
~ZTT H
TT- = G x
cit
po dx
dv
dt

1
+

dp

pa d y

(2.40)
(2.41)

diu
1 dp

-777 H
T T = G~
dt
po dz

(2.42)

dv
1
TT7 H--------V P =
dt
po

(2.43)

or as
G,

Discretizing the time derivative leads to


Vn + 11 +

Vp = v n + A tG

(2.44)

Po

using the continuity equation at time t = (n + 1)A t,


V v n+1 = 0

(2.45)

leads to a three dimensional (elliptic) poisson equation for the pressure p :


V 2p = V v n + A / V G .
Po

(2.46)

Solving this equation ensures that the velocity at time t = n + 1 islocally divergence-free. However,
a numerical solution to (2.44) is quite costly and therefore is the main bottle-neck in resolving the
non-hydrostatic flow field.

2.6

(Sem i-)im plicit method

Instead of splitting the full three-dimensional governing set of equations into a barotropic and
baroclinie part, to circumvent the severe explicit time-step restriction due to surface gravity waves;
a different approach consists of (semi-) implicitly discretizing the primitive equations.
The main problem then, is that, for the present large set of equations, the matrix inversion involved
with the implicit description becomes too large to treat with direct methods. In particular, the
system
Ax = b

(2.47)

needs to be solved, in which x are the unknown variables. Several methods can be used to make
the solution procedure of (2.47) feasible.

2.6.1

Iterative methods

Iterative (Krylov) methods provide competitive approaches to solve (2.47). In the framework of
ocean modeling, the conjugate gradient method is probably the most used. We refer to Shewchuk
(1994), for a thorough introduction to this method. The main drawback of the method, however, is
that the equations need to be discretized such that the matrix can be written positive-definite and
symmetric. Otherwise other iterative methods (GRMS, BiCGstab) need to be used. The concept
of the conjugate gradient method consists of the following. Consider x* as a unique solution of
the system and the vectors u and v such that both are conjugate w.r.t. A ,
ut

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

A v = 0.

(2.48)

12

T H V IM D C -S o resm a
i.s.m. KU Leuven, UG ent, BM M en W LB

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e
inC O H E R E N S

Note the uT A v represents an inner product < uv > A . Now, one should consider first a set of
vectors { p k } which is a sequence of n mutually conjugate directions such that they form a basis
in R n . Hence, we can write
n

x * = ] T Pi

(2.49)

i=l

Therefore, A x * = b = ^"= 1 a P- Now consider

n
Pkb = P kA x * =

a ip ? A p i

(2 -5)

i= 1

a fcp T A p k ,

since

< P i, p k > = 0

(2.51)

leading to
a, = - 5 _ .

(2.52)

< Pk, Pk >

The method therefore finds solutions of A x = b, once the basis { p k } is defined. The latter can
be evaluated most efficiently by means of iterative schemes, the details of which fall beyond the
scope of this note.
The iterative procedure does not always converge (fast) to a solution. A method to increase this
convergence is to precondition the matrix A . Examples of preconditioners are Jacobi precondi
tioner, successive over relaxation, sparse approximate Inverse method and Incomplete LU de
composition. Although the preconditioned conjugent gradient iteration method is often used, and
efficient, it should be noted that the implementation is quite elaborated, and the correct choice of
a preconditioner is not trivial.
The main reference for for the preconditioned conjugated gradient method in ocean modeling is
Casulli (1999). In the following, we summarize this approach.
A first step is to discretize (1) the gradient of the surface elevation in the horizontal momentum
equations, and (2) the horizontal velocity components in the free-surface equation by means
of the 6 (semi-implicit) method, see Casulli & Cattani (1994). Also, wind shear stress, vertical
viscosity and bottom friction are discretized implicitly. Convective and horizontal viscosity terms
are dicretized explicitly by using an Eulerian-Lagrangian scheme, see Casulli & Cheng (1992).
In this step, the implicit contribution of the non-hydrostatic pressure is neglected, leading to a
provisional flow field v and free water surface . The provisional flow field is found by substituting
the discretized horizontal velocity components into the free surface evolution equation, which then
can be determined. Subsequently, the provisional flow field is computed.
In the second step the provisional flow field is corrected by including the non-hydrostatic pressure
terms. Substituting these expressions into the mass-conservation equation leeds to relations
which describes the non-hydrostatic pressure. Casulli (1999) solves this set of elliptic equations
by means of preconditioned conjugate gradient iterations.
2.6.2

ADI

A different implicit approach is to split the discretized equations such that each physical direction
is taken implicitly, subsequent to each other within intermediate steps. The advantage is that at
each intermediate step, a much simpler matrix inversion should be performed.

2.7

Some com m ents on the use of vertical or a vertical coordinates

To follow the often complex bottom topography, several methods can be used. Considering the
s - coordinate as vertical leads to a stair-stepped resolution of the bottom topography which can
invoke large errors. For example, the downslope flow is represented by a sequence of horizontal
motion and vertical mixing, and as such is represented in a very diffusive way. Using shaved
cells" (Adcroft et al. , 1997), this error, however, can be minimized. Traditionally, terrain-following
coordinates have been introduced such as a coordinates. Of course, the use of unstructured grids
also has the benefit of representing complex geometries smoothly. Nevertheless, these models

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

13

T H V IM D C -S oresm a
i.s.m. KU Leuven, UG ent, BMM en W LB

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

also have disadvantages. For instance, using the a coordinates leads to errors in the calculation
of the horizontal pressure gradient, especially where the topography is steep. Fully unstructured
meshes, on the other hand, can resolve topographical changes very well, however, have the
disadvantage, with respect to and a coordinates that the latter are able to store the entire water
column contiguously and therefore are more efficient from memory point of view.

2.8

Open com m unity Models - Commercial Models

In the following, we list the methods and approaches used in the present available (state-ofthe-art) models. Attention is given to the physical approximations, discretization method and
approaches.

A. Open community Models


2.8.1

SUNTANS

Fringer et al. (2006)


This model uses the approach suggested by Casulli (1999) such that pressure is split into a
hydrostatic and a non-hydrostatic part, the non-hydrostatic part being solved subsequent to the
hydrostatic part. The three-dimensional pressure field is solved by means of a block-Jacobi pre
conditioner.
Non-hydrostatic
Finite volume
Unstructured in the horizontal, coordinates in the vertical
Semi-implicit method
Developed to be efficient with parallel computers

2.8.2

POM

Blumberg & Melior (1987) and following


POM is a finite difference model which has been developed at Princeton University and uses
the mode-splitting technique. Versions of the model exist that use
a and the general vertical
coordinate together with the horizontal curvilinear coordinate. The model is mainly hydrostatic,
however, a non-hydrostatic extension has been developed by Kanarska & Maderich (2003).
(Non)hydrostatic
Finite difference, staggered C-grid
z, er and general vertical coordinates, curvilinear horizontal

mode-splitting
the model of Kanarska & Maderich (2003) employs an explicit approach for the barotropic
mode and an implicit approach for the baroclinie mode.
the model of Kanarska & Maderich (2003) employs an Incomplete LU decomposition as
preconditioner to solve the three-dimensional Poisson equation.

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

14

T H V IM D C -S oresm a
i.s.m. KU Leuven, UG ent, BMM en W LB

2.8.3

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

ROMS

Regional Ocean Model - Haidvogel e t al. (2008)


This model uses the mode-splitting technique in a finite difference approximation with an Arakawa
C grid. The model is hydrostatic. Recently, Warner et al. (2008) have extended the model to
account for sediment-transport and Haas & Warner (2009) have included the effect of radiation
stresses on the current when moving nearshore.
Hydrostatic
Finite difference, staggered C-grid
z, er and general vertical coordinates, curvilinear horizontal

mode-splitting
curvilinear grids possible

2.8.4

FINEL3D

Labeur & Pietrzak (2005)


The model developed by Labeur & Pietrzak (2005) solves the non-hydrostatic set of equations with
a finite element method. It is notable since it does not make use of the splitting of the pressure in a
hydrostatic and non-hydrostatic counterpart. Therefore, it appears one of the only models in which
the free surface at a given time step is not updated in the absence of the non-hydrostatic pressure
at that level. However, as pointed out by Fringer et al. (2006), the effect of the non-hydrostatic
pressure on the free-surface at a given time step is the same order of the magnitude of the error
associated with the global second-order temporal accuracy of the overall solution procedure and
therefore negligible.
Non-hydrostatic
Fully unstructured
Implicit
Finite element

2.8.5

MITgcm

Marschall e ta l. (1997) To some extend similar to the method of Casulli (1999) in that the pressure
is split into a hydrostatic and a non-hydrostatic part and free surface part. They then compute the
free surface pressure by (1) using the hydrostatic approximation (2) the pressure method, which
for the free surface pressure is only a two dimensional Poisson problem. The non-hydrostatic
correction is then computed, again using the pressure method, now leading to a three-dimensional
Poisson problem. This is solved by means of preconditioned conjugate-gradient solution methods.
Non-hydrostatic
Structured grid
Finite volume
Preconditioned conjugate gradient iterations

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

15

T H V IM D C -S oresm a
i.s.m. KU Leuven, UG ent, BMM en W LB

2.8.6

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

ICOM

Imperial College - Ford e t al. (2004)


ICOM is a three-dimensional non-hydrostatic parallel ocean model which uses control volume fi
nite element discretisation methods on meshes which may be unstructured in all three dimensions
and which may also adapt to optimally resolve solution dynamics. The model uses the splitting of
the pressure into a hydrostatic and non-hydrostatic part and steps forward implicit in time.
Non-hydrostatic
Unstructured mesh
Mesh adaptivity
Pressure-splitting approach
Implicit
Finite element method
2.8.7

SELFE

Zhang & Baptista (2008)


This model is based on a formal Galerkin finite element framework which treats the advection
in momentum by means of the Eulerian - Lagrangian method. The model uses the hydrostatic
approximation and solves the three-dimensional flow field with a semi-implicit approach.
Flydrostatic
Semi-implicit
Finite element method
2.8.8

FVCOM

Chen e t al. (2003b)


FVCOM is a finite volume model that solves the hydrostatic governing equations on an unstruc
tured grid. The mode-splitting technique is employed and the equations are written in the terrainfollowing a- coordinates. The external mode is solved with an explicit Runga-Kutta time stepping
scheme and the internal (baroclinie) mode is evaluated by means of a coupled explicit-implicit
scheme.
Flydrostatic
mode-splitting
Finite volume method
a coordinates

B. Commercial Models
2.8.9

Delft3D

Delft3D is a finite difference model that solves the hydrostatic equations, but has also the option
to resolve the non-hydrostatic flow field. The model introduces curvilinear (Arakawa C-) grid in the
horizontal and uses a or Z coordinates. The equations are solved implicitly with a ADI scheme.
Implicit, ADI - scheme
(Non)hydrostatic

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

16

T H V IM D C -S oresm a
i.s.m. KU Leuven, UG ent, BMM en W LB

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

Finite difference
Arakawa C-grid
Both a and Z coordinates possible
2.8.10

TELEMAC

TELEMAC1 is based on finite element method with an unstructured grid of triangular meshes. The
model solves the non-hydrostatic flow field implicit (by means of a semi-implicit scheme). Several
options for solving the resulting discretized equations, such as the conjugate gradient method,
square conjugate method and the generalized minimum residual method are possible.
Implicit
Several iterative solvers possible
(Non)hydrostatic
Finite element
2.8.11

MIKE3

The MIKE3D model resolves the (non-) hydrostatic flow field by means of an implicit scheme
on a staggered Arakawa C-grid. The model uses the ADI technique for the momentum equa
tions, however, also makes use of the Artificial Compressibility Method. This method consists of
adding a time-derivative of pressure to the continuity equation with the goal of transforming the
incompressible NS-equations into a hyperbolic system and then apply schemes suitable for com
pressible flows. This method introduces a parameter /3 that relates to the speed of sound. Mainly
the method appears to be beneficial for steady state solutions. We refer to Flousman et al. (2004)
for more details.
Implicit
Artificial Compressibility Method using the ADI approach
Non- hydrostatic
Finite difference

1TELEM AC is partly open source

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

17

T H V IM D C -S o resm a
i.s.m. KU Leuven, UG ent, BMM en W LB

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

18

T H V IM D C -S oresm a
i.s.m. KU Leuven, UG ent, BMM en W LB

Chapter 3
An overview of the numerical schemes in Coherens V2

3.1

Introduction

In this chapter an overview is given of the numerical schemes that are currently implemented
in COHERENS . The aim of this overview is by no means to go provide an exhaustive and de
tailed description. Instead, its main purpose is to form a guide in the selection of the implicit
code to be implemented in COHERENS . Thus we will give some indication of the implication of
these schemes for the implementation of the implicit code. A complete overview of the numerical
schemes in COHERENS can be found in the Coherens V2 manual. COHERENS is very flexible
and generic. Thus multiple schemes and multiple different options can be set by the user, each
of them having a different implementation. We will not discuss all these options, but limit ourself
to the main points.
The numerical schemes are used to solve the 2D and 3D hydrodynamic equations and 3D scalar
advection equations. As equation of motion in 2D, the shallow water equations are used, assum
ing implicitly the hydrostatic pressure assumption. In 3D, the hydrostatic pressure assumption
is also used, leading to two equations for the horizontal velocity components, and a separate
equation (derived from the continuity equation) for the vertical velocity. Mode splitting is used
to allow a different time step to be used in 2D and 3D (hydrodynamics, scalar advection and
turbulence equations) calculations. The equations are transformed horizontally using orthogonal
curvilinear coordinates and vertically using s-coordinates (which are basically spatially varying acoordinates). The indexes of the computational grid are shown in figure 3.1 (see the COHERENS
manual par. 6.2 for more details).
The 2D hydrodynamic flow field is described by respectively the continuity and momentum equa
tions in the 1 and 2 direction:

dt

dU

(3.1)

hiho
V

A h i( U ) + Ah2(U)
gH d(

TTZ

h \ di^i

H h th i

H dPa
-,---------------

p a h i 9m

r
TT,
1 ,
F 1 + H F 1 - I -------------( r
pa

s l

T fc l )

+ Tdmhl{Tll) + Tdmh2(Tl2) ~ SAhl + SDfrl


dV

A h l (V ) + A h2( V )
gHdC
r

(3.2)

- !i u ] + m u m a i

H h ih o
dPa

"o/"------------- T ~ ? ----- r ^ 2

'

2---I------- V s2 Tb2 )

P m h l { P ) + P m h 2 {P ) ~ 5 A ha + S D h2

(3.3)

Here, A is the advection operator, V is the diffusion operator,M and I D are correction terms
for the fact that the depth averaged advection and diffusion terms are not equal to the advection

T H V IM D C -S oresm a
i.s.m. KU Leuven, UG ent, BMM en W LB

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

Vertical

Horizontal
U V ( + 1 )

V ( + 1 )

sea s u rfa c e

U V ( i+ lj+ l)
s

----------------------------------------------------------------

nz+1

C -----------------------------------------------------

nz

W -------------------------------------------------------------

U ( i+ lj)

Cftj)

c
w
c
w
c
w

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

-------------------------------------------------------------

-------------------------------------------------- 2

c ------------------------------------- 1
W ------------------------------------------------------------U V ( r ilj)

V ( ij)

seabed

Figure 3.1: Schematic overview o f the indexing o f the com putational grid. Left: horizontal; Right: vertical.

and diffusion of the depth averaged velocity (see Coherens V2 manual, eq. 5.80 to 5.83). The
variable P a is the atmospheric pressure, F b the force due to baroclinie pressure gradient and F *
the tidal force. The angular velocity of the earths rotation is denoted by 0 . Further FL is the water
depth, U and V the depth-integrated velocities in ^ and 2 direction. The shear stress at the free
surface and at the bed are represented by rs and n respectively. Finally, h i,ho and h3 are metric
coefficients related to the grid spacing. The equations (in transformed coordinates) for the 3D
mode are (for respectively continuity, momentum in i direction and momentum in io direction):
1 dh3
/?3 dt

1 8 d

him('w ,)

1
hihoh-i

A h i(u )

d
t; i

( h i h 3v )

1 dio
/?3 d s

(3.4)

dho \

- A u ( u )

hi h2

h i di i

dhi

Ah^i'u)

dP
polii d i i

d
Ot;2

(hoh3u ) +

-F t

F ?

v ( ll)

P m h l ( T l l )

P m h 2 { T l o )

(3.5)
1 d
1 777
fi3 o t

{h' 3 'V) + A h l { v ) + A ho { v ) + A v (v) +

g d
ho d ^ o

dPa

pu h o d i o

F o

F ^

dho
i

v { v )

dhi \
) + 2 i' wsm<?>

u~
t

P m h l { T o i )

nih2

(^ "2 2 )
(3.6)

Flere C is the free surface elevation and u, v and cu represent the velocities in

3.2

^2 and s direction.

Description mode splitting

In COHERENS both the two-dimensional and three-dimensional hydrodynamic equations are


solved, although the latter are optional. These two equations use a different time step, where
the 3D time step is a multiple of the 2D time step. The reason for this is that the maximum time
step that can be used is strongly limited by the explicit scheme used in COHERENS for the free
surface elevation. However, the internal flow (i.e. the flow profiles) change much slower in time
than the shallow water surface waves1. Therefore, less time steps are needed for the 3D calcula
tion than for the 2D calculation. In 2D and 3D, the criteria for the maximum time step that can be
used in COHERENS are respectively (with A X the grid size):
1Short waves such as wind generated waves are not considered in COHERENS .

I/RA/11339/10.072/GVH
Version 1.0 31/01/2011

20

T H V IM D C -S oresm a
i.s.m. KU Leuven, UG ent, BMM en W LB

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

(3.7)
(3.8)
This leads to the following criterion for the maximum mode splitting that can be used:
\U

2v P

(3.9)

Hence the deeper the flow (lower value of \u\/2^fgH), the more gain can be obtained from modesplitting. Thus mode splitting is a very effective method in oceanography, but will not lead to a
high efficiency in rivers and estuaries. The time step of baroclinie (3D) mode is also determined
by the wave speed of the internal waves:
A T sjj <
=
2-\/Ap/pgH

(3.10)

This leads to the following criterion for the amount of mode splitting that can be used:
(3.11)
Since the relative density difference (A p/p) is usually very small, this criterion is normally not
important in practical situations.
Mode splitting such as implemented in COHERENS has two different objectives:
To separate internal (baroclinie) and external (barotropic) motion. Therefore, the 3D equa
tions are decoupled from the 2D equations such that they can be solved separately. In
particular, this means that the 3D momentum equations are decoupled from the equation
for the free surface. In this way, the calculated water levels in a 2D time step are used as
input for a 3D time step. This function is also important when the 2D and 3D time step are
the same.
To decrease calculation time. This is done by using a larger time step for the baroclinie
motion (which is much more computationally expensive to calculate than the baroclinie time
step) than for the barotropic motion. Because of the different time steps that are used,
correction terms need to be added to the 2-D and 3-D equations.
A very brief overview of the order in which the different partial differential equations are solved in
a COHERENS calculation are given below. A more complete overview can be found in par. 6.6 of
the COHERENS manual.

1. Predictor time step (3D). At this time step, the following tasks are performed:
(a) The equations for the 3-D turbulence equations are solved.
(b) The equations for the 3-D current predictors are solved giving vP and vp.
2. Barotropic time step (2D). At this time step, the following tasks are performed:
(a) The 2D continuity equation is solved in order to obtain the new water depth H.
(b) The 2D momentum equations are solved to yield the depth integrated currents U and
V.

3. Corrector step (3D). At this step, the following tasks are performed:
(a) The 3D lateral open boundary conditions are applied.
(b) The 3D currents u and v are calculated from the current predictor while enforcing that
the discharges are equal to the depth-integrated currents U and V.

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

21

T H V IM D C -S oresm a
i.s.m. KU Leuven, UG ent, BMM en W LB

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

(c) The vertical currents are calculated from the continuity equation.
(d) Scalar advection (for temperature and salinity) is calculated.
These two different functions of the mode splitting must be taken into account when determining
how the COHERENS code will be converted to an implicit code. There are a few possibilities. It
is possible to limit the implicit code to the 2D mode. This will lead to a large speed-up for the 2D
mode, but no speed up for the 3D mode. This will be advantageous for 2D calculations, but for the
3D calculation the gain in calculation time will be rather limited, because even using mode splitting
the 3D mode has been observed (e.g. in test case Bohai) to be responsible for the majority of the
calculation time. Further, the gain will be even less in shallow areas, where u /^ /g H is rather large
and the CFL criterion for the discretization of the advection quickly becomes dominant. Hence,
it seems at least necessary to make both modes (2D and 3D) implicit. It can be considered
to eliminate the mode splitting completely. In that case, the 2D mode and 3D mode become
separate routines for doing either 2D or 3D equations. The consequences for the 2D calculation
will be rather limited. However, the routines for the 3D equations need to be changed such that the
continuity equation can be solved simultaneously with the 3D momentum equations (for u and v).
This might give a considerable effort, but can lead to an additional increase in calculation speed,
because the 2D equations do not need to be solved anymore in a 3D calculation.

3.3

Description of 2D hydrodynam ics schem es

Here a brief description of the numerical methods for the 2D hydrodynamic equations is given.
A complete overview can be found in the COHERENS manual (par. 6.3.1.2 and 6.3.2.3)). The
two-dimensional hydrodynamic equations are solved at every two dimensional time step. A first
order explicit Euler scheme is used for the time integration. This leads to the following equation
(from the continuity equation 3.1) for the water level elevations (at grid cell i j see figure 3.1):
/m+1

/m

^ AT9z/

( ^ i - U r ) - v O'T+i - V f )

(3.12)

Here i and j are the index (in x and y direction respectively). Note that in order to simplify the
notation as much as possible, we have applied the following simplifications: subscripts in the
direction where no changes take place are omitted (like the j in the x-gradient term) and terms
involving the size of the grid are dumped in a factor a . A detailed overview of the schemes (where
all terms depending on the grid are given exactly) can be found in the COHERENS V2 manual.
After the continuity equation is solved, the momentum equations are evaluated. Thus the continu
ity and momentum equations are decoupled in the numerical scheme that is used in COHERENS
. The momentum equations (using the depth integrated currents U and V) are also integrated with
a first order explicit Euler scheme (only the discretization for the U equation is given, the equation
for V is very similar):
1

JJ771

A T2 D
A d v e c tio n

kn/

D iffu s io n

Tj-m + 1 _ u n / m

fV m
C o rio lis ; e x p lic it d is c re tiz a tio n

B o tto m fric tio n ; q u a s i im p lic it d is c re tiz a tio n

'''m

F l
b a ro c lin ie p re s s u re g ra d ie n t

+ a gradCm+1 +

tid a l fo rc e

s u rfa c e s tre s s

gradPQ
m+1

N/

V"

w a te r level g ra d ie n t

A tm o s p h e ric p re s s u re g ra d ie n t.

- A n + Dn

(3.13)

'---------- V ---------- '

C o rre c tio n te rm s ; fro m 3 D tlm e s te p

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

22

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

Note that in these equations, data from three different time steps are used: m (explicit te rm s ),m + l
(implicit corrections) and n (3D corrections resulting from mode-splitting using explicit information
from the 2D time step). The implicit corrections (at m + 1) are used to increase the stability
for the bed shear stress. The three-dimensional correction terms in the 2-D mode are coming
from the baroclinie pressure term (i.e. the pressure gradient generated by density differences)
and difference in the 2-D and 3-D horizontal advection (thus between dsdu2/d, and <92/<9)
and diffusion terms (thus between dsvH {s)du/d and i/nd/d). The implementation of the
baroclinie pressure gradient is discussed in paragraph 6.3.12 of the COHERENS manual. Note
that the diffusion term is only non-zero if the horizontal eddy viscosity varies over the depth,
which can only happen if the Smagorinsky turbulence model is used. The advection correction
term will be small if the velocity profile is relatively close to the depth averaged velocity (such
as when a logarithmic velocity profile is encountered), but might be large in case stratified flow
exist, where the flow direction changes in different parts of the water column. More details on
these terms can be found in par 6.3.5 and 6.3.9 of the COHERENS manual. With respect to
changing the code to an implicit code, this dependence on two different time steps seems to be
a unwanted complication. The most important complication is related to the baroclinie (density
induced) pressure gradient. In order to make this term implicit, the density at time step m + 1
has to be known. This can only be done by solving the scalar advection equation for salinity and
temperature simultaneously with the 2D momentum equations, rather than consecutively as it is
currently implemented. This is a significant drawback. However, it may not be needed to make
this term implicit. It has already been shown that internal waves move rather slowly. Thus the CFL
stability criterion for these waves is rather low and thus an explicit discretization may be sufficient.
Because the calculation of the water levels is decoupled, the water level gradient in the calculation
is included at time step m + 1. In case of an implicit code, it is not possible anymore to decouple
these equations, and the momentum equations becomes coupled through the water level gradient
term. In that case the continuity equation becomes coupled to the momentum equations, they
also become coupled to each other. Presently, the coupling is through the Coriolis term, but
this is circumvented, because an implicit correction is used for this term rather than a completely
implicit discretization (as explained later on). This means that the three equations of the 2D
mode (continuity, x momentum and y momentum) need to be solved simultaneously, rather than
consecutively.
The atmospheric pressure is already known beforehand, thus the atmospheric pressure gradient,
can be applied at the new time step. The gradients (which are needed at U and V points) are
obtained easily from the water level and atmospheric pressure values, which are defined at Cpoints.
With respect to the bottom friction, the precise discretization depends strongly of the options that
are used. In this discretization, k is a coefficient. When quadratic bottom friction is used, this
coefficient depends on the velocity. Two options are available. The same bottom friction as in the
3D mode can be used. In this situation, k depends on the 3D velocity field at 3D time step n.
In case the 2D option is used, k depends on the 2D velocity at the 2D time step n. Note that in
case the 2D option is used, the bottom friction does not depend on up - -jp), but rather the depth
integrated velocities velocities U m and V m are used.
The Coriolis term is only included in an explicit way in equation 5.2. In order to increase the
stability, an implicit correction is applied to the Coriolis force after the momentum calculation is
calculated (COHERENS manual paragraph 6.3.1.2 ). The corrected velocities u n+1'c and v n+1'c
are given by:

U m+1 = fOAT2D {V'


f9AT2D {ir

(3.14)

(3.15)

This correction bears a great similarity with the semi-implicit scheme (it would have been semiimplicit if v m+1c were used instead of V m+1), but has the advantage that the equations are
explicit, and thus they can be calculated rapidly.
The advection operator A is discretized using either an upwind, Lax-Wendroff or TVD scheme
for horizontal advection and upwind, central or TVD scheme for vertical advection (see the CO-

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

23

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

HERENS manual 6.3.4 for the precise discretization). It also includes a correction term for the
curvilinear grid. The upwind discretization is 1st order in space, the Lax-Wendroff and central
schemes 2nd order. In this discretizations, the TVD scheme is a non-linear combination of up
wind and either central or Lax-Wendroff schemes, using an upwind scheme for steep gradients
(in order to prevent wiggles) and the more accurate central or Lax-Wendroff schemes elsewhere.
The used discretization has a stencil that occupies three adjacent points in space in case of the
central scheme. As an example, for advection in the x direction, the stencil uses the velocities at
i - i, i and i + 1. More details on the advection terms (specifically the vertical ones) are given in
paragraph 3.7.2. The diffusion terms (see par 6.3.8 of the COHERENS manual) are discretized
using a central scheme, which are a linear combination of the concentrations at locations (for
diffusion in the x direction) i - I, i and i + 1.
It seems that the used spatial discretizations for the advection and diffusion terms can be used
also in an implicit code. However, the advection terms have to be linearized, in such a way that
the new stencil is linear in the velocity at the new time step m,+ 1 in order to obtain a linear system
of equations.
Here we focus on the integration of the equations without using operator splitting (see par 3.7.1).
This operator splitting is applied when the TVD scheme is used for integration of the advection
terms. If the upwind (the default scheme) or the Lax-Wendroff scheme is used for the advection
terms, no operator splitting is used. The operator splitting (also called fractional step method) is
discussed in paragraph 3.7.1.

3.3.1

Drying and flooding

Drying and flooding is presently implemented in COHERENS using the method of Burchard et al.
(2004). In this method, drying areas are represented by a layer of water with a small depth dmin
(by default 2 cm). In this small layer, the source terms masked out using a parameter a , which
decreases linearly from 1 to 0 between a critical depth dcrit and dmin. The only terms that are not
masked out using a are the water level gradient and bottom shear stress. Thus in a dry area,
there is an equilibrium between bottom shear stress and water level gradient. Because the drag
coefficient (in the bottom friction term) in such small water depths become very high, the velocity
will be very low (approximately 0) in dry areas. There is also a land mask implemented, which
works as an absolute mask. Any cell that is zero in this mask will be always dry, and therefore
it will not take place in the hydrodynamic and sediment calculations. It seems that this method
for drying and flooding does not present strong limitations, when the code is made implicit, this
should be investigated any further. Note that currently, alternative drying and flooding schemes
are being implemented, which may have a stronger dependence with the implicit code.

3.4

Description of 3D hydrodynam ics schem es

3.4.1

Predictor step

During the predictor step, the three-dimensional momentum equations are solved for the hori
zontal currents u and v. This is done using a first order Euler time integration scheme (see
COHERENS manual par 6.3.1.1 for more details). However, the method that is used depends
on various options. Here, the complete integration method is discussed, which is used when the
upwind or Lax-Wendroff scheme are used for the advection terms. In case the TVD scheme is
used, a fractional step method is used for the integration of the momentum equations. This is
discussed in paragraph 3.7.1.

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

24

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

A T-3 D

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

M in

H o riz o n ta l a d v e c tio n

h {v n

H o riz o n ta l d iffu s io n

- 0 D v ( i , n + 1 ) + (1 - 0 ) A v ( u n ) + 0 D v ( u n + 1 ) + (1 - 0 ) A v ( i
V e rtic a l a d v e c tio n ; s e m i-im p lic it

-agrad C "

w a te r level g ra d ie n t

V e rtic a l d iffu s io n ; s e m i-im p lic it

Tgrad"
a tm o s p h e ric p re s s u re g ra d ie n t

F1
B a ro c lin ie p re s s u re g ra d ie n t

F [ l+1
T id a l fo rc e

fv ^

(3.16)

C o rio lis ; e x p lic it p a rt

From this equation it can be seen, that only terms at time steps n and n + 1 (thus only 3D time
steps) are used. Thus there is no coupling with the 2D mode, except that the calculated water
levels from the 2D calculation are used. The meaning of the terms is similar as in the 2D equation.
The same discretizations are used for the horizontal advection terms (upwind, Lax-Wendroff or
TVD scheme; including an extra term for the curvilinear grid; see paragraph 6.3.3 and 6.3.6 in the
COFIERENS manual) and the horizontal diffusion (central differences; see par 6.3.7 and 6.3.10
in the COHERENS manual). After the calculation of the velocities, an implicit correction for the
Coriolis terms is applied:
U n + l,c _ u n + l =

f O S T 3 D (l>"+ 1 - V n )

(3.17)

The vertical terms (advection and diffusion) are discretized using a semi-implicit scheme for larger
stability. Note that for vertical advection the default is 6 = 0.501 and for vertical diffusion the default
is 0 = 1. The semi-implicit terms in the vertical direction are solved using a tridiagonal matrix
solver that is using the Thomas algorithm.
The terms that were needed in the 2D equations to correct for 3D effects are (of course) not
included in the 3D equations. The shear stresses at the free surface and the bed are now applied
as boundary conditions, rather than source terms. For the bed shear stress (that is used as a Von
Neumann boundary condition), a semi-implicit discretization is used:
n = kn (dun+1 + {1 - 0)un)

(3.18)

Here kn is a friction coefficient, which for quadratic friction depends on the velocities at time step
n. There is also an option in COHERENS to use the bed shear stresses calculated from the 2D
mode. In this case, an explicit discretization is used (using the velocity U m).
As for the 2D mode, the largest problems in converting the code from explicit to implicit are related
to the coupling to other equations, viz. the baroclinie pressure gradient (which is coupled to
the scalar advection equations of temperature and salinity). However, as was discussed for the
2D mode, it might be sufficient to keep this term explicit, since it does not provide a very large
restriction on the time step. The coupling with the 2D mode comes through the water levels and
the water levelelevation gradient, which are calculated in the 2D mode (see paragraph 3.2). In
the corrector step, the velocity fields calculated in the 3D mode are adapted in order to agree with
the continuity equation from the 2D mode.
3.4.2

Corrector step

One 2D time step after the 3D current is calculated, a correction step is applied (see paragraph
6.3.1.3 and 6.3.1.4 of the COHERENS manual). In this time step, the 3D currents are corrected,
such that the mass balance of the 3D flow field agrees with the one from the 2D flow field. Fur
thermore, the 3D open boundary conditions are applied, the vertical velocity is calculated from
the continuity equation and filtered velocities (Deleersnijder, 1993) are calculated for application
in the scalar advection equation.
In the correction step the velocities at the open boundaries are replaced by those calculated
from the boundary condition. They then serve in the advection and diffusion terms of the 3D

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

25

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

momentum equations at the next time step. When the code is made implicit, the 3D boundary
conditions cannot be decoupled anymore from the solution of the momentum equations. For
the two most used boundary conditions (a specified profile, or zero gradient condition), it does
not seem to be a large problem to integrate these in an implicit solution scheme. Flowever, for
radiation boundary conditions, this might be somewhat more difficult.
Then the mass balance is corrected. Flere, the 3D velocities are changed, such that the depth
integrated current calculated from the 3D velocity field is equal to the depth-integrated velocities
in the 2D mode. This is done by adding the difference between the two velocity fields to the 3D
velocity field:

= g , " F + ( c ' ,; : T E ^

(3.19)

The filtered current (necessary for the calculation of scalar advection) is calculated by adding the
difference between the time average (between two 3D time steps) of the 2D current and the depth
average of the 3D current to the 3D velocity field (here M is the number of 2D time steps per 3D
time step):
Un+ 1 =

+ (

^ m -

(3 20)

yyn+1

'

'

'

Note that this is only necessary if the 2D and 3D time step are different. In case mode splitting is
removed, the calculation of the filtered currents are not necessary anymore.
Finally the transformed vertical velocity is calculated from the continuity equation. The continuity
equations does not contain any time derivatives, thus the integration is only performed in the
vertical direction. This leads to:
u^+^O

(3.21)

and
k 1

, n + l

,n - \- 1

w k+1 = w k

Nk

J2
f+J2f>
=i
fc+i

(3 -2 2 )

With:
h n+1

7711+1

F i = a x grad( J < +1)a y grady(<fr>+1) +

g ra d ,-^ - +

I+ n +

h n+1

g ra d ^ -^ -

(3.23)

Here Su denotes the baroclinie velocity component, (thus the difference between the 3D velocity
and the depth average of the 3D velocity) and a are geometric terms, depending on the grid
spacing. The physical velocity is calculated from the transformed velocity field (using an explicit
expression).

3.5

Description of scalar advection-diffusion

The numerical solution of the scalar advection-diffusion equation is described below. More details
can be found in the COHERENS manual paragraph 6.4. It is to be noted, that the same CFL
criterion must be fulfilled for scalar-advection as for advection of momentum. Hence, the stability
criterion is:
A Tscaiar < ---u

(3.24)

Since this will lead to rather small time steps, in seems necessary to solve the scalar advectiondiffusion equation implicitly. Otherwise, an increase in the computational time step can only be
obtained for hydrodynamic calculations, and any calculation using scalar advection (either salinity,
temperature or the future suspended sediment transport module) will obtain no benefit from the
presence of the implicit code. These equations are currently used for the advection-diffusion of
temperature and salinity on the one hand and turbulence quantities (such as k and e) on the other

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

26

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

hand. Later on, it will also be used for suspended sediment transport and biological quantities. In
the present paragraph, the advection diffusion module such as used for the advection of salinity
and temperature are discussed. The implementation used for the transport of turbulent quantities
is discussed in the next paragraph.
The scalar advection-diffusion equation is very similar to the momentum equation. However, the
scalars are defined at the C nodes, rather than the U and V nodes, thus less interpolation needs
to be used. The same schemes are used for advection (upwind, Lax-Wendroff or a combination
(TVD) horizontally; upwind or central scheme or a combination (TVD) vertically) and diffusion
(central scheme) are used for the momentum equation (see par 6.4.4 of the COHERENS manual).
It is solved using a semi-implicit scheme for the vertical terms and a first order Euler scheme for
the horizontal terms. Source and sink terms are included in a explicit way. Extra terms, called the
corrector terms are added. These correct the advection-diffusion equations for the changes in the
cell sizes due to the motion of the free surface:

/?3 dt

dt

(3.25)

/?3 dt

In this equation, the continuity equation is substituted (in the second term on the right hand side),
in order to get terms that are separated in the three directions (a term for x, y and z). In this way,
the corrector term in x direction becomes (and similar for the two other directions; see par 6.4.2
of the COHERENS manual for details):
(hohs'Uf)

(3.26)

This is discretized (using the filtered velocities; see paragraph 3.4.2) as:
^ '.i !"v )

1 Tw i !!f./

(3.27)

1c !!f. / )

Here a are geometric factors which depends on the grid spacing.


Numerically, the corrector terms are extra source/sink terms, discretized using the explicit Euler
scheme. For an explicit Euler scheme, the stability criterion for a source term is given by:
(3.28)
for an equation of the form:
(3.29)
If this stability criterion applied to the corrector terms, the constant k is equal to the velocity gra
dient. The velocity gradients are normally quite small, thus it might not be necessary to discretize
them implicitly. It does not seem very complicated to discretize them implicitly in the direct integra
tion method. However, this changes when the fractional step method is applied. In this case, they
are always evaluated using
rather than the local time step in the fractional step (see paragraph
3.7.1). This is done in order to fulfill the continuity equation exactly.
The reasoning above leads to the following discretization for the scalar advection-diffusion equa
tion (when no fractional step method is used):

V>n+1 - ipn
-

A h( r ) + D h( r )

'---------------- V---------------- '

H o riz o n ta l a d v e c tio n a n d d iffu s io n .

dAv( r +1) -

(i -

o)Av( r ) + oDv( r +1) +

o)Dv( r )

S e m i im p lic it v e rtic a l te rm s .

C(r)
C o rre c to r te rm s , e x p lic it

S '(T n )

(3.30)

S o u rc e te rm , e x p lic it

The advection and diffusion terms are discretized similar as in the momentum equations. For
advection, the upwind, Lax-Wendroff (replaced by a central scheme for vertical advection) or TVD

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

27

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

scheme can be used. A central difference scheme is used for the diffusion terms (see par 6.4.6.
of the COHERENS manual). Both these schemes lead to numerical stencils for the operators A h
and D h that extend over three cells, from i - 1 to i + 1.
It seems that the source term, that is discretized explicitly, might lead to a restriction on the used
time step, but this depends very much on the specific use of the advection-diffusion module. In
the present salinity module the source term is zero. In the temperature module, it depends on the
solar radiation. There might also be influences for the sediment transport module, where these
sources can be non-zero.

3.6

Turbulence models

Various turbulence models are implemented in COHERENS (see par 5.3 of the COHERENS
manual). These include algebraic turbulence models (such as Pacanowski-Philander or MunkAnderson), in which the eddy viscosity and eddy diffusivity are calculated directly from the cal
culated velocity and density fields using an algebraic equation. Further, one and two-equation
models are implemented (such as the k-e and k-l model). In these models, the eddy viscosity and
eddy diffusivity are calculated from turbulence quantities (such as k and I), which on its term are
calculated using a scalar advection diffusion equation.
The numerical method used for the advection diffusion of turbulence quantities is similar to the one
used for the scalar advection diffusion module described in the previous paragraph (see par 6.5
of the COHERENS manual for a detailed description of the numerical solution of the turbulence
equations). However, it differs from those in the following aspects:
All turbulence quantities are defined at W-nodes, rather than C-nodes. Thus the equations
and schemes are shifted half a grid cell in the vertical.
The turbulence equations are solved at the predictor time-step (before the hydrodynamic
equations are solved), other scalar equations are solved at the corrector time step. In this
way, the eddy viscosity is calculated just before the 3D momentum equations are solved.
The source terms S are discretized quasi-implicitly using Patankars (1980) method:

S '(V ,n +

1) = ^ T ^ S ' ( V n ) . This method has the advantage that it guaranties that the turbulence
quantities cannot become negative. However, the disadvantage is that this method is not
exactly conservative (thus an extra dissipation of turbulence quantities can occur).
Only a zero gradient boundary condition can be used as an open boundary condition for
turbulence quantities.
Note that advection and horizontal diffusion terms are switched off by default in the advection
diffusion equations for the turbulence quantities (such as k). In that situation, the turbulence
model reduces to a 1DV point model at each grid point in the model. Such an 1DV model poses
less severe restriction on the used time step, since CFL criterion for horizontal advection does not
apply anymore. The vertical terms are discretized using a semi-implicit scheme and thus do not
lead to restrictions on the time step.

3.7

Details of the implementation

3.7.1

Operator splitting

If the TVD schemes are used for advection, operator splitting is used in the solution of the momen
tum equations. This is used for the two-dimensional momentum equations, the three-dimensional
momentum equations and the scalar advection-diffusion equation (see for more details paragraph
6.3.2.2, 6.3.2.3 and 6.4.3.3 of the COHERENS manual).
When operator splitting is used, the equations are split in three different equations for the three
different spatial directions (x, y and z). All source term s are added to the equation in the
direction. For the two-dimensional equation, no z-terms are included, but the source terms are
solved at the fractional time step when in the 3D calculations the z equation is solved. Then the

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

28

T H V IM D C -S o resm a
i.s .m. KU Leuven, UG ent, BMM en W LB

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

three equations are solved first in x, then in y and finally in z direction. This is followed by a second
calculation where first the z direction is used, then the y direction and finally the x direction. The
final value for a quantity is obtained by taking the average of the first and the second sweep.
Thus in the case of scalar advection, which we will use as an example, the solved equations are
respectively:

^n+l/3 _

m r ) + Dx( r ) + c u r )

A TiD

(3 .31 )

^lyi+2/3 0n+-1-/3

(3 .32)

= - A y( r +1/S) + D y( r + 1/S) + c m

A T3D

r +1-0n+ 2/ 3 =
AT-:3D

- d A z( r + 1) + o D m 1)

- (i - e)Azm

V3) + (i- e)Dzm

V3) + c m

+sru

(3 .33 )

Followed by:

In + 1/3 _

in

\rp

A-L3D

= - e A zm
-

ffpn-\-2/3

(i -

1/3) + e D z m

e ) A m

1/3)

+ (i - e ) D m

+ c

+ s r u

( 3 . 34 )

^n+1/3

A-L3D

= - A ym

i/3 ) + D ym

i/3 ) + c y( r )

r +l
r +~/3 = _ A x { r + 2/3) + D x { r + V 3) + c u r
A-L3D

0 .35)
(3.36)

Flere, A, D , C and S are respectively the advection, diffusion, corrector and source terms (see
paragraph 3.5). Note the use of the semi-implicit scheme for the vertical direction. Also note that
the corrector terms are all determined by the value of at the original time step n rather than that
they are updated.
The presence of operator splitting is important, because ADI based implicit schemes use this kind
of fractional step approach. This means that the algorithm used here can be extended to such
approaches using the code for the TVD schemes as a building block.

3.7.2

Semi-implicit vertical time integration

In the three dimensional mode, the vertical advection and diffusion terms in the horizontal mo
mentum and scalar equation are solved using a semi-implicit scheme. This is done, because an
explicit scheme would require a very small time step (due to the very small vertical grid spacing).
The semi-implicit scheme (here given as an example for vertical scalar advection-diffusion) has
the following form (see the detailed explanation for scalar advection in paragraph 6.4.3 and 6.4.8
of the COHERENS manual)):
l!)n+ 1 i/;71

Arr

A-L3D

= - Q A u r +1) + oDz( r +1) - (i- o ) A u r ) + a - o ) D u r )

(3.37)

The accuracy of this schematization is of second order if 0 = 0.5. It is completely implicit if 0 = 1.


The default options are to use 0 = 0.501 for advection and 0 = 0.501 for diffusion. The advection
term in its most general form is the TVD scheme, which is a combination of an upwind and a
central scheme. The purpose of a TVD scheme is to use the more accurate central scheme when
the solution is smooth and the upwind scheme (which is always positive and thus prevents the
occurrence of wiggles) when the gradients are large. To that end, a weighting factor il is used,
which is a nonlinear function of the gradients of the fluxes (r). Note that it is also possible to use
the upwind or central scheme, which corresponds to respectively il = 0 and il = 1. This leads to:

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

29

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

(1

a m

Vt(v k ) ) F Up k T D ( r k ) F c e )

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

(1

Q>(rk ) )Fwp:k i T L ( r k ) F c e i )

1)

(3.38)

Fup,k = 0.5wfc ((a - s(ivk))'tpk_ 1 + (f3 - s(iuk))ipk)

(3.39)

Fce,k = 0.5wfc ( m /T - i + ipk)

(3.40)
(3.41)

Here, h3k is the vertical size of cell k\ a and parameters related to the geometry of the grid, and
s is the sign function, yielding 1 if w k > 0 and - 1 otherwise. Further F up and F ce are the advection
fluxes at the edge a grid cell using an upwind or a central discretization. Note that the vertical
velocity used here is the transformed velocity in s coordinates and not the physical velocity. Finally
note that the same scheme is used for the horizontal advection, but that a Lax-Wendroff scheme
is used there, rather than a central scheme.
It is important that in this discretization, the concentration at location k depends on those at
locations k - 1, k , and k + 1. This leads in the numerical implementation to a tridiagonal matrix,
which can be solved efficiently (see paragraph 3.9). This scheme depends non-linearly on ip if the
TVD scheme is used (thus if Q = f ( r k )). Therefore, the time influence has been linearized in this
equation (thus preventing the need to solve a nonlinear system of equations), by using a value of
f i ( r ) , which depend on the flux at time step n for the calculation of the flux at time step n + 1 as
well at time step n. In this equation for both A z(4>n ) and A z(ipn+1), the fluxes (F up and F ce) are
calculated using the velocity w n+1 that has already been calculated before.
For the diffusion terms, the fluxes in the discretizations are linear functions of the ip, and thus they
can be directly added to a tridiagonal matrix (see par 6.3.17 and 6.4.8 of the manual for more
details how the tridiagonal matrix is defined and solved). For the vertical advection of momentum,
the most important difference is that the vertical velocity has to be interpolated to the velocity
points, because it is defined at C-points.

3.8

Description of the lateral boundary conditions

3.8.1

Two-dimensional boundary conditions

In the implemented finite volume scheme, a momentum flux needs to be prescribed at the open
boundaries in the 2D mode. There are 14 different options implemented for these boundary
conditions. An overview of these boundary conditions is given in par 5.9.1 of the COHERENS
manual. Their numerical implementation is described in paragraph 6.3.15 . We will not discuss
all these options in detail. Most important is the general structure, which is that they apply a local
value of the depth integrated velocity (either U or V) at the location of the boundary conditions.
These depth integrated values are calculated from the variables that are applied at the boundaries,
which can be in the form of (depth integrated) velocities, water depths or a combination of both.
In some instances the gradient of water level or fluid velocity can also be used. Depending on the
type of boundary condition used, the normal velocity at the new time step is calculated from data
at the previous time step or from data at an adjacent grid cell, in combination with the prescribed
data. Cross stream velocities and diffusive terms are set to zero at the boundary.
The following additional remarks should be made:
If only water levels or water level gradients (thus no velocities) are applied to the boundary,
an approximate (explicit) momentum balance is applied to convert these to a velocity value.
In two types of boundary conditions (Orlanski 1976, and Camerlengo & O Brien 1980), the
velocity at a previous time step (m - 1) is also required.
An additional option exist to prevent spurious instabilities near ragged boundaries. If this
options is applied, the advection terms that depend explicitly on the values of U and V at
the boundaries are set to zero. Also the diffusive flux at the open boundary is made exactly

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

30

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

equal to the diffusive flux one cell to the interior of the grid (such that the gradient of the
diffusive flux is zero there).
The general way in which this is implemented is that a momentum balance is applied locally, in
which the prescribed boundary condition is substituted. This momentum balance is then solved
to give the depth integrated velocity at the boundary point, which is then applied.
In the current implementation of COHERENS , which uses an explicit scheme for time integration,
the application of the open boundary conditions is decoupled from the solution of the momentum
equations. The open boundary conditions are applied at the end of a 2D time step. Then the
calculated velocities are replaced by the ones obtained from the boundary conditions. The calcu
lated values are then used in the numerical schemes (for the advection and horizontal diffusion
terms) in the next 2D time step.
In case an implicit scheme is used in COHERENS , this decoupling of boundary conditions from
the momentum equations can not be used anymore. Conceptually, this is not problem. This
seems relatively straightforward for those boundary conditions, where the boundary condition is
either applied using a local momentum balance (which can be solved simultaneously with the
global momentum balance) or using a direct relation with adjacent cells (such as a zero volume
flux or a clamped boundary; d U /d t = 0 ). It might be somewhat more difficult for boundary
conditions using the characteristic method, where it may be necessary to linearize the boundary
conditions, because they are a nonlinear function of both C and U or V. However, it appears that
the implementation of the open boundary conditions have to be recoded completely.

3.8.2

Three-dimensional boundary conditions

Only four types of 3D boundary conditions are implemented in COHERENS (see par 5.9.2 and
6.3.16 of the manual): the use of zero gradient condition, a specified external profile, radiation
condition and Orlanski condition. All these boundary conditions are applied to the baroclinie
component of the velocity (thus to the deviation of the velocity from the depth averaged velocity).
The three dimensional boundary conditions in the current explicit scheme in COHERENS are
evaluated at the corrector time step. Just as in the 2D mode, they are decoupled from the solution
of the momentum equations, and used in the advection and diffusion terms used to calculate the
following time step. In an implicit code, the application of the open boundary conditions needs to
be coupled with the solution of the momentum equation. The consequences are similar as for 2D
boundary conditions.

3.9

Description of m athematical libraries

In implicit numerical models, a system of linear equations needs to be solved. Two techniques
can used for this, direct solution methods and iterative solution methods. In COHERENS three
different methods to solve systems of linear equations are built in, all of them are direct solution
methods.
Solution of a linear system of equations using Cholesky decomposition. This is a direct
method for the solution of equations with square symmetric (a = ,,) positive definite
matrices. It is used in performing the harmonic analysis.
Solution of a linear system of equations using LU decomposition. This is a direct method
for solving equation with square matrices. It is used to solve a 3x3 matrix when determining
the surface exchange coefficients using Monin-Obukhov similarity profiles.
Solution of a linear system of equations using the Thomas sweep algorithm. This is a highly
efficient algorithm (based on LU decomposition) to solve tridiagonal matrices. It is used in
the solution of the semi-implicit vertical step transport equations for momentum and scalar
transport.

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

31

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

3.10

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

Conclusions and recom m endations

In this chapter, a review was given of the numerical schemes that are currently implemented in
COHERENS , from the point of view of the implementation of an implicit code. From the schemes
presented in this review the following conclusions and recommendations can be drawn.
It was shown that especially for shallow water, the velocity of the long waves ( \fg ) and
the advection velocity are of the same order. Thus the gain that will be obtained from only
implementing an implicit scheme in the 2D mode will be rather limited. It therefore seems
necessary to make the 2D mode as well as the 3D mode and the scalar advection equation
(whose time step depends on the same CFL criterion as the 3D momentum equations)
implicit.
A decision should made, whether the implemented mode-splitting scheme should be re
tained. The gain obtained from a mode splitting scheme seems rather limited in an implicit
code (especially when applied to shallow water such as rivers and estuaries). The used
mode splitting algorithm yields some additional complexity in making the code implicit for
the 2D mode, where terms are presently implemented that depend both on the last 2D and
the last 3D time step. This might however be overcome to some extend by neglecting some
of the terms (due to the differences between the depth-averaged advection and diffusion
and the advection and diffusion of the depth averaged quantities), which are usually small
corrections. However, it makes the solution for the 3D momentum equations easier, be
cause they are decoupled from the continuity equation. Note that it should be investigated
in the literature whether a mode splitting schemes with both modes (2D and 3D) implicit are
stable, or that instabilities can exist due to the coupling between the two modes, when large
time steps are used.
The fractional step method that is implemented seems rather easy to extend to implicit
fractional step methods such as ADI (alternating direct implicit).
The spatial discretizations that are used for advection and diffusion terms seems suited to
use in an implicit code, without adaptation, except that some linearization may be needed
(to prevent non-linear systems of equations at the new time step).
The time integration schemes in COHERENS are only first order accurate in time (except
the semi-implicit scheme for the vertical advection and diffusion terms). This does not lead
to severe accuracy restrictions, because the time step needs to be very small because of the
explicit scheme that is used. If an implicit scheme is used, the time step can be increased,
which might possibly lead to a decreased accuracy. Therefore, in case of an implicit code,
the use of higher (second) order time integration might be advantageous. Note that Picard
linearization is used to linearize the non-linear terms in the semi-implicit vertical terms is
COHERENS . This type of linearization leads to first order accuracy Wesseling (2001). Thus
changing the order of accuracy might also lead to the need of more complicated linearization
(such as Newtons method of linearization) and hence iterative solutions of the equations.
The sources of momentum due to external forces (tide, atmospheric pressure, and wind
stresses) seem straightforward to make implicit in the calculation scheme. The Coriolis
force and bed shear stress term are already implemented with respectively an implicit cor
rection, and a quasi-implicit term. It should be investigated whether these terms lead to time
step restrictions, although this does not seem very likely. In the scalar advection diffusion
equation, the corrector term and source term are discretized explicitly. The latter might also
lead to restrictions of the time step, but it will depend on the application.
Only direct matrix solvers are currently implemented in COHERENS . For many types of
implicit implementations, these might not be sufficient. However, there is a tridiagonal algo
rithm implemented (used for the solution of the implicit vertical terms), which can be very
useful in certain types of implicit schemes (such as ADI).

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

32

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

An additional complexity of an implicit code is that some equations that are uncoupled in the
explicit implementation of COHERENS become coupled in an implicit implementation. The
most important of these are:
- The continuity and momentum equations in the 2D mode will become coupled. Hence
these equations have to solved simultaneously rather than consecutively (as it is done
presently). In case the mode splitting is removed, this coupling also exists between
continuity and the 3D momentum equations.
- The scalar equation and momentum equations become coupled in case of an active
scalar, (thus if the baroclinie pressure is included in the momentum equations). In
that case, the scalar advection equation needs to be solved simultaneous with the
momentum equation, rather than after it. However, it seems not to be very necessary
to make the baroclinie pressure gradient implicit, because this term does not lead to
very severe stability restrictions, since internal baroclinie waves move rather slow.
- The open boundary conditions become coupled with the momentum equations. Hence
they need to be solved simultaneously with the momentum equations (rather then be
ing applied after the momentum equations are solved). In principle, this is not a prob
lem (although it depends on the type of boundary condition that is used). Boundary
conditions using radiation criteria or flow characteristics may need to be linearized. A
consequence will be that a sufficient part of the boundary condition code have to be
recoded.

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

33

T H V IM D C -S o resm a
i.s .m. KU Leuven, UG ent, BMM en W LB

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

34

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

Chapter 4
Towards an implicit scheme

The aim of this Chapter is to narrow down the abundance of numerical and physical modelling
possibilities, described in Chapter 2, to a framework within the numerical model will be developed.
Within this process, the numerical and physical path considered in COHERENS , described in
Chapter 3, is taken into account. In a first part, we discuss the physical equations we aim to
tackle within this project, after which the numerical approach is considered.

4.1

Physical equations

In Chapter 2, we pointed out that, in general, three approximations are applied to the ReynoldsAveraged equations of motion and continuity:
Boussinesq, traditional and hydrostatic approximations.
The first and second approximation do not impose severe restrictions to the physical description
of the flow field. Mainly, the Boussinesq approximation filters the acoustic modes, while the tradi
tional approximation implies that the flow field in regions near the Equator will be described less
accurately. On the other hand, the hydrostatic approximation is known to describe the flow field
only crudely when depth variations are significant. A situation which occurs occasionally in the
coastal zone and in estuaries.
Nevertheless, within this project, it is chosen to apply all three approximations such that our gov
erning set of equations consists of hydrostatic momentum equations combined with the continuity
equation, an equation of state and equations describing the transport of the scalars: temperature
and salinity; i.e. we consider equations (16) - (22) of Chapter 2.
As pointed out above, the first two approximations do not impose severe restrictions. Therefore,
we do not discuss the motivation to apply these approximations thoroughly. On the other hand,
applying the hydrostatic approximation could be questionable. For this project, the primary moti
vation to apply also the hydrostatic approximation is that the aim of the project is more to provide a
time-efficient code which describes the flow field reasonably in a large range of situations instead
of a code that is more accurate in some special cases but more time-consuming. In this respect,
it is obvious that a code which tackles also the non-hydrostatic correction to the flow field is much
more time demanding. Furthermore, we point out that, the general approach to describe also the
non-hydrostatic flow field is first to calculate the hydrostatic flow and then to correct this flow field
with the non-hydrostatic pressure; i.e. by means of the pressure method described in Chapter
2. Hence, our choice of applying the hydrostatic approximation, does not limit us to extend the
model, in future projects, with a non-hydrostatic correction part.

Note on nearshore circulation


The considered equations, do not take into account short free-surface waves such as wind waves.
However, in the nearshore region, the influence of these waves on the current is substantial. To
provide an accurate description of the detailed flow field in the nearshore zone, two approaches
can be considered. The first consists of coupling the ocean model with a nearshore circulation
model that resolves the quasi-3D depth-integrated short wave-averaged equations, i.e. equations

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

(35) - (36) of Chapter 2. The second possibility is to take into account the effects of the short
waves by introducing additional terms into the equations we presently take into account (Warner
e ta l. , 2008).
Research (Haas & Warner, 2009) has been done to compare both approaches which illustrates
that, in general, the model results are comparable. Differences being primarily the result of a
distinct approach to the representation of radiation stresses. Haas & Warner (2009) also describe
that the first approach, probably, will be computationally faster, while the second approach has
the advantage to be able to describe the flow field over a broader range of processes.
Here, we point out that, an effort to improve the description of the flow field, taking into account
the action of short waves, has been done and is currently under taken within a BELSPO project,
see Van Lancker et al. (2009). The merging of this work with the current project appears an
interesting future prospective.

4.2

Numerical approach

To narrow down the numerical approach we will follow in this project, at this point, we need to
make some decisions on the following points:
1. Grid: unstructured - structured,
2. General discretization method: FEM - FVM - FDM,
3. Mode-splitting or not?
4. (Semi-)implicit method.
Each of these points will be addressed subsequently, leading to a general framework which we will
use to build the implicit numerical code. Here, it is worth to point out that, in our decision-making
we consider (1) the efficiency, accuracy and robustness of the method and (2) the feasibility of
implementing the code, taking into account the structure of the present COHERENS code.

4.2.1

(Un)structured grid - general discretization method

As these two points are somewhat related, we discuss them together. The main advantage of
unstructured grids is that they provide flexibility, which is beneficial for complex domains. Both
finite volume and finite element methods allow the use of unstructured grids, while finite difference
methods are restricted to a structured grid.
Although unstructured grids have the intrinsic advantage of flexibility, since the present COHE
RENS code is structured, we suggest, within this project, to keep this feature and develop an
implicit code on a structured grid. Next to the motivation that the present COHERENS code is
structured, it is worth to point out that the disadvantage in flexibility can be reduced by applying
a coordinate transformation; in the horizontal into curvilinear coordinates and into s-coordinates
in the vertical. This coordinate transformation is already used in COHERENS and we propose
to retain this feature in the upcoming implicit code. Remark that presently COHERENS uses
orthogonal curvilinear coordinates, which enhances already the flexibility of the code. A further
reduction of the limitations due to the use of structured grids could be achieved by introducing
general curvilinear coordinates. This could be an interesting enhancement in future projects.
Chosing for a structured grid, the main advantage of the finite element method drops such that,
taking into account that the finite element method generally results in large size matrix calculations
(and therefore is less efficient), we foresee to implement the model equations by means of a finite
volume method (FVM) and/or finite difference method (FDM). The choice between these two
methods is not yet made at this point, since on a structured grid these methods do not differ much
from each other. Moreover, it could be beneficial to use FVM for a particular set of equations and
FDM for another. In Chapter 5, this point will be discussed.

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

36

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

4.2.2

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

Mode-splitting or not

As pointed out in Chapter 2, the primary numerical motivation to use the mode-splitting approach,
is that it provides a relatively competitive scheme when explicit time-stepping methods are used.
This is because the system of equations which suffers the most severe time-stepping restriction
(the barotropic mode) is less complex than the full three-dimensional equations. Therefore, solv
ing the barotropic mode explicitly (even with very little time steps A s) is still feasible. Then, cou
pling the free surface evolution derived from the barotropic equations with the three-dimensional
set of equations, and solving the latter also explicitly with a larger time step A provides, as a
whole, still a reasonable scheme.
The gain of this approach is quantified in Chapter 3. In particular, it is described that the maximum
mode splitting that can be used is
S
T -A p2 D2 < H M

<4 -1>

indicating that the mode-splitting is efficient when deep water conditions are considered, while
in rivers and estuaries the approach will provide only a limited gain. Therefore, as discussed in
Chapter 2, retaining the mode-splitting approach and making only the barotropic mode implicit
would not improve the calculation time considerably. This suggests that within the mode-splitting
scheme both the barotropic and the baroclinie mode should be made implicit to reduce signifi
cantly the calculation time.
In addition to this remark, we point out that the difference in work-load between making the
barotropic mode implicit and making immediately the full three-dimensional equations implicit is
not excessive. This can be understood by considering that both the barotropic mode and the full
three-dimensional hydrostatic equations consist of three equations; i.e. two horizontal momentum
equations and an equation that describes the free surface elevation.
Finally, it is remarked that introducing an implicit time-discretization to the barotropic mode, could
induce some non-trivial issues when the barotropic mode is coupled to the baroclinie mode.
Taken together the above described considerations, we suggest to discretize the full three-dimensional
hydrostatic equations implicitly. Thus, to eliminate the mode-splitting while introducing an implicit
time-discretization. Nevertheless, remark that, when modifying the code, we intend to retain for
the user an option to use the mode-splitting scheme (with explicit-time stepping). The advan
tage of this suggestion is that backward compatibility is assured. The disadvantage, however, of
maintaining both approaches in the code is that it may lead to a double maintenance of the code,
and will induce a significant larger effort when new developments are implemented. Therefore,
we suggest that a future project concentrates on the comparison of the performance of both ap
proaches for several cases. If, from this study, it appears that one of the two models performs
better in most of the cases, we suggest to remove the other at that stage.
4.2.3

(Semi-) implicit method

Two conceptual approaches are available to solve numerically the flow field we consider. Sche
matically, after discretizing the equations we will have to solve the system Ax = b. One approach
consists of applying advanced iterative methods to solve the inversion of the matrix A like the conjugent gradient method. A second method is to split the governing set of equations into several
subsets of discretized equations which are subsequentially solved. In each subset only one phys
ical direction is taken implicitly such that the matrix inversion can be performed more efficiently.
This approach is called the ADI method. In Table 4.1, we summarize the advantages and disad
vantages of each approach. It appears that both the ADI and the iterative methods have particular
advantages for certain aspects. Mainly, iterative methods have as advantage that they are more
accurate, probably more efficient and provide an easier scheme to parallelize the code, in future
projects. On the other hand, the ADI method essentially is more transparent to implement. From
both approaches, we choose to pursue the iterative approach. The primary motivation for this
is that iterative methods will allow an easier implementation of the parallelization of the code. In
fact, the performance of the ADI method and iterative methods can be comparable w rt accuracy
and efficiency. Also, we note that the efficiency of an iterative solver highly depends on the use of
appropriate preconditioners, a choice which is not trivial and requires much attention.

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

37

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

+
+
+

ADI
easy to implement
available experience to
implement this scheme
available libraries
in COHERENS

diffusive (but this can be limited


by means of appropriate discretization)
Less accurate for Courant
numbers above 10

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

+
+

Iterative solver
more accurate
efficient solver (less
computation time for
each computation time step)
better adapted
to parallelize
difficult to implement

Table 4.1: Advantages and disadvantages o f the A D I scheme and the C onjugent Gradient method.

Finally, we remark that the implementation of an iterative method is not straightforward and a
challenging task. Nevertheless, we choose for the iterative method as it will provide a more
advanced tool to reduce computation time by parallelization, next to the implementation of the
implicit description of the free surface gradient.

4.3

Conclusions and outlook

In this section we have presented several arguments to narrow down the abundance of numerical
and physical modeling possibilities to the framework within we will develop the numerical model.
In summary, we will describe the flow field by means of
1. Reynolds-averaged momentum and continuity equations (together with scalar-advection
equations and an equation of state) which apply the Boussinesq, traditional and hydrostatic
approximation.
2. The discretization on a structured grid, by means of orhogonal curvilinear and s-coordinates
will be maintained.
3. The choice to discretize the terms with Finite Volume Methods or Finite Difference Methods
will be done in upcoming sections.
4. It is intended to implement the full 3D flow and remove the mode splitting. For backcompatibility, the mode-splitting option, nevertheless, is suggested to remain present in the
code, for the moment. If, from further studies, it is found that the mode-splitting option is
less performant, we propose to remove this option for the user.
5. From a comparison between implicit methods to resolve numerically the flow field, it is found
that an iterative method is more appropriate.
Although in this Chapter, we have taken a substantial step to narrow down our approach to de
scribe numerically the flow field, in the upcoming Chapter still some steps need to be taken.
Primarily, it should be specified how each term is discretized. Besides, attention should be given
on how the boundary conditions will be taken into account.
Finally, in this Chapter, some interesting suggestions for future development of the code came
apparent:
1. It appears an interesting prospective to account for the influence of short waves on the flow
field.
2. An evaluation of the performance of the present model with the foreseen code is an appeal
ing future task.

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

38

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

Chapter 5
An overview of the code implementation in Coherens V2

5.1

Introduction

In this chapter an overview is given of the implementation of numerical schemes into the COHE
RENS code. This overview is by no means meant to be exhaustive or very detailed. Instead, its
main purpose is to form a guide in the selection of the implicit code to be implemented in CO
HERENS and a guide to the proper implementation into the code. Some indications will be given
concerning the implication of the current structure regarding the implementation of the implicit
code. A complete and very detailed overview of the numerical schemes and the code structure of
COHERENS can be found in the Coherens V2 User and Reference Manuals.
The main structure of the code related to the numerical schemes is described starting from the
general structure up to the details of the specific routines, including a brief description of their
aims and composition.

5.2

Description of the code structure

The COHERENS code is structured in several subroutines focusing on several objectives (e.g.
numerical scheme, reading of input data, writing of output, etc). The following description is
strictly oriented to the numerical schemes present in the current version of COHERENS , they are
listed as follows:
coherens_main
hydrodynamic.equations
current_2d
current_pred
current-corr
This structure is illustrated in Figure 5.1, where it is possible to observe the degree of depen
dencies of the main subroutines used for the calculation of the hydrodynamic equations. Starting
from the subroutines for the solution of the hydrodynamic equations, up to the subroutines for the
solution of the advection diffusion terms.
5.2.1

Coherens main program

coherens_main is the main routine of the model. This routine is oriented to call all the subroutines
of COHERENS , from the opening of input files, up to the printing of results. The structure of this
routine is depicted in Figure 5.2.
The main subroutine related with the numerical schemes is hydrodynamic_equations. This sub
routine is called in all the processes, depending on the flags or switches activated by the user (2D
or 3D simulation), this subroutine will call three other subroutines for the numerical calculations:

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

Figure 5.1: Structure o f subroutines in COHERENS

current_2d, current_pred and current_corr. The main feature of the general scheme of COHE
RENS , is the definition of a time loop for the solution of the hydrodynamic equations (where nt
is the number of time steps). Before the the initialisation of the time loop, COHERENS defines
arrays and variables to be used during the whole simulation (see Figure 5.3).
The subroutines called before the time loop are described as follows:
default_grid

: Mean water depth flows (bathymetry data) are read from the data provided by
the user and assigned to the global array depmeanglb. This array is used for
uniform and varying bathymetries.

defineJocaLgrid: Mean water depth flows are read from the global array depmeanglb and as
signed to the specific arrays for C- and U V -nodes: depmeanatc, depmeanatuv.
pointer_arrays

: Land mask functions are initialised in order to determine if the grid cells are wet
or dry, with the objective to mask out dry grid cells. They are a function of a
minimum water depth defined by the user. These functions are defined for CU- and y-nodes: nodeatc, nodeatu and nodeatv.

depth_at_nodes : Reads the specific array of mean water depth flow defined at C-nodes and as
signs its values to arrays for the U- and y-nodes: depmeanatu and depmeanatv.
water.depths

: Initialisation and calculation of the total water depths, and their assignations
to global arrays for total water depth at C- U- V - and U V -nodes: deptotatc,
deptotatu, deptotatv and deptotatuv.

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

40

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

tim e _ a v e ra g e s
In itia lis e m o d e l o u tp u t

ia rm o n ic _ a n a ly s is
u s r d e f_ o u tp u t
w r ite _ p h s ic s

u p d a te _ tlm e

yes

m e te o _ in p u t

e q u a tlo n _ o f_ s ta te
yes
p re d s te p ?

b a ro c lln lc _ g r a d le n t

current_pred
hydrodyna mi c_ equations

yes

te m p e ra tu re _ e q u a tlo n
s a lin ity _ e q u a tlo n

M o d e l O u tp u t

n t < nstep

Figure 5.2: Structure otcoherens.m ain routine

Inside the time loop, the subroutine m askJunction is called. This subroutine focuses on the dy
namic updating of the mask funtion defined previously, with the aim of activating or deactivating
grid cells during the simulation. The objective of the dynamic activation/deactivation is the sim
ulation of flooding/drying processes. This mask is defined in function of the kind of simulation.
For 2D simulations, this subroutine is called at the beginning of the time loop, while for 3D simu
lations, it is called after the predictor step. This difference is related to the use of different time
steps (splitting mode).

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

41

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

d e fa u lt_ g r ld

d e fn e _ lo c a l_ g r ld

p o in t e r_ a rra y s

d e p th _ a t_ n o d e s

a te r_ d e p th s

(flo odin g 2d)

u p d a te _ tim e
c u re n t_ p re d

hydrodynamic_eqi

(flo odin g 3d)

a te r_ d e p th s

M o d e l O u tp u t

n t < nstep

Figure 5.3: Structure o fc o h e re n s .m a in routine with definitions o f arrays and the specification o f the dynamic
m ask function

5.2.2

Subroutine hydrodynamic_equations

This subroutine is located in the Hydrodynamic.Equations.f90 file, and is called by the coherens_main routine. Depending on the selection made by the user, this subroutine is oriented to
call the three main routines for 2D and 3D simulations. The structure of this subroutine is depicted
in Figure 5.4
The specification of the switches iopt_mode_3D and iopt_mode_2D will determine the type of simu
lation. For the case of a 3D simulation, the mode splitting technique is applied, and the calculation
is performed in two steps: the predictor step and the corrector step.

5.2.3

Structure of the 2D hydrodynamics

This subroutine is located in the Hydrodynamic.Equations.f90 file, and is called by the hydrodynamic_equations subroutine. The two-dimensional hydrodynamic equations are solved by this
subroutine, following the numerical scheme explained in the previous chapter. The general struc
ture of this subroutine is depicted in Figure 5.5.
This subroutine performs internal calculations to solve some of the terms of the continuity and
momentum equations for 2D. On the other hand, makes external calls for other terms (advection
diffusion) which need further calculations. As ilustrated in Figure 5.5, red frames refer to internal
calculations while black frames refer to external calls of subroutines. The details are given as
follows:

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

42

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

hydrodynamic_equations

yes
iopt_mode_3D = 1

current _pred

no

iop t_mo de_ 2D

yes

no

yes
iopt_mode_3D = 1

no

RETURN

Figure 5.4: Structure o f hydrodynamic.equations subroutine

Initialisation

Initialisation of the local arrays to be used during the subroutine.


Here the status of grid cells is verified, in order to determine if
they are dry or wet.

update_2dobc_data

Data for open boundary conditions in 2D mode are read from the
arrays provided by the user.

surface.elevation

This subroutine solves the continuity equation to calculate the


surface elevation.

Atm ospehric pressure gradient Calculates the atmospheric pressure gradient term of the mo
mentum equations.
Surface slope

Calculates the surface slope term of the momentum equations,


takes into account the presence of flooding/drying proceses.

Baroclinie

Calculates the baroclinie pressure term of the momentum equa


tions.

Astronomical tidal force

Calculates the astronomical tidal force term of the momentum


equations.

Bottom stress

Calculates the bottom stress term of the momentum equations.

Surface stress

Calculates the surface stress term of the momentum equations.

Coriolis term(explicit part)

Calculates the explicit part of the Coriolis term of the momentum


equations.

transport_at_U_2d

Solves the advection diffusion equation for the momentum equa


tions, updates the 2D currents at Indirection.

transport_at_V_2d

Solves the advection diffusion equation for the momentum equa


tions, updates the 2D currents at ^-direction.

Coriolis term(implicit part)

Calculates the implicit part of the Coriolis term of the momentum


equations.

open_boundary_conds_2d

Applies the open boundary conditions for 2D mode, verifying the


type of boundary condition assigned to each open boundary point.

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

43

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

m a s k a tu
m a s k a tv

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

m a s k a r r a y s f o r la n d b o u n d a r i e s

u p d a te _ 2 d o b c _ d a t

a tm o s p h e ric p re s s u re g ra d ie n t
s u rfa c e slo p e
b a ro c lin ie
a s tro n o m ic a l tid a l force
b o tto m s tre s s
s u rfa c e s tre s s

C o rio lis term (e x p lic it p a rt)

tr a n s p o r t _ a t_ U _ 2 d
tr a n s p o rt_ a t_ V _ 2 d

E x c h a n g e h a lo s e c tio n s (M P I)

C o rio lis term (im p lic it p a rt)

E x c h a n g e h a lo s e c tio n s (M P I)

2d

E x c h a n g e h a lo s e c tio n s (M P I)

D e p th m ean c u rre n ts
F ilte re d c u rre n ts

C o rre c to r s te p fo r 2D

>pt_nests

u p d a te _ n e s t_ d a ta _ 2 d

RETURN

Figure 5.5: Structure o/current_2d subroutine

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

44

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

Depth mean currents

Calculates the depth mean currents.

Filtered currents

Calculates the filtered currents.

bottom_stress

Updates the bottom stress term.

surface .stress

Updates the surface stress term.

Corrector step for 2D

Calculates corrected currents for 2D.

update_nest_data_2d

Calculates values for nesting processes.

5.2.4

Structure of the Predictor step

This subroutine is located in the Hydrodynamic.Equations.f90 Fortran file, and is called by the
hydrodynamic_equations subroutine. The three-dimensional hydrodynamic equations are solved
by this subroutine following the numerical scheme explained in the previous chapter. The general
structure of this subroutine is depicted in Figure 5.6.
This subroutine performs internal calculations to solve some of the terms of the momentum equa
tions for 3D in the predictor mode. In addition, it makes external calls for other terms like the
advection diffusion terms, which need further calculations. As ilustrated in Figure 5.6, red frames
refer to internal calculations while black frames refer to external calls of subroutines. The details
are given below:
Initialisation

: Initialisation of the local arrays to be used during the subroutine.


Here the status of grid cells is verified, in order to determine if
they are dry or wet.

update_1 sur.data

: Data for open boundary conditions in 1D mode are read from the
arrays provided by the user.

Surface slope

: Calculates the surface slope term of the momentum equations,


takes into account the presence of flooding/drying proceses.

Astronom ical tidal force

: Calculates the astronomical tidal force term of the momentum


equations.

Baroclinie

: Calculates the baroclinie pressure term of the momentum equa


tions.

Coriolis term(explicit part)

: Calculates the explicit part of the Coriolis term of the momentum


equations.

Bottom stress

: Calculates the bottom stress term of the momentum equations.

transport_at_U_3d

: Solves the advection diffusion equation for the momentum equa


tions, updates the 3D currents at -direction.

transport_at_V_3d

: Solves the advection diffusion equation for the momentum equa


tions, updates the 3D currents at ^-direction.

Coriolis term(implicit part)

: Calculates the implicit part of the Coriolis term of the momentum


equations.

Depth integrated currents

: Calculates the depth integrated currents.

5.2.5

Structure of the Corrector step

This subroutine is located in the HydrodynamiC-Equations.f90 Fortran file, and is called by the
hydrodynamic_equations subroutine. The three-dimensional hydrodynamic equations are solved
by this subroutine, following the numerical scheme explained in the previous chapter. The general
structure of this subroutine is depicted in Figure 5.7.
This subroutine performs internal calculations to solve some elements of the momentum equa
tions for 3D in the corrector mode. Like in the previous step, makes external calls for other
elements which need further calculations. As ilustrated in Figure 5.7, red frames refer to internal
calculations while black frames refer to external calls of subroutines. The details are given as
follows:

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

45

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

c u rr ent_pred

m a s k a tu

ma s k a r r a y s f o r l and b o u n d a r i e s

m a skatv

update_ldsur_data

s u rfa c e slo p e
a s tro n o m ic a l tid a l force
b a ro c lin ie p re s s u re

C o rio lis te rm (e x p lic it p a rt )


botto m s tre ss

transport_at_U_3d
tr a n s p or t _ a t _ V _ 3d

E x c h a n g e h a lo s e c tio n s (M P I)

C o rio lis te rm (im p lic it p a rt)

E x c h a n g e h a lo s e c tio n s (M P I)

D e p th in te g ra te d c u rre n ts

RETURN

Figure 5.6: Structure o/current_pred subroutine

Initialisation

: Initialisation of the local arrays to be used during the subroutine.


Here the status of grid cells is verified, in order to determine if
they are dry or wet.

update_profobc_data

: Data for open boundary conditions in 3D mode are read from the
arrays provided by the user.

open_boundary_conds_3d

: Applies the open boundary conditions for 3D mode, verifying the


type of boundary condition assigned to each open boundary point.

define_profobc_spec

: Reads the arrays for 3D boundary conditions defined by the user


and assigns their values onto local processes previous verifica
tions.

update_profobc_spec

: Data for open boundary conditions in 3D mode are read from the

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

46

T H V IM D C -S o resm a
i.s .m. KU Leuven, UG ent, BMM en W LB

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

u p d a te _ p ro fo b c _ d a ta
o p e n _ b o u n d a ry _ c o n d s _ 3 d

open boundaries

d e fin e _ p r o fo b c _ s p e c

Exchange halo section s (MPI)

p h y s ic a l_ v e r tic a l_ c u r r e n t

u p d a te _ p ro fo b c _ d a ta

yes
u p d a te _ n e s t_ d a ta _ 3 d

u p d a te _ n e s t_ d a ta _ 3 d

Figure 5.7: Structure ofcu rre n t.co rr subroutine

arrays provided by the user and stored previously.


update_nest_data_3d

Calculates values for nesting processes.

Baroclinie current

Calculates the corrected baroclinie current term of the momentum


equations.

Open boundaries

Applies the location of the open boundaries.

Relaxation schemes

Applies relaxation schemes at the open boundaries.

Corrected and filtered current

Calculates the corrected and filtered current terms of the momen


tum equations.

transf_vertical_current

Calculates the transformed vertical current.

physicaLverticaLcurrent

Calculates the physical vertical current.

bottom_stress

Updates the bottom stress term.

surface .stress

Updates the surface stress term.

5.3

Subroutines of the numerical scheme

5.3.1

Subroutine for 2D hydrodynamics

The current_2d subroutine solves the continuity and momentum equations for 2D.

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

47

T H V IM D C -S o resm a
i.s .m. KU Leuven, UG ent, BMM en W LB

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

Solution of the continuity equation


The solution of the continuity equation is performed by the surface_elevation subroutine, which
solves the follwing discretized continuity equation:
/m +l

/m

^ AT9Z/

( ^ 1 - U i1) - % (^+1 - V f )

(5.1)

where the variables and arrays used by the Fortran code are defined by:
C = zeta
A T 2D = delt2d
a x = delxatc
oty = delyatc
U = udvel
V = vdvel
The complete sequence of the solution is described as follows:
1. Calculation of the surface elevation for X-direction
2. Calculation of the surface elevation for Y-direction
3. Exchange of data for parallel computing through the exchange of halo sections
4. Updating of the total water depths by calling the subroutine water.depths
5. Calculation of the alpha-factor for flooding/drying processes based on the water depths
Solution of the momentum equations
The next step is the solution of the momentum equations, here is given the discretized equation
of momentum for U\

T jm

-\-1

T jm

= _ ( ^ ) + (L T ")
A d v e c tio n

D iffu s io n

l,n/m TTTO-L1 TV)/*YV~i I//


jjm + 1 _ k n/m
up
h n / m

Hm

T JP '\
TJp

-----U
-------+

ry r>

HnJ
C o rio lis ; e x p lic it d is c re tiz a tio n

B o tto m fric tio n ; q u a s i im p lic it d is c re tiz a tio n

Fn

+ pm + 1 +

b a ro c lin ie p re s s u re g ra d ie n t

tid a l fo rc e

+ a gradCm+1 +
^

gradPQ
m+1

w a te r level g ra d ie n t

s u rfa c e s tre s s

A tm o s p h e ric p re s s u re g ra d ie n t.

- 5 A n + 5D n
' -------------------

V--------- '

(5.2)

C o rre c tio n te rm s ; fro m 3 D tlm e s te p

where the variables and arrays used by the Fortran code in the subroutine are defined by:
A (U m) = solved by transport_at_U_2d
D (U m) = solverd by transport_at_U_2d

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

48

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

k n/ m = bfricatu
f v m = coriolatu

= sourceatu

f +1 = sourceatu
r 1 = usstresatu
PQ
m+1 = atmpres

The complete sequence of the solution is described as follows:


1. Allocate of arrays
2. Initialisation of masks and arrays and update of boundary conditions
3. Update of the surface elevation-previously described
4. Calculation of the surface slope term, taking into account the presence of flooding/drying
processes
5. Calculation of the baroclinie pressure gradient
6. Calculation of the astronomical tidal force term
7. Calculation of the bottom and surface stress terms
8. Calculation of the explicit part of the Coriolis term
9. Solution of the advection diffusion terms
10. Exchange of data for parallel computing through the exchange of halo sections
11. Calculation of the implicit part of the Coriolis term
12. Exchange of data for parallel computing through the exchange of halo sections
13. Application of the boundary conditions
14. Exchange of data for parallel computing through the exchange of halo sections
15. Calculation of the depth mean currents
16. Calculation of the filtered currents
17. Update of the bottom and surface stresses
18. Application of the corrector step for 2d case
19. Writing at nest location when nesting is required
Solution of the advection diffusion terms - updating of currents
The solution of the advection diffusion terms is performed by the transport_at_U_2d and transport_at_V_2d subroutines, here is described the first one (the solution for V is similar).
1.

Time integration without operator splitting, this is performed with the following items:
Initialisation
Calculation of the advection term (calls the subroutine Xadv_at_U_2d)
Calculation of the diffusion term (calls the subroutine Xdif_at_U_2d)
Calculation of explicit terms

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

49

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

Update of the U current


2. Time integration with operator splitting - step A, this is performed with the following items:
Calculation of the X-derivative terms (calls the subroutines Xadv_at_U_2d and Xdif_at_U_2d)
Calculation of the Y-derivative term (calls the subroutines Yadv_at_U_2d and Ydif_at_U_2d)
Calculation of the source/sink terms
3. Time integration with operator splitting - step B, this is performed with the following items:
Calculation of the source/sink terms
Calculation of the Y-derivative term (calls the subroutines Yadv_at_U_2d and Ydif_at_U_2d)
Calculation of the X-derivative terms (calls the subroutines Xadv_at_U_2d and Xdif_at_U_2d)
4. Time integration with operator splitting - updating of the U current
Solution of the advection terms
The solution of the advection terms is performed by the Xadv_at_U_2d subroutine.
1. Initialisation of arrays, this is performed for the following items:
Mask arrays
Fluxes
Work space aray
Advective velocity
2. Calculation of the explicit terms, this is performed with the following items:
Calculation with the upwinding scheme
Calculation with the Lax-Wendroff scheme
Calculation with the TVD scheme
Calculation of the advection near the open boundaries
Calculation of the advective term
Calculation of the curvature term
Application of the reduction factor (alpha-factor) for flooding/drying scheme
Update of the depth-integrated advective term
Solution of the diffusion terms
The solution of the diffusion terms is performed by the Xdif_at_U_2d subroutine.
1. Initialisation of arrays
2. Calculation of the explicit terms, this is performed with the following items:
Calculation of the fluxes
Calculation of the diffusion near the open boundaries
Calculation of the diffusive term
Application of the reduction factor (alpha-factor) for flooding/drying scheme
Update of the depth-integrated diffusive term

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

50

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

5.3.2

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

Subroutine for the Predictor step

Solution of the momentum equations


The predictor step solves the 3D momentum equation given as follows:
v n + l _

u n

= -

a t 3D

A h (un )

D h(un )

H o riz o n ta l a d v e c tio n

0Dv(i,n+1) +

(1 -

H o riz o n ta l d iffu s io n

0)Av(un) + 0Dv(un+1) +

V e rtic a l a d v e c tio n ; s e m i-im p lic it

- o g r a d i"
w a te r level g ra d ie n t

(1 -

0)Av(i

V e rtic a l d iffu s io n ; s e m i-im p lic it

/grade"
a tm o s p h e ric p re s s u re g ra d ie n t

B a ro c lin ie p re s s u re g ra d ie n t

F1+1 +
T id a l fo rc e

fv ^

(5.3)

C o rio lis ; e x p lic it p a rt

where the variables and arrays used by the Fortran code in the subroutine are defined by:
A h ( u n ) = solved by transport_at_U_3d
D h ( u n ) = solverd by transport_at_U_3d
A T 3D = delt3d
u n = uvel

Vn = w e l
f v m = coriolatu

= sourceatu

f +1 = sourceatu
The complete sequence of the solution is described as follows:
1. Allocate of arrays
2. Initialisation of masks and arrays and update of boundary conditions
3. Calculation of the atmospheric pressure gradient
4. Calculation of the surface slope term, taking into account the presence of flooding/drying
processes
5. Calculation of the astronomical tidal force term
6. Calculation of the baroclinie pressure term
7. Calculation of the explicit part of the Coriolis term
8. Calculation of the bottom stress term
9. Solution of the advection diffusion terms
10. Calculation of the implicit part of the Coriolis term
11. Exchange of data for parallel computing through the exchange of halo sections
12. Addition of implicit corrections
13. Exchange of data for parallel computing through the exchange of halo sections
14. Calculation of the depth-integrated currents

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

51

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

Solution of the advection diffusion terms - update of currents


The solution of the advection diffusion terms is performed by the transport_at_U_3d and transport_at_V_3d subroutines, here is only described the calculation for the U nodes (the solution for
V is similar).
1. Time integration without operator splitting, this is performed with the following items:
Initialisation
Calculation of the time derivative term
Calculation of the source term
Calculation of the advection term (calls the subroutine Xadv_at_U_3d)
Calculation of the diffusion term (calls the subroutine Xdif_at_U_3d)
Update of the u current
2. Time integration with operator splitting - step A, this is performed with the following items:
Calculation of the X-derivative terms (calls the subroutines Xadv_at_U_3d and Xdif_at_U_3d)
Calculation of the Y-derivative term (calls the subroutines Yadv_at_U_3d and Ydif_at_U_3d)
Calculation of the Z-derivative source terms: time derivative, vertical advection (sub
routine Zadv_at_U) and vertical diffusion (subroutine Zdif_at_U)
3. Time integration with operator splitting - step B, this is performed with the following items:
Calculation of the Z-derivative source terms: time derivative, vertical advection (sub
routine Zadv_at_U) and vertical diffusion (subroutine Zdif_at_U)
Calculation of the Y-derivative term (calls the subroutines Yadv_at_U_3d and Ydif_at_U_3d)
Calculation of the X-derivative terms (calls the subroutines Xadv_at_U_3d and Xdif_at_U_3d)
4. Time integration with operator splitting - update of the u current
Solution of the advection terms
The solution of the advection terms is performed by the Xadv_at_U_3d subroutine.
1. Initialisation of arrays, this is performed for the following items:
Mask arrays
Fluxes
Work space aray
2. Calculation of the explicit terms, this is performed with the following items:
Calculation of the advective velocity
Calculation with the upwinding scheme
Calculation with the Lax-Wendroff scheme
Calculation with the TVD scheme

Calculation

of the advection near the open boundaries

Calculation

of the advective term

Calculation

of the curvature term

Application

of the reduction factor (alpha-factor) for flooding/drying scheme

Update of the depth-integrated advective term

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

52

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

Solution of the diffusion terms


The solution of the diffusion terms is performed by the Xdif_at_U_2d subroutine.
1. Initialisation of arrays
2. Calculation of the explicit terms, this is performed with the following items:
Calculation of the fluxes
Calculation of the diffusion near the open boundaries
Calculation of the diffusive term
Application of the reduction factor (alpha-factor) for flooding/drying scheme
Update of the depth-integrated diffusive term

Solution of the advection terms in the vertical direction


The solution of the advection terms in the vertical direction is performed by the Zadv_at_U subrou
tine.
1. Initialisation of arrays, this is performed for the following items:
Mask arrays
Fluxes
Work space aray
2. Calculation of the explicit terms, this is performed with the following items:
Calculation with the upwinding scheme
Calculation with the central scheme
Calculation with the Lax-Wendroff scheme
Calculation with the TVD scheme
Calculation of the advective term
Calculation of implicit terms

Solution of the diffusion terms in the vertical direction


The solution of the diffusion terms is performed by the Zdif_at_U subroutine.
1. Initialisation of arrays
2. Calculation of the explicit fluxes
3. Calculation of the explicit terms
4. Calculation of the implicit terms
5. Application of the boundary conditions at the surface and at the bottom

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

53

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

5.3.3

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

Subroutine for Corrector step

This subroutine is called after the calculations performed by the predictor step and the 2D equa
tions. The complete sequence of the calculations performed in this subroutine is described as
follows:
1. Allocate of arrays
2. Initialisation of open boundary conditions on the first call, this operation is performed before
entering the time loop
3. Opening of boundary conditions, this computation is performed inside the time loop
4. Initialisation of masks based on the status of the grid cells for wet/dry conditions
5. Calculation of the corrected baroclinie current
6. Calculation of the corrected and filtered currents
7. Exchange of data for parallel computing through the exchange of halo sections
8. Calculation of the transformed and physical vertical currents
9. Update of the bottom and surface stresses
10.
5.3.4

Writing at nest location when nesting is required


Subroutine for Scalar advection diffusion

Scalar transport equations (temperature and salinity) are solved after the computation of the hy
drodynamic equations (see Figure 5.2, they are performed by the subroutines temperature_equation
and salinity_equation, both of them are being called by the main program. These subroutines are
located in the Density-Equations.F90 Fortran file.
The discretized equation of the scalar advection diffusion is used for the calculation of the scalar
values (e.g. temperature and salinity). This equation (without operator splitting) is described as
follows.
Lll+l _ L11+ 1
w
w
=
A T-3 D

- A h( r ) + D h( r )
H o riz o n ta l a d v e c tio n a n d d iffu s io n .

dAv( r +1) - (i - o)Av( r ) + oDv( r +1) + a - o)Dv( r )

'----------------------------------------------------- V ----------------------------------------------------- '

S e m i im p lic it v e rtic a l te rm s .

CW 2
C o rre c to r te rm s , e x p lic it

(5.4)
S o u rc e te rm , e x p lic it

The calculation for salinity and temperature differs slightly for the calculation of some terms.
However, the main calculation of the advection diffusion is performed by the subroutine transport_at_C_3d.
The complete sequence of the solution for salinity is described as follows:
1. Initialisation of boundary conditions for the first call, this is performed before entering

to the time loop


2. Opening of the boundary conditions, this is performed inside the time loop
3. Calculation of the surface fluxes, this is performed by the subroutine salinity_flux
4. Calculation of the source term
5. Solution of the advection diffusion terms

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

54

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

6. Exchange of data for parallel computing through the exchange of halo sections
7. Writing at nest location when nesting is required
The complete sequence of the solution for temperature is described as follows:
1. Initialisation of arrays and boundary conditions for the first call, this is performed before
entering to the time loop
2. Opening of the boundary conditions, this is performed inside the time loop
3. Calculation of the radiative source term, this is performed by the subroutine solar_irradiance
4. Application of the surface boundary conditions for: Neumann and Dirichlet conditions
5. Solution of the advection diffusion terms - calling of subroutine transport_at_C_3d
6. Application of the freezing point limit
7. Exchange of data for parallel computing through the exchange of halo sections
8. Writing at nest location when nesting is required
The complete sequence of the solution for the advection diffusion term (subroutine transport_at_C_3d) is described as follows:
1. Initialisation of arrays and boundary conditions for the first call, this is performed before
entering to the time loop
2. Calculation of the corrector term, this is performed by the subroutines Xcorr_at_C,
Ycorr_at_C and Zcorr_at_C
3. Time integration without operator splitting, this is performed with the following items:
- Initialisation
- Calculation of the time derivative
- Calculation of the source term
- Calculation of the advection term by calling the subroutines: Xadv_at_C, Yadv_at_C
and Zadv_at_C
- Calculation of the diffusion term by calling the subroutines: Xdif_at_C, Ydif_at_C
and Zdif_at_C
- Update of the scalar quantity
4. Time integration with operator splitting- step A, this is performed with the following
items:
- Calculation of the X-derivative terms (calls the subroutines Xadv_at_C and Xdif_at_C)
- Calculation of the Y-derivative term (calls the subroutines Yadv_at_C and Ydif_at_C)
- Calculation of the Z-derivative source terms: time derivative, vertical advection
(subroutine Zadv_at_U) and vertical diffusion (subroutine Zdif_at_U)
5. Time integration with operator splitting- step B, this is performed with the following
items:
- Calculation of the Z-derivative source terms: time derivative, vertical advection
(subroutine Zadv_at_U) and vertical diffusion (subroutine Zdif_at_U)
- Calculation of the Y-derivative term (calls the subroutines Yadv_at_C and Ydif_at_C)
- Calculation of the X-derivative terms (calls the subroutines Xadv_at_C and Xdif_at_C)
6. Update of the scalar quantity
7. Application of a relaxation scheme

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

55

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

5.3.5

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

Subroutine for turbulence

The discretization of equations for turbulence are quite similar to the equations for scalars. One
of the main differences is that turbulence equations are solved before the momentum equa
tions. According to the structure of the main routine of COHERENS , the equations for tur
bulence are solved by the subroutine vertical_diff_coefs, this surboutine is located in the Diffusion.Coefficients.F90 Fortran file. The objective of this subroutine is the selection of the turbu
lence model (turbulence equations) to be used in the calculation of the vertical diffusion term.
The present review is oriented to make a description of the k - e turbulence model, considering
that this model is the most complex present in the current version of COHERENS .
The k - e turbulence model is solved by the subroutine dissipation.equation, this subroutine is
located in the Turbulence.Equations.F90 Fortran file. This file contains all the turbulence models
used in COHERENS .
The complete sequence of the calculations for the mentioned turbulence model is described as
follows:
1. Allocate of arrays
2. Initialisation of diffusion coefficients
3. Calculation of the vertical diffusion coefficient
4. Application of the boundary conditions at the bottom and surface
5. Calculation of the source/sink terms
6. Solution of the transport equation by calling the subroutine transport_at_W
7. Calculation of the dissipation at the bottom and surface
8. Application of lower limits for the calculation of the dissipation
9. Exchange of data for parallel computing through the exchange of halo sections
The transport_at_W subroutine is oriented to solve the advection diffusion equation for turbulence
models. This subroutine is located in the Transport.Equations.F90 Fortran file. Here is presented
the complete sequence of computations:
1. Initialisation, this procedure is performed with the following sequence:
Initialisation of array shapes
Initialisation of time integration terms
Initialisation of allocatable arrays
Initialisation of mask for land boundaries
Initialisation of dirichlet boundary conditions at the surface and at the bottom
Initialisation of local arrays

Initialisation of the source/sink terms

Initialisation of the advective velocities

Initialisation of the horizontal diffusion coefficients

Initialisation of the vertical diffusion coefficient

2. Calculation of the corrector term, this is performed by the following sequence:


Calling of subroutine Xcorr_at_C
Calling of subroutine Ycorr_at_C
Calling of subroutine Zcorr_at_C
3. Time integration without operator splitting, this is performed with the following items:

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

56

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

Initialisation
Calculation of the time derivative
Calculation of the source and sink terms
Calculation of the advection term by calling the subroutines: Xadv_at_W, Yadv_at_W
and Zadv_at_W
Calculation of the diffusion term by calling the subroutines: Xdif_at_W, Ydif_at_W and
Zdif_at_W
Update of the scalar quantity
4. Time integration with operator splitting- step A, this is performed with the following items:
Calculation of the X-derivative terms (calls the subroutines Xadv_at_W and Xdif_at_W)
Calculation of the Y-derivative term (calls the subroutines Yadv_at_W and Ydif_at_W)
Calculation of the Z-derivative source terms: time derivative, vertical advection (sub
routine Zadv_at_W) and vertical diffusion (subroutine Zdif_at_W)
5. Time integration with operator splitting- step B, this is performed with the following items:
Calculation of the Z-derivative source terms: time derivative, vertical advection (sub
routine Zadv_at_W) and vertical diffusion (subroutine Zdif_at_W)
Calculation of the Y-derivative term (calls the subroutines Yadv_at_W and Ydif_at_W)
Calculation of the X-derivative terms (calls the subroutines Xadv_at_W and Xdif_at_W)
6. Update of the scalar quantity

5.4

Implementation of open boundary conditions

The numerical implementation of open boundary conditions in COHERENS extends from the
specification of general setups for open boundaries to the definition of open boundary conditions
for 2D mode and 3D mode. However, the specification of coastal boundary conditions, takes
place internally, according to the specification of dry and wet grid cells, where dry grid cells will
correspond to land zones.

5.4.1

Definition of general parameters

General parameters are referred to general input data read by the model to setup the open boun
dary conditions in a specified area. Three main routines are used for the specifications: usrdef_mod_params, usrdef_grid and usrdef_phsics. They are part of the main file Usrdef.Model.f90.
usrdef_mod_params: Here are defined the number of open sea boundaries at U- and Y-nodes
(nosbu,nosbv), and the number of river boundaries at U- and Y-nodes (nrvbu,nrvbv).
usrdef.grid

: Here are defined the grid indices in the X-directions of open boundary points
at U- and Y-nodes (iobu,iobv), and the grid indices in the Y-directions of
open boundary points at U- and Y-nodes (jobu,jobv).

usrdef-phsics

: Here are defined the storage arrays used in case the boundary conditions
at specific nodes require the solution of a differential equation in time. For
2D mode they are given by obc2uvatu(nobu,2) and obc2uvatv(nobv,2) for
U- and Y-open boundaries respectively. For 3D mode they are given by
obc3uvatu(nobu,2) and obc3uvatv(nobv,2) for U- and Y-open boundaries
respectively.

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

57

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

5.4.2

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

Definition of open boundary conditions for 2D

Two main groups are identified for the implementation of open boundary conditions in 2D mode.
The first one refers to the specifications and boundary data provided by the user in the UsrdeLM odel.f90 Fortran file, and the second refers to the internal variables and arrays used to
solve the hydrodynamic equations.
The variables and arrays provided by the user, are defined in two subroutines: usrdef_2dobc_spec
and usrdef_2dobc_data. The former refers to the specification of the type of the boundary condi
tions for 2D mode, and the latter refers to the input of open boundary data for the 2D mode.
The attributes of open boundary data are stored in modfiles(io_2uvobc,ifil,1) where ifil takes values
of 2 up to nofiles (number of files) if more than one open boundary data file is needed. For the
external values of currents and flow depths, the non-harmonic part is defined in usrdef_2dobc_data
usually as time series, while the amplitudes and phases are time-independent and should be
defined in usrdef_2dobc_spec.
The general structure of the implementation of open boundary conditions in 2D mode is illustrated
in Figure 5.8. Two parts are identified in the structure, the initialisation of the data and the appli
cations of boundary data on the solution of hydrodynamic equations. The initialisation is specified
as follows:

>d_p;

d e p th _ a t_ n o d '

depths

ip d a te _ 2 d o b c _ d a t;

( flo o d in g 2d)

i p d a te _ 2 d o b c _ d a ta
h y d ro d y i

M o d e l O u tp u t

n t < nstep

Figure 5.8: Structure o f the implem entation o f open boundary conditions in 2D mode

Usrdef_Model.90

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

: Flere, all the parameters, specifications and data of the open boundaries in
2D mode are provided by the user. The variables and arrays are called by

58

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

initialise_model, in order to setup the model concerning the open boundary


conditions.
reset_mod_params

The number of open boundaries are read and assigned to the global vari
ables nobu and nobv, which are the total (open sea and river) number of
open boundary points at U- and V-nodes respectively.

default.grid

Mean water depth flows are read from the data provided by the user and
assigned to the global array depmeanglb, for uniform varying bathymetries.

defineJocaLgrid

Mean water depth flows are read from the global array depmeanglb and
assigned to the specific arrays for C- and U V -nodes: depmeanatc, depmeanatuv.

open_boundary_arrays: Variables and arrays read from the input are assigned to local processes
by the specification of internal variables/arrays for the locations of the
open boundaries and the number of open boundary points.
pointer_arrays

Land mask functions are initialised, in function of the minimum water depth
already defined, for C- U- and V-nodes: nodeatc, nodeatu and nodeatv.
The orientation of the open boundary cell faces is determined and as
signed to variables westobu and soutobv.

depth _at_nodes

Mean water depth flows are read from the specific array of mean water
depth flow at C-nodes and assigned to arrays for U- and V-nodes: depmeanatu and depmeanatv.

water.depths

Initialisation and calculation of the total water depths, and their assigna
tions to global arrays for total water depth at C- U- V - and t/V -nodes:
deptotatc, deptotatu, deptotatv and deptotatuv.

update_2dobc_data

Data for open boundary conditions in 2D mode are read from the arrays
provided by the user and stored previously. A general structure of this rou
tine is depicted in Figure 5.9. Flere the specifications and data of boun
dary conditions provided in usrdef_2dobc_spec and usrdef_2dobc_data are
read and updated in function of the solution of the hydrodynamic equa
tions. Two routines are called: define_2dobc_spec and define_2dobc_data.
Besides, This routine is called by current_2d, for the solution of the hydrodynamic equations.

define_2dobc_spec

Reads the arrays defined in modfiles(io_2uvobc,1,1) and assigns their va


lues to local processes previous verifications.

define_2dobc_data

Arrays modfiles(io_2uvobc,ifil,1) for (ifil > 1) are open on first call and read
the data provided by the user, assigning specifications for outflow condi
tions at river boundaries.

open_boundary_conds_2d: Applies the open boundary conditions for 2D mode, verifying the type
of boundary condition assigned to each open boundary point. This routine
is called by current_2d, for the solution of the hydrodynamic equations.
5.4.3

Definition of open boundary conditions for 3D

Like in the previous mode, two main groups are identified for the implementation of open boundary
conditions in 3D mode. The first one refers to the specifications and boundary data provided by
the user in the UsrdeLModel.f90 file, and the second refers to the internal variables and arrays
used to solve the hydrodynamic equations.
Variables and arrays provided by the user, are defined in two subroutines: usrdef_profobc_spec
and usrdef_profobc_data. The former refers to the specification of the type of the open boundary
conditions for 3D mode, and the latter refers to the input of open boundary data for the 3D mode.
The attributes of open boundary data are stored in modfiles(io_3uvobc,ifil,1) where ifil takes values
of 2 up to nofiles if more than one open boundary data file is needed. For the external values

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

59

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

update_2dobc_data

yes

define_2dobc_spec

Al locate arrays

Initialise

Checks:
Data in h a r m o n i c f o r m ?
Extern al data pr ovi ded ?
Data a v a i l a b l e i f n e e d e d ?

L o o p : i f il, no f i l e s

Read:
Prescribed transport
Elevation s at U,V nodes

ye s

Evaluate data

Figure 5.9: Structure o f the subroutine update_2dobc_data

of currents and flow depths, the non-harmonic part is defined in usrdef_profobc_data usually as
time series, while the amplitudes and phases are time-independent and should be defined in
usrdef_profobc_spec.
The general structure of the implementation of open boundary conditions in 3D mode is illustrated
in Figure 5.10. Two parts are identified in the structure, the initialisation of the data and the
applications of boundary data for the solution of hydrodynamic equations. The subroutines are
detailed as follows:
The main difference with 2D mode is the calling of the subroutine current_corr at the initialisation
procedure. This subroutine is divided in two parts, the initialisation part and the application of the
open boundary conditions to the solution of the hydrodynamic equations. The first part is called at
the initialisation stage, to define the arrays for the boundary conditions and for an update at initial
time. Thus, two subroutines are called: define_profobc_spec and update_profobc_data.

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

60

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

d_p;

depth_at_

ipdate_profobc_
( f l o o d i n g 2d)

M o d e l O u tp u t

n t < nstep

Figure 5.10: Structure o f the implementation o f open boundary conditions in 3D mode

define_profobc_spec : Reads the arrays defined in modfiles(io_3uvobc,1,1) and assigns their va


lues to local processes previous verifications.
define_profobc_data

: Arrays modfiles(io_3uvobc,ifil,1) for (ifil > 1) are open on first call and read
the data provided by the user.

update_profobc_data : Data for open boundary conditions in 3D mode are read from the arrays
provided by the user and stored previously. A general structure of this rou
tine is depicted in Figure 5.11. Flere the specifications and data of boun
dary conditions provided in usrdef_profobc_spec and usrdef_profobc_data
are read and updated in function of the solution of the hydrodynamic equa
tions. The two previous subroutines are called: define_profobc_spec and
define_profobc_data.
open_boundary_conds_3d: Applies the open boundary conditions for 3D mode, verifying the type
of boundary condition assigned to each open boundary point. This sub
routine is called by current_corr, for the solution of the hydrodynamic equa
tions.

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

61

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

updateprofobcdat

Read:
P rescribed transport

L o o p : i fil, n o f i l e s

E le v a tio n s at U ,V nodes

no
defineprofobcdat

yes

defineprofobcdat

E v a lu a t e data

Figure 5.11: Structure o f the subroutine update_profobc_data

5.4.4

Definition of coastal boundaries

Coastal boundaries are imposed internally by the model. The definitions are made by routines
called for the solution of the hydrodynamic equations. Here is analyzed the case for 2D mode.
For 3D mode, the structure is analogous.
The solution of hydrodynamic equations in 2D mode is made by the subroutine current_2d. The
calculation of U and V currents is made by the subroutines transport_at_U_2d and transport_at_V_2d.
The advection and diffusion terms of the hydrodynamic equations are solved by the above men
tioned subroutines. Four specific subroutines are called for the solution process: Xavd_at_U_2d,
Yavd_at_U_2d, Xdif_at_U_2d and Ydif_at_U_2d for U-nodes; and, Xavd_at_V_2d, Yavd_at_V_2d, Xdif_at_V_2d
and Ydif_at_V_2d for y-nodes.
The main characteristic of these subroutines is the use of logical flags, which depend on the
status of Land Mask Functions. These flags become TRUE for grid cells defined as w et, where
the Land Mask Function is equal to one.
Thus, these flags (maskatu, maskatv and maskatc) are used to perform further calculations. In
the present case, at the initialisation process, it is imposed for land cells (where flags are FALSE)
that fluxes are set to zero.

5.5

Basic elem ents for parallel computing

The basic elements for parallel computing are referred mainly to the use of the MPI external library
, the implementation of this library presents the following features:
W ork load is divided among a given number (Np) of processes.
It uses non-shared memory, i.e. each process does not share its own memory with the other
processes.
The global domain is divided in N p horizontal sub-domains (no decomposition in the verti
cal).
To solve the discretised equations in the horizontal, communications need to be set up
between neighbouring domains.

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

62

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

Communication is handled by the routines of the MPI (Message Passing Interface) library.
Current implementation is Version 1.1.
MPI routine calls are only found in comms-MPI.F90 (with one exception). Each MPI routine
call (starting with MPL) has a corresponding alias (starting with comms_). This allows a
more efficient implementation of future MPI versions.
5.5.1

Domain decomposition

The second element is referred to domain decomposition, which presents the following features:
Process domains are arranged as 2-D grid with dimensions nprocsx and nprocsxy where
nprocsxxnprocsy (total number of processes).
Domains with land points only can be excluded from the grid so that nprocsxxnprocsy>nprocs.
Each domain has a process id number between 0 and nprocs-1 and two domain grid indices
(i,j) where 1<i<nprocsx, 1<j<nprocsy. Dummy (land) domains are defined with a NULL
process id (MPI_proc_null).
W ork load is evenly partioned between the sub-domains (except that the domains are not
of the same size). Exception is the master process which is the only one with write access.
Reading is performed by all processes (except defined otherwise by the user).
For local grid indexing system, grid cells are indexed in the same way as the global grid. The
local grid dimensions are ncloc and nrloc. The most eastern column and most northern row are
no longer composed of dummy land points.
Local computational grid
nrloc-

ncloc

si
Figure 5.12: C grid indices.

The local grid dimensions and indices are related to the global ones through the following definifions:
ncloc

X-dimension of local domain (local variant of nc)

nrloc

Y-dimension of local domain (local variant of nr).

n d lo c

Global X-index of leftmost column (local)

nc2loc

Global X-index of rightmost column (local)

n rllo c

Global Y-index of lowest row (local)

nr2loc

Global Y-index of highest row (local)

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

63

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

nc1 procs(nprocs) Array with values of nc1 loo for each domain (global)
nc2procs(nprocs) Array with values of nc2loc for each domain (global)
nr1 procs(nprocs) Array with values of nr1 loo for each domain (global)
nr2procs(nprocs) Array with values of nr2loc for each domain (global)
Domain decomposition is uniquely defined by these last 4 process arrays. Two options are
available:
1. Simple decomposition: the user specifies the values of two of the three parameters nprocs,
nprocsx, nprocsy. The arrays are defined internally.
2. The arrays are defined externally by the user.
Global and local indices (at any node) are then related by
iglb = iloc + nclloc - 1
jglb = jloc + nrlloc - 1

5.5.2

Halos

Numerical discretisations may require the availability of values of a model array located at grid
points within a neighbouring sub-domain.
These values are calculated, not inside the domain itself, but within its neighbours. They are
obtained by means of (MPI) communications between the domain and its neighbours. Each
neighbour sends a section of the array which is received and stored by the domain in one of the
arrays halo sections.
A halo is created by adding extra columns and rows to the model array. Most arrays have halo
sizes all equal to the parameter nhalo = 2, e.g.
uvel(1-nhalo:ncloc+nhalo,1-nhalo:nrloc+nhalo,nz)

Other arrays may have smaller halos or asymmetric halos, e.g.


gxcoord(0:ncloc+1,0:nrloc+l), atmpres(0:ncloc,0:nrloc)

The W est/East/South/North sizes are usually given by a 4-element vector. The halo sizes of the
3 arrays above are respectively
(nhalo,nh alo,n h alo,nhalo), (1,1,1,1),

5.5.3

(1,0,1,0)

Communications

A MPI communication consist of a send operation on one process (say A) and a receive operation
on another process (say B). COHERENS uses only so-called blocking send and receive opera
tions. The implementation in COHERENS is based upon the following communication modes:
1. Synchronous send.
A send a message with the data to B.
B receives the message and the data, sends a message back to A and completes
afterwards.
A receives the message from B and completes.
Most robust mode.
2. Bufffered send.
A sends a message to B, sends the data to a buffer, and completes afterwards.
B receives the message, retrieves the data from the buffer and completes afterwards.

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

64

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

Useful for large data.


3.

Standard send.
The operation is performed either synchronously or in buffered mode. The choice is
made internally by MPI.
Less robust than synchronous mode but usually more efficient.

Only the standard and synchronous mode are implemented in COHERENS .


The following sort of communications are used in the program: copy, distribute, combine, combine
all, exchange, collect.
1. Copy operations.
Copies (the same) data from the root process to all other processes.
The operation involves N p-~\ sends from the root and 1 receive at each other process.
This is called a one-to-all operation and therefore asymmetric.
Used to copy data read by the root process from a data file (not needed if shared.read
= .TRUE.).
2. Distribute operations.
Copies local sections (i.e. distributes) of a global model array from the root process to
all other sub-domains. Each local section may or may not contain the arrays local halo
parts.
The operation involves N p-~\ sends from the root and 1 receive at each other process.
This is called a one-to-all operation and therefore asymmetric.
Used to set up initial conditions on each local domain or to distribute surface data in
case the surface data grid coincides with the model grid. Distribute operations become
redundant if shared_read = .TRUE..
3. Combine operations.
Copies a local array (i.e. combines) from each sub-domain to a corresponding section
of a global array on the root process. Halos are not included.
The operation involves N p-~\ receives at the root and 1 send from each other process.
This is called a all-to-one operation and therefore asymmetric.
Various versions are implemented:
- Combination of local full model arrays into a global array.
- Combination of local subsections of model arrays into a global array.
- Combination of local irregular (station) data into a global array.
- Combination of local open boundary arrays into a global boundary array.
Used for the construction of global arrays, obtained from local model arrays, local regu
lar or irregular sub-arrays. The global arrays are mostly intended for output, calculation
of global array sums, array maxima and minima.
4. Combine-all operations.
The same as the combine operation except that the global data are made available to
all processes.
The operation involves N p-~\ sends and N p-~\ receives on each process.
This is called a all-to-all operation and therefore symmetric. Note that work load is
(about) the same for each sub-domain so that the CPU time for a combine-all is about
the same as for a corresponding combine operation.

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

65

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

5. Exchange operations.
Send sub-sections of local model arrays to a corresponding section within the halo of
each neighbouring domain. Receives data from each neighbouring domain and stores
these data in one of its halo sections.
Since each sub-domain has 8 neighbours (including dummy domains outside the com
putational domain), the operation requires in general 8 sends and 8 receives on each
sub-domain. However, this number can be reduced by specification of the halo sec
tions for which an exchange is needed or when component(s) of the halo size vector is
(are) zero.
The operation is symmetric.
Exchange operations are an essential part of the parallel code and are mainly for im
plementation of numerical algorithms for horizontal advection and diffusion and for ho
rizontal averaging.
6. Collect operations.
Stores all local arrays into one global array with an extra dimension of size nprocs.
The operation involves A ^ -1 sends and A ^ -1 receives on each domain.
This is a all-to-all operation and therefore symmetric.
The operation is not frequently used.
Remarks:
The root process is by default the master process.
The communication routines are programmed using the MPLsend and MPLrecv routines
either in standard or synchronous mode.
There are options to use MPI collective calls instead for some operations: MPLbcast for
copy and MPLallgather for collect operations.
For exchange operations there is an alternative option to use the MPLsendrecv utility routine
which combine a send and a receive operation into one call.
5.5.4

Parallel processing implemented in numerical schemes

Parallel processing is present in the subroutines of numerical schemes, with the main goal to
transfer the information from the main processor to the other ones. This is done through the
Communications subroutines.
In figure 5.13, is illustrated the main structure of COHERENS , where the subroutines, which
consider parallel processing, are highlighted.

5.6

Conclusions and recomm endations

In this chapter, a review was given of the implemented numerical schemes in the COHERENS
code. From the schemes presented in this review the following conclusions and recommendations
can be drawn in order to fulfill the implementation of an implicit numerical scheme.
The main structure of COHERENS depicts that the subroutine hydrodynamic_equations is
used for the application of the numerical schemes. In addition, three main subroutines are
used for 2D and 3D simulations considering the mode splitting as well. Therefore, in the case
of an implementation of an implicit scheme, it is necessary to consider the implementation
of a new subroutine (e.g. hydrodynamic_equation_implicit). Thus, it would be more feasible
to use a switch or flag to select which scheme is going to be used in the solution of the flow
equations.

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

66

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

1 -g rid

:e r_ d e p th s

h y d ro d y i

:e r_ d e p th s

Figure 5.13: Structure o/coherens_main routine where calls to communications for parallel processing take
place

The structure of the new subroutine for the implicit scheme should be analyzed based on
the scheme to be implemented. Anyhow, the definition of separate subroutines for 2D and
3D simulations (e.g. implicit_2d and implicit_3d) could be considered.
One important element to be considered is the intialization of the model (initialise_model). At
this stage all the input data is read from the input files {Usrdef-files), and all the arrays to be
used during the simulation process are initialised. This stage is performed outside the time
loop. Therefore, the implementation of a new scheme, must make use of the variables and
arrays defined at the initialisation step. These variables are recognized as global variables
and can be transferred in parallel processing.
The solution of the equations for turbulence and scalars are performed before and after
the call of the subroutine hydrodynamic_equations respectively. Therefore, the implemen
tation of the implicit scheme has to consider this feature as well. The new scheme can be
implemented at the beginning of the time loop, specifically after the call of the subroutine
monitorJiles (see Figure 5.2). A similar structure of subroutines for the solution of turbulence
and scalar equations could be considered.
The definition of land boundaries should be taken into account for the implementation of a
new numerical scheme. Since these boundaries are not defined by the user in a direct way
(all the assignation are made internally), the definition of dry and w et grid cells should be
present. COFIERENS verifies at the initialisation stage the status of grid cells based on the
bathymetry data and assigns masks to all the grid cells of the domain. The status of this
mask is verified all the time in all the subroutines related with the numerical scheme. This
verification has the aim to separate dry grid cells from the solution (definition of land grid
cells). Therefore, the use of this mask is strongly recommended. Thus, the new scheme
has to verify in the same way the status of the grid cells.

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

67

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

The definition of open boundaries is performed at the initialisation stage, all the arrays and
variables to be used are based on the assignations made by the user at the setup stage. Two
kind of open boundaries can be assigned, for 2D and 3D cases. The subroutines related
to the assignation of boundaries for the solution of flow equations are performed inside the
time loop. Therefore, for the implementation of the implicit scheme, new subroutines for the
open boundaries should be developed and implemented inside the time loop. This should be
done because the current subroutines for open boundaries are based on explicit schemes.
However, the use of the arrays and variables defined at the initialisation is compulsory. This
operation will allow a full backward compatibility with the current version of COHERENS .
The implementation of the implicit scheme should consider the use of parallel processing,
since this feature allows faster applications of COHERENS in complex cases. Moreover,
considering the reviewed elements of parallel processing and domain decomposition, it is
possible to conclude that parallel processing can be implemented. Besides, all the neces
sary elements for domain decomposition and communications are present in COHERENS
as standard code. These standard subroutines can be called and used for many applica
tions facilitating the addition of new computations inside the code.
The present review of the current structure of COHERENS gives more details and guidelines
for the further implementation of an implicit numerical scheme. In conclusion, new code will
be added, and these new additions should respect the current structure and make use of
the variables and arrays recognized by COHERENS . Nevertheless, further discussions are
advisable in order to define the architecture of the new scheme.

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

68

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

Chapter 6

Numerical framework

The aim of this Chapter is to describe the framework in which the numerical code will be devel
oped; i.e. to define the general approach and the discrezation schemes we plan to use. These
suggestions take into account, the structure of COHERENS and the discussions provided in the
previous Chapters.
In the following, we first discuss our approach to the three-dimensional hydrodynamica! equations.
In a second part, we present the framework in which we intend to solve the depth-integrated flow
field.
For each part, the equations of motion we aim to solve are first recalled, after which the numerical
approach that will be considered is discussed in detail and the numerical scheme is presented. In
a final part, some notes, conclusions and recommendations are given.

6.1

Three-dim ensional flow field

6.1.1

Physical equations

As discussed in Chapter 4, we aim to solve the Reynolds-Averaged equations of momentum and


conservation, taking into account the Boussinesq, traditional and hydrostatic approximations. The
governing set of equations that describes the dynamical flow field is given by

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

du
~dt

du

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

du

-v +

io

du

y
V e rt. Adv.

1 dP.a t m

A tm . P res.

Free S u rf

B a ro c lin . P res.

2 sin(</>)'i
C o rio is

V e rt. D

Hor. D

(6.2)

V e rt. Adv.

Hor. Adv.

1 dP.a t m

A tm . P res.

Free S u rf

B a roch n. P re s

2 Q sin(</>)
Hor. Diff

du

dv

div

dx~^~dy

dz

V e rt. D

(6.3)

C o rio is

(6.4)

The appropriate boundary conditions which are applied to this set of equations is described in
section 6.1.3.1. In (6.1) - (6.4), U and V are the depth-integrated horizontal velocities in the x and
y- directions, respectively. The x-axis is along the parallels, pointing east, while the y-axis points
North along the meridian lines. The -axis is vertical, pointing upward, with = 0 describing the
mean water level. The angular velocity of Earths rotation is denoted by Q and 4> is the latitude
of the origin of the coordinate system. The variable P atm describes the atmospheric pressure,
the free surface elevation and (u, v, w) the velocity components in the x, y and -directions,
respectively. Finally, the tensor R;j (with i,j = 1,2,3) represents the Reynolds stress tensor.

6.1.2

Temporal and spatial discretization

In the following, we discuss how each term within ( 6 .1 ) - (6.4) is discretized.


Furthermore, in general, in space we choose to discretize the terms by means of finite differences
due to the option to re-use large parts of the present code.
1. Free surface gradient:
In space, we suggest to discretize these terms with a central scheme. In time, these terms are
taking into account semi-implicitly, with a ^-factor.
2. Vertical advection:
It is suggested to maintain the choice of discretizing the vertical advection in space by means of
an upwind, central or TVD scheme, as presently possible in COHERENS . Priority will be given to
the TVD scheme. In time, we put forward to discretize these terms semi-implicit (6av-factor).
3. Coriolis, atmospheric and baroclinie pressure gradient terms:
We propose to discretize these terms explicitly in time. Remark that this imposes limitations on
the time-step. However, as discussed in Chapter 3, the CFL restriction related to the baroclinie
pressure gradient is not severe. For the Coriolis terms, on the other hand, we intend to investigate
the possibility, at a later stage, to apply an implicit correction to the Coriolis force similar to the
approach currently applied in COHERENS (COHERENS manual paragraph 6.3.12) to increase

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

70

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

the stability related to these terms. In space, we suggest to discretize these terms making use
of the methods already developed in COHERENS . We refer to Luyten et al. (1999b) for a more
detailed description.
4. Vertical diffusion:
The vertical diffusion terms are suggested to be discretized in space by means of a central
scheme. In time, we propose a semi-implicit {9dv-factor) scheme.
5. Horizontal advection:
In space, we intend to retain the possible horizontal advection schemes presently available in CO
HERENS in the development of the new code; i.e. an upwind, Lax-Wendroff and TVD scheme.
As for the vertical advection, the focus will be on the TVD scheme. The discretization of the hori
zontal advection in time is discussed in more detail below.

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

71

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

6. Horizontal diffusion:
Horizontal diffusion terms will be discretized explicitly centrally in space.

Time discretization of the horizontal advection terms


The discretization of the horizontal advection terms in time, is a point that needs to be discussed
in more detail. Indeed, the two possible approaches (i.e. explicit or (semi-)implicit) to these terms
both have certain advantages and disadvantages such that the choice between these approaches
is not straightforward. In particular, discretizing the horizontal advection and diffusion terms ex
plicitly, imposes a Courant restriction on the time-stepping. On the other side, the advantage of
this approach would be that the computational cost per time step is smaller than when an implicit
approach is used. Indeed, in the latter case, the numerical stencil of the momentum equations is
not anymore confined to the adjacent cells such that the matrix which needs to be inverted is no
longer tridiagonal. The advantage, however, of discretizing the horizontal advection and diffusion
terms implicitly, is that larger time steps will be allowed although the increase of the time steps is
limited due to (1) accuracy and (2) the time step restriction related to the baroclinie pressure gradi
ent. In particular, in this respect, a maximum speed up of 5 times the time step restriction related
to the advection terms can be achieved. In Table 6.1, we list the advantages and disadvantages
of both approaches.

Explicit
efficient solver
each step
easy to implement

restriction on the time step

+
+

Implicit
larger time steps
more stable

less efficient solver


each step
accuracy deteriorates for
large time steps

Table 6.1: Advantages and disadvantages o f the explicit or im plicit time discretizations.

Hence, it appears that both approaches yield certain advantages. At this moment, we foresee
that when relatively coarse horizontal grid sizes are used ~ 0 (1 0 0 m), the explicit approach
will be sufficient since in this case the time-step limitation - 0(1 minute) is about the same as
the physical time-step restriction. However, when finer horizontal spacings are necessary, we
suspect that an implicit time discretization of the horizontal advection and diffusion terms could
be beneficial.
Taking together the above considerations, a third option, recently described by Kramer & Stelling
(2008), is put forward. This approach suggests to introduce a function such that over most of the
domain advection terms are considered explicitly, however, that the cells which exceed locally the
CFL criterion are taken implicitly. Hence, the deviation of the resulting matrix from the tridiagonal
one is not excessive and can still be solved reasonably efficient. This option therefore provides
the benefit of the explicit discretization (efficiency) and the implicit discretization (stability).
All in all, we suggest the implementation of the third option as an aim for future developments of
the code. As a first step, within this project, we set as goal to complete the model with horizontal
advection terms discretized explicitly. Hereafter, the approach of Kramer & Stelling (2008) could
be implemented. This is feasible since, the implicit code can be achieved as a direct extension to
the explicit approach. Moreover, this has as an additional advantage that the development of the
code can be performed as an sequence of two steps which can be tested halfway. Also, we intend
to maintain the numerical code that addresses the horizontal advection explicitly as an option for
the future users. In this context, an interesting future prospective would be also to evaluate the
performance of both approaches for different test cases.

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

72

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

6.1.3

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

Details of the numerical scheme

To describe the details of the numerical scheme, let us first we rewrite (6.1) - (6.4) into:
d

dU

dV

dt

dx

dy

(6.5)

0,

du

dv

diu

dx

dy

dz

(6.6)

du

du

~dt

dz

'~d~z

9 dx

d
dx

du
u u - 2vh
dx

du
u v - vh
dy

dy

1 dPatm
d f\
7.----------L t t - / oclz + j v ,
po o x
ox Jz
dv

dv

dt

dz

~dz _

d
dx

u v - vh

1 d P atm

Po

dy

dv

dx

dy

= ~9

(6.7)

3?

(6.8)

dy

dv
v v - 2vh

c)y.

d
+ tt- / bdz f u, .
dy

In transformed coordinates equations (6.5) - (6.8), are given by

1 dh3
/?3 d t

d(hoU)

d ( h\ V)

dt

hi ho

96

36

d( hoh3u)

hihoh3

96

1 d (h 3 u)

h3

dt

dPatn
puhi 9 6

f :? +

]_ d _

vv d u

h3 d s

h3 d s

96

hihoh3
1

hih%h3

96

hzhoh3

F* +

2 Q .V s in

dt

dPatn

paho

9 6

4> -

hiho

9 6

dho
v 36

h3 d s

9 6

hihoh3

d(h%h3T2i)

hlllr,h3

36

h\hoh3

g d
ho 9 6

d ( h o h 3uv)

(6 .12)

9 (hoh3 v v)

96

d(h2
ih3Too)
dho

hi ho

(6 .11)

36

dv

+ F t + F i 2Q u s in <f>

g 3
hi 9 6

(6 .10)

9 ( ^ f t . 3 r 12)

3 6

(6.9)

3 (hoh 3v u )

dhi

h3 d s

h i hoh 3

d (hoh3 uu

d(h%h3Tn)

h3 d s

1 d ( h 3v)

h3

1 diu

36

hihoh3

d ( h i h 3 v) I

0,

( r 6 6

36

flh
u - ^-

v 36 u 36

Then, our approach consists of two subsequential steps. Conceptually, in the first, the horizontal
momentum equations are integrated with the 6 method, leading to:
6? dun+1

(h3 u ) n+1 + A t - ? - ( e avw nu n+1 - edv


OS \
h3 + 1' ds
- A t - - e ch s +1

d n + 1

h * B I:

(6.13)

36

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

73

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

with

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

9 Pn

B% = u n + A <1------ ;----- ^
Po h i

+ F b'n + F ^ n + 2Qvn sin <j>

di

dho\

dh\
u-

V-

9i J

/?i /?2 V
1

d (hnhym)

h ih o h -i

d i

h ih o h -i

9 ( /? |/? 3 r n ) n

d (hn hyii)

92

d { h \h - iT i2)

h i [

d^ d i i l

(6.14)

for the X momentum balance. A similar expression for the y momentum balance is found:

(hy

\n + l

d v n+1

Ai

9avw nvn+1 - i

' h ^ +1

9cn+ 1

ds

B Pn

A <1------ ;------^
p 0h 2 9^2

(6 .1 5 )

+ Fy
b'n + F ' n - 2 Q u n sin <j>
u

9A 2

h i h 2 \ VW i

d (hnhyiv)

h ih o h -i

9i

h ih o h -i

~ U d&

9 (hnhyv)

92
d {h \h -iT 22)

9 (/?|/?.3r 2i ) n

h ih^h^

9^i

h\h2h%

-p ((1

9/?i

9^2

^ 9n" \

- (1-

(6.16)

/?3 9 s

Remark that, for convenience, we have multiplied the momentum equations with /?3 , before dis
cretization.
Then, the set of equations (6.13) and (6.15) can be solved by substituting
9cn+ 1

u n+1 = + u '^z
di

and

vn+1

,9 n+1
V +

(6.17)

9&

such that (6.13) can be rewritten into


.

h%+ 1 - A

9s

ht+^u:
1- / 1 A

9s

9ol,w n+1 - I
du'
h%+1 9s

h%+1 9s

/'2

/ :

-A ^- J 7 .l+ 1 .

*i

(6.18)
(6.19)

Both (6.18) and (6.19) lead to tridiagonal matrices since the equations are only coupled in the
vertical and the numerical stencil is confined to the adjacent cells. Therefore, both can be solved
by means of the Thom as algorithm. A similar set of equations is found for the y momentum
balance and is omitted for the sake of space.
Then, we proceed with the second step and substitute u n+1 and vn+1 into the free surface eleva-

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

74

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

tion equation leading to:

* 1*2

d fi

y > + v

hih2

(6 .20)

which consists of a five diagonal matrix that can be solved by means of a preconditioned iterative
method. As preconditioner we foresee to implement the Incomplete LU factorization. Further
more, the matrix is symmetric and positive-definite such that we can use the conjugate gradient
method as iterative method, which has the advantage to guarantee conversion. We foresee to
take advantage of the numerical library PETSc1 to solve, with an iterative method, the constructed
matrix. The advantage of this open source library is that it (1) contains a list of iterative solvers
that (2) solve sparse matrices with (3) the possibility to work in parallel.
Once n+1 is computed also un+1 and vn+1 can be evaluated. After which also the (transformed)
vertical current is obtained by integrating over the baroclinie continuity equation from the bottom
to the free surface. Finally, we remark that throughout the solving algorithm, next to the unknowns
n+i un+i anc| j,n+i a|S0 /7 + 1 s an unknown. Indeed, the system of equations that needs to be
solved is, in fact, non-linear. To tackle this problem, we suggest the following approach, based on
Zijlema & Stelling (2005):
1. Replace hn+1 with /?"
2. Evaluate n+1 and, subsequentially compute hn+1
3. Check if | |/?n+1 - /?n | | < e, with e a user defined residual
4. If so, proceed to the next timestep, otherwise substitute hn+1 into hn and repeat the compu
tation.
As indicated previously, the implicit treatment of the horizontal advection terms, fully implicit or with
the method of Kramer & Stelling (2008) could be an interesting feature for future developments.
Below, we describe, schematically, the impact of this enhancement on the code.
A coupling in both the horizontal directions and the vertical directions will be introduced
while solving the momentum equations; equations (6.13) and (6.15). Therefore, both will
have to be solved by means of an iterative method instead of the direct Thomas algorithm.
Moreover, instead of solving the horizontal velocities locally (in the horizontal) decoupled
from each other, the velocities are now coupled such that the all velocities in the three
directions need to solved together. An appropriate iterative method in order to solve these
equations still needs to be identified.
The introduction of an implicit implementation of the horizontal advection terms will deteri
orate the symmetric properties of the free surface evolution equation (6.20). Therefore, the
conjugate gradient method can not be used anymore to solve (6.20) and a different iterative
method needs to be used.
The impact on the efficiency of the algorithm of these adjustments can not be properly assessed
without testing. However, it could by that the overall CPU time will not be decreased since the first
point will require a substantial amount of extra computation time. On the other hand, the second
point will not influence the largely the computation time.
1http ://www. mes.ani .gov/petsc/petsc-as/

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

75

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

6.1.3.1

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

Boundary conditions

Bottom and free surface boundary conditions


As presently applied in COHERENS , we suggest to apply a slip condition at the bottom boundary
relating the horizontal fluid stress to a prescribed bottom shear stress such that
(6 .21)

Users are foreseen to have the following options for


1.

( r 61, r 62):

Zero stress condition:


(6 .22)

( n i , T b2) = (0,0)

2.

Linear friction law:


(T b l? 7 5 2 )

lia

i"

!ib-

b) -

(6.23)

with kun a linear constant friction coefficient.


3.

Quadratic friction law:


(t61,T62) = P o C d b ( u \ + >5)1Z2 (6, V b ),

with Cdb a drag coefficient that is expressed in terms of the bottom roughness
vertical grid spacing. In particular,

(6.24)
and the

(6.25)
in which zr is a reference height taken at the grid centre of the bottom cell.
Our focus will be to implement the latter boundary conditions as it describes the physical flow field
less crudely. Also, at the bed, we impose the vertical velocity to vanish such that w is set zero.
The boundary condition at the free surface is obtained by specifying the surface stress as a
function of the wind components leading to
Povh ( I t - I t ) = Pa.Cd,Ww {Um Vw )

(6.26)

where { lh n, Vm) are the components of the wind vector at a reference height of 10 m, Win =
+ V{0) is the wind speed amplitude and pa = 1.2 kg/m3 denotes the air density. Further
more, at the free surface the vertical fluid velocity is set zero.
Open boundary conditions
The three-dimensional open boundary conditions are suggested to be imposed in two steps, as is
currently applied in COHERENS . In particular, first open boundary conditions are imposed on the
depth-integrated horizontal velocities (U, V ) after which conditions are specified for the deviations
of the flow field to the depth-integrated velocities (the baroclinie parts).

Barotropic boundary conditions


Presently, in COHERENS , an abundance of user options for the boundary conditions are avail
able. At this moment, we filter from these options the most interesting for which we foresee to
implement them in the implicit numerical code. In this choice, we need to take into account that
within subtask 11, it is aimed to provide boundary conditions that allow the code to simulate the
presence of structures in river and coastal applications (such as thin dams, dry points, current
deflecting walls, etc) making use of boundary conditions already defined in COHERENS . Fur
thermore, we also consider that in Subtask 12, the implementation of more advanced boundary
conditions for the the hydrodynamics and the scalar transport equations is anticipated.
Keeping this in mind, we propose, as a primary list, to implement the implicit numerical scheme
taking into account the following open boundary conditions for the depth-integrated velocities:

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

76

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

1. Clamped: with this boundary condition the transports are uniform in time and determined by
the initial conditions. Hence, we impose
dU

- = 0

dV

or -

= 0.

(6.27)

This boundary condition can be used as land boundary. Moreover it is presently default in
COHERENS and we suggest to maintain this feature.
2. Specified transport: by setting
U

= U e or V = V e,

(6.28)

with (U e, V T) external depth-integrated velocities. This condition is most used in river ap


plications.
3. Zero volume flux: this a reflective boundary condition whereby the transport is set equal to
its nearest interior value such that
d V ___________________________________ ______

dU

a i =

or ^

= -

(6'29>

and is proposed since it will be a necessary tool for the developments in subtask 11.
4. Specified elevation: This boundary condition calculates a velocity that is applied from a local
momentum balance using a specified elevation. Although in many situations, user experi
ence has illustrated that the use of this boundary condition provides rather peculiar velocities
at the boundaries, the implementation of this boundary condition appears desirable for the
validation of the implicit code for some test cases. However, as discussed below, attention
to this boundary condition should be given in future projects.
Also the following boundary conditions appear interesting, however, as discussed below, they are
(1) not straightforward to implement and (2) not fully investigated such that they are only listed as
a secondary option. In particular, we mention these boundary conditions since they are appealing
and interesting challenges for future projects or as a part of subtask 12.
1. Specified elevation: As discussed above, this is an interesting boundary condition to imple
ment although in some cases, it leads to rather peculiar results. This result probably arises
since the free surface boundary condion is immediately translated into a velocity condition
by means of a linearized equation of motion. Therefore, it seems advisable to develop other
methods for applying a water level boundary condition. However, this appears not feasible
within subtask 5 and should be done in a separate subtask.
2. Zero slope condition: this boundary condition applies a zero water level slope and calcu
lates the depth integrated velocity from the slope using a local momentum balance. Hence,
the 2-D momentum equations are solved without advection, horizontal diffusion, pressure
gradients and astronomical forcing. For practical applications, it seems necessary to extend
this boundary condition, such that any water level slope (rather than only a value of zero)
can be applied. This seems to be another subject that could be evaluated in a separate
subtask.
3. Characteristic method with specified elevation and transport: this boundary condition is
currently used within COHERENS to allow the nesting with different models. However, due
to complexity of the implementation, the application of this boundary condition should not
be considered as a priority in the development of the implicit scheme. It seems appropriate
to evaluate also this boundary condition in a separate subtask.
4. Radiation condition using shallow water speed: To allow the propagation of waves approach
ing the open boundary, radiation conditions can be implemented imposing
dU

dU

dU

or =
l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

d V __________________________ ______

a rT cai =

(6'30)

77

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

in which c is the appropriate wave speed. The notation or =f represents for the upper
(lower) part the signs applied at the western/southern (eastern/northern) boundaries. This
boundary, however, only admits wave propagating with a normal incidence with the boun
dary.
Finally, it is necessary to mention that during the development of the subtask 11, there is the
possibility that the list of boundary conditions should be modified. On the other hand, the im
plementation of the implicit numerical scheme could re-define the use of the current types of
boundary conditions, this possibility will be clarified during the implementation process. There
fore, it is advisable that further discussions and coordinated works will be arranged in order to
assure a compatibility between the present work and subtask 11.

Baroclinie boundary conditions


In COHERENS , four different 3D open boundary conditions are defined. The baroclinie boun
dary conditions determine the deviation of the flow field, at the open boundaries, from the depthintegrated horizontal velocity field, imposing conditions on Su = U - u / H and v = V - v / H .
These boundary conditions can be applied for momentum as well as scalar transport. Of this four,
two boundary conditions are particularly interesting.
1. Zero gradient: this conditions is default in COHERENS and we intend to maintain this fea
ture, which imposes
du

dv

z =

or

- w = -

(6'31>

2. Specified external profile: this boundary condition can be used together with a predefined
profile and/or in combination with a nested model by setting
= ue

5u

or

v = v e,

(6.32)

with Ve and ve external velocities.

6.2

Depth-integrated flow field

6.2.1

The equations

As presently COHERENS has an option to run only the barotropic equations, it is desirable that
the foreseen code is able to run also only the depth-integrated hydrodynamic equations. In the
following, an outline of the implementation of this feature is presented. Integrating the ReynoldsAveraged equations of momentum and continuity over the depth, yields
9

d V _______________________________________________ ______

dU

m + d^ + ^ -
dU

dUU

dt

dx
+

fV

dy
//

p0

dPatm
o

OX

dUV

dt

dx

-fU-

'Tl,, )
po

IK rx

dy

d P a tm

Po

dy

(6.34)

dVV _
^

dx

(Xsj

'

/'; I I I " , l J- r
dV

(6'33)
9

dVU _

dy

{l~sy

7b y )

po

F + H F + D a y l + D ay2.

(6.35)

In (6.33) - (6.35), (U, V ) are the depth-integrated velocity components in the x and y-direction,
H is the total water depth and (Ts x , Ts y ) and ( n x , Tby) the shear stresses at the free surface
and the bottom, respectively. Furthermore, ( F x , F y ) denote the depth-integrated components

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

78

T H V IM D C -S oresm a
i.s .m. KU Leuven, UG ent, BMM en W LB

U itbouw num erie k m od elinstrum e ntarium


Design of the im plicit schem e in C O H E R E N S

of the baroclinie pressure, {F .,F *) the components related to the astronomical tidal force and
( Dsxi, D syi), ( D SX2 , D Sy2) represent the depth-integrated turbulent dissipation of momentum.
Similar to the three-dimensional flow field, we discretize the momentum equations with the semiimplict 0 method. Furthermore, we linearize the bottom friction term and treat it fully implicit. All
the other terms are taken explicit. The depth integrated x momentum equation is then given by
9n+1

1 + A t ) U n+1 = - g H n + ie,
dx
Po
d U nU n
d V nU r> f y
with B
dx
dy
H n dPatr
+ + F x,n + H nF i ,n +
! + D\
Po dx
Po

(6.36)

Writing U n+1 = + ^ F d } ( j anq \ j are readily determined. The same approach can be applied
to the y momentum equation, considering V n+1 = V + V a^ +1.
Substitution into the free surface elevation equation then provides
d

( ~

-< 9 n + 1 \

m + th;{L + u ^ ^ )

( y

- d n+i

+ d ^iv + v ^ ~

(6.37)

which can be written as


^n+1

At

d f d n+l
dx V
dx

d i - 9 n+1
dy V
dy
A du
a dv
- At - A t .
dx
dy

(6.38)

Equation (6.38) has a similar structure as the discretized free surface elevation equation following
from the three-dimensional problem and can be solved in the same fashion; i.e. by means of a
preconditioned conjugate gradient iterative method.
Finally, we remark that the same spatial discretizations as for the three-dimensional case are
used. Also, it is worth to point out that similar considerations upon the implicit discretization of
the horizontal advection terms can be made for the depth-integrated case as those made for the
three-dimensional problem.
6.2.1.1

Boundary Conditions

The boundary conditions we suggest to implement in the barotropic implicit numerical scheme are
the same as specified in Section 6.1.3.1 ; e.g. clamped, specified transport and zero volume flux.

6.3

Testing the implicit scheme

Testing the implementation of the implicit scheme of the free surface as planned in the concept
note is not straightforward. Mainly because the barotropic boundary conditions which are planned
to be implemented are not sufficient to test the code with respect to the test cases set up in the
previous version of COHERENS . Therefore, it should be a goal for future developments of the
code to implement all the boundary conditions necessary to run all the test cases. Also, it should
be foreseen to validate the model output with real-life data, a good example could be the Western
Scheldt. Moreover, it should be planned to test the implicit scheme with respect to accuracy,
increasing the time step.

6.4

Conclusions and outlook

The numerical framework within the implicit time discretization is described. We suggest to dis
cretize the governing equations with finite differences taking advantage of the spatial discretization

l/RA/11339/10.072/GVH
Version 1.0 31/01/2011

79

T H V IM D C -S o re s m a
i.s .m. K U L e u v e n , U G e n t, B M M e n W L B

U itb o u w n u m e rie k m o d e lin s tru m e n ta riu m


D e s ig n o f th e im p lic it s c h e m e in C O H E R E N S

schemes already present in COHERENS . In time, we use a semi-implicit method based on the
6 method. Furthermore, a framework to describe also the depth-integrated governing equations
implicit is suggested, taking advantage of the approach for the three-dimensional hydrodynam
ica! equations. Finally, boundary conditions which will be imposed at the open boundaries are
given. A primary list of boundary conditions is provided and also suggestions are made to further
interesting advancements.

l/RA/11339/10.072/GVH
V e rs io n 1.0 3 1 /0 1 /2 0 1 1

80

T H V IM D C -S o re s m a
i.s .m. K U L e u v e n , U G e n t, B M M e n W L B

Chapter 7
Impact on current users/modules

7.1

Introduction

In this chapter, the consequences of the transformation of the existing explicit COHERENS code to
an implicit code will be discussed. In this part, the discussion will be directed at current and future
subtasks in the project. For the different subtasks that are or will be performed, the consequences
of the implicit code will be discussed.

7.2

Suspended sedim ent transport module

The suspended sediment transport module will calculate suspended sediment transport in the
form of sediment concentrations using the scalar advection diffusion module. As discussed be
fore, it is necessary that the scalar transport module is made implicit in order to be able to use
a sufficiently large time step. Apart from the stability of the advection and diffusion terms, which
will be made implicit, the stability of the advection-diffusion equation depends on the implemen
tation of the source and sink terms. These source terms are used in two ways in the suspended
sediment transport module: as user defined sediment sources in order to simulate special situa
tions (such as dredging plumes) and in two-dimensional calculations to account for erosion and
deposition of sediment from the bed. In the implementation of these source terms, it is important
that the balances are calculated exactly, thus that no sediment is lost from the calculation. These
kind of losses are known to occur if certain types of implicit sink terms are used (such as the
quasi-implicit discretization of Patankar). However, for sediment transport the source terms that
are used near the bed have the form S = w s ( C eq - C ) for sand and similarly S = E - H { 9 d) w sC
. Thus they are linear functions of the sediment concentration. Considering this, it is proposed
to change the source term that is used in the solution of the advection diffusion equation. The
advection diffusion equation has the following form:
dtp

dtp

dtp

dtp

~dt = ~ Ul h : ~ Vl h j ~ W l h
d
+

tz-

dx

dtp
D

dx

dtp

h z z ~ D H

dy

dy

dtp

h ~ zz-D v

dz

+ S (x ,y ,z ,t)

dz
( 7 .1 )

It is advised that the source term is changed to the following form:


S (x , y, z, t ) = S 0(x, y, z, t ) + a ( x , y, z, t ) C

( 7 .2 )

This equation isstill linear in the variable C. Therefore, it can be included in thematrix that is
used to solve thisequation in an implicit solver without any extra work.Moreover, in thisway the
sediment transport can be solved implicitly without the need to Patankars method (which may
lead to errors in the sediment mass balance). Note that non-linear source terms in future routines
(such as the biology module) can still be solved using a combination of explicit and implicit by using
the correct linearisation (i.e a proper formulation of S 0 and a ) at the programmers discretion.

T H V IM D C -S o re s m a
i.s .m. K U L e u v e n , U G e n t, B M M e n W L B

7.3

U itb o u w n u m e rie k m o d e lin s tru m e n ta riu m


D e s ig n o f th e im p lic it s c h e m e in C O H E R E N S

Bed load module

The bed load module will be implement in COHERENS . In this module, equation for bed load or
total load will be implemented. This sediment transport equations are explicit algebraic relations,
in which the sediment transport rate depends on the calculated bed shear stresses as well as
on sediment parameters as grain size and sediment density, and on the bed slope. Since this
module only uses explicit equations, it will not have to use one of the already present modules
(such as scalar advection diffusion). The only input parameters to this module that are currently
present in the model are the bed shear stress and the bed elevation. Given the fact that only
explicit relations are used, there is no stability criterion on the calculated sediment transport rates.
Thus as longs as bed shear stresses remain available in the implicit code (at the same locations
as in the present code; U,V and C nodes)1, no effects of the implicit code on this module are to
be expected. Note that the availability of bed shear stresses is also required for the boundary
conditions in the suspended sediment transport module.

7.4

Bed m orphology module

The bed morphology module calculates changes in morphology due to the calculated sediment
transport (from the bed load and the suspended sediment transport module). This module only
uses the results of the two sediment transport modules as input, but is not directly using one of
the programmed numerical routines. In this way, there is no direct impact of the change to implicit
conditions on this module.
Morphological changes normally occur on much slower time scale than the hydrodynamic pro
cesses, and therefore a larger time step can be used. In the development of this module, it has
to be decided whether an implicit or an explicit scheme is used to calculate changes in the bed
morphology. If it is decided to use an implicit code, it would be advantageous if parts of the implicit
code used for the hydrodynamic equations (such as the matrix solvers) could be reused. There
fore, it is recommended to write the implicit code (when feasible) in a general and modular way,
(similar as is done in the current COHERENS code).

7.5

Bottom roughness module

It is the intension to extend COHERENS with a module in which the bed roughness is calculated
dynamically as function of the occurring flow conditions and sediment. In this way, the influence
of the occurrence of bed forms (such as ripples and dunes) under varying flow conditions can
be simulated. In general this is done by calculating the bed form dimensions as function of the
sediment characteristics and the calculated flow field. From this bed form dimensions, a new
roughness predictor is calculated, which is used to update the flow field.
In principal, the bottom roughness module can be implemented separately, using input from the
sediment transport and flow modules. In this way, it can serve independently from the fact whether
or not the code used to solve the flow and sediment transport is implicit or explicit. It might however
be necessary to include an iteration loop in the above process of determining the roughness as
function of the flow depth, in case large time steps are used. This has to be considered during
the implementation of this module, and hence it is at present not influencing the development of
the implicit code.

7.6

Fluid-mud module

A fluid mud module is currently being developed at the KU Leuven. This module will simulate the
near bed processes on the basis of a low Reynolds number k-e model. It is the intention to use this
module in COHERENS when it is finished. Then, it will provide bed load rates, as well as near bed
1it is currently intended to com pute the bed load at the U and V nodes. However, it might be necessary for computational
stability of the m orphology m odule to evaluate this at the C nodes

l/RA/11339/10.072/GVH
V e rs io n 1.0 3 1 /0 1 /2 0 1 1

82

T H V IM D C -S o re s m a
i.s .m. K U L e u v e n , U G e n t, B M M e n W L B

U itb o u w n u m e rie k m o d e lin s tru m e n ta riu m


D e s ig n o f th e im p lic it s c h e m e in C O H E R E N S

boundary conditions for sediment concentration and flow velocity. Thus when it is implemented,
this will lead to some additional near bed boundary conditions that need to be implemented.
It seems that the implementation of the fluid mud module might be influenced. The precise con
sequences cannot be assessed at this moment, because they depend on the precise form that
these boundary conditions take. It may be possible that additional implicit near bed boundary
conditions will have to be coded during the implementation of the fluid-mud module.

7.7

Sand-mud mixtures and consolidation

This module simulates processes that occur within the bed. On the one hand the erosion of sandmud mixtures is calculated, which is influenced by the composition of the bed. Therefore, it must
solve the mixture of sand and mud within the bed. On the other hand, consolidation of mud or
sand mud mixtures in calculated.
Because both these processes occur within the bed, no direct influence of the change from explicit
to implicit code is to be expected for this module.

7.8

Verification procedure

For completeness, the verification procedure is discussed here. In this subtask, a set is scripts is
used that can be used to automatically verify the distributed COFIERENS model. This script runs
the existing test cases that are distributed with COFIERENS and produces a report in which the
results are compared to those from a reference version. Thus in this way, it is verified that the
results of COHERENS are consistent with previous versions and no bugs have entered the new
version of the COHERENS code.
There are no direct consequences of the implicit code on the procedures that are developed for
the verification procedure. However, once the implicit code is working, this extensions should be
included in the automatic verification procedure (as should happen for all the new functionalities
that are currently developed in COHERENS ). To this end, some minor modifications to the existing
test cases might be necessary. Examples could be the use of different switches or the inclusion of
an extra run with a larger time step. In case new tests are developed for validation or verification of
the implicit module, these should be included in the test bank used for the verification procedure.

7.9

Central input file facility

The central input file strategy (CIF) is a new functionality in COHERENS aimed to deliver input to
the program outside the source code. The input in the current version of COHERENS takes place
through a set of UsrdeLfiles where input information such as flags, parameters, files and even the
read/write routines are hard coded.
The data in the enhanced version of COHERENS (with CIF) can be introduced to the program
by means of data located in external files and not in the code. These files contain the flags,
parameters, and filenames refering to more information. Therefore, the operation of recompiling
the source to modify the input data is no longer required. However, in order to allow backward
compatibility with the current version, the use of UsrdeLfiles is still possible.
Since the CIF facility focuses on the management of input and output data (performing computa
tions outside the numerical subroutines), it is expected that further enhancements to the COHE
RENS code will add more data to be managed. Thus, the implementation of an implicit numerical
scheme will generate additional data such as flags, switches or parameters, which have to be
supplied by the user.
Taking into account the conclusions and recommendations pointed out in the review of the code,
the explicit numerical scheme should be implemented as an independent module, apart from the
subroutines of the explicit scheme. For this purpose, a by pass technique should be imple
mented within the time loop. Therefore, the selection of the numerical scheme falls in the users
criteria. This selection can be performed by the addition of a switch or flag to choose the neces
sary scheme. Moreover, considering the feasibility that more than one implicit scheme would be
l/RA/11339/10.072/GVH
V e rs io n 1.0 3 1 /0 1 /2 0 1 1

83

T H V IM D C -S o re s m a

U itb o u w n u m e rie k m o d e lin s tru m e n ta riu m

i.s .m. K U L e u v e n , U G e n t, B M M e n W L B

D e s ig n o f th e im p lic it s c h e m e in C O H E R E N S

implemented, the selection switch should be able to choose among the explicit and the implicit
schemes. A preliminar example is presented below:
Selection of numerical scheme
iopt_num_scheme = 0
! 0 = explicit numerical scheme
! 1 = implicit numerical scheme N1
! 2 = implicit numerical scheme N2

On the other hand, depending on the implicit scheme to be implemented, it is expected that
additional input should be defined, such as coefficients and/or parameters. Moreover, following
the current structure of COHERENS , several switches can be defined by the user in order to
setup the solution of the numerical scheme: 2D or 3D model, neglect of diffusion, deactivation of
Coriolis, etc. Thus, it is advisable that the implementation of the implicit scheme follows as much
as possible the same structure and the use of the same switches.
Finally, as a conclusion, the new input datashould be listed anddescribed in detail in order
to facilitate the modifications in the Cl F code.Nevertheless, theCl F facility is able toreceive
additional data due to further enhancements to the code.

7.10

Inundation schem es

In the framework of subtask 10, the current drying/wetting scheme of COHERENS has been
enhanced with alternative drying/wetting schemes with a dynamic framework. Therefore, COHE
RENS will be able to simulate flooding processes where grid cells of the computational domain
will become wet/dry in a dynamic way.
The current structure of COHERENS considers two main points: the definition of coastal bounda
ries and the drying/wetting process. Coastal boundaries are defined by the application of mask
functions (nodeatc). They are applied to grid cells in order to determine if they are wet or dry.
Thus, dry cells are removed from the computational domain because they are considered as land
cells. Following, the drying/wetting process in the current version of COHERENS does not con
sider the movement of coastal boundaries and makes use of an alpha factor for the solution of the
momentum equations. This factor is described below.
The alpha factor is a multiplying factor applied to some terms of the momentum equations:

Q-w d ( D f t

S A h

(7.3)

S D h )

This factor is equal to unity in regions where a critical water depth is exceeded, and approaches
to zero, tending to a minimum water depth. The multiplying factor is defined by:
&wd

n ic i'X [n iin (

1,

II

d m in ) / ( d crit

dm in

)? 0 ]

(7.4)

This artifice is applied when water depths aproach to zero. Therefore, it is advisable to apply
this factor in the same maner as for the explicit scheme. Likewise, further problems related to
excessive drying processes can be avoided.
The inundation schemes (with a dynamic framework) implemented in COHERENS make use of
the arrays and variables already recognized by COHERENS . All of these variables are initialized
l/RA/11339/10.072/GVH
V e rs io n 1.0 3 1 /0 1 /2 0 1 1

84

T H V IM D C -S o re s m a
i.s .m. K U L e u v e n , U G e n t, B M M e n W L B

U itb o u w n u m e rie k m o d e lin s tru m e n ta riu m


D e s ig n o f th e im p lic it s c h e m e in C O H E R E N S

at the beginning of the simulation, outside the time loop. Therefore, further implementations of
new numerical schemes have to make use of the arrays and variables that have been initialized
and are recognized as standard COHERENS variables.
The mask function nodeatc is used in all the subroutines related to the solution of the hydrody
namic equations. The status of grid cells is constantly verified by the use of the mentioned mask
function. Then dry grid cells are removed from the solution of the equations. As a consequence,
the implementation of the implicit numerical scheme should make use of the mask function and
make the same verification of the status of grid cells. This action will ensure that the implemented
numerical scheme is backward compatible.
Furthermore, the inundation scheme makes use of the previously described mask function. The
current version of COHERENS defines mask functions only once at the beggining of the simulation
and outside the time loop. Therefore, to turn the mask function into a dynamic one, it is redefined
after each time step, based on the updated status of grid cells. Then, it is possible to simulate
flooding processes with varying coastal boundaries. Moreover, this dynamic mask function is
defined in two different places in the code, depending if the simulation is 2D or 3D (mode splitting).
Thus, the implementation of an implicit numerical scheme by the by pass technique, will have an
impact on this dynamic mask function. It is advisable that the update of this function takes place
after each time step, once the status of the grid cells has changed.
Finally, the new drying and wetting scheme makes use of the same definitions of open boundaries,
since these arrays and variables are initialized before the time loop. It is advisable to use the same
arrays and variables for the implementation of the implicit scheme.

7.11

Structures module

The implementation of structures in COHERENS is foreseen to be developed in subtask 11, with


the aim to simulate the presence of structures in river and coastal water applications. Therefore,
users of COHERENS will be able to schematize structures as follows:
thin dams
dry points
current deflecting walls
discharges
others
It is foreseen that the implementation of structures would make use of boundary conditions already
defined in COHERENS , where the current version contains 14 types of open boundary conditions.
Therefore, a preliminary design of the further implementation, considers the possibility to use
two of the boundary conditions of COHERENS , being them: zero volume flux and specified
transport. It is necessary to mention that during the development of the mentioned subtask, it
would be possible to modify the list of boundary conditions.
On the other hand, the implementation of the implicit numerical scheme could redefine the use of
the current types of boundary conditions, as will be clarified during the implementation process.
Therefore, it is advisable that further discussions and research will be arranged in order to assure
a compatibility between the two subtasks.

l/RA/11339/10.072/GVH
V e rs io n 1.0 3 1 /0 1 /2 0 1 1

85

T H V IM D C -S o re s m a
i.s .m. K U L e u v e n , U G e n t, B M M e n W L B

l/RA/11339/10.072/GVH
V e rs io n 1.0 3 1 /0 1 /2 0 1 1

U itb o u w n u m e rie k m o d e lin s tru m e n ta riu m


D e s ig n o f th e im p lic it s c h e m e in C O H E R E N S

86

T H V IM D C -S o re s m a
i.s .m. K U L e u v e n , U G e n t, B M M e n W L B

Chapter 8
Conclusions and outlook

In this report the process which lead to the numerical framework within we intend to develop an
implicit hydrodynamica! code is discussed. This process consists of the following steps:
1. An overview of the state-of-the-art physical and numerical description of the flow field in
oceans, coastal zones and estuaries. Three main physical approximations have been iden
tified: Boussinesq, traditional and hydrostatic approximations; and their limitations are des
cribed. Numerically, two main approaches are found to solve the equations describing the
hydrodynamics; i.e. with iterative methods and using an Alternating Direction Implicit (ADI)
approach. A list of the approaches and methods used in presently available models is pre
sented.
2. A discussion of the numerical schemes presently used in COHERENS is provided. In par
ticular, an outline of the physical approximations and the numerical approach considered in
the current version of COHERENS is presented. Suggestions towards the implicit imple
mentation, taking into account the present code are put forward and the computational gain
of the possibilities is quantified.
3. A first decision step, in which the abundance of numerical and physical modeling possibilities
is narrowed down, is described. This part motivates the approach to apply also the hydro
static approximation, next to the Boussinesq and traditional approximations. Furthermore,
it is decided that the model will solve the three-dimensional flow field (without the modesplitting approach) on a structured grid. Finally, we motivate the use of iterative methods to
solve numerically the flow field as this method appears to allow an easier parallelization of
the code and seems more efficient. Also, for our applications, the method seems sufficiently
accurate and robust.
4. An overview of the code implementation in COHERENS is presented as a guide for the
upcoming implicit implementation. This part describes the general structure up to the details
of specific routines, leading to recommendations and pointing out some pitfalls which should
be avoided.
5. The numerical framework in which the code will be developed is described in detail. In
particular, the temporal and spatial discretization schemes of each term are addressed;
and a detailed outline of the numerical semi-implicit scheme is provided. We suggest to
discretize the governing equations with finite differences taking advantage of the spatial
discretization schemes already present in COHERENS . Finally, the boundary conditions
that we intend to implement are listed.
6. In a final part, we describe the consequences of the implementation of the implicit scheme
for the current users/modules.
During the writing of this report several issues were encountered which we list as essential addi
tions to the present task or appealing challenges for future development of the numerical code (in
order of priority):

T H V IM D C -S o re s m a
i.s .m. K U L e u v e n , U G e n t, B M M e n W L B

U itb o u w n u m e rie k m o d e lin s tru m e n ta riu m


D e s ig n o f th e im p lic it s c h e m e in C O H E R E N S

1. Several interesting boundary conditions have been listed which are not scheduled to be
implemented within the current subtask. It should be investigated if the implementation of
these boundary conditions can be included in the present task.
2. An evaluation of the performance of the present code with respect to the implicit code ap
pears a necessary task. It should be investigated if an evaluation based on the available
test cases in COHERENS can be included in the present task.
3. The present scheme foresees to consider horizontal advection terms explicitly. Although this
does not yield a severe global time step restriction, locally, this approach could be restrictive.
In order to solve this, we suggest to implement the scheme proposed by Kramer & Stelling
(2008). It should be investigated if the implementation of the (partly) implicit horizontal
advection terms, as well as the implicit treatment of the horizontal advection/diffusion terms
in the scalar transport equations, can be included in the present task.
4. The application of the hydrostatic approximation on the dynamics of bedforms should be
investigated and the limitations of this approximation should be quantified. Based on this
analysis, it could be interesting to extend the present approach with a non-hydrostatic coun
terpart.
5. The parallelization of the code falls beyond the scope of the present code development.
Nevertheless, we expect that a significant additional computational gain could be achieved
by implementing schemes which allow the code to run in parallel. Therefore this point seems
a key prospective task.
6. The influence of short waves on the flow field seems an interesting prospective.
7. For future developments, the implementation of the possibility to run the code with a nonorthogonal grid is an attractive goal.

l/RA/11339/10.072/GVH
V e rs io n 1.0 3 1 /0 1 /2 0 1 1

88

T H V IM D C -S o re s m a
i.s .m. K U L e u v e n , U G e n t, B M M e n W L B

Bibliography

Adcroft, A., Chris, H., & Marschall, J. 1997. Representation of topography by shaved cells in a
height coordinate ocean model. Month. Weather Rev., 125, 2293-2315.
Antuono, M., Liapidevski, V., & Brocchini, M. 2008. Dispersive Nonlinear Shallow-Water Equa
tions. Stud. Appli. Math., 122, 1-28.
Blumberg, A .F., & Melior, G.L. 1987. A description of a three-dimensional coastal ocean circulation
model. In: Heaps, N.S. (ed), Three dimensional coastal ocean models.
Booij, N., Ris, R.C., & Holthuijsen, L.H. 1999. A third-generation wave model for coastal regions.
Part 1, Model description and validation. J. Geophys. Res., 104, 7649-7666.
Brocchini, M., & Dodd, N. 2008. Nonlinear Shallow Water Equation Modeling for Coastal Engi
neering. J. WPCO. Eng., 104.
Burchard, H., Bolding, K., & Villarreal, M.R. 2004. Three-dimensional modelling of estuarine
turbidity maxima in a tidal estuary. Ocean Dynamics, 54(2), 250-265.
Casulli, V. 1999. A semi-implicit finite difference method for non-hydrostatic, free-surface flows.
Int. J. Num. Meth. Fluids, 30.
Casulli, V., & Cattani, E. 1994. Stability, accuracy and efficiency of a semi-implicit method for
three-dimensional shallow water flow. Comput. Math. Appl., 27, 99 - 112.
Casulli, V., & Cheng, R.T. 1992. Semi-implicit finite difference methods for three-dimensional
shallow water flow. Int. J. Numer. Methods Fluids, 15, 629 - 648.
Chen, C., Liu, H., & Beardsley, R.C. 2003a. An Unstructured Grid, Finite-Volume, ThreeDimensional, Primitive Equations Ocean Model: Application to Coastal Ocean and Estuaries.
Journal of Atmospheric and Oceanic Technology, 159 - 186.
Chen, C., Haosheng, H., Beardsley, R.C., Liu, H., Xu, Q., & Cowles, G. 2007. A finite volume
numerical approach for coastal ocean circulation studies: Comparisons with finite difference
models. J. Geophys. Res., 112.
Chen, Changsheng, Liu, Hedong, & Beardsley, Robert C. 2003b. An Unstructured Grid, FiniteVolume, Three-Dimensional, Primitive Equations Ocean Model: Application to Coastal Ocean
and Estuaries. Journal of Atmospheric and Oceanic Technology, 20(1), 159-186.
Chen, Q., Kirby, J.T., Dalrymple, R.A., Shi, F., & Thornton, E.B. 2003c. Boussinesq modeling of
longshore currents. J. Geophys. Res., 108.
Deleersnijder, E. 1993. Numerical mass conservation in a free-surface sigma coordinate marine
model with mode splitting. Journal of Marine Systems, 4(5), 365-370.
Ford, R., Pain, C.C., Goddard, A.J.H., de Oliveira, C.R.E., & Umpleby, A.P. 2004. A Nonhy
drostatic Finite-Element Model for Three-Dimensional Stratified Oceanic Flows. Part 1: Model
Formulation. Mon. Wea. Rev., 132, 2 81 6 -2 8 3 1 .
Fringer, O.B., Gerritsen, M., & Street, R.L. 2006. An unstructered-grid, finite-volume, nonhydro
static, parallel coastal ocean simulator. Ocean Modelling, 14, 139-137.

T H V IM D C -S o re s m a
i.s .m. K U L e u v e n , U G e n t, B M M e n W L B

U itb o u w n u m e rie k m o d e lin s tru m e n ta riu m


D e s ig n o f th e im p lic it s c h e m e in C O H E R E N S

Haas, K. A., & Warner, J. C. 2009. Comparing a quasi-3D to a full 3D nearshore circulation model:
SHORECIRC and ROMS. Ocean Modelling, 26, 91-103.
Haas, K. A., Svendsen, I. A., Haller, M. C., & Zhao, Q. 2003. Quasi-three-dimensional modeling
of rip current systems. J. Geophys. Res., 108, doi:10.1029/2002JC001355. C73217.
Haidvogel, D. B., Arango, H., Budgell, W.P., Cornuelle, B.D., Curchitser, E., Lorenzo, E. D., Fennel,
K., Geyer, W.R., Hermann, A.J., Lanerolle, L., Levin, J., McWilliams, J. C., Miller, A.J., Moore,
A.M., Powell, T.M., Shchepetkin, A.F., Sherwood, C.R., Signell, R.P., Warner, J.C., & Wilkin, J.
2008. Ocean forecasting in terrain-following coordinates: formulation and skill assessment of
the Regional Ocean Modeling System. J. Comput. Phys., 227, 3595-3624.
Housman, J., Kiris, C., & Kwak, D. 2004. Comparison of artificial comprssibility methods. Comp.
Fluid Dynamics, 13, 483-488.
Kamenkovich, V.M., & Nechaev, D.A. 2009. On the time-splitting scheme used in the Princeton
Ocean Model. J. Comput. Phys., 228, 2874-2905.
Kanarska, Y., & Maderich, V. 2003. A non-hydrostatic numerical model for calculating free-surfac
stratified flows. Ocean Dynamics, 53, 176-185.
Kirby, J.T., & Dalrymple, R.A. 1994. A parabolic equation for the combined rfraction-diffraction of
stokes waves by mildly varying topography. J. Fluid Mech., 136, 453-466.
Kowalik, Z., & Murty, T. S. 1993. Numerical modeling of ocean dynamics.
Kramer, S. C., & Stelling, G. S. 2008. A conservative unstructured scheme for rapidly varied flows.
International Journal for Numerical Methods in Fluids, 58, 183-212.
Labeur, R. J., & Pietrzak, J. D. 2005. A fully three dimensional unstructured grid non-hydrostatic
finite element coastal model. Ocean Modelling, 10, 51-67.
Longuet-Higgins, M.S., & Stewart, R.W. 1962. Radiation stress and mass transport in gravity
waves with applications to surf-beats. J. Fluid Mech., 8, 565-583.
Longuet-Higgins, M.S., & Stewart, R.W. 1964. Radiation stress in water waves, a physical discus
sion with application. Deep Sea Research, 11, 529-563.
Luyten, P. 2009. Coherens version 2, user manual (in prep.).
Luyten, P., Jones, E., Proctor, R., Tabor, A., Tett, P., & Wild-Allen, K. 1999a. Coherens, a coupled
hydrodynamical-ecological model for regional and shelf seas. MAS3-CT97-0088, pp914.
Luyten, P.J., Jones, J.E., Proctor, R., Tabor, A., Tett, P., & Wild-Allen, K. 1999b. COHERENS - A
Coupled Hydrodynamical-Ecological Model for Regional and Shelf Seas: User Documentation.
Page 991 of: MUMM Report.
Marschall, J., Hill, C., Perelman, L., & Adcroft, A. 1997. Hydrostatic, quasi-hydrostatic, and non
hydrostatic ocean modelling. J. of Geophys. Res., 102, 5733-5752.
Marshall, J., & Adcroft, A. 2004. Lecture notes on Atmospheric and oceanic modelling. Massachusetss Institute of Technology.
Norbury, J., & Cullen, M.J.P. 1985. A note on the properties of the hydrostatic equations of motion.
Q. J. R. Meteoro!. Soc., 111,1135-1137.
Pedlosky, J. 1979. Geophysical Fluid Dynamics.
Shewchuk, J. R. 1994. An introduction to the conjugate gradient method without the agonizing
pain. Tech. rept. School of Computer science, Carnegie Mellon University.
Svendsen, I. A. 2006. Introduction to nearshore hydrodynamics. World Scientific, Singapore.
l/RA/11339/10.072/GVH
V e rs io n 1.0 3 1 /0 1 /2 0 1 1

90

T H V IM D C -S o re s m a
i.s .m. K U L e u v e n , U G e n t, B M M e n W L B

U itb o u w n u m e rie k m o d e lin s tru m e n ta riu m


D e s ig n o f th e im p lic it s c h e m e in C O H E R E N S

THV IMDC - Soresma. 2009. Uitbouw numeriek modelinstrument voor de Noordzeehavens Deelrapport 1 - Aanvangsstrategie, opgesteld voor afdeling Maritieme Toegang, Departement
Mobiliteit en Openbare Werken, Vlaamse Overheid, l/RA/11339/09.059/GVH, september 2009.
Van Lancker, V.R.M., Du Four, I., Degraer, S., Fettweis, M., Francken, F., Van den Eynde, D.,
Devolder, M., Luyten, P., Monbaliu, J., Toorman, E., Portilla, J., Ullmann, A., Verwaest, T.,
Janssens, J., Vanlede, J., Vincx, M., Rabaut, M., Houziaux, J.S., Mallaerts, T., Vandenberghe,
H., Zeelmaekers, E., & Gttin., A. 2009. Quantification of Erosion/Sedimentation patterns
to Trace the natural versus anthropogenic sediment dynamics Q U E S T 4 D Tech. rept. Final
Report Phase 1. Brussels: Belgian Science Policy. 135 pp.
Warner, J. C., Sherwood, C. R., Signell, R.P., Harris, C. K., & Arango, H.G. 2008. Development of a
three-dimensional, regional, coupled wave, current, and sediment-transport model. Computers
and geosciences, 34, 1284-1306.
Wesseling, P. 2001. Principles of computational fluid dynamics. Springer Verlag.
White, A.A., & Bromley, R. A. 1995. Dynamically consistent, quasi-hydrostatic equations for global
models with a complete representation of the Coriolis force. Q. J. R. Meteoro!. Soc., 121, 3 99418.
Zhang, Y., & Baptista, A. M. 2008. SELFE: A semi-implicit Eulerian-Lagrangian finite-element
model for cross-scale ocean circulation. Ocean Modelling, 21, 71-96.
Zijlema, M., & Stelling, G. S. 2005. Further experiences with computing non-hydrostatic freesurface flows involving water waves. International Journal for Numerical Methods in Fluids, 48,
169-197.

l/RA/11339/10.072/GVH
V e rs io n 1.0 3 1 /0 1 /2 0 1 1

91

T H V IM D C -S o resm a
in coi. w ith KU Leuven, UG ent, BM M en W LB

l/R A/11339/10.072/GVH
V e rs io n 2 .0 0 9 /0 8 /2 0 1 2

E xpansion of num erical m odeling tools


Task ord er 4: Design of th e im plicit schem e in C O H E R E N S

23 6

T H V IM D C -S o re s m a
in c o i. w ith KU L e u v e n , U G e n t, B M M en W L B

Appendix G
Note on hydrodynamic algorithm

COHERENS
A C o u p le d H y d ro d y n a m ic a l-E c o lo g ic a l M o d e l
fo r R e g io n a l an d S h e lf Seas

H y d ro d y n a m ic A lg o r ith m O v e rv ie w

V e rs io n 2.0, M a r c h 2011

P ieter Rauwoens

G hent University
Faculty of Engineering and A rchitecture
D epartm ent of Civil Engineering
Division of Roads, Bridges and C oastal Engineering
Technology P ark C am pus Ardoyen, Building 904
B-9052 G hent, Belgium

C o n ten ts

A lg o r it h m O v e r v ie w

1.1
1.2
1.3

Governing Equations
One Step Algorithm
Iterative algorithm

CO NTEN TS

C h a p te r 1
A lg o rith m O v e rv ie w
1.1

G overnin g E q u ation s

In the implicit version of the algorithm , the following equations are to to be


solved:
d_
U
i _

dV

dx

dy

dt.
du

dv

dx + +

1 dh-su
h*

dt.

du
u. t
dx

du
dy

dw

+ dz
du.
w zr~
dz

0,

( 1.1)

0,

( 1.2)

d P,a t m

po

dx

dx

<9Rl

<9R12

<9R1 3

dy

dz

dx
Po
+211 sin ((p) V,

dh-sv

hs

dt.

dv
udx

dv
dy

d_
- i i i
bdz
dx

d(

g + /

(1.3)

dv
r\

po d y
1 <9R.21

dz

Po
2 Q

dx

sin ((p) u,

r\

dy

'

+
/V
dy Jz
I

d R 22

<9R.23

dy

dz

(1.4)

w ith U and V the depth-integrated velocities. Since tim e step is restricted


by the characteristic speed, the purose is to be able to increase the tim e step
by treating the term s related to the gravity wave implicitly. This is done
by treating the term s in ( implicitly. In a second phase, one can eliminate
the tim e step restriction related to the current speed by also treatin g the
advection (and diffusion) term s implicitly. This is standardly done for the
vertical components, however not for the horizontal components. The exact
3

CHAPTER 1. A LG O R ITH M OVERVIEW

treatm ent of the advection and diffusion term s (implicit or explicit), however,
does not interfere w ith the algorithm described in the present document
(apart from a possible higher am ount of sub-iterations needed).

1.2

O ne S tep A lg o rith m

By introducing the notations A d v Q and D i f ( ) for the advective and diffusive


term s, and by denoting all source term s, exept those related to ( , by S), the
equations can formally be w ritten as:
d(

dU

dV

d t + d + ~S
du

dv

dw

T V lh , + x =
h m3

'

(L 6 )

A d v (u, v, w )

D i f ( u , V, w )

S)

gj -9^x- ,,

(1.7)

A dv(u,v,w )

+'

D i f ( u , V, w )

SQ

U Q y

(1.8)

V/

Semi-discretizing the equations (in tim e only), one can w rite w ith super
scripts n and n + 1 for the old an new tim e level respectively:
+i _

d U n+l

d V n+l

dx

dy

d u n+1

d v n+1

d w n+1

dx

dy

dz

At

h%

0,

(1.9)

0,

( 1.10)

7) + 1 ? /ra+ 1 h n n n

.--------------- = A d v { u n , v n, w n , un+1 )
At
v
;
+ D i f ( u n , v n , w n , u n+1)
h n+1

r ! t n+ l

+s<>- V 9V 1

/ ) + 1 7ira + 1 _

(lu)

h n 71

ffd l)(t/ra,Dra,u:ra,l)ra+1)
v
;

+>*(", u ",w n,u n+1)


h n+1

r ! t n+ l

(1 1 2 )

From this notation, we clearly see th a t equation 1.10 decouples from the
other equations and merely serves as a post-processing step to evaluate the

1.2. ONE STEP A LG O R ITH M

vertical velocity component after each tim e step. Equations 1.9, 1.11, 1.12
can be decoupled by introducing th e free surface correction
C

C +1 - C .

(1-13)

and the equations 1.11, 1.12 can be solved in a predictor-corrector fashion.


First a prediction is made, using the known values:
1

h%u* -

h%un

at

A d v(u n, vn, w n ,u*)


+ D i f ( u n ,v n, w n,u*)

hn t n

+ s - h 9W -

h%v* -

h%

h%vn

T~

( 1 - 1 4 )

A d v(u n,v n, w n ,v*)


+ D i f ( u n ,v n, w n,v*)

hn t n

(U 5 )

+ s { ) ~ T k 9W

after which, by assuming knowlegde of the free surface correction, the pre
dicted values are corrected:
m +1u n+1 = E X

(1.16)

h n + i v n+1 = h l v * -

(1.17)

h s+1g ^ j .

The values for ( ' follow from inversion of the elliptic equation th a t arises by
introducing 1.16 and 1.17 into the 2D continuity equation 1.9, yielding:
('
k
At.

dU*

dV*

dx

dy

dx \

dC \
dx J

The one-step algorithm obtained is summarized as follows:


for ntimesteps do:
u-predictor

(eq.

1.14)

v-predictor

(eq.

1.15)

solve free surface correction (eq.


u-corrector

(eq.

1.16)

v-corrector

(eq.

1.17)

end do

dC \

+ hd-y \ ^ 7 7 d7y

1.18)

(1-18)

CHAPTER 1. A LG O R ITH M OVERVIEW

A num ber of secondary errors have been introduced by this algorithm , which
can be im portant or not:

1.

has been retained at the old tim e level in the build-up of the elliptic
equation, here, h+1 m ust be used, which is not known yet, because
dependent on ,
hs

2. the implicit advection and diffusion term s in the predictor equation are
calculated w ith the old (-value. It is doubtful w hether this approach
is valid, since the values of the free surface change more rapidly (due
to characteristic wave speed) th a n the currents themselves. Schemes
th a t include this dependency up to a cerain level are, am oungst others,
SIM PLE, SIM PLEC, SIM PLER, and - for transient sim ulations - PISO
or PIM PLE.

The two remarks m ade above indicate the urge of an iterative procedure to
tackle the problem. This will be the subject of the next section.

1.3

Itera tiv e algo rith m

As explained in the previous section, because of th e nonlinear dependency of


the equations on the free surface hight, there is a need for extra iterations. In
this section, a possible solution strategy is presented. We chose to retain the
free surface height H at the old iteration value. By doing this, the equaitons
are thought to be solved on a fixed com putational mesh. After each iteration
step, the mesh is adjusted, according to th e newly calculated free surface
height.
For clarity, we introduce a new superscript, indicating the iteration level. As
such, (pn+ l 'lt+ l i denotes the value of variable (p M the new tim e step n + 1,
obtained after perform ing iteration it.
At a certain iteration level, the following equations are solved. The predictor

1.3. IT E R A T IV E A LG O R ITH M
step uses the latest values for

and

1 /3+ M iu* - h%un

(:

A d v ( u n, v n , w n , u * )

At.

+ D i f ( u n,v n, w n,u*)
+ S ()

1 /3+mV -

h%v

tis+1M

d ( n+1M

h%

dx

----- -, ------ o+ -----

(1 19)

A d v { u n, v n , w n , v * )

T~

+ D i f ( u n,v n, w n,v*)
+ S ()

The free surface correction

('

hn
+1'a d C +1M

-----^------ o+ ----
+
dy

( 1.20)

is now redefined as:

7_
_7i+l,it+l _
_7i+l,

( 1.21)

so th a t the predicted velocity values are corrected as:


i n + l . t + l n + l . t + l __ i n + l . t * _
ft3
a

a
7i+l,+l n+lj+l

"-3

i n + l.it+ l
113
y

( 1.22)

7
ra
+
M
*_ 7
n+l,H
-l

' *'3

"'3

(1.23)

dy"1

w ith
^7+l,+l

R n-\-l,it _
|_ t

(1.24)

p m + l,it + l
7

7 7 + l,+ l

and

7 + 1 ,

R n + lM

(1.25)

obtained from inversion of the elliptic equation


A 7 7 + M

A /7

-------------------

At.

)[/*

y /

At.
9

dx

f/*
1------------------ =

dy

..rr n + U t9 C \

ox \

ox J

f T j n + l , d <'

oy \

The iterative algorithm then consists of the following steps:


for ntimesteps do:
n = n

7
1
+
1
,it

+ 1

Oy

(1.26)

CHAPTER 1. A LG O R ITH M OVERVIEW

8
jjn + l, it

1 1 l

in + l,it

''3

for niterations do:


it = it

+ 1

u-predictor

(eq. 1.19)

v-predictor

(eq. 1.20)

solve free surface correction (eq.

^/ra+l.+l

jjn + l, it
7 ' + 1 . + 1

h 3

1.26)

^ra+l. _|_

_ |_

f j n + l,it + l j f
H n + 1 ,it
h

i +

/
1

,it

u-corrector

(eq. 1.22)

v-corrector

(eq. 1.23)

if(converged) return
end do
yU

y 'n + 1

u n + l,it+ l

v 'n + l,it+ l
jjn -\-l,it+ l

h3 + 1
^ ra + 1

K +hit+1
n + l,it+ l

end do

Despite the rationalism of the above algorithm , it is implem ented differently,


although yielding the same result. The m ain reasons for th e different imple
m entation are the application of the three dimensional boundary conditions
and the use of the routines already available in COHERENS for the modesplitting. The m ain difference is in the corrector step: the 3D velocity is not
corrected directly with the free surface correction, as in 1.22. The correction
is done by adjusting the depth integrated m ean of the velocity to the 2D ve
locities, corrected w ith the free surface correction. As this is only im portant
at program m ing level and it does not interfere w ith the user, the details op
im plem entation are not described here.
A convergence check is proposed by comparing the norm of ( ' w ith a treshold
value e: ((('H < e.

T H V IM D C -S o resm a
in coi. w ith KU Leuven, UG ent, BM M en W LB

l/R A/11339/10.072/GVH
V e rs io n 2 .0 0 9 /0 8 /2 0 1 2

E xpansion of num erical m odeling tools


Task ord er 4: Design of th e im plicit schem e in C O H E R E N S

24 8

T H V IM D C -S o re s m a
in c o i. w ith KU L e u v e n , U G e n t, B M M en W L B

Appendix H
Report on meeting between Pieter Rauwoens and Patrick Luyten

UMDC

SORESMA
COHERENS II

VERSLAG :
Datum:
Aan:

Overleg Patrick Luyten - Pieter Rauwoens


23/03/2011

Gijsbert Van Holland (IMDC), Chantai Martens (aMT)

Auteur: Pieter Rauwoens (UGent) - Patrick Luyten (BMM)


Documentref:

Betreft : 11339 - Overleg Deeltaak 5: Impliciete code

Inhoudstafe

1. INLEIDING..........................................................................................................................................1
2. BESPREKING UITGEVOERDE IMPLEMENTATIE..................................................................... 1
2.1. HYDRODYNAMIC ALGORITHM OVERVIEW............................................................................1
2.2. IMPLEMENTATIE IMPLICIETE C O D E ....................................................................................... 1
2.3. BESLUIT......................................................................................................................................... 2
3. PORTABILITEIT................................................................................................................................2
3.1. PETSC............................................................................................................................................ 2
3.2. BESLUIT......................................................................................................................................... 2
4. ACTIEPUNTEN.................................................................................................................................2

1.INLEIDING
Deeltaak 5 betreft de omvorming van het in COHERENS aanwezige expliciete numerieke
oplossingsschema naar een impliciet schema, waarbij geacht wordt grote tijdsbesparingen te
kunnen realiseren in benodigde rekentijd.
Het voorliggende verslag betreft een neerslag van de discussie tussen Pieter Rauwoens
(UGent) en Patrick Luyten (BMM) dd. 23/03/2011. Hierbij werd het verrichte implementatiewerk
besproken, alsook nog eventueel te nemen stappen in de portabiliteit van de code.
2.BESPREKING UITGEVOERDE IMPLEMENTATIE
2.1 .Hydrodynamic algorithm overview
Het document "Hydrodynamic Algorithm Overview", P. Rauwoens, Maart 2011, beschrijft het
gemplementeerde algoritme en werd gebruikt ais leidraad bij het overlopen van de
implementatie.
2.2.Implementatie impliciete code
In de huidige implementatie werd getracht zoveel mogelijk routines uit de mode-splitting code te
behouden en te incorporeren in de impliciete code. Dit heeft geleid tot een aantal aanpassing in

THV IMDC - Soresma,


Coveliersstraat 15 - B 2600 Berchem (Antwerpen) tel. +32 3 270 92 95 - fax +32 3 235 67 11 - E-mail: info@ im dc.be

Hydrodynamic_Equations.F90. In hoofdzaak werd de 2d stepping uit de mode-splitting


vervangen
door
een
nieuwe
routine
correct_free_surf,
die
de
impliciete
2d
continuteitsvergelijking discretiseert en oplost. De oplossing van het bekomen stelsel zelf
gebeurt met PetSc, die aanroepen wordt via interface-routines, neergepend in
petsc_inversion.f90. De bundeling van PetSc-commando's in de laatst genoemde file maakt het
mogelijk vlug een aanpassing te maken aan de code indien het gebruik van een andere lineaire
solver gewenst is.
Een tweede reeks aanpassingen bevindt zich op het niveau van de randcondities. Eliertoe waren
aanpassingen nodig aan de reeds bestaande routines voor 2d randcondities aan open
boundaries, alsook het schrijven van een nieuwe routine open_boundary_conds_cont in
Open_Boundary_Conditions.f90. Tot op heden werden slechts een beperkt aantal randcondities
gemplementeerd en getest.
2.3.Besluit
De implementatie van de impliciete code is naar behoren uitgevoerd. Hier en daar is nog een
aanpassing nodig in het gebruik van een aantal switches. Patrick Luyten bekijkt de
geimplementeerde stukken in de komende maand nog ten gronde.
3.PORTABILITEIT
3.1 .PetSc
Een aantal wijzigingen in de makefile werden doorgevoerd door Pieter Rauwoens, teneinde een
afdoende koppeling met de PetSc bibliotheek te verzekeren. Daar deze wijzigingen beperkt
blijven in omvang, is het voor een gebruiker-installateur niet moeilijk deze koppeling ook effectief
te laten werken.
Indien het gebruik van PetSc niet mogelijk zou zijn, door de onmogelijkheid deze bibliotheek te
installeren op een externe rekenserver, bestaat de mogelijkheid de routines in
petsc_inversion.f90 te overschrijven met een zelf geprogrammeerde lineaire solver. Zulk een
aanpassing zou dan gebeuren door Patrick.
3.2.Besluit
De PetSc library kan behouden worden ais bibliotheek voor lineaire solvers. Een subtaak in
deeltaak 5 bestaat erin de makefile verder op punt te stellen voor een optimale
gebruiksvriendelijke installatie hiervan door de gebruiker-installateur.
4.ACTIEPUNTEN
Actie/omschrijving

te behandelen door

datum

controle implementatie

PLU

asap

verderzetten implementatie

PIR

conform planning
Dt5

aanpassing makefile

PIR

31/07

publiek maken document "Elydrodynamic


Algorithm Overview"

PIR

asap

T H V IM D C -S o resm a
in coi. w ith KU Leuven, UG ent, BM M en W LB

l/R A/11339/10.072/GVH
V e rs io n 2 .0 0 9 /0 8 /2 0 1 2

E xpansion of num erical m odeling tools


Task ord er 4: Design of th e im plicit schem e in C O H E R E N S

25 2

T H V IM D C -S o resm a
in coi. w ith KU Leuven, UG ent, BM M en W LB

Appendix I
Presentation on the Technical Workgroup

11/ 29/2011

UNIVERSITEIT
GENT

FACULTY OF ENGINEERING AND


ARCHITECTURE

Implementation of a semi-implicit
scheme in COHERENS
Pieter Rauwoens

T e chn isch e W e rk g ro e p C o h e re n s - P ie te r R a uw oe n s - 23/05/2011


F a cu lty o f E n g in e e rin g a n d A rc h ite c tu re - D e p a rtm e n t o f C ivil E ngineering

Scope of subtask 5
It is expected that there will be a large gain in CPU time
by solving the hydrodynamic equations implicitly
Time step restrictions:
convective:

A <
u

diffusive:

A f< ^ ^
2.V

\x
At < .
Jo"
internal gravity waves, ...
barotropic:

T e chn isch e W e rk g ro e p C o he re n s - P ie te r R a uw oens - 23/05/2011

11/ 29/2011

Scope of subtask 5
Two ways of handling the barotropic time step restriction:
MODE SPLITTING
solve 3d equations related to convective CFL-criterion
solve a number (F r1) of explicit 2d barotropic steps

SEMI-IMPLICIT TIME STEPPING


solve 3d equations related to convective CFL-criterion
solve 2d continuity equation once implicitly.

-> Semi-implicit method is more efficient for small Fr ?


(probably, b u t requires a m ore subtle a n sw e r...)

T e chn isch e W e rk g ro e p C o he re n s - P ie te r R a uw oens - 23/05/2011

UNIVERSITEIT
GENT

im .

&

FACULTY OF ENGINEERING AND


ARCHITECTURE

Overview
Scope of subtask 5
Mode splitting
Semi-implicit method (basic)
will sem i-im plicit m ethod y ie ld higher efficiency?

Semi-implicit method (specialist)


routines that changed, were added
expected issues when m erging with other subtasks

Progress of subtask 5
T e chn isch e W e rk g ro e p C o h e re n s - P ie te r R a uw oe n s - 23/05/2011
F a cu lty o f E n g in e e rin g a n d A rc h ite c tu re - D e p a rtm e n t o f C ivil E ngineering

11/ 29/2011

Mode splitting
Explicit time stepping scheme:
3d-equations:

du dv dw _
+ + =0
dx dy dz
J _dhy _ ^ (] v^u V'
h3 dt

+ Djff(u Viw) + S Q - g
dx

J dh^ _
h3 dt

+ iff(u V' vv) + 5Q _ g ^ dy

~\y
Integrated equations:

V'

+ V U = 0
= Adv(U) + Diff(U) + S - gHV
dt

, uNtNEMftsT

T e chn isch e W e rk g ro e p C o he re n s - P ie te r R a uw oens - 23/05/2011


F a cu lty o f E n g in e e rin g a n d A rc h ite c tu re - D e p a rtm e n t o f C ivil E ng in ee ring

Mode splitting - Implementation


in H y d r o d y n a m i c _ E q u a t i o n s .f 90:
c u r r e n t _ p r e d ()

(every #th time step)

solve 3d momentum equations


g_dhgj_ _

^ + Qiff(U'V'

+ 5Q_gdy_

h3 dt

dx

_1_
current_2d()

(always)

V' + Qiff(U iV i+ 5Q_g^i.

h3 dt

dy

solve 2d momentum and continuity equations


^ - +V 0 = 0
dt

c u r r e n t _ c o r r ()

(every #th time step)

d_
= Adv(U) + Diff(U) + S - gHV (
dt

rescale 3d velocity field to match 2d fields


apply 3d boundary conditions
calculate vertical velocity

dil
dx

dv
dy

dw _o
dz

T e chn isch e W e rk g ro e p C o he re n s - P ie te r R a uw oens - 23/05/2011

11/ 29/2011

Mode splitting - Issues


one has to define 2 time steps (2d and 3d)
tracking the free surface fronts in time is not of interest
gravitational timescale different from tidal period
mesh size different from wavelengths
difficulty of matching 2d flow with 3d flow
definition of 'filtered' velocity for scalar equations

T e chn isch e W e rk g ro e p C o he re n s - P ie te r R a uw oens - 23/05/2011

Semi-implicit scheme - Basic


Implicit treatment of free surface:
3d-equations:

+ + !^}L = o
dx dy <)z
1 d h 3U _ a ^ , , , , aA , n;ff
, ca <*
= Adv(u, V, w ) + Diff(u, V, i/i/) + SO - g
h3 dt
dx
J dhjV _
h3 dt

Integrated equations:

V'

+ iff(u V' vv) + 5Q _ g ^ dy

+ V U = 0
= Adv(U) + Diff(U) + S - ghNC
dt

T e chn isch e W e rk g ro e p C o he re n s - P ie te r R a uw oens - 23/05/2011

11/ 29/2011

Semi-implicit scheme - Algorithm


Semi-discretized equations:
1 hn+1//n+1 hnnn
7)/'n+^
3
3 = Adv(u, V, w) + Diff{u, V, w) + SQ ^ - g h"
At
h"
dx
_/?+1 ^

L.n+'\..n+'\ _

3----------------------------3
h"
At
y n +1 _

Adv(u, V, w) + Diff{u, V, w) + SQ -

h"

<)y

yn

i + V . L/n+1 = 0
At
dun+^ dvn+^ dwn+i n
+
+
= 0
dx
dy
dz

Equations can be decoupled:


3d continuity eqn: postprocessing step for vertical velocity
decoupling of 2d continuity from momentum by projection

un^

rweit

T e chn isch e W e rk g ro e p C o he re n s - P ie te r R a uw oens - 23/05/2011


F a cu lty o f E n g in e e rin g a n d A rc h ite c tu re - D e p a rtm e n t o f C ivil E ng in ee ring

Semi-implicit scheme - Algorithm


1.

predictor step: _1_

le 0 + SO

1 h* v* hnvn
3
3 - = Adv(u, V, w) + Diff(u, V, w) + S()
At

hi

yny1 ftn

2.

corrector step:. h

At

rim -1
- +. fVr L/n
+1 = 0

with L/n+1 = r Cu"+\d z


Jz=0
u

d f n+1
dx
f-n+l fn

= i f -A t.g
?

At
jM j

_
f I - At.gH.VTn+1) = 0
+i 7
V (( L/*

T e chn isch e W e rk g ro e p C o he re n s - P ie te r R a uw oens - 23/05/2011


F a cu lty o f E n g in e e rin g a n d A rc h ite c tu re - D e p a rtm e n t o f C ivil E ng in ee ring

11/ 29/2011

Semi-implicit scheme - Algorithm


Corrector step:
>>/?+1 yn
^

+ V (LT - At.gH.V J"n+1) = 0

<=> r +1 - (Af)2V (gH V C n+1) = Cn - Atv O'

-> requires iterative solver

Typical stencil (1 d) :

1
Fr2

1_
+ Fr2

Fr2

System is less diagonally dominant for small Fr.


And thus more difficult to solve
-> computational cost comparable to mode-splitting method?
Yes, if basic iterative so lve r is used (e.g. Jacobi, Gauss Seidel)
No, if we m ake use o f advanced linear algebra (Krylov solvers with
preconditioning)
y

710

Techn isch e W e rkg ro e p C ohe re n s - P ie te r Rauw oens - 23/05/2011

Semi-implicit vs. mode splitting algorithm


S

No need to distinguish between 2d and 3d time step

Interest only in:


changes in free surface height from tidal wave
transport of salinity and other scalars with 3d current
no interest in:
short gravity wave
-> no need to track them!

For low Fr (deep water), semi implicit method is expected to be


faster

For high Fr (=1), no difference in computing time is expected.

T e chn isch e W e rk g ro e p C o he re n s - P ie te r R a uw oens - 23/05/2011

11/ 29/2011

UNIVERSITEIT
GENT

FACULTY OF ENGINEERING AND


ARCHITECTURE

Overview
Scope of subtask 5
Mode splitting
Semi-implicit method (basic)
will sem i-im plicit m ethod y ie ld higher efficiency?

Semi-implicit method (specialist)


routines that changed, were added
expected issues when m erging with other subtasks

Progress of subtask 5
T e chn isch e W e rk g ro e p C o h e re n s - P ie te r R a uw oe n s - 23/05/2011
F a cu lty o f E n g in e e rin g a n d A rc h ite c tu re - D e p a rtm e n t o f C ivil E ngineering

Semi-implicit scheme - Specialist


Implicit treatment of free surface:
3d-equations:
dx

+^ +^ = q
dy <)z

1 dh3U _ /1Wi/Ai ,,
, n ,w , , 1/laA , CA d
= Adv(u, V, w) + Diff{u, V, w) + SQ - g
h3 dt
dx
J_ dt\V^ _

V'

Diff(u V'vv) + 5Q _

h3 dt
Integrated equations:

dy

+ V U = 0
d0
f = Adv(U) + Diff(U) + S - gHV

T e chn isch e W e rk g ro e p C o he re n s - P ie te r R a uw oens - 23/05/2011

11/ 29/2011

Semi-implicit scheme - Algorithm


Changes made, compared to concept report:
-,1.

+1 = U- + U~5 ----r +1

->

dX

n+1 = U- + U~- ^K~


()X

free surface projection -> free surface correction


W hy?

- Gain in accuracy, w ithout extra com putational cost


- Solution fo r starts autom atically from in itial guess = 0

T e chn isch e W e rk g ro e p C o he re n s - P ie te r R a uw oens - 23/05/2011

Semi-implicit scheme - Algorithm


Changes made, compared to concept report:
1.

free surface projection -> free surface correction

2.

un+^ = + ^ dx

(vn+1 = ( / - A t.g H ^ ()x

predictor-corrector with fixed ,


so vertical transport only implicit up to predictor level.
W hy?

- Gain in com putational cost (rem oves tri-diagonal inversions)


- A lgorithm is also applicable with fractional step m ethod (TVD)
- F ull im plicitness cannot be taken into account without
subiterations an yw ay (h3-loop)
- Surface and bottom boundary condition fo r cannot be based on
physics, (boundary condition applies on un+1
as a whole)

T e chn isch e W e rk g ro e p C o he re n s - P ie te r R a uw oens - 23/05/2011

11/ 29/2011

Semi-implicit scheme - Algorithm


Changes made, compared to concept report:
1.

free surface projection -> free surface correction

2.

predictor-corrector with fixed

3.

extra iteration loop


W hy?

- on ly w ay to achieve im plicit h3.


- can be used to im plem ent several pressure-correction variants:
(SIMPLE, SIM PLEC, SIM PLER, PISO, ...)
result in fa ste r convergence and/or better stability
useful in com bination with im plicit term s in m om entum :
- vertical advection a nd diffusion
- horizontal advection a nd diffusion
- to im pose im plicitness in strict sense (algorithm check)

T e chn isch e W e rk g ro e p C o he re n s - P ie te r R a uw oens - 23/05/2011

Semi-implicit scheme - Algorithm


Present implementation:

for ntimesteps do:

n+

C"+1' = C"

H"+1,* = Hn
= /'S
for niterations do :
it = it - f 1
u-predictor (eq. 1.19)
v-predictor (eq. 1.20)
solve free surface correction (eq.

1.26)

n - \- l,it _|_ r

Hn+1.H-1=
+ '
n + l . i + l _ J ? n + r,tt+ l kT O + l.a
3

u-corrector (eq. 1.22)


v-corrector (eq. 1.23)
if(converged) return
end do
l^ n + l

^ n + l. ii+ l

v n +^ |jn + l, i+ l
JJn+ l _

J jn + l,it + l

h"+l = h~+1M+l
n+l _

n + l,it+ l

end do

UNftraaiHT

T e chn isch e W e rk g ro e p C o he re n s - P ie te r R a uw oens - 23/05/2011


F a cu lty o f E n g in e e rin g a n d A rc h ite c tu re - D e p a rtm e n t o f C ivil E ng in ee ring

11/ 29/2011

Semi-implicit scheme - Implementation


in H y d r o d y n a m i c _ E q u a t i o n s .f 90:
c u r r e n t _ p r e d ()

solve 3d momentum equations


_1_cVyv _

^ + Qjff(U'

+ 5Q_ gjh_

h3 dt
_1_

dx
^

+ Qjff(UiV:

+ 5Q_ g^.

h3 dt

c o r r e c t _ f r e e _ s u r f ()

dy

solve 2d continuity equations


^ +V U =0
dt

c u r r e n t _ c o r r ()

rescale 3d velocity field to match 2d fields


apply 3d boundary conditions
calculate vertical velocity
J

tffif
' UNMRSTOT

dx

dy

T e chn isch e W e rk g ro e p C o he re n s - P ie te r R a uw oens - 23/05/2011


F a cu lty o f E n g in e e rin g a n d A rc h ite c tu re - D e p a rtm e n t o f C ivil E ng in ee ring

dz

=o
1S

Semi-implicit scheme - Implementation


Only minor changes compared to mode splitting:
advantageous in sharing same routines
requires flags (switches) to distinguish between algorithm:
io p t_ h y d r_ s c h e m e =
(
m ax_SlM PLE_it :

0: mode splitting scheme


1 : semi-implicit scheme
2: non-hydrostatic scheme
amount of iteration loops

T e chn isch e W e rk g ro e p C o he re n s - P ie te r R a uw oens - 23/05/2011

10

11/ 29/2011

Semi-implicit scheme - Implementation


Extra issues for dealing with iteration loops:
distinction between previous time level and previous iteration level
In general, previous time le ve l values are addressed as *_old, whereas the
p resent value com prises the m ost recent data

save old time level statements are extracted from (all) subroutines
and put in separate subroutines:
s to re _ z e ta _ o ld
store_old_tim e_2d
store_old_tim e_3d
store_old_obc_arrays

additionally stored arrays:


obc2uvatu_old,

obc2uvatv_old,

zeta_old,
deptota tu _pre v,

deptotatv_jprev

T e chn isch e W e rk g ro e p C o he re n s - P ie te r R a uw oens - 23/05/2011

Semi-implicit scheme - Implementation


Coupling with linear algebra solver:
Subroutine m a t _ i n v e r s i o n .F9 0:
Virtual class, coupling COHERENS with a generic LA pack
Subroutine p e t s c _ i n v e r s i o n .F90:
PetSc functionalities are addressed
is used when petsc is defined (as compiler option)
choices to make:
linear solver:
preconditioner:
tolerance:

gmres
ICC
l e -5

T e chn isch e W e rk g ro e p C o he re n s - P ie te r R a uw oens - 23/05/2011

11

11/ 29/2011

Semi-implicit scheme - Implementation


Conclusion:
For the user/ programmer, nothing much is changed
All former functionalities are kept
Caveat:
in correct_free_surf(), the free surface height is calculated
implicitly and obtained from inversion of an elliptic equation.
the implicit equation is obtained by linearizing the equations
Non-linear effects can be included by:
'I . (Newton-Raphson) iterations
iteration loop already im plem ented

2.

foreseeing in non-linear effects


(?)

T e chn isch e W e rk g ro e p C o he re n s - P ie te r R a uw oens - 23/05/2011

Semi-implicit scheme - Other subtasks


Conflicts with other subtasks depend on questions:
7.Are the models o f the subtasks dealing with non-linear issues?
2.Do these models have an impact on the hydrodynamics, or can
they be seen as a post processing step?
3. Do the models reguire implicitness o f certain terms in momentum
eguations? If so, how strong is the coupling with the free surface
movement?

E.g. flooding/drying: Highly non-linear, strong coupling with free


surface height -> rather difficult to merge with implicit scheme?
W rfy

lif f ir

T e chn isch e W e rk g ro e p C o he re n s - P ie te r R a uw oens - 23/05/2011


F a cu lty o f E n g in e e rin g a n d A rc h ite c tu re - D e p a rtm e n t o f C ivil E ng in ee ring

12

11/ 29/2011

UNIVERSITEIT
GENT

FACULTY OF ENGINEERING AND


ARCHITECTURE

Overview
Scope of subtask 5
Mode splitting
Semi-implicit method (basic)
will sem i-im plicit m ethod y ie ld higher efficiency?

Semi-implicit method (specialist)


routines that changed, were added
expected issues when m erging with other subtasks

Progress of subtask 5
T e chn isch e W e rk g ro e p C o h e re n s - P ie te r R a uw oe n s - 23/05/2011
F a cu lty o f E n g in e e rin g a n d A rc h ite c tu re - D e p a rtm e n t o f C ivil E ngineering

Progress of subtask 5
implementation is (almost) "ready"
successful tests for scalar transport test cases
o f course, no hydrodynam ics involved!

successful tests for cases without open boundary conditions:


test cases fr o n t, s e ic h , f r e d y
time step could be raised up to convective stability limit.

successful tests were done for cases with open boundary conditions
test case r iv e r
time step could be raised up to convective stability limit.

partly successful for test plum e


Where is the b ug?

T e chn isch e W e rk g ro e p C o he re n s - P ie te r R a uw oens - 23/05/2011

13

11/ 29/2011

Progress of subtask 5 - test Plume


Handbook of
"

DISARMING A TEST-CASE "

- numerical explosion prevention


Observations:
1 .code blow-up in implicit scheme
-> change som ething (e.g. boundary conditions)

2.for certain obc combinations: results are ok.


-> try a sim pler case (disable the plume, ju s t leaving tidal flow)

3.something weird in upper right corner


-> Hey, that's strange, that point has a different obc!?! Let's put it more regular

4.upper right corner behaves normal, until a wiggle shows up


-> let's try the sam e set-up with the m ode-splitting scheme, ju s t for fun...

T e chn isch e W e rk g ro e p C o he re n s - P ie te r R a uw oens - 23/05/2011

Progress of subtask 5 - test Plume


Handbook of
"

DISARMING A TEST-CASE "

- numerical explosion prevention

X c o m p o n e n t_ o f_ e u r r e n t ( m / s )

14

11/ 29/2011

Progress of subtask 5 - test Plume


Handbook of
"

DISARMING A TEST-CASE "

- numerical explosion prevention

M ode-splitting s c h e m e also fails here

implementation of boundary condition? (N R C B C )


failure m o re prominent in s em i-im p licit schei
-> w h y do w e not s e e this when the plume is active?
-> d u e to

-> w h y is the

X c o r a p o n e n t_ o f_ e u rr e n t ( m / s )

15

T H V IM D C -S o resm a
in coi. w ith KU Leuven, UG ent, BM M en W LB

Appendix J
Acomen Paper

Fifth International C onference on A dvanced C o m p u tatio n al M ethods in EN gineering (ACOM EN 2011)


Lige, Belgium , 14-17 N ovem ber 2011
(c)University of Lige, 2011

Converting a Mode-Splitting Scheme into a Semi-Implicit


Scheme for Free Surface Flows*
P. R a u woens1,T. Van O y e n 1,J. Vierendeels2,P. Troch1,P. Luyten3,
A. Breugem4,M . Heredia G o m e z 5
1 G hent University, D epartm ent o f Civil Engineering,
Technologiepark 904, B-9052 G hent, Belgium
2 G hent University, D eptartm ent o f Flow, H eat and C om bustion M echanics,
Sint-Pietersnieuw straat 41, B-9000 Ghent, Belgium
3 Royal Belgian Institute of N atural Sciences (RBIN S-M U M M ),
G ulledelle 100, B-1200 Brussels, Belgium
4 International M arine and D redging Consultants (IMDC),
C oveliersstraat 15, B-2600 A ntw erp, Belgium
5 A ntea Group, Posthofbrug 10, B-2600 A ntw erp, Belgium
e-mail: {pieter.rauwoens, tom as.vanoyen,jan.vierendeels, peter.troch} @ugent.be,
pa trick.lu yte n @mumm. ac.be, alexander, breugem @imdc. be, m rcelo.herediagomez@ anteagroup. com

A b s tra c t

We present the m odification of the 3-D hydrostatic free surface flow solver C O H EREN S. The
original solver uses the explicit m ode-splitting technique, in w hich the stepping o f the surface grav
ity w aves is decoupled from the stepping of the hydrodynam ic 3-D currents. A s such, C PU -tim e is
gained by adopting few er 3-D current solutions than 2-D depth-integrated gravity w ave solutions.
Since the CFL lim it for the 2-D m ode is inversly proportional to the root m ean square o f the depth,
the m ode-splitting technique becom es less efficient for larger w ater depths. Treating the term s re
lated to gravity im plicitly avoids gravity w ave tim e step restriction and the use of m ode splitting,
w hile the stability o f the code is still guaranteed. On the other hand, it requires an iterative inversion
o f a system . We present an iterative version of the sem i-im plicit algorithm . A com parison of the
results reveals the equivalence o f both algorithm s in term s o f accuracy. D ue to coding inefficiency,
the expected gain in C PU -tim e is not y et obtained for the test case presented. However, w ith the
m odifications presented, the robustness o f the C O H EREN S m odel is increased, allow ing larger tim e
steps for com plex m odel applications.

Introduction

In the framework of the study Expansion of the numerical modeling tools for the North Sea harbors
assigned by the Maritime Access division (aMT) of the Department of Mobility and Public Works of
the Flemish Government, various software developments are carried out by T H V I M D C - Soresma,
supported by the universities of Ghent and Leuven.
The assignment consists of the development of mathematical, hydrodynamical and morphological
software in collaboration with Flanders Hydraulics Laboratory (WLB, Flemish government) and the
Management Unit of the North Sea Mathematical Models ( M U M M , federal government). The point
Research funded by project Development o f a Flemish-Belgian numerical model o f the North Sea Ports, ToR
16EF/2008/02 assigned by the Maritime Acces Division (aMT) o f the Department o f M obility and Public Works o f the
Flemish Government.

of departure for the developments in this study is the current version of the C O H E R E N S version 2
hydrodynamic model that has been developed by the M U M M [1, 2],
The developed software aims to simulate currents and tidal propagation in seas, estuaries and rivers,
including the simulation of sediment transport and morphological bed changes caused by these currents
or human interference and will be used to study the hydrodynamic and morphological challenges during
the development of harbor extensions, alternative dredging- and pumping strategies and sediment influx
reducing measurements for the Flemish North Sea Ports.
Besides morphological changes and implementation of additional physics, such as sediment trans
port, also changes, with respect to the starting version C O H E R E N S V2, are made to the hydrodynamical
core in order to increase the codes efficiency as much as possible. In this respect, the development of an
implicit numerical scheme for the hydrodynamical equations is put forword as an important achievement
to realize large gain in computational calculation time.
In this paper, the conversion of the original C O H E R E N S V 2 hydrodynamical module is described.
The original solver uses the explicit mode-splitting technique, in which the stepping of the gravity waves
is decoupled from the stepping of the hydrodynamic 3 D currents, by using two different time steps cor
responding to the time scales of the barotropic and baroclinie mode respectively. The modification
presented here, treats the terms related to gravity implicitly and renders the use of mode splitting super
fluous, while the stability of the code is still guaranteed.
The paper is organized as follows. Section 2 describes the equations that govern the 3D hydrostatic
environmental free surface flow under study. The conversion into a semi-implicit algorithm is described
in section 3, after which numerical examples (section 4) serve to illustrate the algorithms properties.
The conclusions section summarizes the findings of the paper.

Governing Equations

Taking advantage of the hydrostatic, traditional and Boussinesq approximations, the dynamics of a fluid
with mean density po is governed by:
du

dv

dx

dy

du

du

dw
dz
du

(D

fc

du

M + u d i + " y + w a ; . - - g d i + d i Jz
dv

dv

dv

dv

9Rn

9 R i2

9R i 3

dx

dy

dz

9 R 2i
dx

9R22

/ bdz' H---

d(

m + U d i : + V d y + W d~z= ~ 9 y + y

Po

fC
1
/ bdz H--'z

Po

dy

9 R 23
dz

+ fv ,

(2)

- fu .

(3)

Here, {u, v, w ) describe the velocity components in the x, y and 2 -directions, respectively. The -axis is
along the parallels, pointing east, while the y-axis points North along the meridian lines. The 2 -axis is
vertical, pointing upwards, with 2 = 0 describing the mean water level. The variable b = (p po) g / po
represents the buoyancy, the tensor Ry, (with i , j = 1, 2, 3) denotes the Reynolds stress tensor, is the
Coriolis parameter and g the gravitational acceleration. In addition, integrating (1) over the depth and
using the kinematic condition at the free surface leads to an equation which describes the dynamics of
the free surface elevation ( ,
d(
dU
dV

dt + i h

+ d - 0'

(4)

in which U and V are the depth-integrated horizontal velocities. Atthefree surface and bottom bound
ary,the horizontal fluid stresses are related to a surface stress induced by wind and aprescribed bottom
shear stress, respectively.
It is c o m m o n to discretize the equations with an Arakawa C'-grid [3] such that scalars (e.g. water
depth, surface elevations) are defined in the center of a grid cell while vector quantities (e.g. velocities
and stresses) are assigned to cell faces. In the vertical direction, the movement of the grid with the free
surface boundary is treated by using s-coordinates.

Introducing the notations AV), D v(), /I/,() and /)/,() for the vertical and horizontal advective and
diffusive terms, and by denoting all source terms, except those related to the free surface elevation by S,
we can write the discrete momentum equations (in conservative form) as

= Ah^

+ A v^

+ Dh^

+ D v^

+ Sx~ 9 f a

fa-wr = Ah(v) + Av(v) + D h{v) + D h(v) + Sy Ii3

ot

(6)

oy

with 13 the time-dependent grid spacing in the vertical direction.

Semi-Implicit Algorithm

3.1

Algorithm Description

In the semi-implicit version of the algorithm, the above equations are solved using a segregated ap
proach. In time, the vertical advection and diffusion terms are considered implicitly. In addition, also
the free surface gradient is taken implicitly such that the time step is not restricted to the C F L criterion
related to the propagation of surface gravity waves. All the other terms are discretized explicitly. Using
A t to denote the time step and superscripts n and n + 1 for the old and new time levels, repectively, the
governing equations are semi-discretized (only in time) as:

ATi+1 _ A
At
u n + l

n + l

-A

g u n+ l

QVn + l

+ ~ T + - +

y n

r =

(7)

r)+ n + l

------- = h? [A v (u n , u n + l) + D v (u n , u n + l) +

A h{un)+

D h (u n ) + Sx] - ha+ 1 g ^ ^ ,

%)
u n + l

-A

n + l

y ji.n

----- 3 _ = hn [M v n^ ^n+1) +

^n+1) +

a /- n + l

_ ^n+ l g ^ _ _
(9)

Considering the non-linearity in the time-discretized equations of the momentum due to ti^ + 1 u n + 1
and IF 11v " 11, and the coupling of the continuity and momentum equations, an iterative algorithm is
adopted. For clarity, a new superscript is introduced, indicating the iteration level; i.e. <>+M*+i denotes
the value of the variable <fi at the new time step n + l obtained after performing iteration it . Introducing
the free surface correction
C

(^ T l+ 1 > + 1

i+ l, it

Q Q )

equations (7) - (9) are now decoupled and the system (at a certain iteration level, it) can be solved by
computing first a predictor velocity ( u * ,v * ) considering:
, n + l,it

i n

u 3

3 a

At

a f n + l,it
h 'n A
n,n
n
n,n
n,n \
n
n,n \
o
1
= h%
[A v ((u
n , u *) +i D
v ((u
n , u *) +i AA h ((v
n ) +i D
h ((un
) +i Sx}
- hr , ra +^ M ui g
77

dx

(11)
i n + l, it

-A

At

i n . n

= ^

fi+ n + l,it

[A,(U\ u*) + D v { v \ v *) + A h (vn ) + D h (v n ) + Sy] V (12)

Both (11) and (12) consist of a tridiagonal system that is readily solved using the Thomas algorithm.
The horizontal velocities are then given by

Here, h + 1 i t + 1 = h+ 1 H n + 1 i t + 1 / H n+1 with H n + lit + l = H n+1a +


In order to compute the
horizontal fluid velocities from equations (13) and (14), the free surface correction needs to be evaluated.
The latter is obtained by substitution of (13) and (14) into the free surface elevation equation leading to
a positive definite, five diagonal symmetric system for the unknowns
(n + l,it _

//
+

At

At

g y *

Q u*
+

T W

dx

^ f g A t H n + 1 a ^ f ) +
i g A t H n + 1 a ? f ) .
d
ox \
ox )
oy \
ay )

dy

(15)

The inversion of (15) is computed using preconditioned Krylov methods, taking advantage of the open
source scientific computation library PETSc [4],
In summary, the iterative algorithm consists of:

for ntimesteps do:

n + 1, C + l,it = C , H n+1 = H n and ti^+1u =


for niterations do:

n =

it = it + 1

(u,v)-predictor (eq.12 & 11)


solve free surface correction
n + l,it+ l =

ra+l,it + I '

H n + l,it+ l =

(u,v)-corrector (eq.
if(converged) return
end do
un+ 1 _

u n + l,it+ l

yn+l _

^n+l,ii+l

(eq.

H n + l,it +

15)
/

and

13 & 14)

ggn+l _

g g n + l,it+ l

and Cn+1 =
end do
In the convergence check the Loo-norm of (' is compared with a treshold value e: 11'| |

< e.

3.2 Discussion
The purpose of elaborating algorithms for free surface flows is to increase efficiency. Standard explicit
algorithms are inefficient due to the disparity in time scales of the barotropic and baroclinie modes. Two
com m o n solutions exist: semi-implicit treatment of the equations [5] and the mode-splitting technique
[6]. With both methods, the 3-D momentum equations are solved in time with a time step related to
the convective CFL-criterion. With the semi-implicit method, the determination of the free surface
height is done once every time step by inverting the elliptic equation (15), whereas the mode-splitting
technique involves a number, inversely proportional to the Froude number (Fr),of explicit solutions of
the depth-integrated (2-D) momentum and continuity equations. As such, one can expect that the modesplitting algorithm becomes less efficient for deeper water (higher Fr) and the use of a semi-implicit
might become more advantageous. One has to note, however, as the matrix becomes less diagonally
dominant for higher Fr, that the solution of the elliptic system also becomes harder for the iterative
solver invoked. Relying on recent advances in linear algebra, the semi-implicit algorithm is expected to
be most efficient. N o w having the two algorithms within the same C O H E R E N S code, allows to check
whether this is true. W e come back to this point later in this paper.
The semi-implicit algorithm, used in the examples, uses a correction method to obtain higher ac
curacy (see also [7]) and hence differs from the projection method, described in [5], Also, the extra
iteration loop allows to achieve h% fully implicit and is useful in combination with implicit advection
and/or diffusion terms in the momentum equation. The advantage of the extra iteration loop is illustrated
below.

Numerical Tests

Preliminary results of the model performance are presented. Hereto, w e analyse the ability of the nu
merical model to describe the circulation and evolution of a tidally modulated estuarine salinity front.

R e sid u a l_ S a lin ity (PSU)

R e sid u a l_ S a lin ity (PSU)

(a) one day

(b) tw o days

DATA SET: resid

R e sid u a l_ S a lin ity (PSU)


(c) three days

Figure 1: Residual salinity and current field analysed after (a) one, (b) two and (c) three days.

90

E x p lic it
Im p lic it

80

=
O

70

CL

O
=3
O
=
O

60

50

<75

CL

40

30

10

20

30

40

50

60

70

80

tim e [h o u rs]

Figure 2: The time development of the distance between the left boundary and the point where the
salinity front outcrops the surface considering the free surface gradient implicitly (full line) and explicitly
(dashed line).

This experiment follows closely the test case


sake of clearness.

riv e r

described in [1] and is summarized herein for the

A two-dimensional (in horizontal and vertical directions) channel of uniform depth is considered.
The channel is 140 k m long and 20 m deep. Initially, a vertical uniform salinity front is considered by
imposing a salinity distribution given by
r 30
S =

if

I 0.25( [35

< 25

25) + 30if

25 < x < 45

(16)

if x > 45.

Here, S is the salinity in P S U and x the distance from the left boundary of the channel in km. The
propagation of a tidal wave is induced by specifying a periodic (incoming) Riemann variable at the left
boundary such that

R+ = 2cAcos(uit +

7t /2 )

(17)

y/gH is the barotropic wave speed, ui the frequency of the tidal wave (semi-diurnal),H the
water depth and A the forcing amplitude. At the right boundary, the normal gradient of the incoming
Riemann variable //_ is set zero (i.e. dR -/d x = 0) such that the tidal wave can propagate freely
where c =

from left to right. In addition, a zero normal gradient condition is assumed for salinity at the two open
boundaries. The simulation is caried out in two phases. First, a spin-up phase of 2 days is considered
without salinity. In the second part, the salinity front is introduced and the modulation of the salinity
front is simulated for three days.
In figure 1 the residual salinity and current field after one, two and three days is plotted. The figure
shows that a circulation is generated with a surface flow to the right and a bottom flow to the left; together
with downwelling at the right edge and upwelling at the left edge of the front. The current is generated
by a balance between the baroclinie pressure gradient and the vertical diffusion term, induced by tidal
friction [1],
Figure 2 plots the location of the point where the salinity front outcrops the surface, h f r , during
the tidal cycle. h f r is measured by the distance i k m of the 34 P S U contour line (taken at the first grid

0.02

A h fro n t
A re s v e lo c ity

0.015

0.01

0.005

-0.005
1e-06

1e-05

0.0001

0.001

0.01

0.1

tre s h o ld v a lu e e

Figure 3: Sensitivity of the model results with respect to the treshold value t[m],

cell below the surface) to the left boundary. It is found that the front moves to the right with an almost
uniform speed on which tidal modulations are superimposed. The position of the outcrop is presented in
figure 2 considering the free surface gradient implicitly (full line) and explicitly (dashed line). A good
agreement is found indicating the equivalence of both algorithmic approaches.
The sensitivy of the results and the performance of the model with respect to the treshold value e is

analysed in figures 3 and 4. In figure 3, A h f r(mt and Ares velocity is plotted for several treshold values
with
a7
h f rconv\
i a
i a
r^res(^) ^res.conv
/1 o\
A hfro nt = j
and Ares velocity = J----------------:--- L.
(18)
" f r.ronr
Ures,conv
In (18), u res represents the residual surface horizontal current and the underscript 'c o n v ' denotes the
value to which h f r and u res converge descreasing the treshold value. It is found that the relative differ
ence for both output parameters is smaller than 2%, indicating that the obtained accuracy by decreasing
the treshold value is not substantial. Here, it is worth to point out that for the largest value of e consid
ered (t = 0.1), the norm of ( ' turns out smaller than the treshold value at the first check; i.e. only one
iteration is performed. Considering that a decrease from e equal 0.1 to 1.0-5 triples the computational
time (see figure 4), the results suggest that the use of a very small value of e is not necessary. Depending
on the desired accuracy, for these simulations a value of e equal to 0.01 or 0.07 seems appropriate.
Finally, in figure 4, also the computational time to complete the simulation using the explicit (modesplitting) scheme is presented (red horizontal line). For stability, the mode splitting scheme requires
10 2-D substeps, each time step. It is found that the implementation of the implicit algorithm sligthly
decreases the computational cost of the numerical model when the treshold value is large. For decreasing
values of e, it turns out that the numerical simulation with the free surface gradient implicit becomes
more expensive than using the mode-splitting scheme. The only slight increase in efficiency does not
correspond to the expectations and is probably due to the way PETSc is coupled to the main source code.
It is expected that a more efficiently coded matrix fill-up will result in higher efficiencies. In the future,
a linear solver will be coded within the source code, yielding faster calculations.

32
im plicit
explicit

30
28
26
ITT

24

22

TD

0)

0)

20

I 18
16
14

12

++-

10
1e-06

1e-05

0.0001

0.001

0.01

0.1

treshold value e

Figure 4: The time necessary to complete the simulation for different values of t[m]. The necessary
computational time, using the explicit scheme, is represented by the red line.

Conclusions

W e presented the modification of a mode-splitting algorithm into a semi-implicit free surface correction
algorithm for free surface flows within the framework of the hydrodynamical flow solver C O H E R E N S .
By virtue of the modifications made, the codes robustness is increased, allowing larger time steps for
complex model applications. In order to cope with the non-linearity in the governing equations, an
iterative algorithm was adopted. The influence of the amount of iterations, controlled by means of a
convergence criterion for the free surface correction, was investigated with the test case of a tidally
modulated estuarine salinity front. W e concluded that accuracy increases as the convergence treshold
becomes smaller. O n the other hand, also simulation time increases. Comparing the efficiency of the
semi-implicit method and the mode-splitting algorithm, the expected efficiency increase was not ob
tained. ft will be investigated whether further code optimization is capable of obtaining the predicted
efficiency gain.

References
[1] P.J. Luyten. Coherens, a coupled hydrodynamical-ecological model for regional and shelf seas: User
documentation, version 2.0. Technical report, R B 1 N S - M U M M , Royal Belgian Institute of Natural
Sciences, to be published on http://www.mumm.ac.be/coherens,2011.
[2] P. Luyten, 1. Andreu-Burillo, A. Norro, S. Ponsar, and R. Proctor. A new version of the european
public domain code coherens, ln H. Dahlin, N.C. Fleming, P. Marchand, and S.E. Petersson, editors,
European O perational Oceanography: Present and future. Proceedings o f the fourth EUROGOOS
Conference, pages 474-481, E U R O G O O S Office, Norrkping, 2006.
[3] A. Arakawa and V. Lamb. Computational design of the basic dynamical processes of the ucla general
circulation model. In Methods in Computational Physics, volume 17, pages 174-267. Academic
Press, 1977.

[4] Satish Balay, William D. Gropp, Lois Curfman Mcinnes, and Barry F. Smith. Efficient management
of parallelism in object oriented numerical software libraries. In E. Arge, A. M. Bruaset, and H. P.
Langtangen, editors, M odern Software Tools in Scientic Computing, pages 163-202. Birkhuser
Press, 1997.
[5] V. Casulli and E. Cattani. Stability, accuracy and efficiency of a semi-implicit method for threedimensional shallow water flow. Computers and M athematics with Applications, 27(4) :99 112,
1994.
[6] A.F. Blumberg and G.L. Melior. A description of a three-dimensional coastal ocean circulation
model. In N.S. Heaps, editor, Three dimensional coastal ocean models, American Geophysical
Union, Washington, 1987.
[7] X. Chen. A free surface correction method for simulating shallow water flows. Journal o f Compu
tatio na l Physics, 189:567-578, 2003.

T H V IM D C -S o resm a
in coi. w ith KU Leuven, UG ent, BM M en W LB

Appendix K
Acomen presentation

11/ 29/2011

UNIVERSITEIT
GENT

FACULTY OF ENGINEERING AND


ARCHITECTURE

Converting a mode-splitting scheme


into a semi-implicit scheme
for free surface flows
Pieter Rauwoens, Tomas Van Oyen, Jan Vierendeels, Peter Troch,
Patrick Luyten, Alexander Breugem, M arcelo Heredia Gomez

A C O M E N - P ie te r R a uw oens - 16/11/2011
F a cu lty o f E n g in e e rin g a n d A rc h ite c tu re - D e p a rtm e n t o f C ivil E ngineering

Flemish-Belgian model of North Sea Ports


Development of new models and / or algorithms within
COHERENS
COupled Hydrodynamica! Ecological model for REgioNal Shelf seas

'iMVHtsHT

A C O M E N - P ie te r R a uw oens - 16/11/2011
F a cu lty o f E n g in ee rin g and A rc h ite ctu re - D e p a rtm e n t o f C ivil E ngineering

11/ 29/2011

Flemish-Belgian model of North Sea Ports


Study:
Expansion o f the numerical modeling tools for the North Sea Harbors
assigned by:
Maritime Access division o f the Department o f Mobility and Public
Works, Flemish Government.
-> Several software developments, e.g.
Development of a sediment transport model in Coherens
W.A. Breugem et al.
Implementation of Inundation Schemes into the Coherens Model
M. Heredia et al.
Converting a Mode-Splitting Scheme into a Semi-Implicit Scheme
for Free Surface Flows
P. Rauwoens et al.
Iffllr
M /uMvrasmiT
/ 1ihJiunKimr

ACOMEN - Pieter Rauwoens - 16/11/2011


Farnltv
F a cu lty nf
of

F nnnmpprnn
anri
A rc
r rh
itpcrti
E
g in e e rin g a
nd A
h ite
tuirp
re -- D e p a rtm e n t o f C ivil E ng in ee ring

Accelerating the code


It is expected that there will be a large gain in CPU time
by solving the hydrodynamic eguations implicitly
Time step restrictions:
* convective:

a t<
u

diffusive:

barotropic:

Ax
At < ,

Jo"
internal gravity waves, ...
f lf f if
K / unwersiibt

A C O M E N - P ie te r R a uw oe n s - 16/11/2011
F a cu lty o f E n g in e e rin g a n d A rc h ite c tu re - D e p a rtm e n t o f C ivil E ngineering

11/ 29/2011

Accelerating the code


Two ways of handling the barotropic time step restriction:
MODE SPLITTING
solve 3d equations related to convective CFL-criterion
solve a number (F r1) of explicit 2d barotropic steps

SEMI-IMPLICIT TIME STEPPING


solve 3d equations related to convective CFL-criterion
solve 2d continuity equation once implicitly.

-> Semi-implicit method is more efficient for small Fr ?


(probably, but requires a more subtle answer...)

fjjy

tffllT

ACOMEN - Pieter Rauwoens - 16/11/2011


Faculty of Engineering and Architecture - Department of Civil Engineering

nun

,r

UNIVERSITEIT
GENT

i
FACULTY OF ENGINEERING AND
ARCHITECTURE

Overview
Introduction
COHERENS before
mode splitting algorithm

COHERENS after
semi-implicit algorithm

Test Cases
2D and 3D tests with emphasis on computing time
simulation results vs. theoretical reasoning
Conclusion and Prospects
ACOMEN - Pieter Rauwoens - 16/11/2011
Faculty of Engineering and Architecture - Department of Civil Engineering

11/ 29/2011

COHERENS before
Starting point = COHERENS v. 2.0
Hydrodynamic core:

Explicit time stepping scheme


implicit in vertical direction to avoid restringing time-step limits
Acceleration by mode splitting algorithm

ACOMEN - Pieter Rauwoens - 16/11/2011

Governing equations
Explicit time stepping scheme:
3d-equations:

+ + !^}L = o
dx dy <)z
1 d h 3U _ a^ , , , , aA , n;ff
, ca
< *
= Adv(u, v, w) + Diff(u, v, i/i/) + SO - g
h3 dt
dx
J dhjV _
h3 d t

Integrated equations:

r tf'

V'

+ iff(u V' vv) + 5Q _ g ^ dy

+ V U = 0

= Adv(U) + Diff(U) + S - gHV


dt

ACOMEN - Pieter Rauwoens - 16/11/2011

11/ 29/2011

Mode splitting - Implementation


in Hydrodynamic_Equations.f90:
current_pred ()
(every #th time step)
solve 3d momentum equations
^ + Qiff(U' V'

t_diyj_ _
h3 dt

+ 5Q_gdy_
dx

V' +Diff(UiViw) + 5Q_g th current_2d()


(always)
^
^
solve 2d momentum and continuity equations
^+ V
dt

u =o

= Adv(0) + Diff(0) + S -gHV

current_corr ()
(every #th time step)
rescale 3d velocity field to match 2d fields
apply 3d boundary conditions
calculate vertical velocity
ffi/fy Ttffrr
J i p / uMivERsrrEiT

dx

dy

dz

=o

ACOMEN - Pieter Rauwoens - 16/11/2011


Faculty of Engineering and Architecture - Department of Civil Engineering

Mode splitting - Issues


one has to define 2 time steps (2d and 3d)
tracking the free surface fronts in time is not of interest
gravitational timescale different from tidal period
mesh size different from wavelengths
difficulty of matching 2d flow with 3d flow
definition of 'filtered' velocity for scalar equations

Wj ' /
US
^ ^ /ifN^asiTHT

ACOMEN-Pieter Rauwoens-16/11/2011
Faculty of Engineering and Architecture - Department of Civil Engineering

10

11/ 29/2011

COHERENS after
Destination point = COHERENS v. 3.0
Hydrodynamic core:

Semi-implicit time stepping scheme


implicit in vertical direction to avoid restringing time-step limits
Acceleration by treating barotropic modes implicit

ACOMEN - Pieter Rauwoens - 16/11/2011

Semi-implicit scheme - Basic


Implicit treatment of free surface:
3d-equations:

+ + !^}L = o
dx dy <)z
1 d h 3U _ a^ , , , , aA , n;ff
, ca
< *
= Adv(u, v, w) + Diff(u, v, i/i/) + SO - g
h3 dt
dx
J dhjV _
h3 d t

Integrated equations:

V'

+ iff(u V' vv) + 5Q _ g ^ dy

+ V U = 0
= Adv(U) + Diff(U) + S - gHS/
dt

ACOMEN - Pieter Rauwoens - 16/11/2011

11/ 29/2011

Semi-implicit scheme - Algorithm


Semi-discretized equations:
1 hn+1//n+1 hnnn
7)/'n+^
3
3 = Adv(u, V, w) + Diff{u, V, w) + SQ ^ - g h"
At
h"
dx
L.n+'\..n+'\ _

i_/?+1 ^

3----------------------------3
h"
At
y n +1 _

Adv(u, V, w) + Diff{u, V, w) + SQ - g
h"

<)y

yn

i+ V . L/n+1 = 0

At

dun+^ dvn+^ dwn+i n


dx

dy

dz

Equations can be decoupled:


3d continuity eqn: postprocessing step for vertical velocity
decoupling of 2d continuity from momentum by projection

un^

rweit

ACOMEN - Pieter Rauwoens - 16/11/2011


Faculty of Engineering and Architecture - Department of Civil Engineering

Semi-implicit scheme - Algorithm


1.

predictor step: _1_

le 0 + SO

1 h* v* hnvn
3
3 - = Adv(u, V, w) + Diff(u, V, w) + S()
At

hi

2.

corrector step:.

f^n+1 ftn
S

At

rim -1
- +. fVr L/n
+1 = 0

with L/n+1 = r Cu"+\d z

Jz=0

= i f -A t.g

d fn+1
dx

f-n+l fn
?

At

_
f I
+i 7
V (( L/*
- At.gH.VTn+1) = 0

ACOMEN - Pieter Rauwoens - 16/11/2011

11/ 29/2011

Semi-implicit scheme - Algorithm


Corrector step:
>>/?+1 yn
^
+ V ( Lf - At.gH.V J"n+1) = 0
<=> r +1 - (A f)2V

( gH V C n+1)

= Cn - A tv O'

-> requires iterative solver

Typical stencil (1 d) :

F r2

1_

+ F r2

F r2

System is less diagonally dominant for small Fr.


And thus more difficult to solve
-> computational cost comparable to mode-splitting method?
Yes, if basic iterative solver is used (e.g. Jacobi, Gauss Seidel)
No, if we make use o f advanced linear algebra (Krylov solvers with preconditioning)
r

ACOMEN - Pieter Rauwoens - 16/11/2011


tNWEjtEOTBT Faculty of Engineering and Architecture - Department of Civil Engineering

Semi-implicit vs. mode splitting algorithm


S No need to distinguish between 2d and 3d time step
S Interest only in:
changes in free surface height from tidal wave
transport of salinity and other scalars with 3d current
no interest in:
short gravity wave
-> no need to track them!
S For low Fr (deep water), semi implicit method is expected to be
faster
S For high Fr (=1), no difference in computing time is expected.
S A more robust code is obtained, regardless of (local) Fr.
ACOMEN - Pieter Rauwoens - 16/11/2011

11/ 29/2011

Semi-implicit scheme - Specialist


1.

free surface projection -> free surface correction


Why?

2.

- Gain in accuracy, without extra computational cost


- Solution for starts automatically from initial guess = 0

Extra iteration loop


Why?

- only way to achieve implicit h3.


- can be used to implement several pressure-correction variants:
(SIMPLE, SIMPLEC, SIMPLER, PISO, ...)
result in faster convergence and/or better stability
useful in combination with implicit terms in momentum:
- vertical advection and diffusion
- horizontal advection and diffusion
- to impose implicitness in strict sense (algorithm check)

ACOMEN - Pieter Rauwoens - 16/11/2011

Semi-implicit scheme - Algorithm


Present implementation:

for ntimesteps do:


n= n+ 1
C"+1' = C"
H "+

1,* = H n

= /'S
for niterations do :
it = it - f 1

u-predictor (eq. 1.19)


v-predictor (eq. 1.20)
solve free surface correction (eq.

1.26)

n - \- l,it _|_ r

H n + 1.H-1

n+l.i+l _

+ '
Jfn+l.tt+1 ^ n + 1 ,i t

u-corrector (eq. 1.22)


v-corrector (eq. 1.23)
if(converged) return
end do

l^n+l _
v n+^
JJn+ l _

m + l,it+ l

h"+l = h~+1M+l
n+l _

n + l,it+ l

end do

UNftraaiHT

Technische Werkgroep Coherens - Pieter Rauwoens - 23/05/2011


Faculty of Engineering and Architecture - Department of Civil Engineering

11/ 29/2011

Semi-implicit scheme - Implementation


in Hydrodynamic_Equations.f90:
current_pred()
solve 3d momentum equations
_1_ cVyv _
h3 dt

_1_

Qjff(U'

+ 5Q _

gjh_
dx

+ Qjff(UiV: + 5Q_ g^.

h3 dt

dy

correct_free_surf()
solve 2d continuity equations

^ +V U =0
dt

current_corr()
rescale 3d velocity field to match 2d fields
apply 3d boundary conditions
calculate vertical velocity
J
Vffl/fy

tiffir

j||p/ jNivERsrrEiT

A
dxv

.41/
dy

A7
dz

=o

ACOMEN - Pieter Rauwoens - 16/11/2011


Faculty o f Engineering and A rchitecture - Department of Civil Engineering

UNIVERSITEIT
GENT

FACULTY OF ENGINEERING AND


ARCHITECTURE

Overview
Introduction
COHERENS before
mode splitting algorithm

COHERENS after
semi-implicit algorithm

Test Cases
2D and 3D tests with emphasis on computing time
simulation results vs. theoretical reasoning

Conclusion and Prospects


ACOMEN - Pieter Rauwoens - 16/11/2011
Faculty o f Engineering and A rc h ite c tu re - Department of Civil Engineering

10

11/29/2011

Test case RIVER

Tidally modulated estuarine salinity front


2 days (spin-up) and 3 days (including the front)
Boundary conditions with Riemann invariants
140km X 20m (140x1 x20 mesh)

R e s i d u a l S a l i n i t y (PSU)
A C O M E N - P ie te r R auw oens - 16/11/2011
Faculty o f E n ginee ring and A rc h ite ctu re - D e pa rtm e n t o f C ivil E ngineering

Test case RIVER


0.02
Ahfront
A res velocity

0.015

0.01

im p licit
e xp licit

0.005

0
-0.005 1e-06

1e-05

0.0001

0.001

0.01

0.1

treshold value e

1e-05

0.0001

0.001

0.01

treshold value e

jgjfr 'u w iv e k s fte it

A C O M E N - P ie te r R auw oens - 16/11/2011


Faculty o f E n ginee ring and A rc h ite ctu re

D e pa rtm e n t o f C ivil E ngineering

11

11/ 29/2011

Test case RIVER

Robustness of the code is increased since barotropic time step


limit is eliminated

Accuracy depends on threshold value

Computing time depends on threshold value (reflected in number


of iterations)

Unaccomplished gain in computing time w.r.t. explicit scheme


Larger gain is expected theoretically
Gain is not achieved due to inefficient coupling with
external solver library PETSc

ACOMEN - Pieter Rauwoens - 16/11/2011

Test case OPTOS

Tidal flow at North Sea


4 day run
Boundary conditions with Riemann invariants
Nested grids; coarsest and most extended grid: 2D

ACOMEN - Pieter Rauwoens - 16/11/2011


Faculty o f Engineering and A rchitecture - Department of Civil Engineering

12

11/ 29/2011

Test case OPTOS


Time step could be raised with factor 90 in case of semi-implicit
scheme
CPU time (minutes) vs. threshold value for explicit and semiimplicit scheme:
45
40
35
30
25

"implicit

20

-explicit

15
10
5

0
1,E-04

J | p / un^ rweit

1,E-03

1,E-02

1,E-01

1,E+00

ACOMEN - Pieter Rauwoens - 16/11/2011


Faculty o f Engineering and A rchitecture - Department of Civil Engineering

nun

p jT

UNIVERSITEIT
GENT

v /i

FACULTY OF ENGINEERING AND


ARCHITECTURE

Overview
Introduction
COHERENS before
mode splitting algorithm

COHERENS after
semi-implicit algorithm

Test Cases
2D and 3D tests with emphasis on computing time
simulation results vs. theoretical reasoning
Conclusion and Prospects
ACOMEN - Pieter Rauwoens - 16/11/2011
Faculty o f Engineering and A rc h ite c tu re - Department of Civil Engineering

13

11/ 29/2011

Conclusions

Algorithmic developments withing COHERENS

Increase in efficiency and robustness by semi-implicit time


integration scheme, replacing mode splitting scheme.

Non-linearity of equations is included by sub-iterations

Accuracy and computing time depend on threshold value

Gain in computing time is not fully achieved yet

ACOMEN - Pieter Rauwoens - 16/11/2011

Prospects

Increased amount of implicitness within COHERENS

In-code programmed solvers to tackle the inefficiency of matrix


conversions

Development of fast solvers within COHERENS

ffl/ty
||^U N ra i|n B T

ACOMEN - Pieter Rauwoens - 16/11/2011


Faculty o f E n gineering and A rchitecture - Department of Civil Engineering

14

11/ 29/2011

UNIVERSITEIT
GENT

FACULTY OF ENGINEERING AND


ARCHITECTURE

Converting a mode-splitting scheme


into a semi-implicit scheme
for free surface flows
Pieter Rauwoens, Tomas Van Oyen, Jan Vierendeels, Peter Troch,
Patrick Luyten, Alexander Breugem, M arcelo Heredia Gomez

ACOMEN - Pieter Rauwoens - 16/11/2011


Faculty o f Engineering and A rc h ite c tu re - Department of Civil Engineering

15

T H V IM D C -S o re s m a
in c o i. w ith KU L e u v e n , U G e n t, B M M en W L B

Appendix L
Test cases for validation

UMDC

SORESMA
COHERENS II

RAPPORT :
Datum:
Aan:

Validatietestcases voor het impliciete schema


7/09/2011

Gsbert Van Holland (IMDC)

Auteur: Pieter Rauwoens (UGent) - Tomas Van Oyen (UGent)


Documentref:

Betreft : 11339 - Deeltaak 5: Impliciete code - validatie test cases

Inhoudstafe

1. INLEIDING..........................................................................................................................................1
2. VOORGESTELDE TEST CASES................................................................................................... 1
2.1. LINEAR PROGRESSIVE WAVES THROUGH A FLUME..........................................................1
2.2. 2.
TIDAL FLOW OVER AN IRREGULAR BED...................................................................... 2
2.3. 3.
TWO SEICH OSCILLATIONS.............................................................................................2
3. BESLUIT............................................................................................................................................ 2
4. REFERENTIES..................................................................................................................................2

1.INLEIDING
Conform actiepunt 13.2 van de technische werkgroep werd UGent gevraagd enkele test cases
voorop te stellen ter validatie van de impliciete code. Na literatuuronderzoek bleek het aantal
geschikte test cases eerder minimaal: veel cases dienen ter validatie van niet-hydrostatische
codes, anderen zijn geschikt om een schema te testen dat beschikt over een drying-wetting
procedure. Deze laatste reeks test cases kunnen eventueel worden aangewend om de merging
van de impliciete code met de inundatieschema's te valideren.
Hoewel het aanwezige testschema in COHERENS reeds een afdoende test vormt voor de
correcte implementatie van het impliciete schema, worden hieronder nog 3 extra test cases
voorgesteld, allen academisch van aard.
2.VOORGESTELDE TEST CASES
2.1.

Linear progressive waves through a flume

The linear progressive wave is a simple 1D problem, having an analytical solution. It is used to
assess the frequency dispersion and wave damping. One set-up can be used, with different
boundary conditions, providing details of the incoming wave. A comparison is to be made
between the semi-implicit scheme and the explicit scheme, and accuracy is to be tested for a
number of time steps.
The test case resembles the river test case, but without focus on the salinity front.

THV IMDC - Soresma,


Coveliersstraat 15 - B 2600 Berchem (Antwerpen) tel. +32 3 270 92 95 - fax +32 3 235 67 11 - E-mail: info@ im dc.be

Further details can be found in Zijlema et al, 2011.


Claim: the model is able to capture the wave dispersion in intermediate and deepwaters
effectively using a few number of vertical layers.
2.2.2.

Tidal flow over an irregular bed

The tidal flow is a simple 1D problem, having an analytical solution. It is used to assess the bed
slope source term, and thus to check whether the code has correct conservation properties.
With this respect, since the same 3D momentum equations are solved, no difference is expected
for the implicit and explicit code. On the other hand, in the explicit scheme, also integrated 2D
momentum equations are solved, so there might be an issue there.
Further details in Zijlema et al, 2011. Test case by Bermudez et al, 1994.
Claim: the model applies the correct conservation properties, such thatno artificial waves are
created, both in the semi-implicit formulation and the explicit formulation.
2.3.3.

Two seich oscillations

This test case can be seen as an extension of the first test case. Again there is an analytical
solution (of the linearized equations), but now the (horizontal) 2D aspect of the flow is assessed.
Comparison between implicit and explicit scheme might clear out the difference in accuracy
between the two methods.
This test case was used as an academic test case to prove the validity of the free surface
correction scheme of Chen, 2003. The implemented scheme in COFIERENS is very similar.
Flence, this test case seems appropriate.
Claim: the model is able to capture wave dispersion for waves generated in two dimensions.
3.BESLUIT
Er werden 3 test cases voorgesteld, die relatief eenvoudig te modelleren zijn in COFIERENS,
om het impliciete schema te valideren.
4.REFERENTIES
Bermudez A., Vazquez M.E., Upwind methods for hyperbolic conservation laws with source
terms. Computers and Fluids 23, 1049-1071, 1994.
Chen X., A free surface correction method for simulating shallow water flows. Journal o f
Computational Physics 189, 557-578, 2003.
Zijlema M., Stelling G., Smit P., SWASFI: An operational public domain code for simulating wave
fields and rapidly varied flows in coastal waters. Coastal Engineering 58, 992-1012, 2011.

T H V IM D C -S o re s m a
in c o i. w ith KU L e u v e n , U G e n t, B M M en W L B

l/R A/11339/10.072/GVH
V e rs io n 2 .0 0 9 /0 8 /2 0 1 2

E x p a n s io n o f n u m e ric a l m o d e lin g to o ls
T a sk o rd e r 4 : D e s ig n o f th e im p lic it s c h e m e in C O H E R E N S

29 8

T H V IM D C -S o re s m a
in c o i. w ith KU L e u v e n , U G e n t, B M M en W L B

Appendix M
Revised manual (extracts)

We highlight the revised parts of the manual. All revisions are marked in red in the uploaded full
manual on the svn-server.
The user can choose the type of hydrodynamic scheme: the mode-splitting technique can
be applied to solve the 2-D and 3-D momentum and continuity equations; or the semi-implicit
scheme can be chosen to solve the 2-D and 3-D continuity and 3-D momentum equations.
a compiled PETSC library which is needed (only) to solve the 2-D continuity equation when
the semi-implicit algorithm is choosen
The PETSC compiler option is needed to solve the linear system formed in the semi-implicit
mode. An error will occur by the compiler if the PETSC library is not installed and linked to
the main source code.
Using PETSc solver library is as follows:
1. Make sure that the PETSC library (Version 3.1 or later) is properly installed.
2. Insert the appropriate library options in compilers.cmp.
3. Insert -DPETSC in options.cpp.
4. Export the PETSC-directory, using the command
export PETSC_DIR = $ H 0 M E / p e t s c - 3 .*-p*

2-D mode equations: In case of the semi-implicit scheme, the 2-D momentum equations are
not needed and the CFL limit is resolved by treating the free surface implicitly.
Two options are available to solve the hydrodynamic equations. The original implemen
tation in COHERENS used the mode-splitting technique as in the model of Blumberg &
Melior (1987) to solve the momentum equations. This method consists in solving the depthintegrated momentum and continuity equations for the external or barotropic mode with a
small time step to satisfy the stringent CFL stability criterium for surface gravity waves, and
the 3-D momentum and scalar transport equations for the internal or baroclinie mode
with a larger time step. A predictor and a corrector step are applied for the horizontal
momentum equations to satisfy the basic requirement that the depth-integrated currents
obtained from the the 2-D and 3-D mode equations, have identical values. Recently, the
possibility to solve the momentum equations semi-implicitly as in the model of Chen (2003),
based on the original work of Casulli & Cheng (1992) was implemented. With this method,
there is no longer need to solve the depth-integrated momentum equations. The stringent
CFL stability criterium is relaxed by treating the terms that provoke the barotropic mode in
an implicit manner. After an explicit predictor step, velocities are corrected with the implicit
free surface correction in hte corrector step. In this method, the free surface correction
follows from the inversion of the elliptic free surface correction equation obtained from the
2-D continuity equation.

T H V IM D C -S o re s m a

E x p a n s io n o f n u m e ric a l m o d e lin g to o ls

in c o i. w ith KU L e u v e n , U G e n t, B M M en W L B

T a sk o rd e r 4 : D e s ig n o f th e im p lic it s c h e m e in C O H E R E N S

The semi-implicit hydrodynamic scheme only uses one (3-D) timestep. In this case, M t = 1
and A t = A t Because of the implict treatment of the free surface wave, for stability, there is
no 2-D CFL time step restriction. The convective CFL criterion does need to be satisfied in
all cells at all times.
There is a possibility to perform the hydrodynamic solution more than once every time step.
Particularly in case of the use of the semi-implicit free surface correction method, the accu
racy can be enhanced by applying extra iterations. The values at these extra iteration levels
are addressed with the following superscrips :
- it:

it

quantity at the previous iteration level


+ 1: quantity at the present iteration level

- mode-splitting The 2-D depth-integrated equations of continuity and momentum are


solved for C, U and V. This involves M t integrations in time.
- semi-implicit free surface correction The 2D depth-integrated continuity equation is
solved for '.

Within the framework of the semi-implicit method for free surface correction, steps 1 to 6
are repeated, according to the convergence criterion for the free surface correction and the
maximum number of iterations specified by the user.
semi-implicit free surface correction:
1. The 2-D continuity equation, written in terms of the free surface correction is solved:

At

( A c

At

( A t h t j g H n+

M7.2 V V

/? i /?2

hi{

( A w u m) +

(h iv n )

/ A lli ' g i l '

X^J

y\

At the level of the equation itself, open boundary conditions for the depth integrated
velocities are already introduced.
2. The free surface elevation is updated
n + l,it+l

_ n + l, i t _|_ /

2)

3. The total water depth is updated, e.g. in the C-nodes:


H n+ l , i t + l = j j n

+ 1,it

(M.3)

and interpolated values are calculated. Also the third grid spacing at the new iteration
level is evaluated.
4. The depth-integrated velocity fields are corrected:
+

Lj n + l , i t + l = Ljp _

(M .4)

V n+ i , i t + i = y p _ & t.hv1g H n+1i t 'vh%Av


y '

5. The definition of filtered velocity is now simply:


U = U n+1'it+ 1 ,

(M.5)

V f = V n +1'it+1

The iteration loop is broken, once one of the two following criteria are met:
1. The maximum amount of iterations is exceeded:

i t > i t max

2. The free surface elevation does no longer change:


treshold value.

m a x (CO

l/R A/11339/10.072/GVH
V e rs io n 2 .0 0 9 /0 8 /2 0 1 2

<

e,

with e the user-defined

300

T H V IM D C -S o re s m a

E x p a n s io n o f n u m e ric a l m o d e lin g to o ls

in c o i. w ith KU L e u v e n , U G e n t, B M M en W L B

T a sk o rd e r 4 : D e s ig n o f th e im p lic it s c h e m e in C O H E R E N S

Solution of the discretised equations for 2-D continuity


Within the framework of the semi-implicit free surface correction method, the 2-D continuity
equation turns into an elliptic equation for the free surface correction '. The implicitness of
the free surface correction gives rise to a matrix system, which typically consists of five (off-)
diagonals. For an internal node, the linear equation takes the form
(M.6)
At the boundaries, a different representation exists, depending on the type of open boundary
condition. The inclusion of the boundary condition prior to the solution of the linear system
is crucial for elliptic systems, since the influence of the boundaries are not restricted to
the boundary itself, but extend to the entire domain. Since open boundary conditions are
imposed at the level of the integrated velocity field, it is advantageous to write the linear
system in a finite-volume context, i.e. on a flux-basis, rather than filling out the coefficients
of M.6 cell per cell.
Composition of the fivediagonal matrix
1. Time derivative.
The contribution of the time derivative is given by:

2. U-velocity fluxes
For the determination of the contribution of the fluxes to the linear system, the fluxes are
calculated at a certain cell face (U-node). In the finite-volume context, the contribution
of the flux is the same (but with opposite sign) for the two adjacent cells. For the velocity
flux at the western face of cell i j, the contributions are:

with the intermediate variables a and v defined as:


V

(M.9)
h \h o

3.

V-velocity fluxes
For the velocity flux at the southern face of cell ij, the contributions are:

with the intermediate variables a and v defined as:


V

l/R A/11339/10.072/GVH
V e rs io n 2 .0 0 9 /0 8 /2 0 1 2

( ^ )

hiho h%

n + 1 , i t ;v

(M.11)

301

T H V IM D C -S o re s m a
in c o i. w ith KU L e u v e n , U G e n t, B M M en W L B

E x p a n s io n o f n u m e ric a l m o d e lin g to o ls
T a sk o rd e r 4 : D e s ig n o f th e im p lic it s c h e m e in C O H E R E N S

4. Open boundary conditions


As mentioned, the open boundary conditions are incorporated in the matrix system
at this stage. The specific contributions depend on the type of boundary condition.
Section 5.3.15.1 describes the values of the U- and V-velocity fluxes at the boundaries,
to be introduced in the equations. Replacing superscripts m and m+1 for the mode
splitting scheme by n and n+1it+1 respectively, gives rise to the equations, adjusted
for the semi-implicit free surface correction scheme. Dependence of the boundary
conditions on ' is revealed by introducing M .2- M.4 into the adjusted equations.
solution of fivediagonal systems At present, no algorithm is programmed within the COHE
RENS source code. An external library is used to solve the linear system, arising from the
discretisation of the 2-D continuity equation. With the compiler option -DPETSC, links are
made with the PETSC-library. Different algorithms (linear solvers and preconditioners) are
available, whose default values (Incomplete Cholesky preconditioner in combination with a
GMRES solver) can be changed by the user. Since the solvers are iteratice, also a tolerance
level has to be provided.

l/R A/11339/10.072/GVH
V e rs io n 2 .0 0 9 /0 8 /2 0 1 2

30 2

T H V IM D C -S o re s m a
in c o i. w ith KU L e u v e n , U G e n t, B M M en W L B

Bibliography

Blumberg, A.F., & Melior, G.L. 1987. A description of a three-dimensional coastal ocean circulation
model. Pages 1-16 of: Heaps, N.S. (ed), Three-dimensional Coastal Ocean Models. Coastal
and Estuarine Sciences. Washington D.C.: Americal Geophysical Union.
Casulli, V., & Cheng, R.T. 1992. Semi-implicit finite difference methods for three-dimensional
shallow water flow. International Journal for Numerical Methods in Fluids, 15, 629-648.
Chen, X. 2003. A free-surface correction method for simulating shallow water flows. Journal of
Computational Physics, 189, 557-579.