discontinuous galerkin finite element method for solving

87
School of Mathematics University of Nairobi ISSN: 2410-1397 Master Project in Mathematics Discontinuous Galerkin Finite Element method for solving Equations in Ocean Circulation Research Report in Mathematics, Number 12, 2017 Mathias Nthiani Muia I56/82837/2015 August 2017 Submied to the School of Mathematics in partial fulfilment for a degree in Master of Science in Applied Mathematics

Upload: others

Post on 13-Apr-2022

9 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Discontinuous Galerkin Finite Element Method for Solving

Scho

olof

Mat

hem

atic

sU

nive

rsit

yof

Nai

robi

ISSN: 2410-1397

Master Project in Mathematics

Discontinuous Galerkin Finite Element method for solvingEquations in Ocean Circulation

Research Report in Mathematics, Number 12, 2017

Mathias Nthiani MuiaI56/82837/2015

August 2017

Submied to the School of Mathematics in partial fulfilment for a degree in Master of Science in Applied Mathematics

Page 2: Discontinuous Galerkin Finite Element Method for Solving
Page 3: Discontinuous Galerkin Finite Element Method for Solving

Master Project in Mathematics University of NairobiAugust 2017

Discontinuous Galerkin Finite Element method forsolving Equations in Ocean CirculationResearch Report in Mathematics, Number 12, 2017

Mathias Nthiani MuiaI56/82837/2015

School of MathematicsCollege of Biological and Physical sciencesChiromo, o Riverside Drive30197-00100 Nairobi, Kenya

Master of Science ProjectSubmied to the School of Mathematics in partial fulfilment for a degree in Master of Science in Applied Mathematics

Prepared for The DirectorBoard Postgraduate StudiesUniversity of Nairobi

Monitored by: The DirectorSchool of MathematicsUniversity of Nairobi

Supervised by: Dr Charles NyandwiSchool of Mathematics

Page 4: Discontinuous Galerkin Finite Element Method for Solving

ii

Page 5: Discontinuous Galerkin Finite Element Method for Solving

iii

Abstract

Fluid mechanics is a branch of mechanics that is concerned with the study of uids, their

properties and the eects of forces acting on them. It can be used to model a large number

of uid systems including the ow of water down the bathroom sink to the complex

systems of ocean and atmospheric circulations. This project analyzes key components of

the ocean circulation modeling and presents the physical and computational issues raised

in numerical solution of equations generated in the study of shallow water ows in the

earth’s atmosphere. We describe ocean circulation into detail and outline the relationship

between oceanic and atmospheric circulation. The ocean-atmospheric circulation discussed

in chapter one is made to help us understand the eects of Ocean circulation on weather,

climate and the global energy transfer. The main equations connected to ocean circulation

(in a rotating framework) have been introduced and systematically modied by applying

some standard approximations to obtain the so called shallow water equations (SWEs).

SWEs, as example of hyperbolic system of partial dierential equations, have been most of

the time solved using the Finite Dierences Method (FDM). Finite Element methods (FEM)

and Finite Volume methods (FVM) have also been used. The 2D SWE representing oceanic

circulation has not been solved in this work. At a later stage of this work, we derive the 1D

shallow water equations which are free of the Coriolis parameter and the eect of rotation.

This 1D SWE is then solved using the Discontinuous Galerkin Finite Element Method

(DGFEM). The reason why we choose this method over the many numerical methods

is because it combines the advantages of the FEM and FVM and seems to present well

balanced solutions. In particular we use the Runge-Kutta DGFEM in nding our solution

due to the following reasons:

1- Its ability to preserve the capability of the FEM of handling complicated geometries.

2- It increases the degree of approximating polynomials locally. This allows ecient

p-adaptivity for each element independently.

3- Allows data communication only between neighboring elements. This gives room

for an ecient parallelization.

Although recent advances on the DGFEM for the shallow water equations with topography

source terms have been considered, we limit ourselves on the solution of one dimensional

shallow water equations which are free of th Coriolis parameter and the eects of rotation.

This choice is made so that we can easily illustrate the main advantages of this method

especially if the dam break problem is concerned.

Page 6: Discontinuous Galerkin Finite Element Method for Solving

iv

Dissertations in Mathematics at the University of Nairobi, Kenya.ISSN 2410-1397: Research Report in Mathematics©Mathias Nthiani Muia, 2017DISTRIBUTOR: School of Mathematics, University of Nairobi, Kenya

Page 7: Discontinuous Galerkin Finite Element Method for Solving
Page 8: Discontinuous Galerkin Finite Element Method for Solving

vi

Declaration and Approval

I the undersigned declare that this project report is my original work and to the best of

my knowledge, it has not been submitted in support of an award of a degree in any other

university or institution of learning.

Signature Date

Mathias Nthiani Muia

Reg No. I56/82837/2015

In my capacity as a supervisor of the candidate, I certify that this report has my approval

for submission.

Signature Date

Dr Charles Nyandwi

School of Mathematics,

University of Nairobi,

Box 30197, 00100 Nairobi, Kenya.

E-mail: [email protected]

Page 9: Discontinuous Galerkin Finite Element Method for Solving
Page 10: Discontinuous Galerkin Finite Element Method for Solving
Page 11: Discontinuous Galerkin Finite Element Method for Solving

ix

Dedication

This project is dedicated to my family.

Page 12: Discontinuous Galerkin Finite Element Method for Solving

x

Contents

Abstract ............................................................................................................................... iii

Declaration and Approval..................................................................................................... vi

Dedication ........................................................................................................................... ix

Acknowledgments .............................................................................................................. xii

1 Introduction: Ocean circulation Modelling ...................................................................... 1

1.1 Oceans and Ocean circulation ............................................................................................. 11.1.1 General Atmosphere-Ocean circulation ........................................................................... 21.1.2 Numerical ocean Modelling .......................................................................................... 31.1.3 Physical and computational issues in numerical ocean circulation modelling .......................... 4

2 Background of the problem............................................................................................. 9

2.1 Problem statement ............................................................................................................ 102.1.1 Main objective .......................................................................................................... 102.1.2 Specific objectives ..................................................................................................... 10

2.2 Applications of SWEs ........................................................................................................ 102.3 Literature review............................................................................................................... 11

3 The shallow water equations ......................................................................................... 14

3.0.1 Time-step limitations on the HPEs ............................................................................... 193.0.2 External gravity waves ............................................................................................... 193.0.3 Rigid-lid approximation .............................................................................................. 203.0.4 Implicit free surface ................................................................................................... 213.0.5 Split-Explicit method ................................................................................................. 223.0.6 Accelerating to equilibrium ......................................................................................... 233.0.7 Vertical modes .......................................................................................................... 233.0.8 Slowing down inertia-gravity waves.............................................................................. 24

3.1 SWE for a flow through a Channel .................................................................................... 273.1.1 3D shallow water equations ........................................................................................ 273.1.2 2D shallow water equations ........................................................................................ 293.1.3 One-dimensional SWE ............................................................................................... 32

4 Finite Element Methods for PDEs .................................................................................. 35

4.1 Introduction: Partial Dierential Equations (PDEs) ............................................................. 354.1.1 Methods of solving PDEs ............................................................................................ 364.1.2 Finite element Method ............................................................................................... 374.1.3 Steps in the Finite Element Approach............................................................................ 384.1.4 Strong Formulation (Poisson Equation) ......................................................................... 384.1.5 Weak Formulation (Poisson’s Equation)......................................................................... 384.1.6 Approximating the Unknown u .................................................................................... 40

Page 13: Discontinuous Galerkin Finite Element Method for Solving

xi

4.1.7 Basis Functions......................................................................................................... 414.1.8 Solving the Poisson Equation....................................................................................... 434.1.9 Minimization formulation ........................................................................................... 434.1.10 Weak formulation ..................................................................................................... 444.1.11 Geometric representation ........................................................................................... 444.1.12 Summary................................................................................................................. 47

4.2 Discontinuous Galerkin method (DG) ................................................................................ 474.2.1 Runge-Kua Discontinuous Galerkin method (RKDG) ..................................................... 484.2.2 Steps in the RKDG method ......................................................................................... 484.2.3 The general RKDG methods and their stability ............................................................... 504.2.4 Stability .................................................................................................................. 514.2.5 Round-o errors ....................................................................................................... 534.2.6 The generalized slope limiter ....................................................................................... 54

5 The DG for solving the 1D SWE..................................................................................... 55

5.0.1 Spatial discretization ................................................................................................. 555.0.2 The weak formulation ................................................................................................ 56

5.1 Practical problem: The dam break problem......................................................................... 625.1.1 Boundary conditions ................................................................................................. 62

6 Results, Conclusions and Recommendations .................................................................. 66

6.1 Results ............................................................................................................................. 666.1.1 Conclusion............................................................................................................... 666.1.2 Recommendation ...................................................................................................... 68

Bibliography....................................................................................................................... 69

7 Appendix...................................................................................................................... 73

7.1 MatLab Code for the Problem............................................................................................ 73

Page 14: Discontinuous Galerkin Finite Element Method for Solving

xii

Acknowledgments

First and foremost, my gratitude goes to the Almighty God for granting all of us peaceand good health to proceed successfully with this work.

Second, I would like to thank the University of Nairobi for oering me a scholarshipwhich enabled me undertake my studies comfortably. I appreciate my lecturers in thedepartment of Mathematics for equipping me with the knowledge to enable me face thiswork with ease.

I would also like in a more special way to thank my supervisor Dr. Charles Nyandwi forthe hard work he did guiding me on all the aspects of this work to see that my work wasof good quality. I could not have managed to come this far without his support.

Next I would like to pass my heartfelt gratitudes to my classmates, Kariuki D. Waweru,Jenier Chepkoril, Patrick Kamuri and Robert Makanga for being always there for mewhen I needed their assistance during this work.

Lastly, I would like to pass my sincere gratitude to my family for persevering the hardshipsI had to take them through during the accomplishment of this work. To all whom I havenot mentioned here by name and contributed to my success, feel appreciated.

Mathias Nthiani Muia

Nairobi, 2017.

Page 15: Discontinuous Galerkin Finite Element Method for Solving

1

1 Introduction: Ocean circulation Modelling

1.1 Oceans and Ocean circulation

About two-thirds of the earth’s surface is occupied by water bodies. The water bodiesinclude oceans, seas, lakes, rivers, swamps artificial water reservoirs such as dams. Inthis project, we are going to study shallow water flows in these systems, study oceanichydrodynamics and solve a one dimensional shallow water flow then apply the solutionobtained to the dam break problem.

Oceans play a very important role in the global weather and climatic paerns. They act asa regulatory devices for the global climate, for instance by transporting huge amounts ofheat from the tropical regions to the poles. During the process of ocean circulation, largeamounts of energy are transported around the world. This is done by both surface anddeep ocean currents which flow within the oceans like rivers; some currents are violent ontheir course whereas others are slow and meander along their course. Ocean circulationis caused by a combination of winds and variations in both temperature and salinity.The movements of the earth especially its rotation play a very important role in dictatingthe paths taken by water masses during ocean circulation. Wind-driven circulation mainlyoccur within a region between the surface of the ocean and a depth of a few hundred ofmeters. Changes in temperature and salinity of the ocean water lead to variation in densitywhich is a key factor contributing to massive water movements. Density-driven circulationis mainly dominant near the ocean boom and takes place in form of "thermohaline"circulation. This is because it is caused by temperature dierences and changes in salinity.Thermohaline circulation is also termed as "overturning" circulation and involves verticalwater movements, whereby warm water flows towards the poles near the surface, at thepoles, it gets cooled, sinks and flows back towards the equator in the interior. This form ofcirculation is very significant for support of aquatic life as convectional eect causes coldwater from beneath to rise upwards to fill the gap le by the misplaced water a processcalled "upwelling". The upwelling part of thermohaline circulation is important as it bringsnutrient-rich deep water up to the surface hence playing as a mode for supplying nutrientsto ocean living organisms. Radiocarbon tests shows that this mode of ocean circulationturns over all the ocean water within periodic intervals of about 600yrs. This form ofcirculation transports about 1015W of heat energy towards the poles hence playing a verycrucial role in the earth’s climatic changes.

Factors that influence ocean circulation

Page 16: Discontinuous Galerkin Finite Element Method for Solving

2

Temperature: This Ocean property is mainly dependent on the atmosphere whichtakes or adds heat on the surface of the water. Temperature dierences in dierent layersof the ocean water influences circulation through convectional currents.

Salinity: This refers to the quantity of salts dissolved in the water. Sea water is composedof 3.5 percent salt with Sodium chloride being the most common salt. This property variesby small ranges in the surface zone. This variation is suicient to aect water circulation.

Pressure: It is the eect of the weight of overlying water mass felt at a given depth.This property varies with depth. The atmosphere also exerts pressure on the water surface.Variation in pressure on the water layers may cause the density to change which in turntrigger density-driven ocean circulation.

Density: We define density as mass per unit volume. In water bodies, density increaseswith depth. It is dependent on temperature, salinity and pressure and its variation betweentwo regions of the ocean trigger mass movements of water. In most models, densityvariations are usually ignored and eliminated by applying the Boussinesq approximationto obtain the so called Boussinesq equations.

In modeling of natural phenomena such as weather and climate, dynamics in both theoceanic and atmospheric systems are very important. This is because a lot of exchangestake place between these two including exchange of dierent forms of energy such asheat, exchange of moisture and water in the processes of evaporation and precipitationrespectively. Due to these inter-relationships, we cannot talk about oceanic circulationwithout touching on atmospheric circulation.

1.1.1 General Atmosphere-Ocean circulation

Models of the ocean and the atmosphere deal with descriptions of circulations of heat,water, air and other components of these systems. In the circulations that take place inboth systems, a lot of exchanges take place and this makes it possible to come up witha combined model design. A combined ocean-atmosphere general circulation is used tostudy the features of the ocean circulation and its impacts on the climate of the world(Toggweiler, 1994). This is achieved in a succession of global experiments and models thathelp predict the future changes in the climate resulting from eects of ocean circulation.The oceans play a very vital role acting as a storage site for heat to regulate seasonalchanges in the atmosphere as well as act as a transport media, moving heat all over aroundthe globe. Heat transported by the ocean is a very important component of the globalheat budget, (Trenberth and Caron, 2001). Dierent ocean circulation models developed

Page 17: Discontinuous Galerkin Finite Element Method for Solving

3

by dierent researchers have been observed to come up with a fine detail.Changes in the land surface configurations (topography) adjacent to the ocean coastcauses variation in temperatures, winds and rainfall. This is because heat transportswithin the system are aected to some extend. Study indicates that if all the oceantransport was to be inhibited, it would lead to a reduction in the global mean of 8oC,coupled with a sharpening of the meridional temperature gradient. This is because oceantransport is very important in in determining the global atmospheric humidity. The levelof humidity (amount of water vapor in the air) determines the tropical albedo hence actingas a regulator of global surface temperatures.The atmospheric and oceanic systems are complex ones, with processes and feedbacksthat operate over timescales ranging from seconds to thousands of years and spacial scalesranging from millimeters to tens of thousands of kilometers. This complexity together withthe inability to perform controlled experiments has led to invention of more sophisticatedclimatic and oceanic models e.g. Gordon et al. [2000]; Roeckner et al. [2003]; Marslandet al. [2003] which are climatic models capable of providing suitable feedbacks betweencomponents. However, due to the high costs of integrating these models, they are onlyappropriate for use in questions of the past, current and future climatic systems. Tocounter this, more general and simpler models are coming up for purposes of learningspecific processes that function in our climatic systems. According to Broecker, (1985) andMcManus, (2004), changes in the thermohaline part of ocean circulation are consideredto have been very influential in the climatic changes that has been experienced over theearth’s history.The eects of changes in the ocean circulation and transport systems has been analysedin a number of studies. The first general ocean circulation model was developed byStommel (1948) and Munk, (1950). They generated analytical models of wind-driven oceancirculation confined in rectangular basins. This they did by applying simplified dessipativelaws. The first numerical ocean circulation models were developed by Bryan and Cox(1967) while the impacts of ocean circulation on climate were addressed later in time withthe development of coupled atmosphere-ocean circulation models.The strong interdependence between ocean circulation and the climate means that amodel designed to predict climatic changes must include aspects of ocean circulation andmixing as well as aspects of atmospheric circulation plus the physics of weather factors.

1.1.2 Numerical ocean Modelling

Numerical ocean modelling entails computational techniques that describes mathemat-ically aspects of the ocean. It is important in making predictions of ocean processes tosome points in the future. It gives a convenient way of mathematically representingphenomena connected to this complex geophysical system. Oceanic models are usedwidely by oceanographers and weather/climate scientists as experimental tools. Withgreat improvements in the understanding of ocean models together with developmentin related computer programs, we can today model very realistic ocean fluid dynamics

Page 18: Discontinuous Galerkin Finite Element Method for Solving

4

representations.Today this field is growing rapidly due to its many applications. Some of the applicationsof ocean model design include; studies of climate change, oceanography and ultra-refinedresolution process studies. The challenge being faced today by developers is that of codedistinctions which prevents mathematicians from interchanging algorithms. This makesit diicult to compare simulations directly or reproduce them using dierent codes henceincreasing burdens of model design maintenance.Numerical ocean modelling involves solving geophysical fluid dynamics equations. Dif-ferent modelers take dierent approaches to represent the ocean fluid dynamics i.e. interms of the model equations and the method used to solve them. The type of model alsodepends on the aspect of the ocean being modeled. Models such as Dale B. Haidvogel,John L. Wilkin and Robert young (1988) use the complete primitive equations with sigma-vertical coordinates to study regional and basin-scale ocean circulation processes. This isjust an example which presents just a grain of sand in the desert in terms of models thatare 3-dimensional.Many modelers have made modifications on the complex original 3D equations to obtainforms of equations that best suits their area of study. An example of modified equationsis the shallow water equations which are simplifications of the 3-D set of equationscontaining the Navier-Stokes equations, equations representing tracer distribution andthe equation of state. Oceanic wave modelling for waves that have large wavelengths isdone using the shallow water equations (E. Hanert, V. Legat and E. Deleersnijder, 2002).Models are usually associated with partial dierential equations called primitive equationswhich have to be solved at the end. To solve the final model equations three numericalmethods have been used in the history of oceanic-atmospheric modelling, namely; thefinite dierence methods (FDM), Spectral methods (SM) and the finite element methods(FEM). Using these solutions, approximations are then made to interpret the properties offlows in the ocean. Manipulations are done on the obtained equations mainly throughintegrations over the ocean depth to obtain other forms of the equations known as Shallowwater equations.Modeling practices are usually associated with a wide range of diiculties. The modeler isfaced by challenges of making decisions on the choice of the numerous approaches thatcan be undertaken to accomplish the task of modelling. The section below presents thephysical and computational issues encountered in oceanic modeling.

1.1.3 Physical and computational issues in numerical ocean circulation mod-elling

The process of modeling involves physical, mathematical and computational aspects thathas to be handled in order to arrive at the final results and conclusions. The modeler hasto make decisions on;

a). The choice of scales (time- and spatial scales)

Page 19: Discontinuous Galerkin Finite Element Method for Solving

5

The ocean basins are thousands of kilometers in width and length. Circulations herepresent themselves in a wide range of time, space and mixing scales. The choice of thetime- and spatial-scales has a significant eect on the numerical scheme to be used tomodel them.

b). choice of vertical coordinatesThe depth of the ocean varies with some regions having depths of up to 5kms in aver-age. The dominant form of circulation in the vertical is the thermohaline circulation.Vertically, the scale is normally very small compared to the horizontal scale, a propertyknown as shallow water condition . In such flows the vertical accelerations of the fluidare negligible implying an hydrostatic nature of the fluid. Most of the flows that takeplace on the surface of the earth are shallow water flows. .Traditional vertical coordinates can either be geopotential, terrain-following, isopycnal,hybrid or pressure coordinates. The terrain-following coordinate is suitable for represent-ing an irregular boom topography. Isopycnal coordinates are commonly adopted foridealized adiabatic simulations. They are widely used in global climate based simulationsespecially in a combination with the pressure coordinates. The hybrid coordinates areused in models aimed at generalizing vertical coordinate formulation. They allow otherdierent vertical coordinates to be fixed depending on the model application and the fluidregime hence providing a specific area to work on for their next development.

c). Acoustic modes and gravity wavesThe shallow water equations are linear in nature and this allows the existence of a largeassortment of waves that are seen in the large scale circulation of the ocean. These wavesare characterized by wavelengths which are long relative to the ocean depth and canbe classified as external or internal waves. Waves that can be supported by a fluid ina rotating framework include the inertia-gravity, Kelvin and Rossby waves. Rossbywaves, also called planetary waves are created by variation of the Coriolis parameter or bychanges in the elevation of the boom floor They greatly contribute in the developmentof large scale circulations of the ocean. Gravity waves on the other hand are generated bygravity and they are much faster than the Rossby waves.Kelvin waves are caused by a combination of variation of the Coriolis parameter andthe existence of dynamical boundaries. They have a minor impact on the general oceancirculation as they transport very small portions of the total ocean energy budget.

d). AssumptionsValid assumptions and approximations on the original equations have to be considered.These approximations help to simplify the equations by eliminating acoustic modes andlinearizing non-linear terms. The approximations used include; Boussinesq approximation,hydrostatic approximation, Newtonian fluid approximation and the spherical geopotential.The approximations used in this work are discussed in the next section.

Page 20: Discontinuous Galerkin Finite Element Method for Solving

6

e). Rotation of the earthThe geopotential approximation assumes that the earth is spherical, (Hanert, 2004) andin constant spinning about its axis, a movement called rotation. The eects of a rotatingframework of reference on the equations of motion must be put into consideration duringderivation of the primitive equations. The earth’s rotation vector is defined by Ω = Ω kwhere k = cosθ ey+sinθ ez is a unit vector along the rotation axis of the earth. The Coriolisacceleration is given as

2Ω × v = f∗ey× v+ f ez× v

where f = 2Ω sinθ is known as the Coriolis parameter and f∗ = 2Ω cosθ is the reciprocalof the Coriolis parameter. We also assume the gravitational acceleration, g to be constant.

f). Mixing scalesA major part of oceanic flows is involved with the transport of tracers such as temperature,salinity and other biochemical species. Temperature and salinity directly aects density ofthe ocean water and hence influence the dynamics of the oceans. These two are classifiedas active tracers while the other tracers which have less influence on the dynamics of thefluid are called passive tracers.Tracer concentration is aected by the convergence of tracer flux plus the potentiallynon-zero sources or sinks. Alternatively, tracer concentration may be caused to varyby the mixing caused by small-scale turbulent motions having lengths as small as justa few centimeters. The full extend of these small-scale motions in the ocean model isparameterized by use of some diusion operator to outline their large-scale eects.On the surface layer, the tracer concentration keeps on changing as a result of; additionof fresh water from rivers and precipitation and heat exchange with the atmosphere.The process of balancing tracer concentration is a continuous one. This is achieved viadiusion and oceanic fluid movements (both horizontal and thermohaline circulations).

g). The governing equationsSome physical and computational challenges are encountered during the simulation. Theoceanic general circulation includes the horizontal and vertical transport of water, heat,air, salts and other biogeochemical species. All these components of the ocean are involvedin establishing the dynamical balances in the oceanic systems. The circulation thereforeincludes associated pressure, salinity and temperature fields which influence currentsthrough the density variations. Due to the rapid growth of this field, alot of time andresources are being devoted to research activities. Many questions arise during the designof models with some remaining partially answered while others remain completely unan-swered. These fundamental questions give the motivation to mathematicians, physicistsand oceonographers to venture in studies in these fields so as to come up with validanswers. Ocean circulation is normally described by the Navier-Stokes equations sedin a rotating framework plus the equations relating conservation of tracer deposits and

Page 21: Discontinuous Galerkin Finite Element Method for Solving

7

the equation of state. These are the equations that modelers aim to discretize and mostof the questions asked in the field of ocean circulation modeling are connected to theseequations. The questions to answer include;

• The question of whether the equations used in the model should be hydrostatic ornon-hydrostatic? The model of Marshal et al. (1997) states that both forms of modelsare equally suicient.

• Should the fluid flow be taken to be compressible or should it be incompressible?Incompressibility of the fluid is achieved by applying the Boussinesq approximation(discussed later in this chapter). Some modelers today are opting to use non-Boussinesqfluid conditions in their work to represent sea level changes due to steric eects, Griies(2004); Marshall et al. (2003); Lorsch et al. (2004).

• Another dilemma encountered is whether to consider the upper free surface of theocean as non-varying in time (Bryan [1969]) or should we allow it to fluctuate naturallydue to water motions? A fluctuating/varying surface puts into consideration the eectsof addition of fresh water onto the surface and lose of water in form of water vapourinto the atmosphere.

• Aer selecting the model equations known as primitive equations, the question ofthe choice of vertical coordinates to be adopted arises. We have a wide range ofvertical coordinates to choose from which include terrain-following sigma coordi-nates, geopotential coordinates, isopycnal coordinates and the generalized hybridcoordinates.

• Which horizontal grid system should be used? In the solution of the primitive equations,we have to discretize the domain using horizontal grids. Some of the commonly usedgrid systems are the traditional A, B, C, D and E grids of Arakawa and Lamb (1997),the spectral methods discussed by Haidvogel and Beckmann (1999).Numerical methods are very important for time-stepping the ocean forward. Thenumerical methods used include, Finite volume methods (FVM), Finite dierencemethods (FDM), Finite element Methods (FEM), Continuous/Discontinuous GalerkinFinite Element Method and spectral methods

As a result of all these issues associated to ocean circulation models, specific accurateapproximations and assumptions are applied to reduce the original equations to simplerforms. In this work, we choose to modify our original equations into the shallow waterequations (SWE). We begin with the continuum equations of hydrodynamics expressed ina rotating framework and reduce them to the shallow-water equations form. This wayof connecting from the 3D hydrodynamics equations to 2D SWEs also helps us avoidthe diiculty encountered solving the full 3D equations. SWEs are suitable for modeling

Page 22: Discontinuous Galerkin Finite Element Method for Solving

8

waves in the atmosphere, rivers, lakes, dams, oceans and seas that have large wavelengthscompared to the depth of the water basin. They are applied in models of Rossby andKelvin waves and under some conditions the gravity waves. SWEs are used to model tideswhich have very large wavelengths of roughly up to 100 kilometers. Hence the very deepocean may be assumed to be shallow when it comes to tidal motion since the depth ismuch smaller than the tidal wavelength.In this work we choose the shallow water type of model since our work is to the largerextend based on ocean circulation that involve oceanic waves such as the Kelvin andRossby waves which display very large wavelengths. In their linearized form the shallowwater equations still display the main features of these waves. The acoustic waves areeliminated by making the flow incompressible. This is done by applying the Boussinesqapproximation which assumes that no density variations in the fluid. The acoustic/soundwaves make use of compressibility of the water and are very fast to be relevant forgeophysical flows. The incompressibility of the flow implies non-divergence and we callthis type of flow barotropic (flow with no density variations). The only driving forces inthese flows are the gravity and Coriolis force and the waves propagated in this kind offlows are the Kelvin and Rossby waves. The type of shallow water equations on which ourmodel will be based takes the form given below. The derivation of these equation is donein chapter 3. The 2-D SWE derived in chapter 3 is not solved in this work, it has been leto be solved in further work.

Page 23: Discontinuous Galerkin Finite Element Method for Solving

9

2 Background of the problem

The origin of the shallow water equations dates back to the mid 19th century. The conceptof shallow water flows was first initiated by a French mathematician and mechanician,Adhemar Jean Claude Barre de Saint-Venant (1797-1886). He contributed significantlyin the initial stress analysis and developed the unsteady open channel flow shallow waterequations (also known as the Saint-Venant equations).With the advancement of computational technology, many applications of these equationshave mushroomed in dierent disciplines. For instance, they are used in modeling ofoceanographic and atmospheric fluid flows to design models that describe phenomena inthese systems. For example, modelers have come up with designs that help in predictionof climatic changes, spread of pollutants polar ice-cap melting, e.t.c to mention but afew. With the growing interest of research in the fields of oceanography and atmosphericstudies, dierent researchers have come up with shallow water models that suit dierentpurposes. Dronkers (1964) describes the use of shallow water equations to determineocean circulation paerns and tidal elevations at the interior of an enclosed region subjectto tidal waves. Kahawarn (1978) proves the relevance of the shallow water equations inthe prediction of tsunami waves which are known for causing severe flooding destructionof property and loss of lives. Research being still active in this field, mathematicians,physicists and oceanographers are still seeking for the possibility of using these equationsto model schemes that would be useful for conversion of tidal energy into commerciallyutilizable forms. Aempts in this interesting field are outlined in the works of Charlier(1982) and Gray and Gashaus (1972). Leendertse, 1967, used SWEs model to describe theeect of waves originating from explosion of military nuclear bombs near ocean surfacesor in the interior of the ocean water.The numerical solution of shallow water equations was among the first numerical simula-tions to be carried out on digital computers during their invention in the 1950’s. Hensen,(1956) used computational power to model oceanographic flows using SWES while Char-ney et al. (1950) modeled atmospheric flows.All authors and/or researchers have arrived to the SWES through successive approxi-mations of the general equations governing fluid motions. These general equations arenormally the well-known Navier-Stokes equations plus the equations of conservation oftracer deposits (heat, salt and biogeochemical tracers) and the equation of state. Severalnumerical methods have been applied to solve the final exact form of the SWES with themostly used method being the Finite Dierence Method (FDM). Hanert (2004) in his PHDthesis uses the FEM with unstructured grids to arrive at quite nice results. Other methodswhich have been applied to solve these equations include the Riemann solver for SWES(J. Bohacek [2015]; L. George [2004]; D. Ambrosi [1995]), the collocated coupled solution

Page 24: Discontinuous Galerkin Finite Element Method for Solving

10

method (CCSM) used by Aukje de Boer (2003). There are several more methods whichhave been proved to give very accurate solutions.In this work, we use the Discontinuous Galerkin Finite Element Method to solve theone-dimensional shallow water equation for a flow through a channel.

2.1 Problem statement

Our main task in this project is to study and understand the numerical methods of solvingSWEs and specifically apply the Discontinuous Galerkin finite element method to solvethe 1D SWE;

∂tu+∂x f (u) = s(u)

subject to initial conditions defined by a dam channel domain:

h(x,0) =

hL, if 0≤ x≤ 300

hR, if 300 < x≤ 1000

u(x,0) = 0 0≤ x≤ 1000

This equation is the conservation law form of the 1D SWE derived in chapter 3.

2.1.1 Main objective

To study and understand Shallow water flows, translate the dynamics mathematicallyinto equations and use these equations to come up with a model that can be of importancein the societies in which we live.

2.1.2 Specific objectives

1. To study and understand fluid flows on the sphere and relate the flows to the shallowwater equations.

2. To apply the SWEs to model flows in a channel.

3. To study and understand the FEM and the DG finite element method for solving PDEs.

4. To apply step-wise DG formulation to the 1D-SWE to determine its numerical solution.

2.2 Applications of SWEs

Shallow water flows are experienced in oceans, rivers, coastal estuaries, lakes and theatmosphere. In addition to ocean circulation modeling the shallow water equations havemany more practical applications in dierent disciplines. These include;

Page 25: Discontinuous Galerkin Finite Element Method for Solving

11

i. In oceanography to determine tsunami-wave propagation and prediction of tidal cur-rents. This is important for navigation purposes in seas and oceans and prediction ofdisasters.

ii. Analysis of the dam-breaking problem and the associated flood elevation.

iii. Determination of pollutant dispersion and storm surges.

iv. In meteorology and atmospheric flows to predict weather and climatic changes.

v. Planetary flows (Vreugdenhill, 2004) and internal flows.

2.3 Literature review

Rigorous research has been undertaken in the study of oceanic and atmospheric circula-tions. Dierent numerical models that describe the dynamics in these complex geophysicalsystems has been on the growth for the last over 50 years.The first model of ocean circulation was designed in the 1900’s aer Ekman, (1905)described the eects of the rotation of the earth on oceanic currents. Sverdrup, 1947,described the eects of rotation on wind-driven currents. He came up with a simple lawgoverning this relation. However, these initial models were non-numerical, they formed abasis for the development of modern numerical models. Bryan and Cox, (1967) combinedthe very first numerical ocean circulation model. Since their pioneering, models thataim at predicting dierent physical phenomena have been on the rise. Haidvogel andBeckmann, (1999), give a more detailed overview of the numerical modelling.Dale B. Haidvogel, (1991) uses spectral methods with vertical sigma coordinates and or-thogonal curvilinear horizontal coordinates to solve the full equations of ocean circulation.His model becomes very eicient for irregular basin geometries with non-uniform boomtopography.

Bernard Bernier, Patrick Marchesiello, Anne Pimenta and Macky Coulibaly, (1995) de-scribes the terrain-following σ−coordinates numerical model for a case study of circulationin the south Atlantic. Their model is of the semi-primitive type-a model introduced byHaidvogel et al., (1991). In this work, they investigate the advantage of σ−coordinates inthe calculation of pressure gradient and the diusion of tracers. They make use of openboundary conditions based on radiation conditions and climatology relaxation.

Haidvogel and Beckmann, (1999) ocean model give a good description of the general oceancirculation. They present 3-D ocean models using the Modular Ocean Model (MOM)approach, Spectral coordinate models (SPEM), Miami Isopycnic Model (MICOM) andSpectral Element Ocean Model (SEOM). They give detail applications of each of thesetypes of models and proceeds to give a case study on the North Atlantic ocean modelusing the SPEM approach.

Page 26: Discontinuous Galerkin Finite Element Method for Solving

12

Many authors and researchers have made use of the Finite Dierence Method (FDM)and the Finite Volume Method (FVM). ing Wang, (2007) describes a FEM ocean modeland its aspect of vertical discretization. He concentrates mainly on the study of theperformance of dierent vertical grids by using a couple of numerical experiments basedon the FE ocean models. He also develops a new version of a Finite Element Ocean circu-lation Model (FEOM). The horizontal span in his work is based on unstructured triangularelement grids and prismatic grids in the vertical sense. He makes use of continuous linearequations to describe the horizontal aspects such as velocity, temperature and salinity.The standard set of hydrostatic primitive equations are solved with the characteristicbased split (CBS) scheme which is used to suppress computational pressure modes.The FE method has not been used as widely as the FD method. Since the use of thismethod by Fix (1975), the most applications of the FE method has been mainly on thecoastal and shelf regions. Fix described the nice properties of this method in his earlywork-the methods gives a natural treatment of boundaries and has the property of en-ergy conservation which is a very important aspect of these methods. The most renownoceanic models that apply the FE method are Lynch and Gray, (1979); Lynch et al. (1996);Platzman, (1981); Le Provost et al., (1995); Le Roux et al. (1998); Walters, (2008) whichall focus on on coastal and shelf region modeling. Some finite element models also dealwith stationary-state ocean inverse problems (Brasseur, [1991]; Schlichtholz and Houssais[1999]; Dobrindt and Schroter [2003] and Losch et al. [2005]). A combination of of the FEMand unstructured grids gives a very fine detail of resolution (Danilov et al. [2004]; Fordet al. [2004], Hanert [2004] and White et al. [2007]). The FEM in general becomes moreaccurate on unstructured meshes (Hanert, 2004). The FEOM supports a couple of verticalgrids namely z-level, sigma and z+σ grids but it does not support isopycnal grids. Untilpresent, there are only a few 3D FE ocean circulation models whereby of all these noneof them has been designed for large-scale ocean circulation on decadal time scales. Themost commonly used models are QUODDY (Lynch and Naimie, 1993) and ADCIRC whichapply FE method discretization only in the horizontal direction and they are designedfor tidal and coastal applications within relatively short time periods (just a number ofmonths). Sergey Danilov, Gennady Kivman and Jens Schroter, (2002) describes a 3D FEocean model for investigating the large scale ocean circulation on time-scales from yearsto decades. In their model they solve the primitive equations in the dynamical part andthe advection-diusion equations for temperature and salinity in the thermodynamicalpart. Their model makes use of linear functions to represent horizontal velocities on thetetrahedra used in the 3D mesh. The tracers on the tetrahedra and the surface elevationon the surface triangles are also represented using linear functions.

Another form of models in this field is the Shallow water modelling. These models area simplification of the real world whereby the ocean is represented by a single layer offluid of a varying height and a constant density. SWE models have been widely developedfor dierent applications such as modeling tidal currents, modeling the problem of dam-break (Robert Brandoni and Gerald Freitas, 2012). Other works that make use of SWEs

Page 27: Discontinuous Galerkin Finite Element Method for Solving

13

to model dam-break problems include Szu-Hsein Peng (2012), C. Ancey, R. M. Inverson,M. Rentschler and R. P. Denlinger, (2008). Hossam S. Hassan, Khaled T. Ramadan andSarwat N. Hanna, (2010) uses the FEM to solve 2D ocean model equations. The work outrigorous calculations by employing fractional steps in the numerical procedure to obtainthe solutions.

Our current study involves solution of 1D SWEs for modeling a flow with a uniformcross-section. We use a practical problem of a dam with a rectangular cross-section totest our results. The method we use to solve the equations is aimed at improving theresolution. We aim to obtain very accurate solutions that can be interpreted and appliedin risk management in case a dam fails.

Page 28: Discontinuous Galerkin Finite Element Method for Solving

14

3 The shallow water equations

The SWEs representing ocean circulation contain the eects of rotation of the earth.They cater for centrifugal forces and eects of gravity. They are linear equations andcan be represented on a plane (in two dimensions). The two-dimensional shallow waterequations interprets properties and eects of shallow flows under specified initial andboundary conditions. The basic equations that govern the dynamics of fluids are built onthe principles of conservation of mass, momentum and energy which are well representedin the Navier-Stokes equations. Due to the nature of ocean/sea water, these equationstogether with equations of conservation of heat, salt and the equation of state are used torepresent oceanic fluid dynamics. These initial equations are non-linear in many termsand they support fast acoustic modes making them both diicult to solve and costly towork with. We apply a series of approximations and assumptions to these equations tosimplify them to the primitive equations which are then used in the model. The generalequations in a rotating framework are given by

∂ (ρ~v)∂ t

+∇.ρ~v~v+2~Ω ∧ρ~v+gρ k+∇p = ∇.τ (1)

∂ρ

∂ t+∇.ρ~v = 0 (2)

∂ (ρS)∂ t

+∇.ρS~v = 0 (3)

∂ (ρT )∂ t

+∇.ρT~v =1

cpS∇.FT (4)

ρ = ρ(T,S, p) (5)

where as described previously,ρ is mass density ,~v velocity , p the pressure ,S represent the salinity ,

T the potential temperature which add up to 7 independent variables while~Ω is the rotation vector of a sphere,g the gravitational accceleration and cp

the specific heat capacity at a constant pressure τ is the stress tensor and FT

represent non-advective heat fluxes

Eq (1) and (2) represent the Navier-Stokes equations of expressed in a rotating frameworkof reference. Equations (3) and (4) relates conservation of tracer deposits, while the lastequation, (5) is known as the equation of state.Acoustic modes arise from the dependence of the density on pressure. These modesare very fast and are not of any importance in geostrophic fluid flow and they can beeliminated from the equations.

Page 29: Discontinuous Galerkin Finite Element Method for Solving

15

Sound waves

Using the equation of continuity, (2), we can write

Dt=−ρ∇.~v (6)

where DDt =

∂ t +~v.∇ stands for the material derivative and ∇. is the divergence. Also usingthe chain rule to dierentiate the equation of state (5), we obtain

Dt=

∂ρ

∂T|S,pDtT +

∂ p∂S|T,pDtS+

∂ρ

∂ p|T,SDt p (7)

where using Eq (6) and Eq (7) to eliminate Dt p we can write for adiabatic motion;

1c2

sDt p =−ρ∇.~v+ρλDtT −ργDtS (8)

with cs, λ and γ (all functions of T, S and p) respectively representing sound speed, thermalexpansion and the coeicient of haline expansion. This equation in its linear form togetherwith the equations of momentum in linear form describes sound waves;

ρ∂t~v =−∇p

∂t p =−ρc2s ∇.v

or

∂tt p = c2s ∇

2 p

These waves travel at an average speed of 1500ms−s in water which translates to 100kmof distance they cover in a minute. This is unpractical for ocean scale calculations andtherefore it is necessary to filter the equations of these acoustic modes by removingdensity dependence on pressure. This is achieved by making the approximations discussedbelow

Boussinesq approximation

This approximation assumes that the density is constant throughout the domain Ω exceptwhere gravitational body forces are involved. Thus dρ

dt = 0. Using this we can represent thewater density as a sum of some constant density and a smaller time- and spatial-varyingperturbation;

ρ(x,y,z, t) = ρ0 + ρ(x,y,z, t)

Page 30: Discontinuous Galerkin Finite Element Method for Solving

16

where ρ(x,y,z, t) ρ0 is a space- and time-varying term. Boussinesq approximation statesthat we may ignore ρ at all points except when gravitational forces are involved. As aresult the equation of mass conservation (2) reduces to an equation of volume conservation

∂u∂x

+∂v∂y

+∂w∂ z

= 0

In this case we call the flow incompressible. This kind of approximation helps us to linearizeterms involving products of density with other dependent terms. For example ρ~v−→ ρ~vwhere ρ is the background mean, a scalar. With this approximation and assuming thatthe flow is non-divergent, the equations (1) to (5) are modified to the non-hydrostaticBoussinesq equations below

Dt~v+2~Ω ∧~v+ gρ kρ

+1ρ

∇p =1ρ

∇.τ (9)

∇.v = 0 (10)

DtS = 0 (11)

DtT =1

ρcpS∇.FT (12)

ρ = ρ(T,S,z) (13)

This new system of equations does not support acoustic modes. These equations arehowever not easy to solve as they are prognostic in three components of velocity. Wesimplify these equations further by make the hydrostatic approximation.

Hydrostatic approximations

From equation (9) the vertical component of the modified Boussinesq momentum is givenby

DwDt

+2Ω cosφν +gρ

ρ

∂ p∂ z

=1ρ

∇.τw

Using the fact that the horizontal scale is large compared to the vertical one, we canshow that the vertical pressure gradient may be given as a product of the density andgravitational acceleration. The dominant balance from a scaling for each term is

∂ p∂ z

=−gρ

We use the boundary condition p = 0 at z = η (where z = η is the surface elevation atthe top) to obtain the internal pressure

p =∫

η

zgρdz

Page 31: Discontinuous Galerkin Finite Element Method for Solving

17

Let z = −H(x,y) be the length of the water column from some fixed level z = 0 to theboom and z = η(x,y, t) be the height from z = 0 to the surface of the fluid as shown in.Integrating the non-divergent continuity equation vertically using the limits −H ≤ z≤ η∫

η

−H∂zwdz = [w]η−H =−

∫η

−H∇h.~vhdz

using the Leibniz’s rule∫η

−H∇h.~vhdz = ∇h.

∫η

−H~vhdz−~vh|z=η .∇hη +~vh|z=−H .∇h(−H)

The vertical normal velocity into the solid boom is given by

w|z=−H = w(−H) =−~vh.∇hH

At the free surface, fluctuations of the fluid are dominant and the rate of variation of thesurface elevation with time is given by

Dt= w|z=η +(P−E)

where DDt =

∂ t +~v.∇ is the material derivative and−(P−E) is the excess evaporation overaddition of water on the top surface. We can therefore write the free surface equation as

Dtη +~vh.∇hH =−∇h.∫

η

−H~vhdz+~vh|z=η .∇hη−~vh|z=−H .∇h(−H)+(P−E)

or∂η

∂ t+∇h.

∫η

−H~vhdz = (P−E)

This is the hydrostatic equation of continuity. The equations (1) to (5) then reduce to anew set of equations of the form

Dt~vh + f k∧~vh +1ρ

∇h p =1ρ

∇.~τh (14)

p =∫

η

−Hgρdz (15)

∂zw =−∇h.~vh (16)

DtS = 0 (17)

DtT =1

ρcp∇.F (18)

ρ = ρ(T,S,z) (19)

∂tη =−∇h.∫

η

−H~vhdz+(P−E) (20)

Page 32: Discontinuous Galerkin Finite Element Method for Solving

18

where ∇h =∂

∂x ex +∂

∂y ey is the horizontal gradient operator,~vh is the horizontal kinematiceddy viscosity. Equations (14) to (20) are the hydrostatic primitive equations (HPEs).These are equations for variables u,v,w, pand ρ together with the turbulence closureschemes for the diusion and viscosity coeicients. The HPEs form the basis for mostocean general circulation models. Eq (14) represents the horizontal momentum, (15) isan equation of hydrostatic balance, (16) represents the vertical variation of motion, (17)to (19) represent distribution of tracers and the last equation is the hydrostatic equationof continuity. Equations (15), (16) and (19) are diagnostic one for each of ρ, p and wwhile equations (14), (17), (18) and (20) are prognostic and describe baroclinic or three-dimensional evolution. The four prognostic equations corresponds to a pair of gravitymodes, a geostrophic mode (Rossby waves) and a thermo-haline mode. The free surfaceequation couples with the depth-integrated momentum equations to give a pair of externalgravity modes and an external Rossby mode. We will derive the shallow water equationsfrom further simplification of the HPEs.

Coordinate System

The equations we are dealing with are two dimensional. We therefore choose a 2Dcoordinate system called the β -plane coordinate system. In this system the x−,y− planeis considered to be tangent to the earth at the latitude under consideration. The x−axisis taken to be in the direction of the latitude at that point whereas the y−axis is takento be in the direction of the longitude. The z−axis is taken to be in the direction of theoutward normal to the Earth’s surface. The domain under consideration is the ocean andwe denote it by Ω and the boundaries of this region by ∂Ω .

Boundary conditions

The boundary ∂Ω of the domain includes the open/closed vertical surfaces that enclosesΩ , the free surface and the impermeable boom of the domain. The free surface is givenas

z = η(x,y, t)

and the velocity there as

~v = (0,0,∂η

∂ t)

and for a particle within the fluid the velocity is given by~u = (u,v,w). We assume thatthe fluid particles do not cross the free surface hence

~v.~n =~u.~n

Page 33: Discontinuous Galerkin Finite Element Method for Solving

19

where~n = (−∂ν

∂x ,−∂ν

∂y ,1) is the unit normal drawn outwards at the free surface. Equatingterms in the dot product above yields

∂ν

∂ t=−u

∂ν

∂x− v

∂ν

∂y+w

Since the free surface is at z = H +h then we have η(x,y, t) = H(x,y)+h(x,y, t). Usingthis in the above equation gives us the boundary condition at the surface as

∂h∂ t

+ u∂

∂x(H +h)+ v

∂y(H +h)− w = 0

where the "hat" on the velocity components indicates that they are evaluated at thefree surface. In a similar manner, since fluid cannot penetrate the impermeable boomΩ(z =−H), we obtain

u∂H∂x

+ v∂H∂y− w = 0

where the breve is used to indicate the velocities are those at the boom. We can applythe "no-slip" condition so that

u = v = w = 0

3.0.1 Time-step limitations on the HPEs

The HPEs have time-step limitations due to existence of fast external gravity and Rossbymodes. External waves as mentioned previously have propagation speeds as high as200ms−1. This speed, c is obtained from the relation c =

√gH , where g is the gravitational

acceleration and H is the height of the water column.

3.0.2 External gravity waves

We have have already seen that acoustic waves if permied can limit the time-step of anexplicit large scale model to only the order of seconds. The HPEs are free of these wavessince we already filtered the initial equations of these very fast speed modes. Externalgravity waves are the next fast modes aer sound waves. We analyze these motions bydepth-integrating the equations.If the pressure is split into two parts

p =∫

η

zgρdz+

∫η

zg(ρ− ρ)dz

then the external gradients of the first term on the right hand side will be uniform withdepth and a function only of the free surface height:

∇h

∫η

zgρdz = g∇hη

Page 34: Discontinuous Galerkin Finite Element Method for Solving

20

Using this in the depth averaged momentum equations (14) and the free surface equationswe summarize

∂ t

∫Ω

~vhdΩ +g∇hη = ...

∂ tη +∇.H

∫Ω

~vhdΩ = ...

Combining the two summary representations above we get

∂ 2

∂ t2 η−∇h.gH∇hη = ...

which is a representation of waves whose phase speed is given as cw =√

gH . For instanceif H = 4000m then cw = 200ms−1 which is very fast.For resolutions of 10km and 100 km such an explicit time-step would be limited to an orderof 1 minute and 8 minutes respectively. We can avoid these time limitations by filteringHPEs to remove the external waves. This is accomplished by use of three conventionalmethods namely;

i. Rigid-lid approximation

ii. the split-explicit method and

iii. the implicit method

3.0.3 Rigid-lid approximation

In the hydrostatic primitive equations, the total height of the water column is given ash(x,y, t) = H(x,y)+η(x,y, t) where z = η(x,y, t) is the surface elevation and z =−H(x,y)is the length of the water column beneath a fixed level z = 0. In rigid-lid approximationwe first assume that the free surface is at z = 0 and non-varying such that

Dtη = 0

As a result, equation (20) is modified into

∇.∫ 0

−H~vhdz = 0

The second step is to work on the pressure equation. We partition the pressure into twoparts, one associated with the rigid lid denoted by ps and an hydrostatic part ph so that

p = ps + ph

Page 35: Discontinuous Galerkin Finite Element Method for Solving

21

The surface pressure, ps is the pressure exerted by the rigid lid on the level surface z = 0while the hydrostatic pressure is obtained by vertically integrating the hydrostatic equationfrom z = 0 to an arbitrary depth z and applying the boundary condition ph(0) = 0;

ph =∫ 0

z

ρdz

This further modifies the modifies the momentum equations to new form

∂t~vh +1ρ

∇h ps = ~Gh

where ~Gh contains all the other missing terms including the lateral gradient of hydrostaticpressure. Discretization of this equation in time yields

~vn+1h +

∆ tρ

∇h ps =~vnh +∆ t~Gh

Using this equation in the depth-integrated continuity equation gives

∆ tρ

∇h.H∇h ps = ∇.∫ 0

−H(~vn

h +∆ t~Gh)dz

This form of approximation requires that we find ~Gh and then solve the elliptic equationsto obtain the surface pressure. This is known as the pressure method and ensures non-divergence of the depth-integrated flows.To solve the 2-D elliptic equations we require to specify the stream functions at the coasts(i.e. at H = 0) so as to be able to obtain the boundary conditions. The stream functionwas first used by Bryan and Cox in their first ocean model and clarifies that the ellipticequation need not be solved accurately.

3.0.4 Implicit free surface

The method is applied in time treatment of the free surface equation. It is a very stablemethod and does not limit the time step. For all types of oceanic flows, the free surfaceelevations are very small as compared to the nominal depth of the ocean |η |<< H . Thisfact gives us a justification for linearizing the free surface equation (20) for the purposesof applying the implicit method (the implicit method is only suitable for linear terms).The equation for pressure (15) can be split into three integrals and wrien as

p =∫

η

zgρdz =

∫η

0gρdz+

∫η

0g(ρ− ρ)dz+

∫ 0

zgρdz

≈ gρη +∫ 0

zgρdz

Page 36: Discontinuous Galerkin Finite Element Method for Solving

22

We next seek to linearize the free surface equation by making the assumption that (ρ(η)−ρ)<< ρ so that the approximate above becomes

p = gρη +∫ 0

zgρdz

The next thing we do is to discretize the free-surface equation using the implicit backwardmethod

~vn+1h +∆ tg∇η

n+1 =~vnh +∆ t~Gh (21)

ηn+1 +∆ t∇.

∫ 0

−H~vn+1

h d∇z = ηn +∆ t(P−E) (22)

Using equation (21) in Eq (22) to eliminate~vn+1h we get

ηn+1 +∆ t2

∇.gH∇ηn+1 = η

n +∆ t(P−E)−∆ t∇.∫ 0

−H(~vn

h +∆ t~Gh)dz (23)

an elliptic equation which we need to solve for ηn+1 at each level in the model and thenstep forward the momentum equation.

3.0.5 Split-Explicit method

This one involves treating the depth-integrated equation dierently from the rest of theequations in the system. The idea here is that we split this equation from the rest andintegrate it using a shorter time-step. This is applied on this single equation because itis the equation that causes time-step limitations due to external gravity waves. First wefind an approximate of the barotropic momentum equations

∂t

∫Ω

~vhdΩ +g∇η =∫

Ω

~GhdΩ (24)

where∫

Ω~GhdΩ is the depth average of all the terms of the momentum equation. Next

we integrate this Eq (24) with the free-surface equation forward using a short time step,∆ tM , with ∆ t being the regular time step for the entire full model. This is done using theforward-backward method outlined below

ηn+(m+1)

M = ηn+m

M +∆ tM

∇.(H +ηn+m

M )~vn+m

Mh

~vn+(m+1)

Mh =~v

n+mM

h +∆ tM

(g∇ηn+(m+1)

M +< ~Gh >)

These equations are then stepped forward M times to give the approximation for ηn+1.

Page 37: Discontinuous Galerkin Finite Element Method for Solving

23

3.0.6 Accelerating to equilibrium

Several manipulations are made on the equations to aain a fast convergence to equi-librium. A typical physical general circulation model would require roughly 7× 1011

operations with 4050 grids to perform a complete computational model. This means thatspinning up an ocean-climate model to equilibrium would take at least 1000 years. Thanksto Bryan for coming up with acceleration mechanism to help mathematicians realizeaccurate ocean models within a sensible time duration. Bryan, 1984, analyzed the methodof accelerating ocean-climate models to converge fast to equilibrium. Accelerating theapproach to equilibrium reduces the time needed to carry out computations by a largeextend and eliminates the diiculty of the process. The consequences of the acceleratingapproach has been investigated extensively by Danabasoglu, McWilliams and Large J.Clim (1996) who gave support to the approach. In the following subsections, we will derivethe dispersion relations for internal gravity waves then finally analyze the distortion.

3.0.7 Vertical modes

The linearized equations of motion are

∂t~vh + f k∧~vh +1ρ

∇h p = 0 (25)

−b+1ρ

∂z p = 0 (26)

∇h.~vh +∂zw = 0 (27)

∂tb+wN2 = 0 (28)

where b = −gρ

ρis the buoyancy variable N2 = ∂zb0(z) is the background stratification

for buoyancy. These equations are used for analysis of wave motions. To avoid the 3-Dnature of these equations, we need to describe the vertical structure in terms of modes.To do this we use the Fourier modes and assume that the background stratification, N2 isa constant. Every field can be described as a set of time and space dependent coeicientsmultiplying a vertical structure.

(~vh,w, p,b) = ∑m(~vm,wm, pm,bm)eimz

This way we replace the vertical derivatives with im where m = 2π

hmis the vertical wave

number. Equations (26), (27) and (28) becomes respectively

bm = impm

imwm =−∇h.~vm

∂tbm = N2wm

Page 38: Discontinuous Galerkin Finite Element Method for Solving

24

These three are then combined together to give

m2∂t

pm

ρ+N2

∇hvm = 0

and the four equations of motion (25) - (28) then reduces to

∂t~vh + f k∧~vh +1ρ

∇h p = 0 (29)

∂tpm

ρ+

N2

m2 ∇hvm = 0 (30)

where Nm is the gravity wave speed. These two are the equations that govern every vertical

mode. They both take the form of shallow water equations. To obtain the dispersionrelation for internal waves we assume another form for the vertical modes given byei(kx+ly−wt) for each vertical mode. Working with this yields a dispersion relation of theform

ω = f 2 +(Nm)2(k2 + l2)

Note that the background stratification N2 can also be allowed to vary vertically as usedbt Bryan, 1984. In this work we choose N2 = constant to avoid complications since theresults obtained in both choices have just a slight dierence.

3.0.8 Slowing down inertia-gravity waves

To accelerate the motion we use shorter time steps in the momentum equation than inany other of the equations.

∆ t~v =1α

∆ t

where ∆ t~v is the horizontal time step, ∆ t the regular time step used in the full model andα is the distortion factor. This scales all the terms in the equation of momentum by α sothat the new system becomes

∂t~vh +1α( f k∧~vh +

∇h p) = 0 (31)

−b+1ρ

∂z p = 0 (32)

∇h.~vh +∂zw = 0 (33)

∂tb+wN2 = 0 (34)

Using this new form of equations with a new time step applied to the momentum equationwe repeat the process used in the previous subsection to reduce equations (32), (33) and(34) into a common equation. For the three combined together we get

∂tpm

ρ+(

Nm)2

∇h.~vm = 0

Page 39: Discontinuous Galerkin Finite Element Method for Solving

25

so that the resulting equations for each vertical mode are given by

α∂t~vh + f k∧~vh +1ρ

∇hpm

ρ= 0 (35)

∂tpm

ρ+(

Nm)2

∇h.~vm = 0 (36)

The dispersion relation for internal waves is obtained by another form of vertical modesgiven by ekx+ly−wt for each vertical mode. The dispersion relation is:

ω2 =

f 2

α2 +N2

αm2 (k2 + l2)

For long waves (k2 + l2)<< N2

( f m)2 where the frequencies approach the Coriolis frequency,

the distorted frequency is lower than α and the gravity wave speed is√

α slower. Theapplication of smaller time-step in the momentum equation slows down the fast waves.

Distorted Rossby waves

Using shorter time-step in the momentum equation also aects the Rossby waves (Rossbywaves are also distorted). The geostrophic balance remains unaected by the distortionfactor α since the Coriolis and pressure gradient terms are equally scaled by α :

f k∧ vm =1ρ

∇h pm

so that the vorticity can be wrien as

ζm =1ρ

∇2h

pm

ρ

Using this we express the vorticity equation as

α∂tξm + f ∇h~vm +βvm = 0

and the potential vorticity equation is

α

f∂t∇

2h pm− f

m2

N2 ∂t pm +β

f∂x pm = 0

The dispersion relation of Rossby waves is given by

ω =−βk

α(k2 + l2)+ f 2m2

N2

Page 40: Discontinuous Galerkin Finite Element Method for Solving

26

For long waves (k2 + l2) << 1L2

rand the distortion becomes negligible. Distortion can

aect the stability of the models at western boundaries since short waves are slowed bytime-stepping. The shallow water equations are given by

α∂t~vh + f k∧~vh +1ρ

∇hpm

ρ= 0 (37)

∂tpm

ρ+(

Nm)2

∇h.~vm = 0 (38)

Spliing the momentum equation (37) into x- and y- components we have

α∂tum−βyvm +∂xpm

ρ= 0 (39)

α∂tvm +βyum +∂ypm

ρ= 0 (40)

∂tpm

ρ+

N2

m2 ∇~vm = 0 (41)

Equations (39), (40)and (41) are the linear shallow water equations on the β -plane. Theseequations can be combined into a single equation of the form

∂t [α2∂tt +(βy)2−α

N2

m2 ∇2h]m−β

N2

m2 ∂xvm = 0 (42)

We applied a rescaling to the meridional coordinates so that the new coordinates arey, =

√βy(αm2

N2 )14 . This results to a weak modification of equatorially trapped waves. The

distorted linear bouyancy is given by

∂tb+ωN2

µ(z)= 0

where µ(z) = 1 at the surface and less than 1 in the interior of the fluid. N2 being aconstant indicates that N2

µ(z) is purely a function of z or simply a function of depth. Hence

modal decomposition of N2

µ(z) must reflect the approximate vertical structure and theFourier decomposition fails to work.The method we have used here aims at accelerating the approach to equilibrium. Itmodifies the time-scales of the system to allow longer eective time-steps. We haveused dierent time-steps for the thermodynamic tracer equations and the momentumequations. The convergence of this approach is most meaningful if there exists a steadystate solution. This equation, (42) is not easy to solve. We will not solve this equationin this work, it is le to be solved in a further study by applying an appropriate method.This is the equation we intend to solve using the Discontinuous Galerkin Finite ElementMethod as per the topic of this project. The Navier-Stokes equations are the govern-ing equations to most fluid dynamic models. They are the basis equations for models

Page 41: Discontinuous Galerkin Finite Element Method for Solving

27

concerning flows through thin channels (pipes), flows around aircras and ships, etc.to mention but a few. These equations are usually complicated and diicult to workwith. To simplify them we make an assumption that the vertical acceleration in a fluidflow is negligible compared to the horizontal acceleration. This assumption is obviousfor most flows on the earth’s surface. Applying this assumption to the N-S equationsresults in a hydrostatic pressure distribution and the shallow water equations whichare easy to deal with instead of the complicated N-S equations. The derivation here isbased on the work of Young et al. (1997), Vreugdenhil (1994) and Schwanenberg (2003)

3.1 SWE for a flow through a Channel

In this section we derive the shallow water equations in one-dimension beginning withNavier Stokes equations which are free of the eects of rotation of the earth. For a smallscale flow such as flow in a river/channel, dam or a lake, we may ignore the eects ofearth’s rotation. This leaves us with less complicated equations which can be solved withmuch ease. In this chapter we derive the 1D SWE. We begin with the N-S equations thenapply the Boussinesq and hydrostatic approximations to obtain the 3D SWEs. This isthen followed by application of subsequent conditions and integrations to the 3D SWE toobtain the 2D depth-integrated SWEs from which we then derive the 1D SWE.

3.1.1 3D shallow water equations

For a liquid (water in this context), the mass density remains more or less constant duringmotion. In this case we say that the flow is incompressible and we can express the densityas

ρ = ρ(t,x) = ρ0, (all through the domain of flow)

for some ρ0 > 0. In this case the equation of mass conservation is given by

∂u∂x

+∂v∂y

+∂w∂ z

= 0

The nature of this equation is kinematic. However, some experiments show that thereexist flows whose velocity satisfy the equation above but whose density is dependenton the variables t and x. The incompressible N-S equations are made up of equation ofconservation of mass above together with the equations of conservation of momentum.

Page 42: Discontinuous Galerkin Finite Element Method for Solving

28

The Cartesian form of the N-S equations is

∂u∂x

+∂v∂y

+∂w∂ z

= 0 (43)

∂u∂ t

+∂u2

∂x+

∂ (uv)∂y

+∂ (uw)

∂ z=− 1

ρ

∂ p∂x

+ν(∂ 2u∂x2 +

∂ 2u∂y2 +

∂ 2u∂ z2 ) (44)

∂v∂ t

+∂ (vu)

∂x+

∂v2

∂y+

∂ (vw)∂ z

=− 1ρ

∂ p∂y

+ν(∂ 2v∂x2 +

∂ 2v∂y2 +

∂ 2v∂ z2 ) (45)

∂w∂ t

+∂ (wu)

∂x+

∂ (wv)∂y

+∂w2

∂ z=− 1

ρ

∂ p∂ z

+ν(∂ 2w∂x2 +

∂ 2w∂y2 +

∂ 2w∂ z2 ) (46)

where (u,v,w) are velocity components in the (x,y,z) directions and ν = µ

ρis the kinematic

viscosity, µ in the expression of ν is a constant representing the dynamic viscosity ofwater. p is the pressure and ρ is the mass density of water.Using vector notation, let us denote by v j the velocity components, x j the directionalindices, g the gravitational acceleration and σi j the deformation stresses then the N−Sequations can be represented using this notation as

∂x jv j = 0 (47)

∂tvi +∂x j(v jvi−1ρ

σi j) = gi (48)

where Eq (47) is the mass conservation equation and Eq (48) the equation of momentumconservation. The index notation i, j ∈ x,y,z represent the spatial directions and thepartial derivatives are represented as ∂x j =

∂x j. The stresses of deformation are in the

formσi j =−pδi j +µ(∂x jvi +∂xiv j)

where δi j is the Kronecker delta defined by

δi j =

1, if i = j

0, if i 6= j

In this conversion and in the entire work we assume that gx = gy = 0 and gz =−gThe depth of the fluid is given by H(x,y,z) is a variable. The variation is caused bymovements of water on the free water surface and changes in the level of the floor of thechannel. At the free surface z = η(x,y, t) but at the boom face of the water layer, sincewe assume that the floor is not flat, the height there is depended on x and y but fixed intime, i.e. z =−h(x,y). By fixing a reference level within the water layer at z = 0 then thetotal depth will be given by

H(x,y, t) = h(x,y)+η(x,y, t) (49)

Page 43: Discontinuous Galerkin Finite Element Method for Solving

29

The fluid depth and velocity are variables for which we seek solutions. The verticalacceleration is assumed to be negligible from the definition of shallow water flows. Thusin the z-momentum equation (46) we have that |Dw

Dt | |g+1ρ

∂ p∂ z | and |ν∇2w| |g+ 1

ρ

∂ p∂ z |

where DwDt is the three dimensional material derivative given by Dw

Dt = ∂

∂ t +u ∂

∂x +v ∂

∂y +w ∂

∂ z

and ∇2 = ∂ 2

∂x2 +∂ 2

∂y2 +∂ 2

∂ z2 Thus the z-momentum equation can be approximately given by

∂ p∂x

=−g (50)

which is the hydrostatic pressure distribution equation. Integrating this equation verticallyand assuming that the atmospheric pressure is constant yields

p = ρg(η− z) (51)

Using equation (51) in equations (44) and (45) to substitute the pressure yields

∂u∂ t

+∂u2

∂x+

∂ (uv)∂y

+∂ (uw)

∂ z=−g

∂η

∂x+ν(

∂ 2u∂x2 +

∂ 2u∂y2 +

∂ 2u∂ z2 ) (52)

∂v∂ t

+∂ (vu)

∂x+

∂v2

∂y+

∂ (vw)∂ z

=−g∂η

∂y+ν(

∂ 2v∂x2 +

∂ 2v∂y2 +

∂ 2v∂ z2 ) (53)

The three equations (43), (51) (52) and (53) are the 3D shallow water equations (or incom-pressible hydrostatic Navier-Stokes equations). The unknowns are the velocity componentsu,v,w and the surface elevation η

We can evaluate the vertical velocity of a fluid particle at the free surface and that of afluid particle at the boom. To evaluate these velocities, we assume that a fluid particleat the boom or at the top retains its position respectively.

At the surface: w|z=η =Dη

DT|z=−h = [

∂η

∂ t+u

∂η

∂x+ v

∂η

∂y]z=η (54)

and at the boom: w|z=−h =−DhDt|z=−h =−[u

∂h∂x

+∂h∂y

]z=−h (55)

Equations (54) and (55) are known as the kinetic boundary conditions for the 3D SWEs.

3.1.2 2D shallow water equations

They are obtained by further integration of the 3D SWEs vertically over the water depth.Starting with the continuity equation (43) and integrating over the interval z = [−h,η ];

∫η

−h

∂xudz+

∫η

−h

∂yvdz+

∫η

−h

∂ zwdz = 0

Page 44: Discontinuous Galerkin Finite Element Method for Solving

30

We recall the Leibniz’s theorem which asserts that;

∂β

∫λ2(β )

λ1(β )f (λ ,β )dλ =

∫λ2(β )

λ1(β )

∂βf dλ + f (λ2,β )

∂λ2

∂β+ f (λ1,β )

∂λ1

∂β

Applying this we can integrate the above terms of the integrals of the continuity equationto obtain

∂x

∫η

−hudz−u|z=η

∂η

∂x−u|z=−h

∂h∂x

+∂

∂y

∫η

−hvdz− v|z=−h

∂η

∂y− v|z=−h

∂h∂y

+w|z=η −w|z=−h = 0

The depth averaged velocity terms are given as

u =1H

∫η

−hudz and v

∫η

−hvdz (56)

We use these definitions to eliminate the integrals from the equation above to obtain

∂ (uH)

∂x−u|z=η

∂η

∂x−u|z=−h

∂h∂x

+∂ (vH)

∂y− v|z=−h

∂η

∂y− v|z=−h

∂h∂y

+w|z=η −w|z=−h = 0

To obtain the boundary conditions at the boom and on the surface, we substitute thekinetic boundary conditions (54) and (55) in this equation to get

∂η

∂ t+

∂x(uH)+

∂y(vH) = 0 (57)

From the definition of the height of the water column in Eq (49), η = H−h(x,y). Thisguides us to seeing that the continuity equation in two-dimensions can be wrien as

∂H∂ t

+∂

∂x(uH)+

∂y(vH) = 0 (58)

expressed in the form of derivatives of the depth averaged velocities and a time derivativeof the height of the column.A similar treatment is carried out on the momentum equations i.e. depth-integrating theindividual terms. For the x-momentum equation, Eq (52), applying the Leibniz’s formula

Page 45: Discontinuous Galerkin Finite Element Method for Solving

31

to integrate each term;

∫η

−h

∂ tudz =

∂ t

∫η

−hudz−u|z=η .

∂η

∂ t(59)∫

η

−h

∂xu2dz =

∂x

∫η

−hu2dz−u2|z=η .

∂η

∂x−u2|z=−h.

∂h∂x

(60)∫η

−h

∂y(uv)dz =

∂y

∫η

−h(uv)dz− (uv)|z=η .

∂η

∂y− (uv)|z=−h.

∂h∂y

(61)∫η

−h

∂ z(uw)dz = (uw)|z=η − (uw)|z=−h (62)∫

η

−hg

∂xηdz = g

∂xη(η +h) = gH

∂x(H−h) (63)

Depth-integrating the last term on the right hand side of equation (52) we obtain thedepth-integrated friction denoted by S fx and given by

S fx =∫

η

−hν(

∂ 2u∂x2 +

∂ 2u∂y2 +

∂ 2u∂ z2 )dz

Since the velocity variation vertically is negligible we can take out the integrands involvingvelocities from equations (59), (60) and (61) since the values of these terms turn out to benegligible. Also let us take equality of the depth-integrated velocities to the horizontalvelocities,i.e. u = u and v = v. Then applying the kinetic boundary conditions (54) and (55)to the depth-integrated x-momentum equation yields

∂ t(uH)+

∂x(u2H)+

∂y(uvH) = gH

∂x(h−H)+S fx (64)

where S fx =∫ η

−h ν(∂ 2u∂x2 +

∂ 2u∂y2 +

∂ 2u∂ z2 )dz is the depth-integrated term of the x-component.

Carrying out a similar operation on Eq (53) we obtain the depth-integrated y-momentumequation which takes the form

∂ t(vH)+

∂x(vH)+

∂y(v2H) = gH

∂y(h−H)+S fy (65)

where S fy is the depth-integrated friction term.Equations (58), (64) and (65) are the two dimensional shallow water equations.

∂H∂ t

+∂

∂x(uH)+

∂y(vH) = 0 (66)

∂ t(uH)+

∂x(u2H)+

∂y(uvH) = gH

∂x(h−H)+S fx (67)

∂ t(vH)+

∂x(vH)+

∂y(v2H) = gH

∂y(h−H)+S fy (68)

Page 46: Discontinuous Galerkin Finite Element Method for Solving

32

This is the system of shallow water equations representing mass and momentum conser-vation. We can write them in the dierential conservative law form as

∂~u∂ t

+∇. f (~u) = S(~u) (69)

where ∇ f = ∂x fx +∂y fy,~u is a vector containing the unknown variables, ~f = (~fx,~fy) is aflux vector and S(~u) is the vector containing the source terms. Here

~u =

H

uH

vH

fx(~u) =

uH

u2H

uvH

fy(~u) =

vH

uvH

v2H

and S(~u) =

0

−gH ∂η

∂x +S fx

−gH ∂η

∂y +S fy

or

~u =

H

uH

vH

fx(~u) =

uH

u2H + 12gH2

uvH

fy(~u) =

vH

uvH

v2H + 12gH2

and S(~u) =

0

gH ∂h∂x +S fx

gH ∂h∂y +S fy

3.1.3 One-dimensional SWE

For flows in channels and rivers we neglect the acceleration in the y-direction. This furtherreduces the 2D SWE into a one-dimensional equation. The equations are simplified bylooking at the cross-section instead of the total water depth.Consider an incompressible 1D flow. Let us take an infinitesimal fluid volume in the flowof a cross-sectional areas A(x) on one face and A(x+ M x) on the other face. Also let thepressure acting on the face of cross section A(x) be p(x) and that acting on the secondface be p(x+ M x). Then the Navier Stokes equations for this infinitesimal control volumewithout viscous stress terms are given by

∂t(A M x)− (Au)(x)+(Au)(x+ M x) = 0 (70)

Page 47: Discontinuous Galerkin Finite Element Method for Solving

33

∂t(Au M x)− (Au2)(x)+(Au2)(x+ M x)

=1ρ[(Ap)(x)− (Ap)(x+ M x)]+

p[A(x+ M x)−A(x)] (71)

where M x is the length of the selected control volume and p is the normal pressure actingon the infinitesimal control volume. Dividing equations (69) and (70) by M x and takingthe limit as M x−→ 0 we obtain the dierential equations given below

∂tA+∂x(Au) = 0 (72)

∂t(Au)+∂x(Au2) =− 1ρ

A∂x p (73)

Applying the hydrostatic pressure condition since the flow here is a shallow water flow,the equations are further modified into

∂tA+∂x(Au) = 0 (74)

∂t(Au)+∂x(Au2) = gA∂x(h−H) (75)

These are the one-dimensional shallow water equations. To obtain the (quasi-) conservationlaw form of these equations, we further dierentiate the R.H.S term on equation (75) toget

∂tA+∂x(Au) = 0 (76)

∂t(Au)+∂x(Au2 +gAH) = gA∂xh−gH∂xA (77)

We still need to modify the equations further to obtain the equations in a completelyconservation law form. We will do this by making the assumption that the channel is of aconstant width W , so that A = HW . Inserting this value of A in Eq (74) and (75) we obtain

∂tH +∂x(uH) = 0 (78)

∂t(uH)+∂x(u2H) = gH∂x(h−H) (79)

Let q= uH be the discharge and η the surface elevation then the equations further reducesto the form

∂tH +∂x(q) = 0 (80)

∂t(q)+∂x(uq) =−gH∂xη (81)

The term on the right hand side of (81) represents the surface slope and it brings aboutvariations in the discharge.If the conservative form of the equations are required to include the momentum flux,

Page 48: Discontinuous Galerkin Finite Element Method for Solving

34

then we represent the boom slope as the source term so as to facilitate this. The surfacebecomes no longer the source term as in the above equations and (80) is modified and wehave the new form of the equations as

∂tH +∂x(q) = 0 (82)

∂t(q)+∂x(q2

H+

12

gH2) = gH∂xh (83)

which can be wrien in conservative law form as

∂tu+∂x f (u) = s(u) (84)

where

u =

H

q

, f (u) =

qq2

H + 12gH2

and s(u) =

0

−gH∂xh

(85)

This equation represents a one-dimensional SWE where f (u) =

qq2

H + 12gH2

is the fluid

flux and s(u) =

0

−gH∂xh

is the source term. We will solve this equation using the

Discontinuous Galerkin finite element (DG) discussed in the next chapter.

Page 49: Discontinuous Galerkin Finite Element Method for Solving

35

4 Finite Element Methods for PDEs

4.1 Introduction: Partial Dierential Equations (PDEs)

PDEs are Mathematical expressions describing a relation between dependent variableu(x) and independent variables x through multiplications and partial derivatives. Theorder of a dierential equation is defined as the order of the highest derivative of u(x)that appears in the equation. A general second order PDE with constant coeicients takesthe form

Auxx(x,y)+2Buxy(x,y)+ cuyy(x,y)+Dux(x,y)+Euy(x,y)+Fu(x,y) = G

The PDE is said to be homogeneous if G = 0 and non-homogeneous if otherwise. Thesedierential equations can either be classified as Elliptic, Parabolic or hyperbolic de-pending on the value of the discriminant d = AC−B2. If d > 0 we say that the PDE isElliptic, if d = 0 we classify the PDE as Parabolic and if d < 0 the PDE is said to beHyperbolic. Examples:

i Elliptic: The Laplacian equation, d2udx2 +

d2udy2 = 0

ii Parabolic: Heat equation, dudt −

d2udx2 = 0

iii Hyperbolic: Wave equation, d2udt2 − d2u

dx2 = 0

Initial conditions and/or boundary requirements are given together with these expressions.Depending on the conditions given, we come up with three types of problems namely;Initial Value Problems (IVP), Boundary Value Problems (BVP) and Initial BoundaryValue Problems(IBVP).

i. Initial value problemAn IVP is a problem in which the value of the dependent variable and its derivative isspecified at the initial point t = 0 or at some value of the independent variables in theequation. Example: Below shows an IVP of the wave equation

d2udt2 − d2u

dx2 = 0 −∞ < x < ∞ t > 0

u(x,0) = f (x), ut(x,0) = g(x), −∞ < x < ∞

Page 50: Discontinuous Galerkin Finite Element Method for Solving

36

ii. Boundary value problemIn this type of a problem, the value of the dependent variable and possibly its derivativesare specified at the extreme values of the independent variable. For example: The 1Dstationary heat equation

−[a(x)u′(x)]′ = f (x), 0 < x < 1

u(0) = u0, u(1) = u1, where u0,u1 ∈ R

There are three types of boundary conditions namely;

1. Dirichlet boundary condition: The value of the depended variable u is specified atthe boundary.

u(x, t) = f (x), for x = (x1,x2, . . . ,xn) ∈ Rn, t > 0

2. Neumann boundary conditions: In this type of BC the derivative of the solution atthe direction of the outward normal vector is provided For the heat equation forinstance;

dudt −

d2udx2 = 0

∂u∂n = n.grad(u) = n.∇u = f (x), x ∈ ∂Ω

where n = n(x) is an outward unit normal to ∂Ω at x ∈ ∂Ω

3. Robin boundary conditions: Also called Mixed boundary conditions. It is a combi-nation of the Dirichlet and the Neumann boundary conditions.

iii. Initial boundary value problemIn this problem we have both the initial conditions and the boundary conditions given.

Solutions of PDEs can then use this information and give us predictions of the laterstates of this information. Mathematically, partial dierential equations are equationswhich contains partial derivatives, three examples of PDEs have been used previously inexamples. Here we introduce another PDE called the Poisson equation which is given by

∆u = ∇2 ∂ 2u

∂x2 +∂ 2u∂y2 = f (86)

4.1.1 Methods of solving PDEs

There are several solution methods that can be used depending on the nature of thephysical problem. These include the Finite dierence method, finite element method andthe finite volume method. The finite dierence method is the most commonly used. It

Page 51: Discontinuous Galerkin Finite Element Method for Solving

37

uses discrete approximations from grid information to replace the partials. For example,in the Poisson equation we have the following operator acting on u

L = ∇2 =

∂ 2

∂x2 +∂ 2

∂y2

Then the equation can be wrien as Lu = f . Finite Dierence methods are based onapproximating this operator by a discrete operator. Unlike the FEM, the FDM is not veryaccurate if the geometry of the domain is complex. This dierence between these twomethods comes in at the point of discretizing the PDE. Reed and Hill, (1971) came up witha modification of the finite element method namely the Discontinuous Galerkin finiteelement method. The need of this new method was to solve the neutron transport equation.Unlike the FEM, this method makes use of discontinuous approximating functions.

The finite element method is a very rigorous method for solving PDEs. PDEs are Mathe-matical expressions describing a relation between dependent and independent variablesthrough multiplications and partial derivatives. Initial conditions and boundary require-ments are given together with these expressions. Solutions of PDEs can then use thisinformation and give us predictions of the later states of this information. Mathematically,partial dierential equations are equations which contains partial derivatives, examplesof PDEs are the wave equations, heat equations, Laplace equations, Poisson equation etc.The Poisson equation for example is given by

∆u = ∇2 ∂ 2u

∂x2 +∂ 2u∂y2 = f (87)

We will use this example in the practical examples and when introducing the finite elementmethod (FEM). In this equation u depends symmetrically on x and y. So, if we choose asymmetric Ω, the solution will be symmetric.In solving this equation, we find the solution in the region Ωdefined byΩ = (−1,1)2..These boundary conditions are fundamental for the formulation of the finite elementmathod.

4.1.2 Finite element Method

The finite element method is mathematically very rigorous. It has much stronger math-ematical foundation than many other methods i.e. it is mathematically more elaboratethan many other methods, and particularly the finite dierence method. FEM uses resultsfrom real and functional analysis. In the practical example in the end, we have includedwhat we call the minimization principle. This is equivalent to the minimizing principleused when deriving the conjugate gradient method by minimizing the quadratic function.The answer to this minimization function is our solution. But there is another result, called

Page 52: Discontinuous Galerkin Finite Element Method for Solving

38

Weak formulation, which, when true, also makes the minimization formulation true. So wewill start at the weak formulation and discuss the results we arrive at. FEM is a numericalmethod of solving PDEs, and to achieve this objective, it is a characteristic feature of theFE approach that the PDE in question is first reformulated into an equivalent form, andthis form has a weak form.

4.1.3 Steps in the Finite Element Approach

The final formulation of the FE method is a linear system Au = b. These are the stepsfollowed in the FE approach

i. Establish the strong formulation

ii. Obtain the weak formulation

iii. Choose approximations for the unknown functions, in this case u

iv. Choose the weight functions v

v. Solve the resulting linear system

4.1.4 Strong Formulation (Poisson Equation)

In this part we consider the Poisson equation chosen in the beginning. We want to solvethis in the region Ω = (0,1)2 We intend to use only Homogeneous Dirichlet boundaryconditions. This gives us

∆u =∂ 2u∂x2 +

∂ 2u∂y2 = f ,defined onΩ = (0,1)2 (88)

u(∂Ω) ∂Ω = (x,y)|x = 0,1 or y = 0,1. (89)

This is called the strong formulation in Finite element, and says no more than the originalPDE formulation.

4.1.5 Weak Formulation (Poisson’s Equation)

The weak formulation is a re-formulation of the original PDE (strong form), and it is fromthis form that we establish the final FE approach. To establish the weak form of the PDE,we multiply equation (88) with an arbitrary function, so-called weight-function v(x,y) toobtain

v∇2u = f v (90)

Page 53: Discontinuous Galerkin Finite Element Method for Solving

39

Integrating this expression over Ω . ∫Ω

v∇2u =

∫Ω

f v (91)

v(x,y) should be chosen in such a way that the manipulations it undergoes are meaningful.Let us define a space of functions and call it H1

H1(Ω) = v : Ω −→ R :∫

Ω

v2,∫

Ω

v2x ,∫

Ω

v2y <+∞ (92)

H1 is a function space where all the functions are bounded [quadratic integrable]. Wewant our functions to be well-behaved, so that we can define operations on them withinthe rules of, say, integration. Let us now define a sub-space X of H1 and let

X = v ∈ H1(Ω) : v|∂Ω = 0 (93)

Integrating further eguation (92). Let u,v ∈ X . We know from calculus that ∇(v∇u =

∇v.∇u+ v∇2u). We can write ∫Ω

v∇2u =

∫Ω

∇v.∇u (94)

Using Gauss’s theorem on ∇(v∇u) we get∫Ω

(v∇u) =∫

∂Ω

ν ν |∂Ω=0︸ ︷︷ ︸∇u.ndS = 0 (95)

In equation (95), we have transformed a surface integral to a line integral and dS refers toan infinitesimal line segment. We have not put dA on the surface integrals, therefore, Eq(94) reduces to ∫

Ω

v∇2u =−

∫Ω

∇v.∇u (96)

and, so we get

−∫

Ω

∇v.∇udA =∫

Ω

f vdA (97)

Advantages of Weak Form Compared to Strong Form

Eq (97) is the final weak formulation. It is equivalent to the strong form posed previously.In the strong form, we have two separate partial derivatives of u, so the strong formrequires that u be continuously dierentiable until at least second partial derivatives. Our

Page 54: Discontinuous Galerkin Finite Element Method for Solving

40

new formulations has lowered this requirement to only first partial derivatives of u bytransforming one of the partial derivatives onto the weight-function v(x,y). This is thefirst big advantage of the weak formulation.X is a subspace of H1 because our weak form requires that the functions be in H1. Thestrong form requires that u be 0 along the boundary, so X is the subspace of all functionswhich are zero on the boundary. Note that, Dirichlet are essential and reflected in X . Thiscomes automatically when we use the weak form.

4.1.6 Approximating the Unknown u

In the FE method, the region is divided into smaller parts and the approximation is carriedout over these smaller parts, and then based on these results, it is established for theentire region. The entire domain is split into smaller parts called finite elements, for whichwe are able to give an approximation for u, then we are able to approximate u for thewhole geometry of any form. Hence we say that the approximation has been carried out"elementwise", hence the name.The following diagrams shows one dimensional elements;

Figure 1. Linear 1-D element

Figure 2. adratic 1-D element

Figure 3. Cubic 1-D element

In 2-dimensions the elements are triangular and can be linear, quadratic or cubic asshown in the next figure. The domain is first discretized into nodes, and then well-definedtriangulation is performed between the nodes. Elements may share nodes with someeven having four or more nodes. The advantage of triangulation is that it can be used toapproximate a huge range of geometries.

Figure 4. Nodes for a 2-D linear element

Page 55: Discontinuous Galerkin Finite Element Method for Solving

41

Figure 5. 2-D adratic element

Figure 6. 2-D cubic element

4.1.7 Basis Functions

The discretization of the 2D-domain is made up of triangles and each triangle has threenodes. One node can be shared by several triangles whereby each triangle is an element.The final formulation will give us a linear system of equations with dimensions N×Nwhere N is the number of nodes. This means that aer solving the system, we will findthe values of u at the nodes.We need to define basis functions for the 2D-domain. We will have as many basis functionsas we have nodes, i.e. each node has one basis function. We denote these basis functions(for node number i) as φ(x j,y j) = δi j. Each φi(x,y) is non-zero only in elements whichshare node i.Going back to the weak form of our equation, Eq (97), let us look at the function u(x,y)which is continuously dierentiable. Note that all the functions φi are continuouslydierentiable.In our problem, we are in search of a function u(x,y) which is piecewise linear on eachelement. The function we are looking for can be wrien as a linear combination of thebasis functions as

u(x,y) =N

∑i=1

uiφi(x,y) (98)

and again

u(x j,y j) =N

∑i=1

uiφi(x j,y j) = u j,Nodal basis (99)

Page 56: Discontinuous Galerkin Finite Element Method for Solving

42

We can define other forms say l and a so as to express our problem in an easy form. Letus define these two forms as

a(u,v)≡∫

Ω

∇v.∇u and l(v)≡∫

Ω

f v (100)

Using integral rules we observe that a is a bilinear form and l is a linear form. Using Eq(100) and the weak form Eq (97), the weak form can be re-wrien as

a(u,v) = l(v), u,v ∈ X (101)

also notice that a(u,v) = a(v,u).Note that the number N used in the summations above is the number of nodes, theboundary nodes included. We can at this stage express our approximation function u andour weight function v respectively as

u =N

∑i=1

uiφi (102)

v =N

∑j=1

v jφ j (103)

Note that we are using v in terms of our basis functions. This is called the Galerkin method.Puing Eq (102) and (103) into the weak form, Eq (101) above we have

a(N

∑j=1

v jφ j,N

∑i=1

ui) = l(N

∑j=1

v jφ j)

= a(v1φ1,N

∑j=2

v jφ j,N

∑i=1

uiφi)

= a(v1φ1,N

∑i=1

uiφi)+a(N

∑j=2

v jφ j,N

∑i=1

uiφi)

=N

∑j=1

a(v jφ j,N

∑i=1

uiφi)

=N

∑j=1

N

∑i=1

a(v jφ j, uiφi)

=N

∑j=1

v j

N

∑i=1

a(φ j,φi)ui =N

∑j=1

v jl(φ j) (104)

The last expression can be wrien in compact form as

vT Au = vT F =⇒ Au = F (105)

Page 57: Discontinuous Galerkin Finite Element Method for Solving

43

Here,

v = [v1,v3, ...,vN ]T (106)

u = [u1, u3, ..., uN ] (107)

and A and F are given by

A =

a(φ1,φ2 a(φ1,φ2) . . . a(φ1,φN)

a(φ2,φ1) a(φ2,φ2) . . . a(φ2,φN)

· · · · · · · · · · · ·

a(φN ,φ1) a(φN ,φ2) . . . a(φN ,φN)

and F =[l(φ1 l(φ2) · · · l(φN)

]T(108)

Note that the system Au = F is not symmetric positive definite (SPD), a property that is aprerequisite for the conjugate gradient method. The reason for this is because we havenot yet specified the boundary conditions. We have just set up the system for all nodes.We need to change this system so that u = 0 along the boundary. Remember that we hadu = 0 in our strong form. We also have f = 1, so that there is no need to use quadratureor any other numerical technique to calculate the l(φi) integral, since this integral is easyto calculate.If our node numbering is given as 1,2,3, ...,N, we can easily change our linear systemto an SPD by seing u = 0 for all nodes i which are boundary nodes. If for instance thefourth node is a boundary node we remove the fourth column and the fourth row fromthe matrix A. Aer removing all the rows and columns corresponding to the boundarynodes, we will have the final SPD form of the linear system which can be solved by theseveral numerical methods.Towards our practical implementation, it will be convenient to define a reference triangularelement and define a 1−1 mapping between a general physical element in the physicaldomain. All the integrals which make up A and F are performed in this reference element.This is just a convenient substitution.

4.1.8 Solving the Poisson Equation

As seen previously, the Poisson equation is given as ∆u = ∇2u = f = 1, defined on theregion Ω = Let us denote the boundary by Γ

4.1.9 Minimization formulation

Page 58: Discontinuous Galerkin Finite Element Method for Solving

44

We seek to find u ∈VD such that

u = arg minw∈V D

J(w) (109)

J(w) =12

∫Ω

∇w.∇wdA−∫

Ω

f wdA (110)

=12

∫Ω

∇w.∇wdA (111)

V D = v ∈ H1(Ω)|v|Γ = 0 (112)

H1(Ω) = v : R−→ R|∫

Ω

v2,∫

Ω

v2x ,∫

Ω

v2y <++∞ (113)

4.1.10 Weak formulation

Let w = u+ v ∈V D.

J(w) = J(u+ v)

=12

∫Ω

∇(u+ v).∇(u+ v)dA

=12

∫Ω

∇u.∇vdA+∫

Ω

∇u.∇vdA+12

∫Ω

∇v.∇vdA (114)

δJv(U) =∫

Ω

∇u.∇vdA

=∫

Ω

∇(v∇u)dA−∫

Ω

v∇2udA

=∫

Γ

v∇u.ndS−∫

Ω

v∇2udA = 0 (115)

It follows from the above results that

J(w)≥ J(u) ∀w,u ∈V D, Weak formulation (116)

4.1.11 Geometric representation

Let φi|T = Ni. This is the function φi restricted to one element. T stands for an element.We want to compute the integral over the element T

a(Ni,N j) =∫

T

∂Ni

∂x∂N j∂x

+∂Ni

∂y∂N j

∂ydA (117)

Page 59: Discontinuous Galerkin Finite Element Method for Solving

45

In terms of programming, it is easier to calculate the element integral (117) by theuse of substitution. We define a linear and aine mapping between T and a refer-ence element T for simplicity. Basis functions for T corresponding to the functionsN1(x,y),N2(x,y) and N3(x,y) are given by

N(ξ ,η) = 1−ξ −η

N2(ξ ,η) = ξ

N3(ξ ,η) = η (118)

The relationship between the coordinates (x,y) and (ξ ,η) is given by

x = xT1 N1 + xT

2 N2 + xT3 N3

y = yT1 N1 + yT

2 N2 + yT3 N3 (119)

We have

∂Ni

∂x= (120)

We need to find ∂ξ

∂x ,∂ξ

∂y ,∂η

∂x and ∂ξ

∂y . Since x = x(ξ ,η) and y = y(ξ ,η), we getdx

dy

=

∂x∂ξ

∂x∂η

∂y∂ξ

∂y∂η

(121)

The Jacobian of matrix is given by

|J|= |∂x∂ξ

∂x∂η

∂y∂ξ

∂y∂η

|= |xT

2 − xT1 xT

3 − xT1

yT2 − yT

1 yT3 − yT

1

| (122)

And the inverse of (121) is given bydξ

=

∂ξ

∂x∂ξ

∂y∂η

∂x∂η

∂y

dx

dy

=1|J|

∂y∂η

− ∂x∂η

− ∂y∂ξ

∂x∂ξ

dx

dy

(123)

This gives us

∂ξ

∂x=

1|J|

∂y∂η

∂ξ

∂y=

1|J|

∂x∂η

(124)

∂η

∂x=

1|J|

∂y∂ξ

∂η

∂y=

1|J|

∂x∂ξ

(125)

Page 60: Discontinuous Galerkin Finite Element Method for Solving

46

It follows that

∂N1

∂x=

1|J|

(yT2 − yT

3 )∂N1

∂y=

1|J|

(xT3 − yT

2 ) (126)

∂N2

∂x=

1|J|

(yT3 − yT

1 )∂N2

∂y=

1|J|

(xT3 − xT

1 ) (127)

∂N3

∂x=

1|J|

(yT2 − yT

1 )∂N3

∂y=

1|J|

(xT2 − xT

1 ) (128)

All the terms in equations (126), (127) and (128) are constants, and the area of T is denotedby AT . The element stiness matrix for T is given by

KT = AT =

∂xN2

1 +∂yN21 ∂xN1∂xN2 +∂yN1∂yN2 ∂xN1∂xN3 +∂yN1∂yN3

∂xN2∂xN1 +∂yN2∂yN1 ∂xN22 +∂yN2

2 ∂xN2∂xN3 +∂yN2∂yN3

∂xN3∂xN1 +∂yN3∂yN1 ∂xN3∂xN2 +∂yN3∂yN2 ∂xN23 +∂yN2

3

(129)

In the Laplace equation discussed here, we have chosen to use a constant load functionf = 1. We make this choice so as to avoid problems that are not necessary in our finalformulation.We know that the entry Fi in the right-hand vector F is given by

Fi = l(φi) =∫

f φi(x,y)dA =∫

φi(x,y)dA f = 1 (130)

Since for the element matrix, φi is non-zero at the elements which share node i, we canalso write the previous expression of the Jacobian as

Fhi =s

∑k=1

∫Ni(x,y)dA (131)

where S is the number of elements in Ω over which the support of Ni is unequal zero.Using the framework mapping between T and T , we can define (131) in terms of referencecoordinates (ξ ,η). Using dA = |detJ|

∫Ni(ξ ,η)dξ dη we get

Fhi =S

∑k=1

∫Ni(ξ ,η)|detJ|dξ dη =

S

∑k=1|detJ|

∫Ni(ξ ,η)dξ dη (132)

The Jacobian J is independent of the elements S. The integral in (132) is simply

∫Ni(ξ ,η) =

16

∀i = 1,2,3 (133)

Page 61: Discontinuous Galerkin Finite Element Method for Solving

47

So,

Fhi =S

∑k=1

∫Ni(ξ ,η)|detJ|dξ dη =

16

S

∑k=1|detJ| (134)

The element matrix derived above is only for one element, we have as many 3×3 matricesas we have elements. To form the entire matrix, we need to place these element matricesat their proper positions. Similar working is repeated for the vector F . Aer puing thesystem together, we need to remove the columns and rows corresponding to boundarynodes, because there we have given function values, in our case u = 0 along the boundary.Then what follows is solving the system using the appropriate methods and then ploingit.

4.1.12 Summary

As we stated at the beginning, we associate a dierential operator (say L) to every PDE. Forinstance, for the Poisson, L = ∇2. The Finite dierence method discretizes this operator byreplacing every dierential with an approximate expression using dierential formulas. Itdoes this by making a grid of nodes, and uses the step length, which in general may varybetween nodes to find expressions for these formulas. The Taylor series is very importantin doing this.The idea of discretization of the domain in which the PDE is defined is a common exercisefor both FE an FD methods. We have nodes in both FE and FD.The main dierence of the two methods lies in the concept of approximation. FD discretizesthe operator whereas FE discretizes the underlying domain X . Recall that in the FE methodused in this work, we derived a weak formulation and based on it we defined a space offunctions in which we supposed ours was to be found. that is

X = v ∈ H1(Ω) : v|∂Ω = 0 (135)

and (136)

H1(Ω) = v : Ω −→ R :∫

Ω

v2,∫

Ω

v2x ,∫

Ω

v2y < ∞ (137)

X is an infinite dimensional space; there is an infinite number of functions that are zeroon the boundary and quadratic integrable until first partial derivatives. In our example inthis paper, we have used functions which are linear polynomials for each element. Thesolution is continuous across the element boundaries.

4.2 Discontinuous Galerkin method (DG)

Galerkin finite element methods are high order methods used to solve convection domi-nated PDEs. Since they make use of finite elements just like the FEM, they are eicientfor use in domains having complex geometry. The discontinuous Galerkin finite element

Page 62: Discontinuous Galerkin Finite Element Method for Solving

48

methods makes use of discontinuous approximating functions and basis functions. Thismakes the methods explicit in nature such that the solution can be developed at elementlevel hence allowing dierent orders of accuracy for each element. This is one of theadvantages of the method over other numerical methods. Another advantage is thatthe resulting mass matrix is local to the cell which allows for an explicit time steppingand no systems to solve. Also, due to the localized nature of the method, it allows onlycommunication between elements that share a common boundary. This in turn leads toeicient parallelization (Flaherty et. al). This feature implies that the mass matrix in thisscheme is block diagonal hence easy to find its inverse. In addition, this method providesstable numerical solutions for first order PDEs. We therefore choose this method for usein this project.The challenges that are encountered while using this method are that: It is more tediousas compared to the FD method and also it involves more degrees of freedom unlike theFV method.

4.2.1 Runge-Kua Discontinuous Galerkin method (RKDG)

These are DG methods that applies Runge-Kua methods at the point of time-discretization.They are used for solving non-linear hyperbolic PDEs especially non-linear conservationlaws arising in:

• Shallow water models

• Gas dynamics models and

• Magneto-hydrodynamics models

4.2.2 Steps in the RKDG method

These are the steps followed in this method:

i. Spatial discretization: The domain in which we seek the solution is divided intoa finite number of elements just as done in the FEM. Let us consider a non-linearhyperbolic conservation law of the form

ut +∇ f (u) = 0

The unknown u is approximated using a discontinuous piecewise smooth function Uh.We choose Uh such that it it contained in a finite dimensional space VDG. Since thisapproximating function is not continuous across the interface between elements, wetake in each element UL

h and URh to represent the le and right limits respectively.

Page 63: Discontinuous Galerkin Finite Element Method for Solving

49

ii. Choice of basis functions: This method gives freedom in the choice of the basisfunctions. Bokhove (2003), chooses the basis functions as the mean and slope of theapproximating function. Cockburn (1998), uses Legendre polynomials Pl instead. Inthe solution of the 1D SWE in the following chapter, we use the Legendre polynomialsas the approximating functions. The first four Legendre polynomials are given by:

P0(x) = 1

P1(x) = x

P2(x) =12(3x2−1) (138)

P3(x) =12(5x3−3x)

iii. Time discretization: From the first two steps the conservative law stated in step (i)is reduced into an ODE of the form

ddt

Uh = Rh(Uh)

We then discretize this system in time using an explicit Runge-Kua method (RK)which is achieved in three steps;

1. Set U0h =Un

h

2. For i = 1, ...,K determine the functions between U0h and Un

h as

U (i)h =

i−1

∑i=0

µilωilh , where ω

ilh =U (l)

h + γil∆tnRh(U(l)h ) (139)

3. Set Un+1h =UK

h

The stability of these methods relies on this step i.e. it depends on the stability of themap

U (l)h 7−→ ω

ilh (140)

This map may not always be stable. To enforce stability we use the last step describedbelow

iv. Slope limiter: The generalized slope limiter methods involve reconstruction of thevariables inside the elements using linear or quadratic elements. The standard repre-sentation of the slope limiter is

∧∏

Kh , Cockburn (1998). It is a non-linear projection

operator designed such that U lh =

∧∏h vh for some function vh. If this holds then the

mapping (141) is stable. The slope limiter algorithm is

Page 64: Discontinuous Galerkin Finite Element Method for Solving

50

1. Set U0h =Un

h

2. For i = 1, ...,K determine the functions between U0h and Un

h as

U (i)h =

∧∏

h

i−1

∑i=0

µilωilh

3. Set Un+1h =UK

h

4.2.3 The general RKDG methods and their stability

In this section we give a detailed description of the steps stated above. We also elaborateon how the stability of the methods is enforced. The forward Euler step defined by themap (140) is not always stable in the L2-norm. We are therefore going to come up with aweaker stability property for this operator and enforce it with the general slope limiter toobtain a stable method.

The DG-spatial discretization

This method is locally conservative and has order k+ 12 if polynomials of degree k are

used. The resulting mass matrix in this step is a block diagonal which guarantees themethod to be highly parallelisable. Again the numerical trace f relies on the traces ofuh on either side of the interface of any two elements. The choice of the numerical traceis usually very delicate and a crucial aspect of the definition of the DG methods as itcan aect their consistency, stability and accuracy. Consistency of the method holdsthat the approximate solution Uh can be replaced with the exact solution u in the weakformulation without aecting the formulation. This means that the numerical trace Uh

should be chosen in a way such that U = u.Let us consider the initial value problem

ddt

u(t) = f (t)u(t), t ∈ [0,T ], u(0) = u0 (141)

We want to find the approximate solution Uh on [0,T ]. We begin by first partitioning thetime interval (0,T ) into tnN

n=0 partitions and set In = (tn, tn+1) n = 0,1, ...,N− 1.We then identify a function Uh on In which is a polynomial of degree not greater than kn,multiply the equation by this function then integrate over In∫

In

uh(s)ddt

v(s)ds = uhv|tn+1

tn =∫

In

f (s)u(s)v(s)ds (142)

Page 65: Discontinuous Galerkin Finite Element Method for Solving

51

where v(s) is a test function and

Uh(tn) =

u0, tn = 0

limε↓0Uh(tn− ε), otherwise

4.2.4 Stability

Still considering the ODE (141), if we multiply through by u and integrate over the entiretime interval we obtain

12

u2(T )− 12

u20 =

∫[0,T ]

f (s)u2(s)ds (143)

This represents the L∞-stability of the solution. For the DG method, let us choose a testfunction v = uh in the weak formulation Eq (142). Integrating by parts yields

N−1

∑n=0

(−12

u2h + uhuh)|t

n+1

tn =12

u2h(T

L)+Θh(T )−12

u20 =

∫ T

0f (s)u2

h(s)ds (144)

with

Θh(T ) =−12

u2h(T

L)+N−1

∑n=0

(−12

u2h + uhuh)|t

n+1

tn +12

u20

The stability of the DG methods holds if

Θh(T )≥ 0

. Let us set

uh(t) = u0, t < 0

uh=12(uL

h +uRh )

[uh] = uLh−uR

h

uL,Rh = lim

ε↓0uh(t± ε)

then

Θh(T ) =−12

u2h(T

L)+(12

u2h(T

L)+ uh(T )uh(TL))+N−1

∑n=0

(−12[u2

h]+ uh[uh])tn

−(−12

u2h(0

R)+ uh(0)uh(0R)+12

u20

Page 66: Discontinuous Galerkin Finite Element Method for Solving

52

= (uh(T )−uh(T L))uh(T L)+N−1

∑n=1

((uh−uh)[uh])(tn)

−(uh(0)−u0)uh(0R)+12[uh]

2(0) (145)

where [u2h] is an identity.

Then defining the trace

uh(tn) =

u0, at t0 = 0

(uh+Cn[uh])tn, if tn ∈ [0,T ]

uH(T L), tn = T

for Cn non-negative and seing C0 = 12 we have from (144)

Θh(T ) =N−1

∑n=0

Cn[uh]2(tn)≥ 0 (146)

This is the condition for numerical stability which is dependent on the numerical trace uh

The RK-time discretisation

Let us consider the definition of the intermediate function given in (139). Let us choosenon-zero values for both µil and γil and let µil ≥ 0 satisfying that ∑

i−1l=0 µil = 1. Using these

conditions and assuming that for a semi-norm |.|, we have that

|ω ilh | ≤ |u

(l)h | (147)

then

|u(i)h |= |i−1

∑l=0

µilωilh |, by 139

≤i−1

∑l=0

µil|ω ilh |, by the positivity of µil

≤i−1

∑l=0

µil|u(l)h | by stability of 147

≤ max0≤l≤i−1

|u(l)h | by the consistency property

From this we obtain that |unh| ≤ |u

0h| for all n≥ 0 (by induction). This indicates that the

stability of the Euler forward step (140) implies the stability of the RK method.

Page 67: Discontinuous Galerkin Finite Element Method for Solving

53

4.2.5 Round-o errors

The RK approach is explicit and may result to amplification of round-o errors. Thisdefect has to be controlled by using some conditions in order to retain the accuracy ofthe method. For the one-dimensional linear case f (u) = cu for example, a von Neumannstability analysis gives a stability of

|c|M tM x≤ 1

2k+1(148)

for a k+1-stage RK method where k is the degree of the approximating polynomials inthe DG discretization.

Stability of the step uh 7−→ ωh = uh +δRh(uh)

The map (140) is not stable in the L2-norm except in the situation where polynomials ofdegree 0 are used. Otherwise, if the polynomials are not constants, the forward Eulerstep (140) can only be stable if Mt

Mx is proportional to (M x)p(k) for p(k)> 0 e.g. p(1) = 12 ,

Chavent G. and Cockburn B. (1989). This condition can only apply where hyperbolicproblems are involved. To deal with this situation, weaker norms or semi-norms wereintroduced for which the Euler step would satisfy stability. To illustrate this let us use theone dimensional case and define the Euler step (140) as follows

∫I j

(ωh−uh)

δ tvhdx−

∫I j

f (uh)(vh)xdx+ f (uh)vh|x

j+ 12

xj− 1

2= 0 (149)

Using vh = 1 we get from (149)

(ω j− u j)/δ t +( f (uLj+ 1

2,uR

j+ 12)− f (uL

j− 12,uR

j− 12))/ M j= 0 (150)

where u j is the mean of uh in I j, uLj+ 1

2and uR

j+ 12

are the le and right hand side limits

of uh in I j respectively. Using a piecewise constant approximating function uh we get amonotone scheme for small enough values of δ and as a result the scheme will be totalvariation diminishing (TVD) i.e.

|ωh|TV (0,1) ≤ |uh|TV (0,1) (151)

where |uh|TV (0,1) ≡ ∑1≤ j≤N |u j+1− u j| denotes the total variation of the local means.If the approximate solutions are not piecewise constant, then for (151) to hold we requirethat

sign(uRj+ 1

2−uR

j− 12) = sign(u j+1− u j)

Page 68: Discontinuous Galerkin Finite Element Method for Solving

54

sign(uLj+ 1

2−uL

j− 12) = sign(u j− u j−1) (152)

The conditions (152) are not necessarily satisfied hence we have to use the generalizedslope limiter

∧∏h to enforce them, Cockburn B. (2001).

4.2.6 The generalized slope limiter

This is a technique used to construct a TVD method. It involves reconstruction of thevariables inside an element by use of linear or quadratic functions, Cockburn (1998). Forpiecewise linear functions

vh|I j = v j +(x− x j)vx, j, (153)

we define the slope limiter of vh as

uh|I j = v j +(x− x j)m(vx, j,v j+1− v j

M j /2,v j− v j−1

M j /2) (154)

where

m(α1,α2,α3) =

smin1≤n≤3 |αn|, if s = sign(α1) = sign(α2) = sign(α3)

0, otherwiseis a midmod function. We can re-write the non-linear projection (154) as

uLj+ 1

2= v j +m(vL

j+ 12− v j, v j− v j−1, v j+1− v j) (155)

uRj− 1

2= v j−m(v j− vR

j− 12, v j− v j−1, v j+1− v j) (156)

For general discontinuous functions denote by v1h the L2-projection of vh into the space of

piecewise linear functions. Then on I j the approximation uh is modified as

uh =∧

∏h(vh) (157)

Then

i. compute uLj+ 1

2and uR

j− 12

using (155) and (156)

ii. If uLj+ 1

2= vL

j+ 12

and uRj− 1

2= vR

j− 12

set uh|I j = vh|I j

iii. If (ii) doesn’t apply take Uh|I j =∧

∏1h(v

1h)

This enforcement of sign conditions stabilizes the forward Euler step In the next chapterwe apply the Discontinuous Galerkin Finite element method to solve the one-dimensionalshallow water equation.

Page 69: Discontinuous Galerkin Finite Element Method for Solving

55

5 The DG for solving the 1D SWE

In this chapter we make use of the RKDG to solve the 1D SWE (84). We opt to use thismethod due to the following reasons;

i. It combines some properties from the FDM and FEM resulting to a high accuracy.

ii. It is suitable for complex geometries.

iii. It is well adapted to parallelization hence easy to use.

iv It can capture discontinuities without generating spurious oscillations.

The 1D shallow water equation in its conservation law form (84) has to be discretizedboth in space, x and time, t . The spatial discretization is done by considering linear finiteelements in which the unknown u(x, t) is approximated by use of discontinuous piecewisepolynomials. We take our basis functions to be the Legendre polynomials Pl in this caseand the time discretization is done using the Runge-Kua method.

5.0.1 Spatial discretization

The linear interval J = [x0,xN ] is divided into a finite number of subintervals Ji = [xi− 12,xi+ 1

2].

The unknown is then approximated using piecewise smooth functions U(x, t) which arenot continuous between elements. These functions belong to the discontinuous Galerkinfinite element space defined by

VG = v ∈ L1(J)|u ∈ pn(Ji),∀Ii ∈ J (158)

where L1(J) is the space of Lebesque integrable functions on I and pn(Ji) is the space ofpolynomials in Ji of degree n.We choose the Legendre polynomials as our basis functions. This choice has also beenused by Schwanenberg (2003). The Legendre polynomials are usually orthogonal in L2

and we have on the interval [−1,1] that∫ 1

−1pl(r)pm(r)dr =

22l +1

δlm (159)

where δlm =

1, l = m

0, l 6= mis the Kronecker delta. This orthogonality is what we apply

to get a diagonal mass matrix M. The general form of the approximating function U(x, t)

Page 70: Discontinuous Galerkin Finite Element Method for Solving

56

is then given by

U(x, t) =n

∑l=0

uli(t)ψ

li (x), x ∈ [xi− 1

2,xi+ 1

2] (160)

where

ψli (x) = Pl(

2(x− xi)

hi) (161)

are the basis functions, hi = xi+ 12− xi− 1

2and xi =

xi+ 1

2−x

i− 12

2 . This approach gives us anapproximate for u in each element in terms of degree n polynomials. We end up with n+1unknowns which are the coeicients ul

i, l = 0,1, ...,n. Using the N elements the matrix ofcoeicients is of the order N× (n+1).

5.0.2 The weak formulation

The weak formulation of the 1D SWE (84) is obtained by first multiplying it by a testfunction ξ ∈ η and integrating over the interval Ji. Here η is a suitable functional space

∫Ji

(∂u∂ t

ξ +∂

∂xf (u)ξ − s(u)ξ )dx = 0

since the approximates U(x) are linearly independent of each other, then for each elementJi we have ∫ xi+

12

xi− 12

(∂u∂ t

ξ +∂

∂xf (u)ξ − s(u)ξ )dx = 0

or for the N elements the sum

N

∑i=0

[∫ xi+

12

xi− 12

(∂u∂ t

ξ +∂

∂xf (u)ξ − s(u)ξ )dx] = 0 (162)

Integrating the second term of this integral by parts we have

∫∂ f∂x

ξ dx =∫

ξ∂ f (u)

∂xdx = f (u)ξ |xi+

12

xi− 12−

∫f (u)

∂ξ

∂xdx

Using this in (162) we obtain

N

∑i=0

[∫ xi+

12

xi− 12

ξ∂u∂ t

dx+ f (u)ξ |xi+12

xi− 12−

∫ xi+12

xi− 12

f (u)∂ξ

∂xdx−

∫ xi+12

xi− 12

s(u)ξ dx] = 0 (163)

Eq (163) is the weak formulation of the equation (84). In this form we only require f (u) tobe integrable unlike in the strong formulation form where we required it to be continuously

Page 71: Discontinuous Galerkin Finite Element Method for Solving

57

dierentiable. This is the advantage of the weak formulation. Note that the approximateU of u has two dierent values in each element. Thus for the flux f (U), we approximateit using

F(U(xi+ 12, t)) = F(UL(xi+ 1

2, t),UR(xi+ 1

2, t)) (164)

where UL and UR represents the le and the right limits of U respectively at the nodeswhere U has a discontinuity. Recall that we put that U is contained in the space definedby (158). We choose the weighted functions used to derive the weak formulation to becontained in the same functional space. Again we take the test function to be similar tothe basis functions, so ξ = ψm

i (x) where m = 0,1, ..., l. Using the new form of our functionin (163) we get for each element Ji

∫ xi+12

xi− 12

∂t

n

∑l=0

uliψ

li ψm

i dx−∫ xi+

12

xi− 12

f (U)ψ′mi dx−

∫ xi+12

xi− 12

s(U)ψmi dx

+F(U(xi+ 12, t))− (−1)mF(U(xi− 1

2, t)) = 0 (165)

where the prime on the second integral denotes dierentiation with respect to x and weused ψl(xi+ 1

2) = Pl(1) = 1 and ψl(xi− 1

2) = Pl(−1) = (−1)l . From (165)

∫ xi+12

xi− 12

∂ tn

∑l=0

uliψ

li ψm

i dx = ∂t(n

∑l=0

[uli

∫ xi+12

xi− 12

ψli ψ

mi dx])

=n

∑i=0

∫ 1

−1ψ

li ψ

mi

duli

dtdx

=hi

2m+1dum

idt

(166)

where we applied the orthogonality relation of Legendre polynomials (159) and the defini-tion (161). As a consequence of this result, we end up with a diagonal mass matrix whichwe have to solve.Using (166) in (167), we find for i = 1, · · · ,N and for l = 0, · · · ,n that

uli =

2l +1hi

[∫ xi+

12

xi− 12

f (U)ψ′li dx+

∫ xi+12

xi− 12

S(U)ψ li dx]− 2l +1

hi[F(U(xi+ 1

2, t))−

(−1)lF(U(xi− 12, t))] (167)

Page 72: Discontinuous Galerkin Finite Element Method for Solving

58

where the dot indicates dierentiation with respect to t . This is an ODE of the form

ddt

Uh = Rh(Uh) (168)

with Uh defined by

Uh =

u0

1 u11 · · · un

1

u02 u1

2 · · · un2

......

...

u0N u1

N · · · unN

(169)

and Rh is a vector made up of the R.H.S of the equation. We applied the Gauss quadratureformula to find the values of the integrals contained in Rh. The quadrature formula statethat ∫

β

α

g(x)dx∼=q

∑i=1

ξig(λi), α ≤ λi ≤ β (170)

where λi are called Gauss points. Using q = 3, we make a three point approximation. Thebasis functions are constants. For instance, when n = 0 the equation (167) becomes

U0i =− 1

M xi[F(U0

i ,U0i+1)−F(U0

i−1,U0i )]+Si (171)

where F(U0i ,U

0i+1) is the flux between elements i and i+1 and Si =

1Mxi

∫ xi− 1

2x

i− 12

The DG scheme is said to be monotone if F(UL,UR) is locally Lipsichitz, consistent andmonotone. The Harten-Lax-Van Leer (HLL) scheme, Harten et. al accounts for the le andright characteristics. This consideration separates the the flux into three states

FHLL(UL,UR) =

FL, if λmin ≥ 0

F∗, if λmin < 0λmax > 0

FR, if λmax ≤ 0

(172)

where FL = F(UL),FR = F(UR) and F∗ = λmaxFL−λminFR+λmaxλmin(UR−UL

λmax−λminThe rarefaction waves determine the wave speeds

λmin = min(uL−√

ghL,u∗−√

gh∗)

λmax = max(uR−√

ghR,u∗+√

gh∗)

where

u∗ =uL +uR

2+√

ghL−√

ghR

√gh∗ =

uL−uR

4+

√ghL +

√ghR

2

Page 73: Discontinuous Galerkin Finite Element Method for Solving

59

Time discretization

Time in this work is discretized using the Runge-Kua method (RK). Let us consider theinitial condition u(x,0) at t = 0. The initial approximation at this point is then given byUh0. The time interval [0,T ] is to be discretized into tkK

k=0, where T is the total time ofcomputation and M tk = tk+1− tk, k = 0,1, · · · ,K−1Let us denote U0

h =Uh0 as the initial polynomial approximation. Then we can use iterationmethods to find Uk+1

h from Unh . If we choose i = 1, · · · ,(m+1) and using RK methods of

the order (m+1) then

U jh = (

j−1

∑l=0

µ jlU lh + γ jl M tkRh(U l

h)) (173)

Using the Runge-Kua method of the first order

Uk+1h = µ1,0Uk

h + γ1,0 M tkRh(Ukh ))

=Ukh+ M tkRh(Uk

h ) (174)

A second order R-K method will be suicient here since our basis functions are linearLet us again denote the CFL-number by ζ . This number expresses the relationship of thespeed of the wave propagation in the actual domain and the grid speed. If M x is a spatialgrid variation within a time t =M t , the grid speed is given by Mx

Mt . In this case we are usinga linear domain Ji so we define

ζ =M tM x

(|v|+ c) (175)

where c is the wave speed. This gives

M t = ζM x

(|v|+ c)(176)

The CFL-number ζ is non-negative and bounded above by 1. It is maximum for n = 0 anddecreases as the order of k increases. The table below shows the values of ζ used hereSometimes the numerical solution U(x) at times may display unphysical oscillations.To avoid this, we use the total variational diminishing (TVD) method. These methodsallows us to restrict the total variation which eliminates the oscillations. We define (for ucontinuous)

TV (u) = limσ−→0

sup1σ

∫∞

−∞

|u(x+σ)−u(x)|dx (177)

Page 74: Discontinuous Galerkin Finite Element Method for Solving

60

If uk = uki is a discrete function

TV (uk) =∞

∑i=−∞

|uki+1−uk

i | (178)

If the initial condition u(x,0) has bounded total variation then the exact solution of theexact scalar conservation law

∂ t(u)+∂x f (u) = 0

has the property that

i. We cannot possibly create a new extrema in x

ii. The lower bound of the exact solution does not decrease and the upper bound doesnot increase.

From these properties we see that TV (u(t)) is a decreasing function i.e.

TV (u(t1))≤ TV (u(t2)), ∀t1 ≤ t2

The numerical scheme is then termed as a Total Variation Diminishing scheme (TVD) andit holds that

TV (uk+1)≤ TV (uk), ∀k (179)

The first order RKDG method satisfies this condition. We can extend this property to the1D SWE by applying it to all the variables separately. In this work we use the slope limitertechnique to construct the TVD for the 1D SWE used in this project. Slope limiting in theDG methods involves construction of the variables in each element using functions of thefirst order or the second order. We modify our solution technique in a way that it willsatisfy the TVD property when k > 1.Let us consider the linear part of our approximating function U(x, t) by

U(x, t) =1

∑l=0

uli(t)ψ

li (x) (180)

such that the coeicients matrix will be

Vh =

u0

1 v11

u01 v1

1...

...

u0N v1

N

Page 75: Discontinuous Galerkin Finite Element Method for Solving

61

Let∧

∏kh be the slope limiter, Cockburn (1998). We define the limit of Uh as Ulim =∧

∏kh(Uh) where we apply the slope limiter separately to all the characteristic variables

since we are dealing with a PDE system. We apply the following algorithm to determineu0

lim,i and uilim,i for i = 1, ...,N

i. Find the transformed variables using the definition below

v1i = B−1u1

i

vLi = B−1(u0

i −u0i−1)

vRi = B−1(u0

i+1−u0i )

where B =

0 1√gH0

i − (q0i /H0

i )2 2q0

i /H0i

ii. Obtain the limiting case v1

i as follows v1lim,i = m(v1

i ,vLi ,v

Ri ) where

m(α1,α2,α3) =

sign(α1)min1≤n≤3 |αn|, sign(α1) = sign(α2) = sign(α3)

0, otherwiseis the minmod function

iii. Reconvert the variables v1lim,i to obtain the limited variable u1

i . Note that u0i is not

modified since only the slope is limited

u0lim,i = u0

i

u1lim,i = Bv1

lim,i

and we get

Vlim =

v0

lim,1 v1lim,1

v0lim,2 v1

lim,2...

...

v0lim,N v1

lim,N

Equation (173) becomes

U jh =

∧ k

∏h(

j−1

∑l=0

µ jlU lh + γ jl M tkRh(U l

h)) (181)

This results to the modification of the RK time discretization, Cockburn (1998).

Page 76: Discontinuous Galerkin Finite Element Method for Solving

62

5.1 Practical problem: The dam break problem

In nearly all countries of the world, hydroelectric power is the main source of the energyused for industrial processes, lighting among other uses. This power is generated in powerstations where a dam is constructed along a water pathway such as a river. The waterbehind the dam possesses potential energy. This energy is used to rotate turbines in theprocess of power generation. To cater for the growing need of electricity, dams have to bemade higher and stronger so that more water can be held behind the dam. The pressureof the water held behind the dam poses a danger of the dam breaking. A one dimensionaldam-break physically represents an instantaneous collapse of an infinitesimal thin damwall in a wide infinitely long horizontal channel. We will use the dam fail problem to testour solution in a channel of a finite water depth at each point downstream of the wall. Ifproper measures are not taken for risk management, a dam failure may cause loss of lifesand property. Therefore the risk of the dam breaking need to be assessed, in terms of;

1. The amount of water that will stream over the broken dam,

2. The speed with which the water will flow downstream

3. The water levels that are expected downstream

Knowing these will allow proper measures to be taken for protection. The water flowaer a dam breaks can be described using the shallow water equations, J.J. Stoker, "WaterWaves". The dependent variables are the water height, H and velocity, v and the onlydepend on the distance x and time, t . We assume an initial no flow condition and that thewater domain is deeper in the dam at the right than at the le. If the dam breaks at atime t0 = 0, the water begins to flow rightwards. Two types of waves are generated bythis dam fail; a shock wave is propagated to the right while a rarefaction is propagated tothe le. This leaves a constant water level in between.

5.1.1 Boundary conditions

The boundary conditions of the 1D domain (channel flow) are obtained by consideringthe le and right boundaries. We take the fluid flow in the le to be inwardly directedand on the right boundary to be outwardly directed. From equations (42) and (43) the 1DSWE can be expressed in its quasi-linear form as

∂tu+B∂xu = s(u) (182)

Page 77: Discontinuous Galerkin Finite Element Method for Solving

63

where B = d fdu =

0 1

− q2

H2 +gH 2qH

=

0 1

c2−u2

is the Jacobi matrix and c the celerity.

The eigenvalues for B areλ1 = u− c

λ2 = u+ c

and the corresponding eigenvectors are

V1 =H2c

1

u− c

and V2 =H2c

1

u+ c

so that B is then diagonalizable as

B = RPR−1 (183)

where P =

λ1 0

0 λ2

is the diagonal matrix and R = (R1,R2).

Multiplying (181) by R−1 and using (182) yields

R−1∂tu+PR−1

∂xu = R−1s or (184)

∂tr+P∂xr = s (185)

where s = R−1s and r =

r1

r2

=

u−2c

u+2c

are characteristic variables called Riemann

invariants. Equation (184) is the characteristic form of the 1D SWE. The characteristics ofthe eigenvalues determines the direction of the characteristics along which the informationis conveyed. At this point, the boundary conditions are dependent on the Riemanninvariants u±2u.

We write a MATLAB program that solves the dam break problem. The Codes of thework are wrien in the Appendix page. These commands are used to obtain valuesof the solutions H and v for dierent time points and plot the graphs representing theinformation. The output of these numerical values of height and velocity is 300 for eachvariable and hence we have not included them in this work so as to safe space. We use aheight, H ∈ [0m,6m] and an horizontal stretch x ∈ [0m,1000m]. We choose N−1 = 400and t ∈ [0,T ] where the period T = 70s.We consider the domain Ω = [−D,D] which has a length of 1000m and the Dirichletboundary conditions h(−D, t) = hL,h(D, t) = hR with hL ≥ hR. The initial conditions are

h(x,0) =

hL, if 0≤ x≤ 300

hR, if 300 < x≤ 1000

Page 78: Discontinuous Galerkin Finite Element Method for Solving

64

u(x,0) = 0 0≤ x≤ 1000 (186)

with hL > hR. This is the Riemann problem for our homogeneous problem. We willcompare our solution with the analytical solution derived by Stoker, 1957. The upstreamdepth hL is maintained at 6m while the downstream depth is a variant. This leads to twodierent cases of flow:

1. hRhL

> 0.5, a subcritical flow

2. hRhL

<< 0.5, a supercritical flow

In a subcritical flow, the fluid velocity is less than the wave velocity. In the first case, letus choose hR = 3.6 and hL = 6. The ratio of hR to hL gives hR

hL= 0.6, which describes a

subcritical flow. The flow profile is then as shown in the graphs below, with the first plotshowing the variation of H versus x and another for the velocity v versus x. A rarefactionoccurs between 300 and 450m and a shock occurs downstream at 650m. This is due tosubcritical flow.

Fig 1: Variation of height with distance, x aer Dam-break

Page 79: Discontinuous Galerkin Finite Element Method for Solving

65

Fig 2: Velocity variation with distance, x aer Dam-break (subcritical flow)

In the supercritical flow, let us take hR = 0.48 and hL = 6, then we have hRhL

= 0.08. Thegraphs below show the simulation of the flow profile for both height and velocity of waterfor the dam break.

Fig 3: Variation of height with distance, x aer Dam-break (supercritical flow)

Fig 4: Variation of velocity with distance, x aer Dam-break (supercritical flow)

The rarefactions are much steeper and longer in this case whereas the shock is formedmuch faster as compared to the previous case. This is because the flow is supercriticaldownstream i.e. the velocity of the fluid is much greater than the velocity of the gravitywaves.

Page 80: Discontinuous Galerkin Finite Element Method for Solving

66

6 Results, Conclusions and Recommendations

6.1 Results

If a village is located a distance 1 kilometer downstream for example from the dam, damexperts want to know how long it will take for the flood to reach the village in case thedam fails. The height h of the water and the velocity v of flow at dierent points aredependent on the distance x along the flow and time t .The domain of obtaining the solution contains the reservoir the channel and the village. Weimposed a le boundary at x= 0. This is justified because the sides of the channel are steep.The right hand boundary is not clear. To find how long it takes the flood water to reachthe village, we need to calculate the grid index for the village. This is dependent on thenumber of grids used in the domain. The Lax-Friedrich’s scheme gives the following results

Number of Grids (N) time(seconds)

100 308

200 369

400 402

800 414

1600 420

3200 423

6400 424

Table 1: Flood times for dierent grid sizes

A grid independent solution is obtained using 6400 grid points. The flood takes 7 minutes toreach the village. This indicates that if a dam breaks, the people at the village downstreamhave 7 minutes until the flood arrives.

6.1.1 Conclusion

The shallow water equations has a much more potential than is discussed in this work.They are well suited for tsunami wave wave modeling. They are used by tsunami warning

Page 81: Discontinuous Galerkin Finite Element Method for Solving

67

centers to model the tsunami wave propagation. Also, many hydrodynamical phenomenasuch as storm surges, river flooding and dam fail problem have been eectively treatedusing the shallow water theory. Shallow water equations have been applied to modellandslides and avalanches. In the process of applying these equations to model the dier-ent phenomena, some limitations may be encountered. Tough restrictions are put in placeand an evaluation of the results obtained has to be done to verify their validity.In the DG method the domain is discretized such that Ji = [xi− 1

2,xi+ 1

2] with i = 1,2, · · · ,N

where N is the number of elements. Multiplying by the weight function v(x) and integrat-ing over the element Ji we have∫ x

i+ 12

xi− 1

2

[Ut +F(U)x−S(U)]v(x)dx = 0

. We obtain for each element a weak formulation of the form

∫ xi+12

xi− 12

ξ∂u∂ t

dx+ f (u)ξ |xi+12

xi− 12−

∫ xi+12

xi− 12

f (u)∂ξ

∂xdx−

∫ xi+12

xi− 12

s(u)ξ dx = 0

For each element the equation is integrated independently applying an explicit time-stepping scheme. The problem of dam fail may lead to huge economic loses. It may leadto loss of lives, damage to property and infrastructure. So, no maer how strong the damhas been built, the risk of breaking of the dam need to be assessed. This risk assessmentis done in terms of; the depth of the flow and the velocities aer the dam fails. A team ofexperts involved with downstream flood prediction and early warning systems in the caseof a dam failure has to be put in place. Also, regular maintenance has to be carried on thedam so that its life can be increased. If the dam is le unmaintained, this exposes it toweakening and hence a possible failure. For example, if trees are le to grow near the dam,the dam may develop cracks due to penetration of roots into the embankments. Throughleakage and flow of water through the cracks on the wall, the wall become eroded henceweakening. The main factors which lead to dam failure include;

i. natural factors such as flooding which may lead to excess water capacity in the dam.

ii. use of poor construction materials which wear out and weaken with time.

iii. cracking of the dam embankment caused by piping and internal erosion of soil in theembankment.

iv. inadequate maintenance services on the dam.

In the test/practical problem, we considered a representation of the water flow followinga dam break using 1D SWE. The results obtained show a very close match with thoseobtained by P. Garcia-Navarro, A. Fras T. Villanueva, (1999) and Samir K. Das, Jafar Bagheri

Page 82: Discontinuous Galerkin Finite Element Method for Solving

68

(2015).The discontinuous Galerkin finite element is suitable for models that involve hyperbolicPDEs. The non-linearity of the 1D shallow water equations used here results into a forma-tion of a bore wave which propagates a finite speed within the domain. The discontinuousbases used in this method are suitable for such shock waves. We used Roe Riemann solversto resolve the fluxes at the boundaries of the elements. These solvers accommodate thephysics of wave propagation. The RK-TVD method is used to ensure that the approximatedsolution remains bounded in an arbitrary semi-norm |wn

h| ≤ |w0h|,∀n≥ 0. This applies if

the intermediate Euler steps, w(l)h −→ vil

h , remains bounded at every intermediate stepin this arbitrary in this arbitrary semi-norm, |vil

h | ≤ |wlh|. According to Cockburn et al, if

degree 0 polynomials are used the DGFEM results in a monotone scheme and stability isensured in the total variation semi-norm,

|vnh|TV ≤ |wn

h|TV

where the TV semi-norm is defined

|wh|TV =N

∑i=1|wi+1− wi|

The slope limiter used eliminates fast oscillations which are experienced near the shockfronts.

6.1.2 Recommendation

More work still remains undone in the field of SWE models and in the implementation ofthe solution methods. Following the results of this work, we would recommend furtherresearch on the following areas;

1. It is an advantage that the 2-dimensional ocean circulation SWE has been derived inchapter 2. This equation need to be solved using the RKDGFEM.

2. There is a need that the slope limiter used in the RKDG method be modified so that itcan accommodate a varying boom of the domain.

3. The RKDG method still leaves room for modification so that it will be able to handlemoving boundaries. The boundary here changes due to flooding or drying. Thusaflooding and drying algorithm still remains to be determined.

Page 83: Discontinuous Galerkin Finite Element Method for Solving

69

Bibliography

[1] Harnet E., V. Legat and E. Deleersnijder, 2003. A comparison of three finiteelements shallow water equations. Ocean modeling 5, (17-35)

[2] Hanert E., D. Y. Le Roux, V. Legat, E. Deleersnijder, 2003. Advection schemes forunstructured grid modelling, Ocean modelling 7, (39-58)

[3] Hanert E., D. Y. Le Roux, V. Legat, E. Deleersnijder, 2003. Comparison of 4advection schemes for use in unstructured grid ocean modelling. Proceedingsof the sixth national congress on Theoretical and Applied Mechanics, Ghent(Belgium), 8 pp

[4] A.J., C.N., Marshall, J.C., 1999. A new treatment of the Coriolis terms in C-grid models at both high and low resolutions., Monthly weather Review 127:8,1928-1936,

[5] Behrens J., 1998. Atmospheric and ocean modelling with an adaptive finite elementsolver for the shallow water equations. Applied Numerical Mathematics 26, (217-226)

[6] Mark A. Cane, Introduction to Ocean Modeling.

[7] Patrick Adrich, Gurvan Madec and Didier L’Hostis:, Performance Evaluationfor an Ocean General Circulation Model: Vectorization and Multitasking, InProceedings 1988 International conference on Supercomputing, ACM, St. Malo,France, July 1988, pp295-302.

[8] L.F. Richardson, Weather prediction by Numerical Process, Cambridge UniversityPress, Cambridge, (1922) Introduction to Ocean Modeling)

[9] McDougall, T. J. (2003) Potential Enthalpy: A conservative Oceanic variable forevaluating heat heat conted and heat fluxes., J. Phys. Oceanogr., 33 (945-963)

[10] McDougall, T. J. R.J. Greatbatch and Y. Lu (2003) On conservation equations inoceanography: How accurate are Boussineq ocean models?, J. Phys. Oceanogr.,32 (1574-1584)

[11] Hellberg R. W., and Adcro A., 2006 On methods of solving the oceanic equationsof motion in generalized vertical coordinates, Ocean Modelling, 11, (224-233)

Page 84: Discontinuous Galerkin Finite Element Method for Solving

70

[12] Arbic, B., Wallcra, A., and Metzger, E. (2010),. Concurrent simulation of theeddying general circulation and tides in a global ocean model. Ocean Modelling,32, (175-187)

[13] Bleck, R. (2002). An oceanic general circulation model framed in hybrid isopycnic-cartesian coordinates. Ocean Modeling, 4, (55-88)

[14] Brankart, J. M., (2013), Impact of uncertainties in the horizontal density gradientupon low resolution global ocean modeling, Ocean Modelling, Submied

[15] A.J. Campin, J.M Hill, C.N. Marshall, Implementation of an atmosphere-oceangeneral circulation model on the expanded spherical cube .,Monthly weatherreview, 2004.

[16] Arakawa A. Computational design for longterm numerical integrations of theequations of fluid motion: two-dimensional incompressible flow. Part I. Journalof physics 1, 1996, 119-143.

[17] Behrens J., 1998. Atmospheric and oceanic modelling with an adaptive finiteelement solver for shallow water equations. Applied Numerical Mathematics 26,217-226

[18] P.E. Bernard, N. Chevaugeon, V. Legat, E. Deleersnijder and J. F. Remacle. High-order h-adaptive discontinuous Galerkin methods for ocean modeling. OceanDynam., 2007.

[19] D. Blayo and L. Debren Adaptive mesh refinement for finite dierence oceanmodels first experiments. J. Phys. Oceeanogr., 1999

[20] Blumberg A.F., and G.L. Mellor, A description of three-dimensional Ocean cir-culation model, in Three-dimensional ocean circulation models, Vol. 4, edited N.Heaps, pp 208, American Geophysical Union, Washington D.C. 1987.

[21] Blumberg A.F., and G.L. Mellor, Diagnostic and Prognostic numerical circulationstudies of the South Atlantin, Bight J., Geophys. Res., 88, 4579-4592 (1983)

[22] Greatbatch, R.J., Y. Lu, and Y. Cai (2001), Relaxing the Boussinesq approximationin Ocean Circulation Models, J. Atmos. Ocean. Technol., 18 (1911-1923)

[23] Gregg, M., T. Sanford and D. Winkel (2003), Reduced mixing from the breakingof internal waves in equatorial waters, Nature, 422, (513-515)

[24] Griies, S. M. (2005) Some Ocean Model Fundamentals, in Ocean Weather Fore-casting: an Integrated view of Oceanography, Vol 577, edited by E. P. Chassignet,and J. Verron, pp 19-73, Springer, Berlin

Page 85: Discontinuous Galerkin Finite Element Method for Solving

71

[25] Tsunami Runuponto, a complex Three-dimensional Beach; Monai valley , ac-cassed 18-1-2017

[26] Audusse E., Bouchut F., Bristeau M.O., Klein R. and Perthame B., A fast andstable well-balanced scheme with hydrostatic reconstruction for shallow waterflows, SIAM J. Sci Comput., (2004), 2050-2065

[27] LeVeque R.J., Balancing source terms and flux gradients in high resolutionGudonov methods: the quasi-steady wave-propagation algorithm, J. Comput.Phys. 146 (1998), (346-365)

[28] LeVeque R.J., George D.L. and Berger M.J., Tsunami modeling with adaptivelyrefined finite volume methods, Acta Numer. 20 (2011) 211-289

[29] Liu P.L.F., Yeh H. and Synolakis C., Advances in Coastal and ocean Engineering,World Scientific, (2008.)

[30] Chanson H., The hydraulics of open channel flow, Arnold, (1999)

[31] Vreugdenhill, C.B., Numerical methods for shallow water flow, Kluwer Ac.Pub.,Dordrecht, The Netherlands, (1994.)

[32] Toro, E.F., Shock capturing Methods for Free-surface shallow water flows, JohnWiley and sons, (2001)

[33] Burguete, J., Garcia-Navarro, P. Eicient construction of high-resolution TVDconservatives schemes for equations with source terms: applications of shallowwater flows, International Journal for Numerical methods in Fluids, 37, pp.209-248, (2001)

[34] Brufau, P. and Garcia-Navarro, P., Two-dimensional dam break flow simulation,Int. J., for Num. Meth. Fluid dynamics 33, pp. 35-57, (2000)

[35] Bleck, R., 2002, An oceanic general circulation model framed in hybrid isopycnic-cartesian coordinates. Ocean modeling 4, (55-88)

[36] G. Strang and G. J. Fix, An analysis of the Finite element method, Prentice Hall,(1973)

[37] C. Johnson, Numerical solution of Partial Dierential Equations by the FiniteElement Method, Cambridge University Press, (1980)

[38] S. C. Brenner and L. R. Sco, The Mathematical Theory of Finite Element Methods,Springer-Verlag, New York, (1994, Second edition 2002)

[39] Fundamentals of the Finite Element Method for Heat and Fluid flow, R.W. Lewis,P. Nithiarasu and K.N.Seetharamu. Wiley Ltd. (2004) ISBN: 0-470-84788-3

Page 86: Discontinuous Galerkin Finite Element Method for Solving

72

[40] Niels Oosen and Hans Peersen, Introduction to the Finite Element Method,Prentice, 1992, 1st Ed, 1992

[41] Dietrich Braess: Finite Elements, Cambridge, 3rd Ed, (2007)

[42] Bernado Cockburn and Wang Chi-Shu. The Runge-Kua discontinuous Galerkinmethod for conservation laws V: Multidimensional systems. Technical Report TR-97-43, (1997)

[43] P. Jamet. Galerkin-type approximations,which are discontinuous in time forparabolic equations in a variable domain. SIAM J. Numer. Analy, 15 912-928(1978)

[44] Toro E. Spruce M, Speares W. Restoration of the contact surface in the HLL-Riemann solver, Shoch Waves, (1994) 4(1): 25-34

[45] Ying X, Khan AA, Wang SSY. Modelling Dam break flows using finite volumemethod on unstructured Grid. Engineering Application of Computational FluidMechanics, 2009, 3(2): 184-194.

[46] Gotlieb S, Shu CW., Total Variation diminishing Runge-Kua schemes. Mathe-matics of Computation, (1998); 67(221) 73-85

[47] Wu W., and Wang, S.S. (2007). One-dimensional Numerical model for NonuniformSediment Transport under Unsteady Flows in Channel Networks, Journal ofhydraulic Engineering, 130(9) 914-923

[48] Ying X, Jorgeson J, Wang SSY (2009), Modelling Dam-break flows using Finite vol-ume methods on unstructured grid, Engineering Applications of ComputationalFluid Mechanics,3(2): 184-194

Page 87: Discontinuous Galerkin Finite Element Method for Solving

73

7 Appendix

7.1 MatLab Code for the Problem