You are on page 1of 20

Doddi Yudianto and Xie Yuebo, 2008.

The Development of Simple Dissolved Oxygen Sag Curve in Lowland Non-Tidal River By Using MATLAB.


137

Journal of Applied Sciences in Environmental Sanitation, 3 (3): 137-155.






Theoretical Paper

THE DEVELOPMENT OF SIMPLE DISSOLVED OXYGEN SAG CURVE IN
LOWLAND NON-TIDAL RIVER BY USING MATLAB

DODDI YUDIANTO* and XIE YUEBO

State Key Laboratory of Hydrology-Water Resources and Hydraulic Engineering, Hohai University,
Nanjing, 210098, China
*Corresponding Author; E-mail: doddi_yd@yahoo.com

Received: 1
st
September 2008; Revised: 18
th
September 2008; Accepted: 19
th
September 2008

Abstract: This paper was aimed to provide more detail explanation focusing on the
development of simple dissolved oxygen (DO) sag curve in a lowland non-tidal river
under steady flow condition. Steady state and dynamic models employed are basically
developed by MATLAB using two mathematical functions of ode45 and pdepe. The
developed numerical models showed a good accuracy to steady state analytical
methods. The plug flow model without dispersion brought about the concentration of DO
and the ulimate biological oxygen demand (BODu) are slightly lower than the dispersion
model. As a result of dispersive mixing, the intersection point between deoxygenation
rate and reaeration rate moves a bit downstream from the point where critical DO deficit
occurs. It was found that mass fluxes due to advection are greater than dispersive
fluxes.

Keywords: DO sag curve, lowland non-tidal river, steady flow, MATLAB


INTRODUCTION

Problems associated with the reduction of DO concentration in rivers have become matters of
concern since over a century ago. Started by the introduction of Fickian analogies as initial
concept of diffusion, there has been a long history of the use of quantitative techniques to assess
the impacts of pollutants on dissolved oxygen concentration in river systems. Only after the
establishment of classical equation of dissolved oxygen (DO) and biological oxygen demand
(BOD) by Streeter and Phelps in 1925, however, a significant development of water quality
models was truly identified [1, 2]. In general, the variability of DO concentration in rivers is
influenced by many factors in which those major influences can be categorized as being either
sources or sinks of DO in rivers. As major sources of DO, the oxygen are usually obtained from
the reaeration/enhanced aeration process, photosynthesis oxygen production, and introduction of
DO from other sources such as tributaries. On the other hands, the depletion of DO can be


ISSN 0126-2807


Volume 3, Number 3: 137-155, September-December, 2008
T2008 Depart ment of Envi ronment al Engi neer i ng
S e p u l u h No p e mb e r I n s t i t u t e o f T e c h n o l o g y , S u r a b a y a
& Indonesian Society of Sanitary and Environmental Engineers, Jakarta
O p e n A c c e s s h t t p : / / w w w . t r i s a n i t a . o r g



Doddi Yudianto and Xie Yuebo, 2008. The Development of Simple Dissolved Oxygen Sag Curve in Lowland Non-Tidal River By Using MATLAB.


138

Journal of Applied Sciences in Environmental Sanitation, 3 (3): 137-155.

caused by the oxidation of organic material and other reduced matter in the water column,
degassing of oxygen in supersaturated water, respiration by aquatic plants, addition of BOD by
local runoff, removal of oxygen by nitrifying bacteria, and the oxygen demand exerted by river bed
sediments.
In water quality modeling, most of those processes above are expressed in mathematical
terminology in the form of differential equations. It would be prohibitively complex to simulate all
of the chemical reactions and biological processes affecting each element. It is also not
necessary or not possible to measure all data from the field site. Therefore, many available
dissolved oxygen models usually employ the extended versions of Streeter and Phelps equations
to describe the BOD and DO profiles along natural rivers [2, 3]. The simplest manifestation of this
equation is usually applied for a river reach characterized by plug flow system with constant
hydrology and geometry under steady state condition. For a large river or estuary, the
phenomenon of DO and BOD distribution becomes even more complex since it is mostly
influenced by a considerable longitudinal dispersion. Therefore, the aim of this paper is to provide
detail explanation focusing on the development of simple dissolved oxygen sag curve in lowland
non-tidal river under steady flow condition. Some components of dissolved oxygen sources and
sinks will be ignored instead of the tidal effect.

METHODOLOGY

In order to gain better understanding of the process of water quality model development, two
simple models are presented in this paper to provide clear description especially about the
dissolved oxygen sag curve introduced by Streeter and Phelps. Both steady state and dynamic
simulations employed here are basically done by MATLAB using two main mathematical
functions: ode45 and pdepe. Under steady state condition, the first model was developed by only
considering the advection fluxes. While as a dynamic plug flow system with dispersion, the given
system of partial differential equations (PDEs) is solved by taking into account both advection and
dispersion fluxes. Since the dynamic model will gain a steady state condition after the equilibrium
time is reached, the analytical solutions for both cases are used to evaluate the accuracy of those
developed numerical models. As the equations contain some driven parameters, the dynamic
model is further used to simulate some scenarios or synthetic examples which are closely related
to the aim of the paper. Besides illustrating the influence of longitudinal mixing on the DO sag
curve, the concept of waste load allocation and enhanced aeration will also well explained in the
paper.

Streeter and Phelps Equations
It was really a great achievement when Streeter and Phelps, in 1925, were able to propose a
mathematical equation that demonstrating how dissolved oxygen in the Ohio River decreased
with downstream distance due to degradation of soluble organic biochemical oxygen demand. By
considering a first order of degradation reaction, for a constant river velocity, the classical
equations of Streeter and Phelps can be written as follows.
( ) C C k L k
dx
dC
u
dt
dC
s a d x
+ = (1)
L k
dx
dL
u
dt
dL
d x
= (2)
D k L k
dx
dD
u
dt
dD
a d x
+ = (3)

Doddi Yudianto and Xie Yuebo, 2008. The Development of Simple Dissolved Oxygen Sag Curve in Lowland Non-Tidal River By Using MATLAB.


139

Journal of Applied Sciences in Environmental Sanitation, 3 (3): 137-155.

where C is DO concentration (ML
3
); L is ultimate BOD concentration (ML
3
); D is DO deficit
concentration (ML
3
); Cs is saturated dissolved oxygen concentration (ML
3
); ux is the cross-
sectional averaged flow velocity (LT
1
); kd is first order deoxygenation rate constant (T
-1
); ka is first
order reaeration rate constant (T
-1
).
If the equation is mathematically consider to be steady state ( 0 = dt dC ), then the above
equations will form initial value problems (IVPs) which can be easily solved by any available
numerical methods suit for ordinary differential equations (ODEs). However, since this paper
emphasizes more on the distribution of oxygen in lowland non-tidal river, it is not appropriate to
leave the dispersion parameter out from the model [4, 5, 6]. In real system, due to various
changes of slope, morphology or irregularity of river bed and bank, sequences of pools and riffles,
roughness, and large turbulent eddies, the role of dispersion term becomes even more crucial [7,
8, 9]. The steady state plug flow model without dispersion, in this case, is used only to show the
influence of longitudinal mixing on the sag curve profiles given by the following equations after the
equilibrium time is reached.
( ) C C k L k
dx
C d
E
dx
dC
u
dt
dC
s a d x x
+ + =
2
2
(4)
L k
dx
L d
E
dx
dL
u
dt
dL
d x x
+ =
2
2
(5)
D k L k
dx
D d
E
dx
dD
u
dt
dD
a d x x
+ + =
2
2
(6)
where Ex is longitudinal dispersion coefficient (L
2
T
-1
).

Estimation of Model Parameters
As it can be noticed from the above equations, there are five factors that affecting the profile
of dissolved oxygen sag curve in river systems. Besides the advection and dispersion fluxes, the
reaeration rate and degradation rate which assumed to follow a simple first order decay rate will
also in fact influence the distribution of DO and BOD concentration. According to Wallis and
Manson [9], the generation of longitudinal dispersion in open channel flows basically can be
expected to be proportional to the differential longitudinal advection and inversely proportional to
the cross sectional mixing. Since both advection and dispersion processes here are governed by
the presence of velocity gradients, the involvement of hydraulic model to derive longitudinal flow
velocities is, without excuse, very important.

Average Flow Velocity (Ux)
In fact, it is difficult to measure the net non-tidal velocity due to freshwater discharge of an
estuary. Usually, the flow velocity is estimated in one or two ways: (1) using the empirical
hydraulic equation or (2) from release of fluorescent dye at high/low water slack tide [3]. In many
applications of water quality models development, also supported by a theoretical research done
by Yudianto and Xie [10] on the distribution of contaminant under non-uniform velocity of steady
flow regimes, however, taking assumption of using the cross-sectional average flow velocity is
found to be sufficient to produce accurate results from one dimensional model under steady flow
condition. For a prismatic channel, the average flow velocity can be generally calculated by using
the Manning formula as defined in the following equation.
2
1
3
2
1
S
P
A
n
u
x
|

\
|
= (7)

Doddi Yudianto and Xie Yuebo, 2008. The Development of Simple Dissolved Oxygen Sag Curve in Lowland Non-Tidal River By Using MATLAB.


140

Journal of Applied Sciences in Environmental Sanitation, 3 (3): 137-155.

where A is cross-section area (L
2
); P is cross-section wet perimeter (L); and S is longitudinal
channel bed slope.

Longitudinal Dispersion Coefficient (Ex)
As clearly mentioned in many literatures, the dispersion coefficient could be technically
determined by using any available predictive equations such as McQuivey and Keefer (1974),
Fischer (1975), Jain (1974), Liu (1977), Seo and Cheong (1998), and Deng et all (2001), etc [3,
9]. Although most of these equations have been widely applied in many research works, however,
Wallis and Manson [9] showed that such predictive equations result a wide range values of
dispersion coefficient for the same case of in bank flow. As the dispersion coefficient may quite
vary from one method to another, this paper will only consider the mostly cited equation which
was developed by Seo and Cheong.
*
62 . 0
428 . 1
*
915 . 5 Hu
H
W
u
u
E
x
x
(

= (8)
where W is water surface width; H is average water depth; and u* is shear/friction velocity.
Since the degradation rate was obviously included in the models, the reaction number Rxn
was used to evaluate the required process. Mathematically, the reaction number is expressed as
foloows:
2
x
x d
xn
u
E k
R = (9)
If the reaction number is less than 0.1, then advection predominates and a model
approaching plug flow is appropriate. On the other hands, if the reaction number is greater than
10, it can be stated that the dispersion controls the transport and the system is completely mixed.

Constants of Reaeration Rate and Deoxygenation Rate (ka and kd)
Since OConnor and Dobbins developed the first model equation for calculating the reaeration
rate constant in rivers in 1958, there have been numerous researches done in this field by such
as Churchill et al. (1962), Owens et al. (1964), Tsivoglou and Neal 1976, USGS - Melching and
Flores (1999), Thackston and Dawson (2001) [3, 11]. Most of those developed formulas,
pertaining different river velocity (at 20
0
C), are usually empirical power function relationships as
follows:
n
m
x
a
H
cu
k = (10)
where c, m and n are the empirical constants dependent on the physical and hydraulic conditions
of the channel.
In this paper, the reaeration formula proposed by OConnor and Dobbins was selected and
applied for all simulations of the models. The complete formula of OConnor and Dobbins in SI
unit is expressed by taking values of c = 3.93, m = 0.50, and n = 1.50.
Furthermore, referring to Schnoor [3], the value of deoxygenation rate applied for large river
and estuary usually ranges between 0.05 and 0.50 day
-1
. Since this deoxygenation rate is
generally estimated based on the model calibration, for the simulations in this paper, the
deoxygenation rate is assumed to be 0.50 day
-1
.

Saturated Dissolved Oxygen (Cs)
Reaeration is basically a process of absorption of atmospheric oxygen into the water. This
process is in fact regarded as one of the most important factors controlling the waste assimilation

Doddi Yudianto and Xie Yuebo, 2008. The Development of Simple Dissolved Oxygen Sag Curve in Lowland Non-Tidal River By Using MATLAB.


141

Journal of Applied Sciences in Environmental Sanitation, 3 (3): 137-155.

capacity of a river since photosynthesis is the only other source of oxygen replenishment. The
reaeration process is generally limited to daylight hours only. If the water is allowed to come to
equilibrium with the atmosphere above it, the concentration of DO reached will be fixed for a
given temperature and pressure. This is known as the oxygen saturation concentration and is
described by Henrys law. The most frequently used equation in water quality modeling is that
developed by Elmore and Hayes (1960) for distilled water [2]:
) 10 7774 . 7 ( ) 007991 . 0 ( ) 41022 . 0 ( 652 . 14
3 5 2
T T T C
s

+ + = (11)
where T is the temperature in degrees Celsius.

Development of Numerical Models
Some of the most common problems in applied sciences and engineering are usually
formulated in the form of either ODEs or PDEs. Since occasionally the exact solutions in closed
form of such problems do not exist in many cases, this makes numerical solutions become
special of interest. Water quality and environmental modeling problem, is no exception, has been
explored and solved up to an extraordinary level of understanding using various numerical
methods to find such an approximate solution as there are tolerance parameters, which mostly
ensured to reach a good accuracy.
Generally, there is a vast amount of literatures on numerical solutions for such kind of
differential problems. Some of the well known methods used in solving these problems are finite
differences, finite volume and finite elements. Aside from these classical approaches, there are
other important numerical schemes which have also been widely employed in many mathematical
softwares i.e. MATLAB.

Steady State Plug Flow Model without Dispersion
As previously mentioned, when the equations (1) (3) are assumed to be steady state
( 0 = dt dC ), those equations will form a system of ODEs in which distance is the only one
independent variable. In MATLAB, there are plenty of ODE solvers; among them are ode23
(second/third order) and ode45 (fourth/fifth order) which implement the Runge-Kutta method as
the most widely used and robust numerical algorithm to solve such kind of problems [12, 13, 14].
In general, the order of a numerical method is the power of h (i.e. dx) in the leading error
term. Since the value of h is very small, the higher of power, the smaller of error produced.
Mathematically, the fourth order of Runge-Kutta method can be described as follows.
( )
4 3 2 1 1
2 2
6
k k k fk k k
f f f
h
y y + + + + =
+
(12)
where ( )
k k k
y x f ,
1
= (12.a)
|

\
|
+ + =
2
,
2
1
2
h f
y
h
x f
k
k k k
(12.b)
|

\
|
+ + =
2
,
2
2
3
h f
y
h
x f
k
k k k
(12.c)
( ) h f y h x f
k k k k 3 4
, + + = (12.d)
In order to obtain sufficient accuracy of the results, the numerical models in this paper was
developed using the fourth/fifth order of Runge-Kutta method (ode45).


Doddi Yudianto and Xie Yuebo, 2008. The Development of Simple Dissolved Oxygen Sag Curve in Lowland Non-Tidal River By Using MATLAB.


142

Journal of Applied Sciences in Environmental Sanitation, 3 (3): 137-155.

Dynamic Plug Flow Model with Dispersion
In general, there are two common methods for formulating dynamic mass transport in one
dimensional river system: (1) the plug flow system and (2) the Continually Stirred Tank Reactors
in series system (CSTRs). The QUAL2E, as the most widely used one dimensional water quality
model, was developed based on the plug flow system with longitudinal dispersion/mixing and
various kinetic reactions. Due to the difficulty in expressing the transport process especially
longitudinal dispersion term, the finite difference method was employed in this model [5, 15].
The CSTRs system, on the other hands, becomes popular because in the form of ODE form it
allows easier formulation of methods for calibration and model evaluation when it is compared
with PDEs model. A special care, however, must be taken in the development of CSTRs to
ensure that the numerical dispersion is well introduced when solving the equations to
approximate the real system [2]. A large number of detention storage or cell in series is required
by CSTRs to obtain the idealized plug flow conditions [3, 5, 16].
In this paper, the numerical solutions for such dynamic system is performed by PDE model
developed using the pdepe function of MATLAB. The necessity introducing this method is
because it offers more possibilities and flexibilities for both beginners and experts to evaluate or
even invent a model since there has been a numerous number of mathematic functions
developed inside MATLAB. Libelli et al [17] and Yuceer et al [18], in this case, have recently
shown some great advanced applications of MATLAB in the field of water quality modeling.
Besides it can be applied for broader aspect of numerical solution of ODEs, in MATLAB,
PDEs with various forms of additional terms can also be easily included and solved as a system.
The pdepe function basically applied for initial-boundary value problems consist of systems of
parabolic and elliptic PDEs in one space variable and time. In this scheme, the initial conditions
are allowed to be space dependent and boundary conditions to be time dependent. In solving
system of PDEs, the pdepe function is generally written in the form:
|

\
|

+
|
|

\
|
|

\
|

\
|


x
u
u t x s
x
u
u t x f x
x
u
x
t
u
x
u
u t x c
m m
, , , , , , , , , (13)
According to the above format, the unknown variables which have to be determined later are
gathered in the vector u; while the coefficients of the time derivatives are gathered in a diagonal
matrix c (has nothing to do with concentrations). On the right side of equation (13), the functions f
and s, as flux and source term respectively, are also given in the form of vector functions which
depending on x, t, u and u/x. As a parameter corresponding to the symmetry of the problem,
the integer m may take value of 0, 1 and 2 to represent slab, cylindrical, or spherical symmetry
respectively.
For a complete formulation of the mathematical problem in pdepe MATLAB, it is necessary to
set the both initial and boundary conditions as follows.
Initial condition : ( ) ) ( ,
0 0
x u t x u = (14)
Boundary condition : ( ) ( ) 0 , , , , , , = |

\
|

+
x
u
u t x f t x q u t x p , valid for x = x0 and x = xn (15)
where p is a function that depends on x, t and u; while q depends only on x and t.
In the pdepe MATLAB, various boundary conditions can also be flexibly formulated either as
Dirichlet, Neumann or even Cauchy/Robin. Here, as the downstream boundaries of the model are
theoretically equal to zero for positive infinity, Neumann condition is considered for all algorithms.


Doddi Yudianto and Xie Yuebo, 2008. The Development of Simple Dissolved Oxygen Sag Curve in Lowland Non-Tidal River By Using MATLAB.


143

Journal of Applied Sciences in Environmental Sanitation, 3 (3): 137-155.

Analytical Solutions
Besides the involvement of analytical solutions under steady state condition for both models,
the residual mean square error (RMSE) is also applied to characterize the goodness of fit of
those numerical schemes. Mathematically, the RMSE can be defined as:
( )
2
1
0
2
(


=

=
N
i
i i
N
A T
RMSE (16)
where Ti are the exact values, Ai are the predictions or approximations of the model, and N is the
total number of data points.
For the steady state plug flow model in which no longitudinal dispersion included, the
analytical solutions can be obtained by either separation of variables or integration factor method
as given in Schnoor [3] as follows.
BOD : x
d
u
x
k
e L L

=
0
(17)
DOdeficit :
|
|

\
|

+ =

x
a
x
d
x
a
u
x
k
u
x
k
d a
d u
x
k
e e
k k
L k
e D D
0
0
(18)
As a plug flow model with dispersion, on the other hands, since it is sometimes not easy to
provide transient analytical solutions, the given equations are also solved under steady state
condition. In this case the analytical solutions are applied only for boundary conditions where x
0 (downstream).
BOD :
|
|

\
|
+
=
2
4
1 1
2
0
x
x d
x
x
u
E k
x
E
u
e L L (19)
DOdeficit :
|
|
|

\
|

+ =
|
|

\
|
+
|
|

\
|
+
|
|

\
|
+
2 2 2
4
1 1
2
4
1 1
2
0
4
1 1
2
0
x
x a
x
x
x
x d
x
x
x
x a
x
x
u
E k
x
E
u
u
E k
x
E
u
d a
d
u
E k
x
E
u
e e
k k
L k
e D D (20

Application of Models
The developed numerical models were applied to a straight and uniform trapezoidal channel
for in bank flow case where the dimensions used for the channel are river width B1 = 15.0 m,
channel side slope 1:1, channel bed slope S0 = 0.0001 and Manning coefficient n = 0.025. The
value of flow rate employed for all simulations is 15.0 m
3
s
-1
.
As it is necessary to provide explanation according to the aims of this paper, the developed
dynamic plug flow model with dispersion is employed to simulate some scenarios as described
below and detail given in Table 1.
(1) Assuming that the concentrations of DO and BOD5 in the river follow the standard values
as given in the Environmental Quality Standard of People's Republic Of China for Surface Water
(GB 3838-2002) under category III which are applied for drinking water and normal fishing, after
reaching the equilibrium time, the model is simulated and compared to the outputs given by the
steady state plug flow model without dispersion using the same characteristic of loading waste.
The accuracy of the numerical models is also evaluated under this scenario. In order to converse
the value of BOD5 into ultimate BOD (L), using the first order decay (or oxidation) rate, an
extrapolation can be made according to Thomann and Mueller [20] as defined as follows.

Doddi Yudianto and Xie Yuebo, 2008. The Development of Simple Dissolved Oxygen Sag Curve in Lowland Non-Tidal River By Using MATLAB.


144

Journal of Applied Sciences in Environmental Sanitation, 3 (3): 137-155.

d
k
e
BOD
L
5
5
1

= (21)
The initial values of DO and BODu are generally estimated based on the assumption of complete
mixing of river water and wastewater/effluent at the point of discharge. Thus, if Qr, Cr, and Lr are
river flow, DO, BODu, immediately upstream of the wastewater, and Qw, Cw, and Lw are the
analogous waste parameters, initial values are given by:
w r
w w r r
Q Q
Q C Q C
C
+
+
=
0
(22)
w r
w w r r
Q Q
Q L Q L
L
+
+
=
0
(23)
(2) Similar to the above condition, under this second scenario, the dynamic plug flow model
with dispersion model is now applied for different loading of BOD concentrations and volumes.
The BOD concentrations modeled here are assumed to follow the typical BOD values of domestic
wastewater as given by Metcalf and Eddy in the Wastewater Engineering [21, 22].
(3) In order to give clear description about the influence of reaeration to the dissolved oxygen
sag curve, under the same condition as given in the first scenario, the model is simulated for
different values of reaeration rate.
(4) Since the value of longitudinal dispersion is in fact influenced by many factors as
previously mentioned, three values of dispersion coefficient are used in the simulations under the
fourth scenario.
(5) As sewage discharges have a variety of effects on the dissolved oxygen contained in
water bodies, the depletion of DO concentration is essential to be further analyzed as part of
water pollution control. Because of the importance of DO in the maintenance of aquatic life, the
potential pollution of wastewaters is often described in terms of carbonaceous BOD (CBOD) and
nitrogenous BOD (NBOD). In order to show broader application of MATLAB in solving system of
ODEs or PDEs, this simple extension of Streeter and Phelps equations is introduced in this paper
as additional information. The extended version of Streeter and Phelps equations used in relation
with CBOD and NBOD are given as follows.
( ) C C k N k B k
dx
dC
u
dt
dC
s a n d x
+ = (24)
B k
dx
dB
u
dt
dB
d x
= (25)
N k
dx
dN
u
dt
dN
n x
= (26)
where B is carbonaceous BOD and N is nitrogenous BOD.
The waste load allocation concept is also applied here by taking some typical values of DO,
CBOD, and NBOD resulted from a common wastewater treatment plant using different options of
treatment processes (Table 2). The synthetic example for this scenario is obtained from the
Environmental System Optimization [23].


Doddi Yudianto and Xie Yuebo, 2008. The Development of Simple Dissolved Oxygen Sag Curve in Lowland Non-Tidal River By Using MATLAB.


145

Journal of Applied Sciences in Environmental Sanitation, 3 (3): 137-155.

Table 1: The values of model parameters for different scenario
Parameters Scenario 1 Scenario 2 Scenario 3 Scenario 4 Scenario 5
River flow, Qr (m
3
s
-1
) 15 15 15 15 1.16
Flow velocity, ux (ms
-1
) Eq.(7) Eq.(7) Eq.(7) Eq.(7) 0.09
Wastewater flow, Qw (m
3
s
-1
) 0.1Qr
(0.10,
0.15,
0.20)Qr,
*

0.1Qr 0.1Qr 0.2Qr
Deoxygenation rate, kd (d
-1
) 0.50 0.50 0.50 0.50 0.35
Reaeration rate, ka (d
-1
) Eq.(10) Eq.(10)
0.80, 1.00,
Eq.(10)
*

Eq.(10) 0.50
Dispersion coef, Ex (m
2
s
-1
) Eq.(8) Eq.(8) Eq.(8)
Eq.(8),
115.74,
173.61
*

289.35
River BODu, Lr (mg L
-1
) 4.36 [19] 4.36 [19] 4.36 [19] 4.36 [19] -
Wastewater BODu, Lw (mg L
-1
) 200
(100, 200,
300)*
200 200 -
Saturated river DO, Cs (mg L
-1
) 9.02 9.02 9.02 9.02 8.00
River DO, Cr (mg L
-1
) 5.00 [19] 5.00 [19] 5.00 [19] 5.00 [19] 8.00
River CBOD, Br (mg L
-1
) - - - - 2.0
River NBOD, Nr (mg L
-1
) - - - - 5.0
Wastewater DO, Cw (mg L
-1
) Max 2.0 Max 2.0 Max 2.0 Max 2.0 Table 2
Effluent CBOD, Bw (mg L
-1
) - - - - Table 2
Effluent NBOD, Nw (mg L
-1
) - - - - Table 2
*)
simulated under the same scenario


Table 2: The effluent quality from treatment options for municipal wastewater [23]
Treatment Processes CBOD (mgL
-1
) NBOD (mgL
-1
) DO (mgL
-1
)
1. Secondary (settling + biological oxidation) 25.00 54.00 2.00
2. Secondary + filtration (microscreening) 13.00 50.00 2.00
3. Secondary + nitrification 13.00 10.00 2.00
4. Secondary + nitrification + filtration 7.00 10.00 2.00


Doddi Yudianto and Xie Yuebo, 2008. The Development of Simple Dissolved Oxygen Sag Curve in Lowland Non-Tidal River By Using MATLAB.


146

Journal of Applied Sciences in Environmental Sanitation, 3 (3): 137-155.

RESULTS AND DISCUSSION

Scenario 1
Based on the simulation of both models, it can be clearly seen from Table 3, Fig.1 and Fig.2
that all numerical schemes developed using the mathematical function of ode45 and pdepe have
shown their high accuracy in solving the given equations. For the steady state plug flow model
without dispersion, the maximum value of RMSE obtained is 0.2226x10
-7
. While under dynamic
condition, after gaining the equilibrium time, the maximum value of RMSE obtained is 0.9477x10
-
3
. Using the dynamic simulations, in addition, numerical calculation process of transient pollutants
in obtaining stable concentration values can be produced for further evaluation as described in
Figs.3 5.
The influence of longitudinal dispersion itself is in fact can be observed in the Figs. 6 - 8 as
the values of DO deficit for the non-dispersion model is slightly higher than the model with
dispersion, while the values of DO and BOD are slightly lower. Moreover, from the results given in
Fig. 9, it can be noticed also that, due to dispersive mixing, the deoxygenation rate (kdL) is equal
to the reaeration rate (kaD) at distance of 34.77 km. This is a little bit downstream from the point
where the critical deficit of DO occurs at xc = 34.26 km. In general, based on the obtained values
of reaction number (Rxn = 0.0015), it can be concluded that for the synthetic example developed
in this paper, the mass fluxes due to advection (uxL and uxD) are greater in magnitude than
dispersive fluxes (Figs. 10 and 11), but both transport processes are still important in the water
quality modeling point of view.

Table 3: The residual mean square error values for both models
Model DO BOD DO deficit
Model without dispersion 0.2226 x10
-7
0.0069 x10
-7
0.2226x10
-7

Model with dispersion 0.5102x10
-3
0.9477x10
-3
0.5102x10
-3


0.0
5.0
10.0
15.0
20.0
25.0
0 10 20 30 40 50 60 70 80 90 100 110 120
Distance (km)
C
o
n
c
e
n
t
r
a
t
i
o
n

(
m
g
/
L
)
Analytical DO Analytical BOD Analytical DOdeficit Numerical DO Numerical BOD Numerical DOdeficit

Fig.1: The DO sag curve for flog flow model without dispersion

Doddi Yudianto and Xie Yuebo, 2008. The Development of Simple Dissolved Oxygen Sag Curve in Lowland Non-Tidal River By Using MATLAB.


147

Journal of Applied Sciences in Environmental Sanitation, 3 (3): 137-155.

0.0
5.0
10.0
15.0
20.0
25.0
0 10 20 30 40 50 60 70 80 90 100 110 120
Distance (km)
C
o
n
c
e
n
t
r
a
t
i
o
n

(
m
g
/
L
)
Analytical DO Analytical BOD Analytical DOdeficit Numerical DO Numerical BOD Numerical DOdeficit

Fig.2: The DO sag curve for plug flow model with dispersion


Fig.3: The profile of DO resulted from a numerical calculation of dynamic model


Fig.4: The profile of BOD resulted from a numerical calculation of dynamic model

Doddi Yudianto and Xie Yuebo, 2008. The Development of Simple Dissolved Oxygen Sag Curve in Lowland Non-Tidal River By Using MATLAB.


148

Journal of Applied Sciences in Environmental Sanitation, 3 (3): 137-155.


Fig.5: The profile of DO deficit resulted from a numerical calculation of dynamic model

2.0
3.0
4.0
5.0
6.0
0 10 20 30 40 50 60 70 80 90 100 110 120
Distance (km)
C
o
n
c
e
n
t
r
a
t
io
n

(
m
g
/
L
)
DO - model without dispersion DO - model with dispersion

Fig.6: Concentration of DO for both models

0.0
5.0
10.0
15.0
20.0
25.0
0 10 20 30 40 50 60 70 80 90 100 110 120
Distance (km)
C
o
n
c
e
n
t
r
a
t
i
o
n

(
m
g
/
L
)
BOD - model without dispersion BOD - model with dispersion

Fig.7: Concentration of BOD for both models

Doddi Yudianto and Xie Yuebo, 2008. The Development of Simple Dissolved Oxygen Sag Curve in Lowland Non-Tidal River By Using MATLAB.


149

Journal of Applied Sciences in Environmental Sanitation, 3 (3): 137-155.

3.0
4.0
5.0
6.0
7.0
0 10 20 30 40 50 60 70 80 90 100 110 120
Distance (km)
C
o
n
c
e
n
t
r
a
t
i
o
n

(
m
g
/
L
)
DOdeficit - model without dispersion DOdeficit - model with dispersion

Fig.8: Concentration of DO deficit for both models

0.0
2.0
4.0
6.0
8.0
10.0
12.0
0 10 20 30 40 50 60 70 80 90 100 110 120
Distance (km)
R
x
n

R
a
t
e
s

(
m
g
/
L
-
d
a
y
)
kdL kaD
34.77

Fig.9: Reaction rates profile resulted from the plug flow model with dispersion

0
200
400
600
800
1000
0 10 20 30 40 50 60 70 80 90 100 110 120
Distance (km)
A
d
v
e
c
t
i
v
e

F
l
u
x
e
s

(
m
g
-
k
m
/
L
-
d
a
y
)
uxL, BOD Advection uxD, DO Deficit Advection

Fig.10: Advective fluxes profile resulted from the plug flow model with dispersion

Doddi Yudianto and Xie Yuebo, 2008. The Development of Simple Dissolved Oxygen Sag Curve in Lowland Non-Tidal River By Using MATLAB.


150

Journal of Applied Sciences in Environmental Sanitation, 3 (3): 137-155.

-1.0
-0.5
0.0
0.5
1.0
1.5
0 10 20 30 40 50 60 70 80 90 100 110 120
Distance (km)
D
i
s
p
e
r
s
i
v
e

F
l
u
x
e
s

(
m
g
-
k
m
/
L
-
d
a
y
)
ExdLdx, BOD Dispersion ExdDdx, DO Deficit Dispersion

Fig.11: Dispersive fluxes profile resulted from the plug flow model with dispersion

Scenario 2
In principal, a waste load allocation must be performed using water quality models when the
water quality standards are expected to be violated even under conditions that all discharges
meet their effluent permits. As given in this paper, typical BOD values of domestic wastewater are
simulated to be discharged into a river contained surface water standard criteria under category
III. The typical values used for the simulations are 100, 200, and 300 mg L
-1
which represent
weak, medium, and strong concentration respectively. Based on the results obtained, it can be
noticed that higher concentration of BOD will cause longer distance required for the river
recovery.
As clearly shown in Fig. 12, when the BOD value is equal to 100 mg L
-1
, the distance required
by river to gain 5.0 mg L
-1
of DO concentration is 47.00 km. While if a stronger value of DO (200
mg L
-1
) is applied, the river will need much longer distance which is about 107.00 km. Similar
conclusion is shown when different volume of waste contain 100 mg L
-1
of BOD is discharged into
river. Based on the illustration given in Fig.13, it can be seen that for waste volumes equal to
0.10xQr, 0.15xQr, and 0.20xQr, the required distances for gaining again the standard DO
concentration of 5 mg L
-1
are 47.00, 77.00, and 98.00 km respectively.

(47.00 , 5.02)
(107.00 , 5.02)
0.0
1.0
2.0
3.0
4.0
5.0
6.0
7.0
8.0
0 10 20 30 40 50 60 70 80 90 100 110 120
Distance (km)
C
o
n
c
e
n
t
r
a
t
i
o
n

o
f

D
i
s
s
o
l
v
e
d

O
x
y
g
e
n

(
m
g
/
L
)
Lw = 100 Lw = 200 Lw = 300

Fig.12: DO profiles for different loading of BOD concentration

Doddi Yudianto and Xie Yuebo, 2008. The Development of Simple Dissolved Oxygen Sag Curve in Lowland Non-Tidal River By Using MATLAB.


151

Journal of Applied Sciences in Environmental Sanitation, 3 (3): 137-155.

(47.00 , 5.02) (77.00 , 5.01)
(98.00 , 5.02)
2.0
3.0
4.0
5.0
6.0
7.0
8.0
0 10 20 30 40 50 60 70 80 90 100 110 120
Distance (km)
C
o
n
c
e
n
t
r
a
t
i
o
n

o
f

D
i
s
s
o
l
v
e
d

O
x
y
g
e
n

(
m
g
/
L
)
Qw = 0.10xQr Qw = 0.15xQr Qw = 0.20xQr

Fig.13: DO profiles for different loading of waste volume contained 100 mg L
-1
of BOD

Scenario 3
As previously stated that in fact the reaeration process is regarded as one of the most
important factors controlling the waste assimilation capacity of a river since photosynthesis is the
only other source of oxygen replenishment, some simulations using different value of reaeration
rate are done to show its influences to the DO sag curve. Based on the given results, it is shown
that the reaeration indeed influence the recovery process of a river. As illustrated in Fig.14,
shorter distance is obtained for higher value of reaeration rate. A transition of reaction rate profile
(kaD), however, will occur after a distance of 90.0 km as shown in Fig. 15. In practice, the
enhanced reaeration can be done by employing a hydraulic structure i.e. weirs.

(78.00 , 5.01)
(60.00 , 5.01)
3.0
3.5
4.0
4.5
5.0
5.5
6.0
6.5
7.0
0 10 20 30 40 50 60 70 80 90 100 110 120
Distance (km)
C
o
n
c
e
n
t
r
a
t
i
o
n

o
f

D
i
s
s
o
l
v
e
d

O
x
y
g
e
n

(
m
g
/
L
)
ka = 0.80 ka= 1.00 ka = 1.23

Fig.14: DO profiles for different loading of waste volume contained 100 mg L
-1
of BOD

Doddi Yudianto and Xie Yuebo, 2008. The Development of Simple Dissolved Oxygen Sag Curve in Lowland Non-Tidal River By Using MATLAB.


152

Journal of Applied Sciences in Environmental Sanitation, 3 (3): 137-155.

2.0
3.0
4.0
5.0
0 10 20 30 40 50 60 70 80 90 100 110 120
Distance (km)
R
x
n

R
a
t
e
s

k
a
D

(
m
g
/
L
-
d
a
y
)
ka = 0.80 ka = 1.00 ka = 1.23

Fig.15: Reaction rates profile resulted for different value of reaeration rates applied to the model

Scenario 4
As it is known that for a large river or estuary, the phenomenon of DO and BOD distribution is
mostly influenced by a considerable longitudinal dispersion as a result of various changes of
slope, morphology or irregularity of river bed and bank, sequences of pools and riffles,
roughness, and large turbulent eddies or tidal effect, there is a crucial necessity in this paper to
introduce about further influences of dispersive mixing on the DO saq curve. Based on the data
given in Table 1, it can be seen that three values of longitudinal dispersion used for this purpose
are 5.83, 10.00, and 15.00 km
2
d
-1
. In fact, a larger value of longitudinal dispersion can be found in
real system and lower flow velocity may occur as there are significant effects such
tidal/backwater, channel storage, etc [9].
Based on the results obtained, it can be noticed that the dispersive fluxes increase as the
value of dispersion coefficient becomes larger. However, since in this paper it is known that the
magnitude of advection transport is much larger compared to the dispersion transport, there is
only a little influence resulted by the increase of longitudinal dispersion on DO sag curve.

0.00
0.25
0.50
0.75
1.00
1.25
0 10 20 30 40 50 60 70 80 90 100 110 120
Distance (km)
D
i
s
p
e
r
s
i
v
e

F
l
u
x
e
s

E
x
d
L
d
x

(
m
g
-
k
m
/
L
-
d
a
y
)
Ex = 5.83 Ex = 10.00 Ex = 15.00

Fig.16: Dispersive fluxes (ExdL/dx) profile resulted for different value of Ex applied to the model

Doddi Yudianto and Xie Yuebo, 2008. The Development of Simple Dissolved Oxygen Sag Curve in Lowland Non-Tidal River By Using MATLAB.


153

Journal of Applied Sciences in Environmental Sanitation, 3 (3): 137-155.

-0.50
-0.25
0.00
0.25
0.50
0 10 20 30 40 50 60 70 80 90 100 110 120
Distance (km)
D
i
s
p
e
r
s
i
v
e

F
l
u
x
e
s

E
x
d
D
d
x

(
m
g
-
k
m
/
L
-
d
a
y
)
Ex = 5.83 Ex = 10.00 Ex = 15.00

Fig.17: Dispersive fluxes (ExdD/dx) profile resulted for different value of Ex applied to the model

3.0
3.5
4.0
4.5
5.0
5.5
6.0
6.5
7.0
0 10 20 30 40 50 60 70 80 90 100 110 120
Distance (km)
C
o
n
c
e
n
t
r
a
t
i
o
n

o
f

D
i
s
s
o
l
v
e
d

O
x
y
g
e
n

(
m
g
/
L
)
Ex = 5.83 Ex = 10.00 Ex = 15.00

Fig.18: The profiles of DO for different value of Ex applied to the model

Scenario 5
Based on the given data in the above Table 1 and Table 2, MATLAB is used to solve the
extended version of Streeter and Phelps equations as defined in Eqs. (24) - (26). The longitudinal
dispersion coefficient added for the model simulations here is equal to 289.35 m
2
s
-1
. As can be
seen from the Fig.19 below, for about 50.00 km long of distance, the required dissolved oxygen of
5 mgL
-1
can only be continuously maintained if the treatment option no 3 or 4 is adopted. When
the treatment option no 2 is employed the river will need about 45.00 km for the recovery. On the
other hands, treatment option no 1 perhaps will never be able to meet the standard quality of DO.

Doddi Yudianto and Xie Yuebo, 2008. The Development of Simple Dissolved Oxygen Sag Curve in Lowland Non-Tidal River By Using MATLAB.


154

Journal of Applied Sciences in Environmental Sanitation, 3 (3): 137-155.

(45.00 , 4.99)
3.0
3.5
4.0
4.5
5.0
5.5
6.0
6.5
7.0
0 5 10 15 20 25 30 35 40 45 50
Distance (km)
C
o
n
c
e
n
t
r
a
t
i
o
n

o
f

D
i
s
s
o
l
v
e
d

O
x
y
g
e
n

(
m
g
/
L
)
Option 1 Option 2 Option 3 Option 4

Fig.19: The profiles of DO for different municipal wastewater treatment options

CONCLUSIONS

Since the variability of dissolved oxygen concentration in rivers is influenced by many factors,
the analysis of both oxygen depletion and replenishment becomes essential to the life of aquatic
animals. In order to perform either the prediction of pollutants concentration or critical condition of
dissolved oxygen in the water bodies, the water quality models have been therefore widely used
for over a century. It is necessary to gain better understanding of the dissolved oxygen profile in a
lowland river in which no tidal effect included, this paper has delivered some basic theories
related to (1) the development of both steady and dynamic numerical models using MATLAB
under steady flow condition, (2) the influences of longitudinal dispersion and enhanced reaeration
rate on the DO sag curve, (3) the concept of waste load allocation, and (4) the broader possibility
of using MATLAB for further water quality models development.
Based on the results obtained from the model simulations, it is showed that, in comparison to
steady state analytical solutions, the developed numerical models have provided good accuracy.
For the plug flow model without dispersion, the values of DO and BODu concentration are slightly
lower compared to the model with dispersion. Furthermore, it is also showed that due to
dispersive mixing, the intersection point of deoxygenation rate and reaeration rate moves a bit
downstream from the point where critical DO deficit occurs.
As the reaction number obtained is much smaller than 0.10 and shown in the both profiles of
advection and dispersion transport, it can be generally concluded that, for the synthetic example
developed in this paper, the mass fluxes due to advection are greater in magnitude than
dispersive fluxes, but both transport processes are still important.
Since the deoxygenation rate is usually low for most conventional pollutants and as described
in the results of scenario 2 above, a quite long distance might be required by a highly polluted
river for the naturally river recovery. Under the scenario 3, besides controlling the concentration
and volume of loading waste discharged into the river, the increase of reaeration rate can also be
employed in order to speed the recovery process up. Moreover, a proper treatment option of
wastewater is absolutely required to maintain the dissolved oxygen in the river.
Based on the above simulation results and supported by previous works on water quality
modeling, it can be finally concluded that MATLAB is an effective tool both for beginners and

Doddi Yudianto and Xie Yuebo, 2008. The Development of Simple Dissolved Oxygen Sag Curve in Lowland Non-Tidal River By Using MATLAB.


155

Journal of Applied Sciences in Environmental Sanitation, 3 (3): 137-155.

experts in the process of water quality model development and is recommended to be used for
even broader applications.

References
1. Beck, M.B., 1978. Modelling of Dissolved Oxygen in a Non-Tidal Stream. In Mathematical Models in
Water Pollution Control. Eds. James. A., John Willey and Sons, pp: 137-164.
2. Cox, B.A., 2003. A Review of Dissolved Qxygen Modelling Techniques for Lowland Rivers. The
Science of the Total Environment, 314316 (1): 303334.
3. Schnoor, J.L., 1996. Environmental Modeling: Fate and Transport of Pollutants in Water, Air, and
Soil. John Wiley and Sons, New York, USA.
4. Sayre, W.W. and Chang, F.M., 1968. A Laboratory Investigation of Open Channel Dispersion
Processes for Dissolved, Suspended, and Floating Dispersants: Technical Report. U.S.
Government Printing Office, USGS, USA.
5. Lee, Y.S. and Park, S.S., 1996. A Multiconstituent Moving Segment Model for Water Quality
Predictions in Steep and Shallow Streams. Ecological Modelling, 89(1, 3):121-131.
6. Wong T.H.F., Fletcher, T.D., Duncan H.P. and Jenkins G.A., 2006. Modeling Urban Stormwater
Treatment - A Unified Approach. Ecological Engineering, 27(1): 5870.
7. Warn, A.E., 1989. River quality modelling. In Surface water pollution and its control. Eds. Ellis, K.V.,
The Macmillan Press Ltd, pp: 322-342.
8. Kashefipour, S.M. and Falconer, R.A., 2002. Longitudinal Dispersion Coefficients in Natural
Channels. Water Research, 36(6): 15961608.
9. Wallis, S. and Manson, R., 2005. On the theoretical prediction of longitudinal dispersion coefficients
in a compound channel. In Water Quality Hazards and Dispersion of Pollutants. Springer, 4:
69-84.
10. Yudianto, D. and Xie, Yuebo. 2008. Contaminant Distribution under Non-Uniform Velocity of Steady
Flow Regimes. Journal of Applied Science in Environmental Sanitation, 3(1): 29-40.
11. Pelletier, G. and Chapra, S. 2006. A modeling framework for simulating river and stream water
quality. Environmental Assessment Program, Olympia, Washington, 98504-7710.
12. Yang, W.Y., Cao, W, Chung, T.S., and Morris, J. 2005. Applied Numerical Methods Using MATLAB.
John Wiley and Sons, New Jersey, USA.
13. Kiusalaas, J., 2005. Numerical Method in Engineering with MATLAB [M], Cambridge University
Press, New York.
14. Karris, S.T., 2004. Numerical Analysis Using MATLAB and Spreadsheets. Orchard Publications,
USA.
15. Brown, L.C. and Barnwell, T.O., 1987. The enhanced stream water quality models QUAL2E and
QUAL2E-UNCAS: Documentation and User Manual. US EPA, Athens, Georgia.
16. Holzbecher, E., 2007. Environmental Modeling using MATLAB. Springer, Berlin.
17. Libelli, S.M., Pacini, G., Barresi, C., Petti, E. and Sinacori, F. 2002. An Interactive Georeferenced
Water Quality Model. Fifth International Conference on Hydroinformatics, Cardiff, UK.
Hydroinformatics 2002.
18. Yuceer M., Karadurmus E. and Berber R., 2007, Simulation of River Streams: Comparison of A New
Technique with QUAL2E. Mathematical and Computer Modelling, 46(1, 2): 292305.
19. Ministry of Environmental Protection of the People's Republic of China and General Administration of
Quality Supervision, Inspection and Quarantine of the People's Republic of China, 2002.
Environmental Quality Standard of People's Republic of China for Surface Water (GB3838-
2002).
20. Thomann, R.V. and Mueller, J.A. 1987. Principles of Water Quality Modeling and Control. Harper
Collins, New York.
21. Metcalf and Eddy, Inc., 1972. Wastewater Engineering. McGraw-Hill, New York, USA.
22. Benefield, L.D. and Randall, C.W. 1980. Biological Process Design for Wastewater Treatment.
Prentice-Hall, Inc. New Jersey, USA.
23. Haith, D.A. 1982. Environmental Systems Optimization. John Wiley and Sons, New York, USA.


Doddi Yudianto and Xie Yuebo, 2008. The Development of Simple Dissolved Oxygen Sag Curve in Lowland Non-Tidal River By Using MATLAB.


156

Journal of Applied Sciences in Environmental Sanitation, 3 (3): 137-155.




























[This page is intentionally left blank]

You might also like