Newsletter, March 2008


Dear WEST® user,

Welcome to MOSTforWATER's March 2008 Newsletter!

The goal of this newsletter is dissemination of information regarding modeling and simulation of water quality (and other fields), and the use of WEST®.

General information

  • New website released!

    MOSTforWATER is proud to announce its new website. Please visit us at www.mostforwater.com to discover the enhanced look and feel.

  • WWWEST 2007

    The WWWEST community meeting of November 2007 was a great success. We would like to thank our distributor ATM and scientific support center CEIT for hosting the event, as well as all participants for their valuable contributions.

  • Job openings

    In order to be successful, MOSTforWATER is looking to extend its team. We currently have the following openings for motivated and skilled new team members: Modeling Consultant and Software Engineer.

  • Welcome to Denis Vanneste

    It is with great pleasure that we welcome Denis Vanneste as our new Sales and Marketing Person.

  • Successful PhD Defense for Filip Claeys

    We want to congratulate our CTO Filip Claeys for the outstanding defense of his PhD thesis entitled "A generic software framework for modelling and virtual experimentation with complex environmental systems".

Events Technical articles Product information
  • WEST® 3.7.5

    WEST® 3.7.5 has been released and contains several new valuable features.

  • User tip: Encrypted models

    In addition to the default standard model library of WEST®, users may purchase additional models in an encrypted format.

1. GENERAL

1.1. New website released!

MOSTforWATER is proud to announce that its new website. Please visit us at www.mostforwater.com to discover the enhanced look and feel and find all relevant info on the company and its products and services. We hope you enjoy your visit!

1.2. WWWEST 2007

The WWWEST community meeting was a great success. We would like to thank our distributor ATM and scientific support center CEIT for hosting the event, as well as all participants for their valuable contributions. We look forward to the next WWWEST, planned for spring 2009. All the presentations can be found on-line in the User Area.

1.3. Job openings

In order to be successful, MOSTforWATER is looking to extend its team. We currently have the following openings for motivated and skilled new team members: Modeling Consultant and Software Engineer. More elaborate job descriptions can be found on our website: www.mostforwater.be/EN/Careers.php.

1.4. Welcome to Denis Vanneste

It is with great pleasure that we welcome Denis Vanneste as our new Sales and Marketing Person. Denis has an extensive international sales background, and will be in charge of further sales of WEST® world-wide. We wish him all the best with his new challenge. You can contact Denis at dv@mostforwater.com

1.5. Successful PhD defense for Filip Claeys

We want to congratulate our CTO Filip Claeys for the outstanding defense of his PhD thesis entitled "A generic software framework for modelling and virtual experimentation with complex environmental systems". A summary can be found in the Technical Articles section of this newsletter.

2. EVENTS

2.1. 1st IWA / WEF modeling seminar (WWTmod)

Mont Saint Anne, Quebec, Canada
1-3 June, 2008

The Activated Sludge Model No. 1 (ASM1) was presented two decades ago at the first modelling seminar in Kollekolle (Denmark) followed by a long series of similar events. These meetings have played a seminal role in the wastewater engineering profession. Based upon the foundations developed in the ASMs, whole plant modelling has found its way into daily process engineering practice and is used for plant design, capacity rating, process optimization, research, training, and development of control concepts.

A number of extensions, new model concepts, and calibration approaches have been developed in the last decades by different research groups and companies. The main ective of the conference is bringing together these different "schools" and approaches with the aim of consensus building and clarification of differences on topics where discussion has matured. The process of consensus building is supported by inviting targeted people from research, consulting companies, equipment suppliers and wastewater treatment plants.

The widespread use of wastewater treatment models depends on the development of widely accepted standards and procedures. The organizers hope this conference will contribute to the further development of "Good Modelling Practice" in this field.

www.modeleau.org/WWTmod2008

2.2. WEST® Training Course

Ghent, Belgium
5-6 May, 2008

MOSTforWATER is organizing a general training course for WEST®. This course will cover:

  • General modeling principles
  • Hands-on exercises: Dynamic Simulations, Sensitivity Analysis, Calibration and Scenario Analysis

The course will be held in Ghent, near Brussels. The course is aimed at water quality professionals, in the fields of wastewater treatment, drinking water production and integrated water systems. Due to the limited number of seats (max. 16 participants), we advise interested parties to book as soon as possible. For more information you can contact Denis at dv@mostforwater.com.

3. TECHNICAL ARTICLES

3.1. Immission-based probabilistic evaluation of WWTP upgrades - by Lorenzo Benedetti

Process choice and dimensioning of WWTPs is a particularly sensitive step to cost-efficiently comply with regulatory standards. This step accounts only for a small fraction of the upfront costs, but it can lead to substantial savings. Legislation in many countries requires compliance both with effluent quality standards -emission-based evaluation-and with receiving water quality standards - immission-based evaluation. Therefore, the boundaries of the system to be managed expand from single structures (e.g. the wastewater treatment plant) or sectors (e.g. agriculture) to all activities affecting the water environment in the river basin. The resulting increase in system complexity, which brings larger prediction uncertainty in system behavior, implies that the evaluation of the impact of pollution mitigation measures on the water quality should be evaluated with instruments able to cope with such complexity, both from the methodological point of view -by developing and applying systems analysis and modeling uncertainty assessment tools- and by making the developed methodology applicable in practice by means of adequate software tools.

This paper illustrates the results of a systematic methodology to evaluate plant upgrade options with regard to both effluent quality and receiving water quality. The methodology consists of four steps: (1) data collection and reconstruction, which in this case consists of making WWTP influent time series available, (2) model building and calibration, for an integrated WWTP and river model, (3) evaluation of alternatives (the WWTP upgrades) and (4) uncertainty assessment.

The first step consists of the generation of influent time series, by submitting an actual rain series to a new phenomenological model of the draining catchment and sewer system. One year time series with data every 15 minutes are produced which realistically represent the influent dynamics with time scales varying from minutes (e.g. first flush effect) to months (e.g. seasonality in infiltration rate). The upgrades were implemented for a 300,000 PE plant size. The upgrade scenarios were simulated for Continental and Mediterranean climate types, characterized by specific influent characteristics driven by temperature and rainfall.

Two options to upgrade a low loaded activated sludge system were selected for evaluation: a) increase of 33% of the activated sludge and secondary settling volumes; and b) increase of 100% of the maximum pumping capacity (therefore of the wastewater flow treated) in wet weather, both for the biological treatment line and for the off-line storm tank.

For the immission-based evaluation, the required integration of the WWTP model with the river stretch model was made by means of the continuity-based interfacing method, which allows to consistently connecting any model expressed in the Petersen matrix format. The whole integrated model could then be implemented in WEST®. The interface consists of a list of algebraic equations expressing concentration inputs in the river in terms of concentration outputs from the sewer or WWTP models, and closes all elemental mass balances in the passage from one system to the other.

The cost categories used in this study are aeration energy cost; energy cost including aeration, pumping and mixing costs; sludge cost which comprises sludge treatment and disposal; variable cost incorporating energy, sludge and chemicals cost; total cost which includes variable, personnel, maintenance (proportional to capital cost) and annualized capital costs.

Probabilistic design is the combination of probabilistic modeling techniques with the currently available deterministic models. The quantification of the uncertainty of the system as a whole may be carried out by running Monte Carlo simulations, which generate a probability density function or cumulative density function of the output

In this study, thirteen parameters of the ASM2d and some parameters of the influent fractionation model have been assumed to be uncertain. For each option, 100 Monte Carlo simulations were run. To reduce the resulting computational burden, tools that distribute simulations over idling PCs available in a local network were also used.

One possibility to summarize the 100 time series is to calculate for each simulation the average for the variables of interest (Figure 1, left). Since the comparison between the three options does not appear straightforward due to the overlapping of the three clouds of 100 dots, the uncertainty characteristics of the MC simulation results may be assessed as in Figure 1, right. Each of the polygons has been created by joining the 5th and 95th percentiles of the 100 data points calculated along the two principal axes found by using principal component analysis (PCA). The markers in each of the polygons represent the 50th percentiles.

Figure 1: Two options to visualize Monte Carlo simulation results: all results as a cloud of markers (left) and polygons joining the 5th and 95th percentiles for the two variables and the 50th percentile as a marker (right); the data show effluent TN and COD for the three options in Continental climate. U0, U1 and U2 denote the alternatives of upgrade examined.Figure 1. Two options to visualize Monte Carlo simulation results: all results as a cloud of markers (left) and polygons joining the 5th and 95th percentiles for the two variables and the 50th percentile as a marker (right); the data show effluent TN and COD for the three options in Continental climate. U0, U1 and U2 denote the alternatives of upgrade examined.

Another instrument to evaluate the difference among the options in their dynamic behavior is the concentration-duration box-plot which allows to evaluate, for any given concentration value, the duration (in percentage of the total simulation period) for which that value has been exceeded (Figure 2).

Figure 2: Period of exceedance of 2 mgNH4/L in the river 1000 m downstream the WWTP effluent for the three upgrade options, expressed as percentage of the total evaluation period (one year) in Continental (left) and Mediterranean (right) climates.Figure 2. Period of exceedance of 2 mgNH4/L in the river 1000 m downstream the WWTP effluent for the three upgrade options, expressed as percentage of the total evaluation period (one year) in Continental (left) and Mediterranean (right) climates.

In contrast to conventional practice, this approach allows to choose the most appropriate trade-off between cost of measures and effluent quality, and to assess the reliability of a process layout. It is therefore an adequate instrument to cope with the flexibility and complexity of integrated water management regulations.

3.2. A generic software framework for modelling and virtual experimentation with complex environmental systems - by Filip Claeys

Computer-based modeling and virtual experimentation (i.e. any procedure in which the evaluation of a model is required, such as simulation and optimization) has proven to be a powerful mechanism for solving problems in many areas, including environmental science. Since the late 1960's, a plethora of software systems have been developed that allow for modeling, simulation, and to a lesser extent, also other types of virtual experimentation. However, given the persistent desire to model more complex systems, and the trend towards more complex computational procedures based on model evaluation, it may be required to re-evaluate and improve existing software frameworks, or even to suggest new frameworks. Moreover, recent developments in information technology have caused a growing trend towards flexible deployment and integration of software components, e.g. in a web-based, distributed or embedded context.

In order to be able to handle the need for malleable deployment and integration of modeling and virtual experimentation systems with other software components, re-evaluation of existing frameworks and/or development of new frameworks may also be required. One particular domain of environmental science that has in recent years attracted the interest of researchers in the field of software frameworks, is water quality management (which, amongst other, includes the study of water quality in treatment plants, sewer networks and river systems). This domain can be considered mature since the inception of standard unit process models such as the Activated Sludge Model (ASM) series. Moreover, the complexity of the most advanced integrated models that are currently studied in this domain is such that mainstream software systems simply cannot handle them anymore.

Figure 3: Evolution of model complexity in water quality management (logarithmic scale)

Figure 4: Moore's law (logarithmic scale)

Filip Claeys' dissertation concerns the design and implementation of an advanced framework for modeling and virtual experimentation with complex environmental systems, which attempts to accomplish the following goals: deliver support for complex modeling and complex virtual experimentation, offer a wide variety of deployment and integration options, and ensure compliance with modern architectural standards. As most systems that are studied in environmental science are continuous, focus is on complex continuous system modeling.

The framework that was developed is generic in nature, although the design and implementation process has been strongly guided by demands coming from the field of water quality modeling. Development was done over a long period of time, i.e. mainly from 1995 until 1998 and from 2003 until 2007. The WEST® modeling and virtual experimentation product that is currently commercially available (and is mainly used for modeling and simulation of wastewater treatment plants) is an emanation of the work that was done during the first period. The work done during the second period has resulted into a software framework named Tornado and should eventually find its way to WEST-4, which is a major rewrite of the former WEST-3 product.

Tornado implements a hierarchical virtual experimentation framework in which new virtual experiments can be created by re-using already existing experiments. The composition graph that represents the virtual experiments that have so far been developed consists of 15 different types of experiments.

Figure 5: Experiment composition hierarchy

Using these experiments, a broad range of problems can be solved, ranging from simple simulation studies to large-scale risk analyses using comprehensive Monte Carlo simulation, such as recently performed in the scope of the CD4WC project dealing with support for the EU Water Framework Directive. All experiment types are highly configurable through an extensive set of properties, which can be dynamically queried and modified. New experiment types can be added by computer scientists or environmental scientists, provided that the design and implementation principles of Tornado are well-understood.

Most virtual experiment types in Tornado are guided by numerical solver algorithms. For the incorporation of these solvers into the kernel, a generalized framework for abstraction and dynamic loading of solver plug-ins was devised. This framework allows for solvers to be classified according to their purpose (integration, optimization, etc.) and for new solvers to be developed on the basis of a library of base classes. At run-time, solvers can be dynamically loaded or removed from the system for reducing memory consumption.

In the scope of Tornado, two declarative, hierarchical, object-oriented, equation-based modeling languages play an important role: MSL and Modelica. MSL has been available as of the first Tornado version and has been the cornerstone of model development in the scope of many water quality modeling studies. Since MSL does not support the concepts of acausal and multi-domain modeling, the Modelica language was introduced in a later version of the framework. Albeit very powerful, Modelica is also a complex language. Consequently, a hybrid approach is adopted in which the standard OpenModelica model compiler front-end is used in combination with a custom model compiler back-end for Tornado. This model compiler back-end allows for the generation of executable models that can be used by the Tornado virtual experimentation kernel, as well as for the generation of S-functions that can be adopted in the scope of MATLAB/Simulink.

Since executable models need to be fast to generate, the Tornado executable model format was designed in such a way that meta-information is represented in XML and computational information is described in a compiled general-purpose programming language, i.e. C. In this way, executable models can quickly be produced, using the user's C compiler of choice.

In order to ensure the run-time performance of executable models, three techniques were implemented that reduce the model complexity and hence provide a considerable performance improvement of 10 to 30%: constant folding, equiv substitution, and lifting of equations. The first computes the results of constant sub-expressions at compile-time, the second removes aliases from a set of equations, and the third allows for detecting initial and output equations and for moving them to appropriate equation ections.

As a result of the manipulations that are performed on models during the executable code generation process, the output of this process is often not recognizable anymore to a user. Consequently, stability is an important issue: in case a problem does occur, it must be reported in a way that is understandable to a user. Two techniques were implemented that allow for improved stability and error reporting in executable models: code instrumentation and the generation of bounds checking code. The first replaces potentially dangerous constructs (e.g., division-by-zero) by "safe" versions in which arguments are first checked on validity before being applied. The second generates code that performs range checking at run-time (e.g., to detect negative values). By generating this code only for variables that need it, a performance improvement of up to 50% could be realized with respect to kernel-based range checking.

In order to allow for the integration of Tornado in other software, several application programming interfaces (API's) were developed. Some of these are comprehensive and allow for any Tornado-related operation to be performed, while others are restricted and only allow for the most frequently occurring operations. Comprehensive API's were developed for C++ and .NET. Restricted API's were developed for C, the Java Native Interface, MATLAB MEX, OpenMI and CLIPS. A special case is the CMSLU interface that allows for the Tornado kernel to be called to run any type of experiment from within a Tornado model.

Several stand-alone applications were developed on the basis of the Tornado kernel. One of these applications is a suite of command-line programs that is developed along with the Tornado kernel itself and is useful for testing, automation and advanced use. Next to the command-line suite, a number of graphical applications were developed, e.g. WEST-3, based on the initial version of Tornado; and WEST-4, based on the most recent version. These graphical applications illustrate that for application development, various technologies can be applied to one and the same Tornado kernel.

With respect to remote and web-based use, a number of technologies were discussed that are potentially applicable to Tornado. Some of these technologies have already been used in the scope of applications (sockets, DCOM and SOAP), while others have merely been adopted in prototype projects (.NET Remoting, ASP.NET). Still some others have not yet been applied, but could in case a need for this would arise (CORBA, OPC, Java RMI). Finally, coarse-grained gridification was applied to Tornado at the level of sub-experiments (i.e., a set of simulation jobs is carried out concurrently on a pool of computational nodes). As a result, Tornado can be deployed in a distributed fashion on the basis of the Typhoon cluster software (which was developed especially to serve as a light-weight solution for the execution of jobs generated by Tornado), as well as on the basis of the gLite grid middleware. Through the application of these distributed technologies, the extreme computational workload (14,400 simulations each requiring 30min of computation time) that was a result of the CD4WC project could be processed in a timely fashion (approximately 10 days).

Tornado was developed from scratch using object-oriented design and implementation principles. C++ was used as a programming language and design patterns such as the singleton, factory, facade and proxy patterns were adopted. Platform-independence of the kernel (but not necessarily its external interfaces) was ensured and thread-safety for high-level entities was provided. For these high-level entities, XML-based persistent formats were devised and described on the basis of XML Schema Definitions. Furthermore, a mechanism that provides for run-time querying of entity properties was provided, which alleviates the need for modification of entity interfaces in case of changes to the set of properties supported by an entity.

Overall, it can be stated that through the design and development of the Tornado framework, the solution of water quality management problems that were hitherto hindered by performance limitations or limitations to the degree to which complexity could be handled, has now become possible. Moreover, thanks to the design of the framework, it is likely that Tornado will be able to adapt to the expected continued increase in complexity for a considerable period of time.

4. PRODUCT INFORMATION

4.1. WEST® 3.7.5

WEST® 3.7.5 was released on October 10, 2007. Most important new features are the following:

  • New models:

    • Membrane model (external)
    • MBR model (internal membrane)
    • Dewatering models (centrifuge, belt-press)
    • Biofilm models (IFAS, trickling filter)
    • Chemical dosage unit model (aluminium, iron, methanol, ethanol, acetate)

  • Model modifications:

    • The volume of a FixVolumeASU or FixVolumeBuffer is now entered through the parameter Vol
    • Modification to the Operational Cost model for aeration cost (extended number of units), mixing cost (new) and chemical cost (new)

  • Enhanced Excel API sample

4.2. User tip: Encrypted Models

In addition to the default standard model library of WEST® a number of additional models are available in an encrypted form. These models have been developed by members of the Scientific Support Center network and are the result of substantial know-how and implementation work. The encryption is a way to protect the know-how and work of the model developers while still allowing users to use these state-of-the-art models.

It should be noted that a tool is available for users who want to encrypt their own models in order to protect their proper know-how.

Figure 6: Selection of the SBRTakacs encrypted model in the configuration builder

These encrypted models differ from the standard models in that:

  • they require a specific license
  • they will have to be manually incorporated into the model library (the procedure is illustrated below)
  • the code is protected, i.e. the model implementation will not be accessible to the user, through the WEST® model editor

The following is the list of encrypted models, currently available for WEST® 3.7.5:

River Quality The River Water Quality Model No. 1 (RWQM1) was published by the International Water Association (IWA) Task Group in 2001 and subsequently implemented in WEST® by a river water quality modeling group of the department of Applied Mathematics, Biometrics and Process Control (BIOMATH) of Ghent University.

The same approach of the IWA Activated Sludge Model (ASM) series is used for the implementation of the RWQM1: the base unit for mass balance is COD and a Petersen matrix is used to describe the proces dynamics.

The model includes 24 components (state variables: e.g., soluble COD, inorganic nutrients, bacteria, algae, etc.) and 23 processes (e.g., biomass growth, physicochemical reactions, etc.).

SBR 1-D Settling This is the implementation of the 1-dimensional settling model (Takacs model) for the settling phase of a sequencing batch reactor (SBR), by the BIOMATH department of Ghent University.

Three sub-models will be available for the process unit SBR, i.e. with one, two and three reaction periods.

Rauch This is the implementation of the Rauch biofilm model for a trickling filter, by the BIOMATH department of Ghent University.

The main characteristics of the model are that it decouples the diffusion process and the biokinetic reactions, i.e.: for each conversion process, the active portion of the biofilm (or: penetration depth) is computed, and the conversions are calculated within the active portion of the biofilm, that is treated as an ideally mixed reactor.

ADM1 The Anaerobic Digestion Model No. 1 (ADM1) was published by the International Water Association (IWA) Task Group in 2002 and subsequently implemented in WEST® by the department of BIOMATH of Ghent University.

It is a structured model with 19 biochemical processes (disintegration and hydrolysis, acidogenesis, acetogenesis and methanogenesis), 3 gas-liquid transfer kinetic processes, and includes 24 components.

Reactive Settling This is the implementation of a Takacs settling model in which biological conversion processes occur during the settling of the sludge, by the BIOMATH department of Ghent University. It is available for every standard category (ASM1, ASM2, etc).

How to activate an encrypted model? The following procedure illustrates the example of the 1-D settling model for a SBR:

  • Copy-paste the relevant encrypted file(s) to the appropriate "..\Modelbase\Msl folder"

  • Open the wwtp.msl file through the WEST® model editor (Figure 7)

    • From the WEST® Manager, select Model Editor, either from the Content List pane or from the WEST® frame on the left
    • Browse to the appropriate modelbase and select the main file of the modelbase (typically, wwtp.msl) and confirm the choice by pressing the OK button
    • Click the Launch Editor button
    • Double-click on the wwtp.msl file in the tree view

    Figure 7: Open the Model Editor, from the WEST® Manager

  • Add the relevant include statement(s), e.g. #include "wwtp.base.SBRTakacs.enc"

    • Use the F2 key, to access the code snippet and select the relevant syntax (Figure 8)
    • It is recommended to add such #include statements towards the end of the wwtp.msl file, e.g. after the list of all other process nodes

    Figure 8: Code snippet

    The encrypted files will appear in the tree view of the model library with a "restricted access" icon and the code will not be visible in the model editor (Figure 9).

  • Save the changes

    Figure 9: The WEST® modelbase with the encrypted model

Kind regards,

The MOSTforWATER Team

MOSTforWATER - Koning Leopold III-laan 2 - B-8500 Kortrijk - BELGIUM
Phone : +32 (0)56 35 43 90 - Fax : +32 (0)56 36 02 30