Vous êtes sur la page 1sur 7

Environmental Modelling & Software 26 (2011) 973e979

Contents lists available at ScienceDirect

Environmental Modelling & Software


journal homepage: www.elsevier.com/locate/envsoft

Short communication

CALHIDRA 3.0 e New software application for river water quality prediction based
on RWQM1
C.M. Cardona a, *, C. Martin a, A. Salterain a, A. Castro a, D. San Martn b, E. Ayesa a
a
b

CEIT and Tecnun, University of Navarra, Environmental engineering section, Manuel de Lardizbal 15, 20018 San Sebastin, Spain
EPTISA, Arapiles 14, 28015 Madrid, Spain

a r t i c l e i n f o

a b s t r a c t

Article history:
Received 13 September 2010
Received in revised form
25 January 2011
Accepted 2 February 2011
Available online 1 March 2011

This paper presents CalHidra 3.0, a new software package developed for dynamic simulation of water
quality in rivers. CalHidra 3.0 combines a 1-D hydrodynamic model based on Saint Venant equations,
a transport sub-model that incorporates the advectionedispersion terms, and a simplied version of the
River Water Quality Model 1 (RWQM1) for the biochemical transformations. This advanced biochemical
sub-model allows the dynamic simulation of the bacterial populations in rivers, making possible the
simulation of the river acclimatisation to changes of pollutant load or environmental conditions. The
software also includes new tools for a Monte Carlo based Bayesian calibration of the unknown model
parameters. CalHidra 3.0 is implemented based on the Component Object Model (COM) programming
paradigm and uses the Windows graphical environment. Three case studies illustrate the possibilities of
the CalHidra 3.0 software.
2011 Elsevier Ltd. All rights reserved.

Keywords:
Component Object Model
Monte Carlo method
River water quality
RWQM1
Saint Venant equations
ULTIMATE

Software availability
Name of software: CalHidra 3.0
Developer: CEIT Environmental Engineering Department
(http://www.ceit.es/)
First available year: 2008
Software requirements: Windows 2000 or XP
Programming language: C/C, Fortran and C#
Program availability and cost: The software application CalHidra
3.0 is property of the engineering company EPTISA S.A.,
Madrid, Spain.
Contact person: Diego San Martn.
E-mail: dsanmartin@eptisa.es
1. Introduction
Water quality models are nowadays widely used for the
management of the water quality in rivers and streams. Some
examples of these models are: SIMCAT, TOMCAT, QUAL2E, MIKE11,
ISIS, etc. (Cox, 2003). Some of them (SIMCAT, TOMCAT, QUAL2E) are
steady state models that estimate the dilution ratios for constant

* Corresponding author. Tel.: 34 943212800; fax: 34 943213076.


E-mail address: ccardona@ceit.es (C.M. Cardona).
1364-8152/$ e see front matter 2011 Elsevier Ltd. All rights reserved.
doi:10.1016/j.envsoft.2011.02.006

pollutant loads. There are others (MIKE11, ISIS) that include the
hydrodynamic equations and the interaction with the sediment.
However, none of them can describe the growth and decay of
biomass and therefore they are not able to explain the biomass
acclimatization in long-term simulations. The River Water Quality
Model No. 1 or RWQM1 (Reichert et al., 2001) was proposed by the
IWA and incorporates the biomass concentrations as state variables
allowing the model to express the evolution of the different populations in time. This feature is very important as it makes the
model well suited for the description of case studies where the
pollutant load or environmental conditions vary over the simulation time.
One of the main drawbacks for a more general utilisation of
water quality models is that they need to be calibrated for each case
study. Generally, the trial and error approach is used to adjust
certain parameters until a reasonable agreement is attained
between model output and eld measurements. The GLUE
approach (Beven and Binley, 1991) is a widely used automatic
calibration method based on the Bayes Theorem (McIntyre and
Wheater, 2004; Martin et al., 2006a). It uses Monte Carlo simulations to yield the joint posterior distribution of parameters, which
explains the suitability of the parameters to obtain good modelling
performance. The main advantage of the method is that it provides
not only the optimum parameter values but also an assessment of
the parameters uncertainty.

974

C.M. Cardona et al. / Environmental Modelling & Software 26 (2011) 973e979

This paper presents the CalHidra 3.0 software, which is intended


to simulate the water quality in rivers in a very general way. It
includes the 1-D Saint Venant equations for the hydrodynamic
model, the advectionedispersion equations for the transport submodel, and a simplied version of RWQM1 for the biochemical submodel. It also includes the GLUE approach for the model calibration. The possibilities of the simulation tool are illustrated by means
of three examples: the Tajo River basin, the Ebro River basin and the
Urola River basin.
2. Materials and methods
2.1. Mathematical models
CalHidra 3.0 incorporates two models: the Hydrodynamic Model, based on the
1-D full Saint Venant non-linear partial differential equations (Abbott and Minns,
1998) and the Water Quality Model. The former describes the river ow while the
latter makes reference to the variation of the pollutant concentrations in the river due
to two phenomena: the transport of components and the biochemical transformation
processes. The Transport sub-model describes the advection and the dispersion
equations (Chapra, 1997) and includes a new parameter called Particulate Transport
Factor (PTF). This parameter adjusts the transport of particulate variables along the
river and makes possible the calculation of the biomass accumulation at certain river
zones independently from the bulk liquid velocity. With this simple modication, the
model is able to explain the signicant self-depuration capacity generally observed in
rivers where high pollutant loads are received (Martin et al., 2006b). Equations (1)
and (2) dene the transport of the dissolved and the particulate variables,



vCdisk 
vCdisk
v
vCdisk
E

qs Cdisk
U
vx
vt advectdispers
vx
vx

(1)




vCpark 
vPTF$Cpark
v
vPTF$Cpark
E
qs Cpark
U
vx
vx
vx
vt advectdispers

(2)

where x is the coordinate in the longitudinal direction [L], t is the time coordinate
[T], Cdisk and Cpark denote the dissolved and particulate concentration of the kth
component [M L3], E is the dispersion coefcient [L2 T1], U is the average velocity
of water in x direction [L T1], qs is the volumetric ow rate per unit of volume
representing uid sink/sources [L3 T1], and PTF is a dimensionless parameter that
denotes the fraction of the particulate variables that is transported along the river.
The Biochemical sub-model is a simplied version of the IWA RWQM1 (Reichert
et al., 2001) that assumes no signicant changes of pH during the processes. The
resulting model includes 17 variables and 25 transformations (Martin et al., 2006b).
The biochemical transformations are expressed in Equation (3),

X
 
vCk 
Ei;j $fri g
Rn
vt biochemical

HD Data base

(3)

where Ck denotes the concentration of the kth component [M L3], [Ei,j] is the stoichiometry matrix, {ri} the kinetics vector, and SRn the biochemical transformation
term [M L3 T1].
2.2. Numerical schemes
CalHidra 3.0 uses different numerical schemes for each model: a) the numerical
solution of the Hydrodynamic Model is based on a four-point implicit nite difference
scheme (Preissmann, 1960; Martin and McCutcheon, 1999) and b) the Split-Operator
(SO) approach splits the transport and reaction terms for the numerical solution of
the Water Quality Model (Kanney et al., 2003; Prommer et al., 1998). The advective
term is based on the explicit nite difference ULTIMATE (Universal Limiter for
Transport Interpolation Modelling of the Advective Transport Equation) method
(Leonard, 1991) and the parabolic dispersion term plus the sink/sources term are
solved by an implicit nite difference method. The biochemical transformation term
is computed by the multiplication of the stoichiometric matrix [Ei,j] with the kinetic
vector {ri} at every iteration step.
2.3. Calibration facility
CalHidra 3.0 includes a Monte Carlo based automatic calibration module. The
facility is based on the Generalised Likelihood Uncertainty Estimation (GLUE), which
assesses the parameter optimum values and their uncertainty. The method lies on the
Bayes Theorem and proposes to relax the classic likelihood estimators of statistical
theory. Basically, the GLUE approach consists of running a number of Monte Carlo
simulations with some randomly sampled parameter values. Each simulated
parameter set is associated with a value of a subjectively dened Likelihood
Measure, which assesses the model performance. The prior beliefs about possible
parameter values are expressed in form of prior probability distributions, while the
ability of random parameter sets to achieve a good level of agreement between the
simulation and experimental results leads to the posterior probability distributions.
The method provides the joint posterior distribution of the parameters as the
calibration result. For the calibration of n parameters, the joint posterior distribution
is an n-dimensional function, which is numerically estimated by the GLUE method
(Sincock et al., 2003). CalHidra 3.0 also calculates the marginal posterior distribution
and the means and standard deviations of the calibrated parameters. For further
information about the post-treatment analysis of the joint posterior distribution, see
Martin and Ayesa (2010). CalHidra 3.0 furthermore includes a Sensitivity Analysis
tool based on the KolmogoroveSmirnov (KS) statistic. KS takes values between 0 and
1 for each parameter: low values denote small sensitivity while high values mean
large sensitivity.

3. Software architecture
CalHidra 3.0 is an integrated software system, designed on the
basis of Component Object Model (COM) programming paradigm.
The communication with the modeller is by a Windows

WQ Data base

Boundary Conditions

HD results
Boundary and Initial Cds
(biochemical state vrbles.)
WQ parameter values

Hydrodynamic Model

Water Quality Model

Topology data
Network
Cross-sections

Saint Venant equations

Transport sub-model
Advection/ Dispersion
equations

HD Results

Biochemical sub-model

Data for calibration


Simulation results
Experimental Data
N of MC simulations

Calibration facility
Monte Carlo based method
Sensitivity analysis

RWQM1 based model

WQ Results

Calibration Results

COM programming paradigm


Windows Environment

Fig. 1. Software layout: COM architecture.

C.M. Cardona et al. / Environmental Modelling & Software 26 (2011) 973e979

975

environment system. The architecture includes three components


(Fig. 1): the Hydrodynamic Model, the Water Quality Model and the
Calibration facility.
The Hydrodynamic Model computation requires the topological
data of the river and the upstream river ow and downstream
water level as boundary conditions. As a result, it provides the
water ow and height along the river. The Water Quality Model
requires the hydrodynamic model results, the boundary and initial
conditions as well as the values of the biochemical model parameters. The Water Quality Model outputs are the biochemical variables along the river, which can be monitored either online or at the
end of the simulation time.
The Calibration facility module includes two options: the automatic calibration of the unknown parameters and the sensitivity
analysis. The output offers not only the calibration result but also
some statistics about the sensitivity analysis.

4. Illustrative application examples


This section presents three illustrative examples that show
different application possibilities of the CalHidra 3.0 software.

4.1. First example: Tajo River basin

Fig. 2. Tajo River basin: Manzanares, Jarama and Tajo river branches, WWTP
discharges and ICA and SAICA measurement stations.

This example illustrates the ability of CalHidra 3.0 to describe


the biochemical activity in a river branch. The model includes
233 km of river constituted by three main rivers: the Manzanares
River, the Jarama River, and the Tajo River. The river branch receives
7 discharges from Madrids WWTPs and is monitored by 19
measurement stations (Fig. 2).

Fig. 3. CalHidra 3.0 window with the simulation results of the Tajo River.

976

C.M. Cardona et al. / Environmental Modelling & Software 26 (2011) 973e979

Fig. 4. Ebro River basin: Gllego, Huerva, and Ebro river branches, WWTP discharges and sampling points.

4.2. Second example: Ebro River basin


The objective of this example is to show the ability of the software to dynamically simulate the hydraulics and the transport
phenomena. The simulation includes 75 km of river crossing the
Zaragoza urban area. It receives two tributaries and several spills
while the measurements of six sampling points serve to monitor
the water quality (Fig. 4).
Fig. 5 shows the hydrodynamic simulation of a high rain event
that lasted approximately two and a half days.
Fig. 6 shows the results in terms of VSS, TSS, and NO3 at P1, P5,
and P6 sampling points. The three water quality parameters
remained stable until the rain event, showing a high level of
agreement between the simulated and experimental data. When
the rain event occurred, CalHidra 3.0 correctly reproduced the TSS
and VSS increase (due to run off), and the soluble nitrates decrease

due to dilution. Finally, Fig. 6 also includes the heterotrophic


biomass dynamics from the sampling points P1eP6. The software
describes the effect of the organic matter accumulation from P1 to
P6 produced by wastewater discharges and the subsequent dilution
due to the rain event. A complete experimental verication of the
model has been presented in San Martin et al. (2004).
4.3. Third example: Urola River basin
The goal of this example is to illustrate the calibration facility of
CalHidra 3.0 based on the GLUE methodology. The model includes
10 km of the Urola River including the discharges from the Urretxus WWTP. Five sampling points in the river were characterised
(Fig. 7).
The model calibration has been carried out using average
values of ammonium, nitrates, and oxygen estimated from
measurements of June 2002. The GLUE approach employed 1000
Monte Carlo simulations to estimate the PTF and KLa parameters.
The prior parameter ranges are usually dened by the modeller,
based on previous experience or bibliographic references. In this
case, some simulation trials were made to understand the model

450
400
Flow (m 3/s)

In the Tajo case study, the biochemical activity has been estimated by adjusting only two parameters, the PTF and the KLa
parameter (Martin et al., 2006b). The PTF parameter regulates the
transport of particulates and the KLa parameter determines the
transfer of oxygen from the atmosphere to the bulk liquid.
Fig. 3 shows a CalHidra 3.0 window with the simulation results
for PTF 0.17 and KLa 13.7 day1 during February 2003. The
gure illustrates a reasonable level of agreement between the
simulated results (bars) and the experimental data (rhombuses) for
ammonium, nitrates, and dissolved oxygen concentrations. In this
case, the WWTPs spills provoke high concentration of ammonium
in the Manzanares branch, which is largely nitried along the
Jarama and Tajo rivers.
The low PTF value (0.17) implies high retention of particulate
variables along the river. Indeed, the high biomass concentrations
(XH, XN1 and XN2) have made possible the description of the nitrication activity in the river (by means of the SNH4 and SNO3
proles).

Simulated P1

350
300

Simulated P2

250
200

Simulated P4

150
100

Simulated P6

Simulated P3
Simulated P5

50
0
240

260

280

300
320
Time (hours)

340

Fig. 5. Dynamic simulation of ow in the Ebro case study.

360

35

100
80

Measured P1
Measured P5
Measured P6

30
SNO3 (mgN/l)

Simulated P1
Simulated P5
Simulated P6

60
40

25
20
15
10

20

0
450

10.0

360

9.5

X H (mgCOD/l)

TSS (mgCOD/l)

VSS (mgCOD/l)

120

270
180
90

Simulated P1
Simulated P4

Simulated P2
Simulated P5

Simulated P3
Simulated P6

9.0
8.5
8.0

7.5

60

120

180
Time (hours)

240

300

360

60

120

180
Time (hours)

Fig. 6. Water quality simulation results in the Ebro case study.

Fig. 7. Urola River case study: the Urretxu WWTP and sampling points along the river.

240

300

360

978

C.M. Cardona et al. / Environmental Modelling & Software 26 (2011) 973e979

Fig. 8. Graphical environment of the calibration facility. The marginal probability functions (a and c) and the joint posterior distribution (b and d) of the PTF parameter (left column)
and the KLa parameter (right column).

Fig. 9. Graphical environment for the sensitivity analysis. Cumulative marginal distributions of the PTF parameter (a) and the KLa parameter (b).

behaviour and to guess reasonable parameter values before


launching the calibration facility. The a priori distributions were
nally set at: PTF [0.0005e0.0045] and KLa [30e70]. The
parameter ranges proposed for the KLa seem suitable for shallow
rivers with gradually varied unsteady ow (Chapra, 1997). Moreover, the PTF parameter can adopt very different values, as it is
related with the complex relationships between the bulk liquid
and the sediment (attachmentedetachment of biomass, sedimentationeresuspension processes, possible wash-outs, etc.).
Fig. 8 presents the calibration results in form of the joint posteriors (b and d) and the marginal posteriors (a and c) of the PTF (left
column) and KLa (right column) parameters. The results also
include the optimum, mean, and standard deviation (STD) values
for each parameter. Comparing standard deviations (STDs), it is
clear that the KLa parameter is more uncertain than the PTF
parameter.
Fig. 9 shows the sensitivity analysis results by means of the
marginal cumulative a priori and a posteriori distributions of the

PTF (a) and KLa (b) parameters (Martin et al., 2006a). The KS statistic
shows that the PTF parameter is slightly more sensitive than the KLa
parameter.
The uncertainty and sensitivity analyses show reasonable
results and can provide useful information for the uncertainty
assessment in model calibration.
5. Conclusions
CalHidra 3.0 is a software package able to simulate different
scenarios related to river water quality. The descriptive capacity of
the models, the calibration facility and the windows environment
make it a very useful tool for engineering purposes. In this respect,
three different examples have shown the possibilities of the
software:
1. The biochemical sub-model has properly described the nitrication activity in the Tajo River. The low value of the

C.M. Cardona et al. / Environmental Modelling & Software 26 (2011) 973e979

Particulate Transport Factor (0.17) has made possible the


simulation of considerable biochemical activity along the
Manzanares and Jarama branches.
2. The hydrodynamic model has been able to handle a signicant rain event occurred in the Ebro River and its
consequences, in terms of solids increase and soluble
substances dilution.
3. The calibration facility has demonstrated its usefulness for the
estimation of the unknown parameters in the Urola case study.
Besides the optimum parameter values, the Monte Carlo based
method also provides an assessment of the parameter
uncertainty.
Currently, research is carried out and planned in two areas: the
simulation of the benthic activity and the inclusion of a sediment
compartment.
Acknowledgements
The authors wish to thank the Spanish company EPTISA S.A. for
supporting this research. We would also like to thank the Spanish
Ministry of Science and Innovation for the grants CONSOLIDER
CSD2007-00055.
References
Abbott, M.B., Minns, A.W., 1998. Computational Hydraulics. Ashgate Publishing
Limited, England.
Beven, K., Binley, A., 1991. The future of distributed models e model calibration and
uncertainty prediction. Hydrological Processes 6 (3), 279e298.
Chapra, S.C., 1997. Surface Water Quality Modeling. McGraw-Hill, U.S.

979

Cox, B.A., 2003. A review of currently available in-stream water-quality models and
their applicability for simulating dissolved oxygen in lowland rivers. The
Science of the Total Environment 314-316, 335e377.
Kanney, J.F., Miller, C.T., Kelley, C.T., 2003. Convergence of iterative split-operator
approaches for approximating nonlinear reactive transport problems. Advances
in Water Resources 26 (3), 247e261.
Leonard, B.P., 1991. The ULTIMATE conservative difference scheme applied to
unsteady one-dimensional advection. Computer Methods in Applied Mechanics
and Engineering 88 (1), 17e74.
Martin, C., Ayesa, E., 2010. An integrated Monte Carlo methodology for the calibration of water quality models. Ecological Modelling 221 (21), 2656e2667.
Martin, C., Cardona, C.M., Salterain, A., Ayesa, E., Eguinoa, I., Garca-Sanz, M., 2006a.
Uncertainty based calibration of a new river water quality model: application to
Urola river. In: Proceedings of the 7th International Conference on Hydroinformatics HIC, 2006, Nice, France, 1269e1276.
Martin, J., McCutcheon, S., 1999. Hydrodynamics and Transport for Water Quality
Modeling. Lewis Publishers, Florida.
Martin, C., Cardona, C.M., San Martin, D., Salterain, A., Ayesa, E., 2006b. Dynamic
simulation of the water quality in rivers based on the IWA RWQM1. Application
of the new simulator CalHidra 2.0 to the Tajo River. Water Science and Technology 54 (11e12), 75e83.
McIntyre, N.R., Wheater, H.S., 2004. A tool for risk-based management of surface
water quality. Environmental Modelling and Software 19 (12), 1131e1140.
Preissmann, A., 1960. Propagation des intumescences dans les canaux et rivres. In:
Proceedings of the 1er Congrs dassociation Franaise de calcul., 433e442.
Prommer, H., Barry, D.A., Davis, G.B., 1998. A one-dimensional reactive multicomponent transport model for biodegradation of petroleum hydrocarbons
in groundwater. Environmental Modelling and Software 14 (2e3), 213e223.
Reichert, P., Borchardt, D., Henze, M., Rauch, W., Shanahan, P., Somlydy, L.,
Vanrolleghem, P., 2001. River Water Quality Model No.1. SRT 12. IWA Publishing,
London.
San Martin, D., Rodriguez, E., Ayesa, E., Sancho, L., Salterain, A., Unze, J.A., 2004.
Development and verication of an Ebro River water quality model for its
course through Zaragoza. CalHidra. In: Proceedings of the 5th International
Symposium on Ecohydraulics. Aquatic Habitats: Analysis & Restoration, 2004,
Madrid, Spain, 182e186.
Sincock, A.M., Wheater, H.S., Whitehead, P.G., 2003. Calibration and sensitivity
analysis of a river water quality model under unsteady ow conditions. Journal
of Hydrology 277 (3e4), 214e229.