1.1 Examples of Different Types of Models in Water Systems: Deterministic, Stochastic, Data-Based, and Others
Water systems vary widely in applications and the present text is aligned mostly towards the hydraulic and hydrologic phenomena as dealt with in civil, environmental, or agricultural science and engineering disciplines. The phenomena discussed include those from the surface and subsurface phases of the hydrologic cycle, and open channel flows through natural or engineered structures. From its initial touchdown till its eventual dispersal to the ocean, the rainwater collects and transmits pollutants, as it flows through the different pathways. The text therefore also discusses the simulation techniques for predicting the fate and transport of the water pollutants in channels, shallow water bodies, soil-seepage, and groundwater flows.
The hydrologic surface and subsurface flows are also related to conventional hydraulics and may be approximated through suitable mathematical relations or equations. The different chapters of this book demonstrate the numerical techniques by which these equations may be solved on a personal computer. In the present age of âbig-dataâ, there is an increasing trend of modelling the hydrologic and hydraulic variables through data analysis â such as by using stochastic or data-driven techniques. These tools are available through various platforms and help in obtaining the âbigger pictureâ of the environmental processes occurring around us. However, on certain smaller scales, it is still necessary to understand the physics behind a hydraulic phenomenon and predict its behaviour using compatible models. For example, atmospheric models and data analytics may help predict future rainfall over a catchment but precise delineation of the flood-inundated areas may only be possible by solving the free-surface flow equations using suitable computational methods. Similarly, computing the extent of surge that may move up a tidal river under predicted future conditions of sea level rise may only be possible using numerical models to solve the flow equations with the help of a computer. For predicting the movement and extent of spread of a contaminant along with the flow of water, whether over the earthâs surface or below, would likewise require solving the appropriate equations numerically on a computer.
1.2 Choosing a Numerical Approach for Flow and Transport Modelling
Many of the physical processes of environmental and engineered flows may broadly be described mathematically by one simple equation, a set of simultaneous equations, or differential equations. In each of these types of equations, the different flow variables are interrelated in terms of the rate of change of one or several variables as a function of time and/or space variables. Under certain simplified conditions, the equation(s) may be solved analytically, and may not require a numerical solution to solve using computers. Some of such examples include the formulae for evapotranspiration and infiltration, expressed in terms of the independent variables. However, in many practical situations, the unique geometry of the flow domain may make it difficult for applying analytical techniques, as the processes can only be described by non-linear partial differential equations. As a result, only numerical solutions of the equations offer the feasible means for obtaining the desired results. Oftentimes, the variation of flow with time may also demand the application of specific numerical techniques. It is important to note that numerical solutions, though producing approximate results, may yield better accuracy either by refining the equations themselves or by adopting more accurate numerical techniques. Quite often, however, simple approximations may also yield reasonably acceptable results, which may help in understanding the occurrence of a particular phenomenon or aid in taking a rapid decision. The contents of this book do not venture into very accurate numerical approximations of the different hydraulic phenomena as encountered in the natural or built environment. Rather, they attempt to demonstrate the general methods that may be selected for tackling a given problem and obtaining an initial solution. Further improvement and refinement of the models are possible by expanding on the building blocks demonstrated here on the application of numerical techniques to different geophysical and engineered flows.
1.3 Python as the Preferred Programming Platform
For solving the numerically approximated equations, one needs to write computer programs or codes, which may be run on a suitable computational platform. The traditionally used computer language for scientific code writing since the middle of the last century had been FORTRAN, and sometimes BASIC and others. However, these were taken over by the end of the century by C/C++, and to some extent by Java. However, the last century also saw the rise of computational platforms like MATLAB, or other similar interpretable programming platforms, which became popular among researchers and still remain so. For this book, however, we have chosen the language Python, which appears to have been gaining popularity lately, especially among the student and academic community. Since the purpose of this text is more pedagogical than a research exposition, we have also chosen Python as the preferred coding language because of its relatively easy learning curve. Python is also a completely open-source computing platform and is rather easy to install and start working. An added advantage of using Python as the coding language is that it provides readily accessible functions for plotting graphs. Thus, it may be used to display and save graphical outputs of the variables which are used as inputs or those which are obtained from running a code. Codes written in FORTRAN or C/C++ first require the variables to be stored in files and then plotted graphically using another software package, such as the Paraview. Although Python may have become popular for its varied applications in non-scientific and scientific but non-numerical applications, Python has also been demonstrated for use in numeric computations, as proved by the appearance of books on the subject over the past decade. Although one may use Python to write codes on the go, such as on interpretable computation platforms, in this book we shall encourage the readers to write scripts (equivalent to computer codes) and then run the codes using the Python command. This is definitely required for longer programs since the errors in the script may be corrected or modified for future reuse. Further, since there are several books and online resources guiding the installation of the Python computing platform, it is not discussed in this book.
1.4 Pedagogical Emphasis
This book is primarily intended for the students of hydraulics, hydrology, environmental, and water resources engineering who may like to start writing their own codes for the problems at hand. Though nowadays many open-source software packages are available for the accomplishment of different tasks in the fields described, quite often, especially when the problem is simple in terms of geometry and other physical properties, it is enough to write a simple computer program and obtain the solution. The same program may be later improved and adapted to more complicated inputs and geometries. Since the book also discusses the popular numerical schemes used for solving problems in the field of hydrology, hydraulics, and transport of contaminants by flowing water it may be used for teaching a semester-long course on numerical methods for the students of such specializations. The codes are not written in the most optimum way and may be modified by the student in order to make it more efficient in terms of memory management or time of execution. Similarly, the student may experiment with other advanced forms of graphical outputs, including animations.
1.5 Types of Models Treated in the Book
The models presented in this book on hydrology, hydraulics, and contaminant transport are demonstrated for the following physical processes:
- Surface runoff generation by rainfall
- Flows in one-dimensional open channels
- Depth change in reservoirs from inflows and outflows
- Flows in shallow lakes and water bodies
- Flows in pipe networks
- Shallow groundwater flow, considered two-dimensional in the horizontal plane
- Saturated seepage flow through soils in the vertical two-dimensional plane
- Contaminant transport in one-dimensional open channel flows, shallow two-dimensional surface flows, and seepage flows in soils.
The equations involved are of the following types:
- Non-linear equation
- Simultaneous linear and non-linear equations
- Ordinary differential equations
- Partial differential equations
The numerical techniques discussed are:
- The NewtonâRaphson method of finding the roots of non-linear equations
- Solution of simultaneous linear equations using the Gaussian elimination method
- Solution of simultaneous non-linear equations by a combination of the above
- Solution of ordinary and partial differential equations using the method of finite differences
This book is not intended to elaborate on the numerical techniques, as many useful texts are widely available, some of these being listed in the bibliography. Nor is this book meant to be a programming guide for the language Python, for which again several books and web resources are available. The reader is thus encouraged to proceed only after acquiring a basic knowledge of coding in Python in order to find the book useful. Nonetheless, it is emphasized that this book should be found useful to the science and engineering students who have started exploring the exciting world of coding and modelling physical processes, especially those involving the flow of water and movement of contaminants in the natural and built environments.
This chapter introduces a variety of physical processes â sometimes called as systems â in hydraulics, and water resources engineering and are described equivalently in the mathematical form as a single or a set of equations. If an equation is possible to be rearranged in terms of the unknown variable explicitly, we may obtain an answer without resorting to advanced computational methods. However, if the equation is non-linear in terms of the unknown variable, then it may not be possible to write an explicit expression for evaluating the variable. In such cases, root-finding algorithms â like the NewtonâRaphson Method â may have to be used. An extension of the single equation involving one unknown variable is the system of say, n, equations in terms of n independent variables. Here too, the n equations may be solved for the n unknowns by standard methods of linear algebra if the system of equation is linear, that is if the variables are not arranged in powers greater than one. Otherwise, techniques such as the NewtonâRaphson may be used by extending it for n unknowns. This chapter demonstrates the solutions for some problems of these kinds and provides computer programs in Python for implementing the solution algorithms.
2.1 Examples of Non-Linear Fun...