12
Systems Analysis for Water Technology

System Analysis for Water Technology

Embed Size (px)

Citation preview

Page 1: System Analysis for Water Technology

Systems Analysis for Water Technology

Page 2: System Analysis for Water Technology

Willi Gujer

Systems Analysis for Water Technology

123

Page 3: System Analysis for Water Technology

Prof. Dr. Willi Gujer ETH Zurich Institute of Environmental Engineering Wolfgang-Pauli-Straße 15 8083 Zurich Switzerland [email protected]

ISBN 978-3-540-77277-4 e-ISBN 978-3-540-77287-1 DOI 10.1007/978-3-540-77287-1 Library of Congress Control Number: 2008924075 © 2008 Springer-Verlag Berlin Heidelberg This work is subject to copyright. All rights are reserved, whether the whole or part of the material isconcerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broad-casting, reproduction on microfilm or in any other way, and storage in data banks. Duplication of thispublication or parts thereof is permitted only under the provisions of the German Copyright Law of September 9, 1965, in its current version, and permissions for use must always be obtained fromSpringer. Violations are liable to prosecution under the German Copyright Law. The use of general descriptive names, registered names, trademarks, etc. in this publication does notimply, even in the absence of a specific statement, that such names are exempt from the relevant pro-tective laws and regulations and therefore free for general use. Cover design: Frido Steinen-Broo, eStudio Calamar, Spain Printed on acid-free paper 9 8 7 6 5 4 3 2 1 springer.com

Page 4: System Analysis for Water Technology

v

Preface

This book has a rather long history. It goes back to 1980, when environmental engineering evolved from sanitary engineering as a new and broader engineering discipline. I had the assignment to teach a course in mathematical modeling of technical systems as part of a new postgraduate course in Urban Water Manage-ment and Water Pollution Control at ETH in Zurich. I decided to teach this course on a rather abstract level, with the goal of introducing methods that are generally applicable across the different disciplines of what was then defined as environ-mental engineering. Now I teach a graduate course in methods for urban water management, which heavily relies on the material I compiled in the 1980s. This course is offered in the first semester of the master education in environmental engineering at ETH; it requires four hours of lecturing and problem sessions a week during one semester. The students earn six credit units (ECTS).

Of all the engineering disciplines, environmental engineering appears to be among those that maintain the most intimate contacts with the natural science disciplines. Only a detailed understanding of chemical, physical, and microbial processes will lead to engineered systems that fulfill the requirements of society and the environment and at the same time do not require excessive economic and natural resources. Mathematical models are a crucial base for engineering design – in environmental engineering they typically combine a quantitative description of chemical and microbial transformation processes with the description of the physical transport processes within the system of interest.

This book introduces methods and generic models that support the development of detailed system-specific mathematical models, primarily of technical water and wastewater treatment systems. It concentrates on methods which are required for the development of these models; it does not introduce a detailed discussion of specific processes or systems. In combination with an in-depth education in physi-cal, chemical, and microbial processes for water and wastewater treatment these methods and models are of eminent value for the professional analysis of engin-eered systems.

Page 5: System Analysis for Water Technology

vi Preface

Frequently mathematical modeling leads to coupled, nonlinear differential equations and thus requires the application of numeric integration. In addition the tools for systems analysis, parameter identification, sensitivity analysis, and error propagation are essential for responsible engineering work. A vast array of soft-ware products for this purpose are available on the market. A steep learning curve, ease of availability, economics, spectrum of tools, and efficiency led me to choose Berkeley Madonna (www.berkeleymadonna.com) as the simulation tool – the code is easy to read and the software, even in its free demo version, is sufficient for most student work. This book provides many examples of code for this soft-ware. Software and computer sessions are an essential part of learning to use the tools that are introduced in this book. Many different software systems can pro-vide support for this; preference should be given to a general tool in the academic environment.

This book touches on many topics. Some are dealt with in depth (kinetics, stoichiometry, conservation of mass, reactor hydraulics, residence time distribu-tion), while in others an introduction primarily based on case examples is provided (parameter identification, sensitivity analysis, error propagation, process control, time series analysis, design under uncertainty). Typically PhD students will subse-quently follow more in-depth systems analysis and statistical courses whereas pro-fessional engineers should at least obtain the basis for their continued education.

In order to support the use of this text I will make some additional material, es-pecially my lecture notes, available online at:

http://www.sww.ethz.ch

Finally I would like to thank my collaborators, assistants, PhD students, and students in general who have helped me to find errors and improve details of this book. I had the opportunity to translate and revise this book during a sabbatical leave that I spent during the summer of 2006 at DTU in Lyngby.

Zürich, summer 2007 Willi Gujer

Page 6: System Analysis for Water Technology

vii

Content

1 Introduction............................................................................................. 1 1.1 Goal and Content of This Text ...................................................... 1

2 Modeling and Simulation ....................................................................... 5 2.1 System, Model, Simulation ........................................................... 5 2.2 Models in Natural and Engineering Sciences ................................ 6 2.3 Types of Mathematical Models ..................................................... 6 2.4 Systems Analysis........................................................................... 8 2.5 Calibration, Validation, and Verification ...................................... 10 2.6 Model Structure ............................................................................. 11 2.7 Simulation ..................................................................................... 12 2.8 Components of a Model ................................................................ 13

2.8.1 Structural Components of a Mathematical Model ........... 13 2.8.2 Case Study ....................................................................... 19

2.9 Dimensions and Units.................................................................... 21

3 System Boundaries and Material Balances .......................................... 23 3.1 System Definition.......................................................................... 23 3.2 System Boundaries ........................................................................ 25 3.3 General Balance Equation ............................................................. 26

3.3.1 Inventory and Accumulation............................................ 26 3.3.2 Transport Processes.......................................................... 27 3.3.3 Reaction, Production, and Consumption.......................... 29 3.3.4 Mathematical Form of the Balance Equation................... 30

3.4 Special Cases of the Material Balance Equation ........................... 33 3.4.1 Stationary Balance or the Steady State ............................ 33 3.4.2 Closed Systems ................................................................ 35 3.4.3 Conservative Material ...................................................... 37

3.5 Summary ....................................................................................... 39

Page 7: System Analysis for Water Technology

viii Content

4 Transport Processes................................................................................ 41 4.1 Characterization of Transport Processes........................................ 42 4.2 Modeling of Transport Processes .................................................. 43

4.2.1 Advection......................................................................... 43 4.2.2 Sedimentation .................................................................. 45 4.2.3 Random Walk .................................................................. 48 4.2.4 Molecular Diffusion......................................................... 53 4.2.5 Turbulent Diffusion.......................................................... 58 4.2.6 Dispersion ........................................................................ 62 4.2.7 Numeric Dispersion ......................................................... 68 4.2.8 Convection ....................................................................... 70 4.2.9 Mass Transfer Coefficients .............................................. 72

5 Transformation Processes ...................................................................... 77 5.1 Case Study..................................................................................... 77 5.2 Transformation Written in Conventional Form ............................. 78 5.3 Stoichiometric Matrix.................................................................... 80 5.4 Kinetics.......................................................................................... 84

5.4.1 Temperature Effects......................................................... 86 5.5 State Variables............................................................................... 87 5.6 Composition of Materials .............................................................. 90 5.7 Conservation Laws ........................................................................ 92

5.7.1 Conservation Law for Several Processes ......................... 95 5.7.2 Charge Balance ................................................................ 95 5.7.3 Theoretical Oxygen Demand ........................................... 97

5.8 Summary ....................................................................................... 100

6 Ideal Reactors.......................................................................................... 101 6.1 Overview of Ideal Reactors ........................................................... 101 6.2 The Batch Reactor ......................................................................... 102 6.3 The Continuous Flow Stirred Tank Reactor (CSTR) .................... 105 6.4 A Cascade of Stirred Tank Reactors.............................................. 108 6.5 The Plug-Flow Reactor.................................................................. 111 6.6 Plug-Flow Reactor with Turbulence.............................................. 114 6.7 Sequencing Batch Reactor............................................................. 123 6.8 Completely Mixed or Plug-Flow Reactor?.................................... 127 6.9 Summary ....................................................................................... 127

7 Hydraulic Residence Time Distribution ............................................... 129 7.1 RTD: A Spectrum of Retention Times .......................................... 130 7.2 Characterization of Residence Time Distributions ........................ 133 7.3 Experimental Determination of an RTD........................................ 134

7.3.1 Tracer Substances ............................................................ 134 7.3.2 Experimental Procedure................................................... 135

Page 8: System Analysis for Water Technology

Content ix

7.4 Residence Time Distributions of Ideal Reactors ........................... 143 7.4.1 RTD of a Stirred Tank Reactor (CSTR)........................... 143 7.4.2 Cascade of Stirred Tank Reactors .................................... 145 7.4.3 Plug-Flow Reactor ........................................................... 148 7.4.4 Plug-Flow Reactor with Turbulence ................................ 150 7.4.5 Numeric Simulation of Turbulence

in a Plug-Flow Reactor .................................................... 155 7.5 Reactor Combinations ................................................................... 159 7.6 RTD with Stochastic Models......................................................... 159

7.6.1 Stochastic Model of a Cascade of Stirred Tank Reactors .................................................. 160

7.6.2 Stochastic Model of Turbulence ...................................... 161

8 Modeling of Real Reactors ..................................................................... 165 8.1 Goal ............................................................................................... 165 8.2 Time of Mixing.............................................................................. 166 8.3 Methods for Model Identification.................................................. 168

8.3.1 Method of Moments......................................................... 168 8.3.2 Adjustment of the Model to the Measurements ............... 170

8.4 Case Study..................................................................................... 171

9 Heterogeneous Systems .......................................................................... 179 9.1 Classification of Processes and Systems ....................................... 179 9.2 Multiphase Systems....................................................................... 180

9.2.1 Microbial Degradation of Stored Pollutants..................... 181 9.3 Behavior of Individual Particles .................................................... 182 9.4 Case Studies .................................................................................. 184

9.4.1 Transformation Processes in a Sewer............................... 184 9.4.2 Activated Sludge Flocs .................................................... 187 9.4.3 Self-purification in a Brook ............................................. 189 9.4.4 Gas Exchange in a Stirred Tank Reactor ......................... 195 9.4.5 Adsorption in an Activated Carbon Column.................... 202

10 Dynamic Behavior of Reactors .............................................................. 211 10.1 Causes of the Dynamics ................................................................ 212 10.2 Adjustment to Step Changes in Load ............................................ 214 10.3 Periodic Load Variation................................................................. 217

10.3.1 Stirred Tank Reactor ........................................................ 217 10.3.2 Cascade of Stirred Tank Reactors .................................... 221 10.3.3 Plug-Flow Reactor ........................................................... 222 10.3.4 Bode Diagram .................................................................. 222 10.3.5 Stochastic Processes......................................................... 226 10.3.6 Dynamic Operation of Plants ........................................... 226

Page 9: System Analysis for Water Technology

x Content

10.4 Discussion of Time Constants ....................................................... 229 10.4.1 The Residence Time of Individual Materials ................... 229 10.4.2 Different Time Constants................................................. 232

10.5 Nonstationary Effluent in Sewers.................................................. 234

11 Measurement and Measurement Uncertainty...................................... 237 11.1 Definitions from Descriptive Statistics.......................................... 237

11.1.1 Analytical Characterization of the Distribution of Measured Values ......................................................... 238

11.1.2 Empirical Characterization of Measured Values.............. 239 11.2 Measuring Systems........................................................................ 241 11.3 Measuring Uncertainty .................................................................. 243

11.3.1 Gross Measurement Errors............................................... 243 11.3.2 Random Measurement Error ............................................ 245 11.3.3 Systematic Measurement Errors, Bias ............................. 248

11.4 Case Example: COD Measurement (Standard Curve)................... 250 11.5 Identifying an Error Model............................................................ 251 11.6 Uncovering Systematic Measurement Errors ................................ 253

12 Parameter Identification, Sensitivity and Error Propagation ............ 257 12.1 Parameter Identification ................................................................ 257

12.1.1 Basic Principles, Chi Square, χ 2 ...................................... 258 12.1.2 Case Example: First-Order Reaction

in a Batch Reactor ............................................................ 261 12.2 Introduction of an Extended Case Study ....................................... 263 12.3 Sensitivity and Identifiability ........................................................ 266

12.3.1 Case Study ....................................................................... 266 12.3.2 Local Sensitivity Functions.............................................. 269

12.4 Model Structure ............................................................................. 274 12.4.1 Structural Model Deviations ............................................ 275 12.4.2 Simple Test Procedures.................................................... 277

12.5 Parameter Uncertainty ................................................................... 281 12.5.1 Theoretical Background................................................... 282 12.5.2 Application to the Case Study.......................................... 288

12.6 Linear Error Propagation ............................................................... 291 12.6.1 Basics ............................................................................... 291 12.6.2 Application to the Case Study.......................................... 294

12.7 Nonlinear Error Propagation ......................................................... 296 12.7.1 Monte Carlo Simulation................................................... 296 12.7.2 Sampling Methods ........................................................... 300 12.7.3 Application to the Case Study.......................................... 308

12.8 Correlated Parameter Values: A Word of Caution ........................ 311 12.9 Summary of Model Identification ................................................. 312

Page 10: System Analysis for Water Technology

Content xi

13 Process Control Engineering ................................................................. 315 13.1 Examples of Operating Strategies ................................................. 315

13.1.1 Adjusting the Water Temperature of a Shower................ 316 13.1.2 Operation of an Activated Sludge System ....................... 316 13.1.3 Summary .......................................................................... 317

13.2 Control Path and Control Loop ..................................................... 318 13.3 Step Response of a Subsystem ...................................................... 321 13.4 Step Response of a Controlled System.......................................... 326

13.4.1 Controlled Systems Without Delay.................................. 326 13.4.2 Controlled Systems with Delay........................................ 327 13.4.3 Controlled Systems with Dead Time ............................... 330

13.5 Characteristic Curves of a Controlled System............................... 331 13.6 The Standard Automatic Controller............................................... 332

13.6.1 The Two-Position Controller (A Discontinuous Controller)........................................... 333

13.6.2 Continuous Automatic Controllers .................................. 335 13.6.3 Comparison of the Standard Controllers.......................... 344 13.6.4 Implementation of a PID Controller

in Berkeley Madonna ....................................................... 344 13.6.5 Disturbance Variable Compensation................................ 345 13.6.6 Optimal Adjustment of a PID Controller ......................... 346

13.7 Case Study: Control of Oxygenation in an Activated Sludge Plant ......................................................... 348 13.7.1 Task.................................................................................. 348 13.7.2 System Performance Without Control ............................. 350 13.7.3 Parameters of a PID Controller ........................................ 350

13.8 Fuzzy controllers ........................................................................... 355 13.8.1 Example of a Fuzzy Controller ........................................ 356 13.8.2 Why Fuzzy Control? ........................................................ 359

14 Time Series Analysis ............................................................................... 361 14.1 Time Series.................................................................................... 361 14.2 Stationary Time Series................................................................... 362 14.3 Case study: Yearly Variation of the Temperature ......................... 363 14.4 Conventional Statistical Characterization...................................... 364 14.5 Moving Average............................................................................ 365

14.5.1 Arithmetic Moving Average ............................................ 366 14.5.2 Geometric Moving Average............................................. 367

14.6 Trend Lines.................................................................................... 370 14.7 Removing a Trend ......................................................................... 372

14.7.1 Correcting for the Average Value .................................... 373 14.8 Logistic Growth............................................................................. 374 14.9 Discrete Fourier Transformation ................................................... 375

Page 11: System Analysis for Water Technology

xii Content

14.10 Autocorrelation, AR(1) Model ...................................................... 378 14.10.1 Autoregressive Models .................................................... 379 14.10.2 Summary on AR(1) models ............................................. 384 14.10.3 Identification of an AR(1) model..................................... 385

14.11 Case study...................................................................................... 388 14.11.1 Task, Question ................................................................. 388 14.11.2 Procedure ......................................................................... 388 14.11.3 Trend Line........................................................................ 389 14.11.4 Fourier Transformation .................................................... 389 14.11.5 Analysis of the Residuals: AR(1) Model ......................... 391 14.11.6 Synthesis .......................................................................... 393

15 Design under Uncertainty ...................................................................... 397 15.1 Dealing with Uncertainty............................................................... 397 15.2 Variation and Uncertainty ............................................................. 399 15.3 Case Study..................................................................................... 403

15.3.1 Task.................................................................................. 403 15.3.2 Variation .......................................................................... 405 15.3.3 Uncertainty....................................................................... 406 15.3.4 Representation of Variation and Uncertainty................... 407 15.3.5 Deterministic Design........................................................ 410 15.3.6 Uncertainty-Based Design ............................................... 414 15.3.7 Operational Experience and Retrofitting of the Plant ...... 418 15.3.8 Critique of the Design Procedures ................................... 419

15.4 Second-Order Uncertainty............................................................. 420

16 Problems .................................................................................................. 423 16.1 Composition Matrix and Conservation Equation .......................... 423 16.2 Conservation of TOD .................................................................... 424 16.3 Breakpoint Chlorination: Stoichiometry and Composition ........... 424 16.4 Deriving a Stoichiometric Matrix.................................................. 425 16.5 Mass Balance in the Steady State .................................................. 425 16.6 Ideal Reactors, Chemostats............................................................ 426 16.7 Ideal Reactors, Plug Flow.............................................................. 427 16.8 Ideal Reactors, Sampling in Turbulent Flow................................. 428 16.9 Ideal Reactors, Disinfection .......................................................... 429 16.10 Ideal Reactors, SBR....................................................................... 430 16.11 Residence Time Distribution, Cascade of CSTRs ......................... 430 16.12 RTD, Reactor Model ..................................................................... 431 16.13 RTD, Activated Sludge Tank ........................................................ 432 16.14 RTD, Flow Rate and Dispersion in a Sewer.................................. 433 16.15 Modeling a Sewer.......................................................................... 434 16.16 RTD, Disinfection Reactor ............................................................ 434 16.17 RTD, Additivity of τm and σ2 ........................................................ 434 16.18 RTD, Turbulent Plug-Flow Reactor .............................................. 434

Page 12: System Analysis for Water Technology

Content xiii

16.19 Heterogeneous Systems: Filtration ................................................ 435 16.20 Substrate Profiles in a Biofilm....................................................... 435 16.21 Bode Diagram................................................................................ 437 16.22 Dynamic Nitrification.................................................................... 437 16.23 Nonstationary Flow in Sewers....................................................... 438 16.24 Stochastic Measurement Error....................................................... 439 16.25 Systematic Measurement Error...................................................... 441 16.26 Sensitivity and Parameter Identification........................................ 442 16.27 Sensitivity...................................................................................... 443 16.28 Error Propagation with Correlated Uncertainty............................. 443 16.29 System Identification..................................................................... 444 16.30 Uncertainty, Error Propagation...................................................... 447 16.31 Process Control, Two-Position Controller..................................... 447 16.32 Process Control, PID Controller .................................................... 448 16.33 Time Series Analysis ..................................................................... 449 16.34 Design under Uncertainty, Nitrification ........................................ 450 16.35 Integrated Problem: Nitrification in an RBC................................. 452 16.36 Integrated Problem: Analyzing a Fish Pond .................................. 455

Literature.......................................................................................................... 457

Index ................................................................................................................. 459