Home

AQUASIM 2.0 User Manual

image

Contents

1. where v is the advective transport velocity and Age te 4 4 n 2 4 1 SIMULATION 139 is the grid spacing e s is the length of the compartment and n the number of grid points The main advantage of the Gear integration technique for the solution of systems of ordinary differential equations Gear 1971b Gear 197la Gear 1971c Hindmarsh 1983 is its property of being stiffly stable The implementation DASSL Petzold 1983 of this technique which is used in AQUASIM has the advantage that not only systems of ordinary differential equations but differential algebraic systems can be solved Stiff systems of differential equations are systems for which the transients towards the solution to be calculated approach this solution on a much shorter time scale as the time scale for variations of the solution of interest The main idea of achieving a stiffly stable integration technique is using backward differencing schemes The advantage of backward versus forward differencing can easily be illustrated with a comparison of the explicit and the implicit Euler algorithm If the system of ordinary differential equations is written in the form dy _ r F y t 4 5 the explicit Euler technique is given as y tj41 y t tj41 ty F y ty ty 4 6 and the implicit Euler technique as tj41 tj th41 ty F y 541 tj 1 4 7 Figure 4 3 shows the numerical solution of a stiff system of differential
2. calculating dynamic solution Calculation calcl Simulation time 0 0058080842 Figure 4 6 Dialog box for interrupting a simulation current calculation and the current simulation time and it allows the user to interrupt the simulation 144 CHAPTER 4 SIMULATION AND DATA ANALYSIS 4 2 Sensitivity Analysis As mentioned in the introduction sensitivity analysis combines the tasks of identifyability analysis and uncertainty analysis The goal of identifiability analysis is to check if model parameters can be uniquely determined with the aid of the available data and to estimate the uncertainty of the pa rameter estimates This can be done by estimating the standard errors and correlation coefficients of parameters during the parameter estimation procedure as described in sec tion 4 3 An additional source of information on the identifiability of model parameters are the sensitivity functions discussed in this section The following four sensitivity functions are distinguished by AQUASIM jaa z 4 9a ga 4 9b ar p 4 9 irr 7 st 4 9d JY A ar yp yP t y a r yP y 0 p 2p P Figure 4 7 Interpretation of the absolute relative sensitivity function dy p y p In these functions y is an arbitrary variable calculated by AQUASIM and p is a model parameter represented by a constant variable or by a real list variable The absolute absolute sensitivity function 4 9a mea
3. lt simple_expression gt lt simple_expression gt lt relop gt lt simple_expression gt lt relop gt I 1 lt gt lt lt gt gt lt simple_expression gt lt term gt lt sign gt lt term gt lt simple_expression gt lt addop gt lt term gt lt term gt lt factor gt lt term gt lt mulop gt lt factor gt lt sign gt lt addop gt or lt factor gt lt varident gt lt unsigned_constant gt lt expression gt lt function gt not lt factor gt lt unsigned_constant gt lt unsigned_number gt lt unsigned number gt lt predefined_constant gt lt unsigned_integer gt lt unsigned_integer gt E lt sign gt lt unsigned_integer gt 24 CHAPTER 3 MODEL FORMULATION lt predefined_constant gt pi lt unsigned_integer gt lt digit gt lt digit gt lt mulop gt div mod and lt function gt lt arith_func_l_arg gt lt arith_func_2_arg gt lt if_function gt lt arith_func_i_arg gt lt ident_func_l_arg gt lt expression gt lt ident_func_l_arg gt sin cos tan asin acos atan sinh cosh tanh deg rad exp log In log10 sign abs sqrt lt arith_func_2_arg gt lt ident_func_2_arg gt lt expression gt lt expression gt lt ident_func_2_arg gt min max lt if_function gt if lt condition gt then lt expression gt else lt expression gt endif lt condition g
4. OEF OCP TMX cur Fo Di CPi ELF Et 1 4 7 Ta ann a Cpi ELF 10 Cpi OCP 1 0 rinetaC ra G5 rAd re ere fare 10 eur Dm X OX M k AY MCE Adz 4 gt px Oz XP 1 Dp x 1 aa AN ak Adz F see ne Cri 1 3 16 The fourth equation describes the changes in biofilm porosity 30 00 18 Dux Xue EAEE P ee ea A aan 1 6 rt 3 17 a Oz Ade 2 a a ee eo In equation 3 16 0e 7 0t can be calculated with the aid of the temporal derivative of equation 3 8 de F 06 es 1 OX pj 3 18 Ot Ot ra Px Ot The above equations must be combined with the equation dlr ae a 3 19 u UE 3 19 describing the temporal change of the biofilm thickness Lpr In this equation uz is the velocity of the interface layer between biofilm and bulk volume The velocity uz is given by ur up Lr Ude Uat 3 20 where Uge and Uat are the detachment and the attachment velocities of solids at the biofilm surface respectively The detachment velocity Ude can either be given globally as a function of the biofilm thickness Lp the advective velocity at the biofilm surface ur Lr time t surface shear stress Tsurf etc Ude ude Lr ur LF t Tsurf 3 21a or in the case of a diffusive biofilm matrix all Dm x gt 0 individual surface detach ment rate coefficients kde surf x can be given alternatively The latter case results in a detachment velocity of 28 1 gt
5. Unit can be specified The Argument may be any other variable already defined Its value is used to determine where to interpolate the list Standard deviations can either be given as individual standard deviations for all data values or as global Relative Standard Deviations and Absolute Standard Deviations In the latter case the standard deviation of a data value is calculated as the square root of the sum of the square of the absolute standard deviation plus the square of the product of the relative standard deviation times the current value of the variable The absolute standard deviation may not be zero if some data elements of the list are zero As for constant variables the Minimum and Maximum bound the range of legal values These bounds also hold for internal changes during sensitivity analyses The list of data is built by elements consisting of a value of the argument a value of the variable and in case of individual standard deviations the 3 1 VARIABLES 21 Read Data Pairs from a Text File Ea Start Row End Row zero for end of file ooo Column Number of Argument i Column Number of Value 2 0 Coltri somber of Stand Deviation iin V Delete existing data pairs Cancel Figure 3 10 Dialog box for reading data pairs from a text file standard deviation of the value The data pairs are sorted with increasing value of the argument All data pairs have to differ in their
6. allow the user to select how the biofilm matrix should be modelled In a rigid biofilm matrix there is no diffusive mass transport of solids whereas in a diffusive biofilm matrix a small effective diffusion is also allowed for solids in the biofilm matrix This option requires the diffusivities Dm x to be specified as properties of particulate variables as described later in this subsection The treatment of surface detachment of solids from the biofilm can be selected with the aid of the radio buttons individual rate and global velocity If individual rate is selected detachment is calculated with the aid of the substance specific detachment rate coefficient kde surf x This option can only be selected for a diffusive biofilm matrix If this option is selected the detachment velocity uqe is calculated according to the equation 3 21b If a global detachment velocity ude is specified solids are detached from the biofilm according to their relative occurrence at the biofilm surface The edit field Biofilm Area is used to specify the area of the biofilm A as a function of the distance from the substratum z which is accessible by the program variable Space Coordinate Z It is not allowed to use a time dependence or a dependence on state variables for the specification of the biofilm area Some possibilities for this function are A constant surface area A const 3 34a describes a planar biofilm a surface area of the f
7. houw ater Column Figure 3 70 Dialog box for editing initial conditions for a river section compartment Edit Initial Condition Variable Qhour Zone Water Column z Init Cond 3600 Q_inF1 Figure 3 71 Dialog box for editing a single initial condition for a river section compart ment algebraic expression specifying the initial value For each combination of a variable with a zone only one unique initial condition can be specified The list of initial conditions can be edited using the buttons Add Edit and Delete If an initial condition is selected while adding a new initial condition the new initial condition is inserted in the list immediately before the selected initial condition otherwise it is appended to the end of the list of initial conditions This gives the user the possibility to influence the order of the initial conditions the order is irrelevant for the program but it may be convenient for the user to have a certain order The dialog box used for editing a single initial condition is shown in Fig 3 71 In this dialog box the fields Variable and Init Cond allow the user to select a variable and to specify an initial condition The field Zone is inactive because the river section compartment contains only one zone Water Column Initial conditions for any type of variables can be specified but only initial conditions for state variables and for the program va
8. AQUASIM Main Menu File Edit Calc View VF WN I AQUASIM File Menu New Open Close Save Save As Revert to Saved Print About ON DOP WN ll E Exit B Back gt e End of program AQUASIM normal termination 6 2 BATCH VERSION 173 6 2 Batch Version The batch version of AQUASIM is designed for executing demanding calculations on a compute server as batch jobs In contrast to the window and character interface versions of AQUASIM the batch version does not provide full functionality In particular it is not possible to define or edit models The idea of the batch version is to perform one of the following tasks for a model defined with the aid of an interactive program version and stored on an AQUASIM system file e Perform a simulation e Perform a sensitivity analysis e Perform a parameter estimation e Calculate values of y e Calculate results for given parameter sets and given variables e Plot results to a PostScript or Encapsulated PostScript file e List results to a text file On systems for which command line arguments can be specified these jobs can be started with the following command lines aquasimb jobfile aquasimb aquasimb aquasimb aquasimb aquasimb aquasimb aquasimb s logfile loadfile savefile scmdfile a logfile loadfile savefile sensfile e logfile loadfile savefile fitfile c logfile loadfile vcmdfile chifile r logfile load
9. Minimum I auto 10 Maximum V auto fis Tick Pos M auto pooo Tick Dist M ato 5 Cancel Figure 5 5 Dialog box for editing scaling of plot axes As a next item in the dialog box used for the specification of a curve definition shown in Fig 5 4 a Variable must be selected If the type of the curve is Error Contrib or Sensitivity Function a constant variable or a real list variable must be selected as a Parameter The curve can then only be plotted if a sensitivity analysis with this Parameter as an active parameter has been performed This field is inactive if the curve is of the type Value The edit field Calculation Number is used to select a calculation identified by its calculation number specified in one of the dialog boxes shown in Figs 4 5 and 4 17 166 CHAPTER 5 VISUALIZATION OF RESULTS Because calculations for different calculation numbers can be stored in memory simulta neously and because variables and process rates can be made depend on the calculation number with the aid of the program variable Calculation Number curves for the same variable at the same location under different process hypotheses can be compared in the same plot As a next specification a Compartment within which the curve must be evaluated can be seleced This field is inactive if only one compartment is defined If the compartment selected above contains more than one zone a Zone must be selected This field
10. NH4 NH3 nitrogen ss sss SsS Unit oN m 3 Type dynamic volume C surface C equilibrium Rel Accuracy fo 0001 Abs Accuracy 0 0001 Cancel Figure 3 5 Dialog box for editing a state variable variable a state variable needs a unique Name as an identifier A name of a variable consists of a sequence of letters A Z a z digits 0 9 and underline characters _ The first character may not be a digit The following reserved names are not allowed as variable names div mod and or not if then else endif pi sin cos tan asin acos atan sinh cosh tanh deg rad exp log In log10 sign abs sqrt min max To improve documentation of variables a Description and a Unit can be specified There are two main types of state variables The values of dynamic state variables are calculated as solutions to differential equations according to the transport processes determined by the choice of the compartment type and to the transformation rates specified by the user equilibrium state variables are used to describe quantities the transformation processes of which are much faster than those of other variables so that they can always be approximated to take the value corresponding to the current equilibrium state of their transformation processes These equilibrium states depend on the values of the other variables and are given as the solution to algebraic equations provided by the user of the
11. partment an immobile region consists of a sequence of letters A Z a z digits 0 9 and underline characters _ The first character may not be a digit To improve documentation of immobile regions the edit field Description can optionally be used to store comments on specific implementation features of the zone The list box of the dialog box shown in Fig 3 63 shows the division of the immobile region into mixed zones At least one mixed zone is required in order to specify a valid immobile region The list of mixed zones can be edited using the buttons Add Edit and Delete If a mixed zone is selected while adding a new zone the new zone is inserted in the list immediately before the selected zone otherwise it is appended to the end of the list of mixed zones This gives the user the possibility to influence the order of the mixed zones The Fig 3 64 shows the dialog box used for the definition of mixed zone The edit field Zone Index can be used to specify a nonnegative inter number as a zone index This value can be accessed with the aid of the program variable Zone Index to make variables or process rates dependent on the zone in the mobile zone the program variable Zone Index returns zero The edit field Vol Fract is used to specify the volume fraction of the zone Bim Note that the sum of the volume fraction of the mobile zone and all volume fractions of the immobile zones must be smaller tha
12. 112 123 124 friction slope 17 river section compartment 97 growth velocity of biofilm 16 biofilm reactor compartment 58 horizontal velocity 17 lake compartment 100 112 123 124 interface velocity of biofilm 16 biofilm reactor compartment 58 link index 16 advective link 127 128 name 15 perimeter length 16 river section compartment 97 reactor volume 16 biofilm reactor compartment 57 58 mixed reactor compartment 35 37 39 reference 15 shear production of TKE 17 lake compartment 124 space coordinate x 16 advective diffusive reactor compart ment 62 69 river section compartment 89 97 saturated soil column compartment 76 84 space coordinate z 16 biofilm reactor compartment 50 58 lake compartment 109 113 124 surface width 16 river section compartment 97 time 16 advective link 128 advective diffusive reactor compart ment 62 69 biofilm reactor compartment 58 lake compartment 124 mixed reactor compartment 39 river section compartment 97 saturated soil column compartment 76 84 turbulent kinetic energy 17 lake compartment 100 112 123 124 INDEX unit 15 water fraction 16 advective diffusive reactor compart ment 69 biofilm reactor compartment 57 58 lake compartment 124 mixed reactor compartment 39 river section compartment 97 saturated soil column compartment 84 water level elevation 16 river section compartment 89 96 97 zone index 16 advective diffusi
13. A Z a z digits 0 9 and underline characters _ The first character may not be a digit The edit field Comp Index can be used to specify a nonnegative inter number as a compartment index This value can be accessed with the aid of the program variable Compartment Index to make variables or process rates dependent on the compartment To improve documentation of compartments the edit field Description can option ally be used to store comments on specific implementation features of a compartment The buttons Variables Processes Init Cond and Input are used to activate and inactivate state variables to activate and inactivate processes to specify initial conditions and to define inputs to a compartment These options are described later in this subsection The edit fields Start Coord and End Coord are used to define the location of the compartment inlet s and of the compartment outlet e respectively The values of variables are resolved continuously with the space coordinate x between these two locations Although all equations in this subsection are formulated with the x axis pointing in flow direction x lt e the program works also correctly with an x axis defined in the reverse direction gt Te The edit field Cross Sect is used to specify the wetted cross sectional area of the compartment A as a function of the longitudinal spatial coordinate x which is acc
14. Batch Version lt eo i fee ee oe A A he EA 173 6 3 Troubl shooting ie 3 Qo eee eek eo oe AO ew te iis con ae es 176 6 3 1 Problem Self Diagnosis 0 000000008 177 6 3 2 Finding Help in the AQUASIM User Group 187 6 3 3 Reporting Program Bugs and Suggestions for Improvements 188 Chapter 1 Introduction The program AQUASIM was designed for the identification and simulation of aquatic systems in the laboratory in technical plants and in nature This user manual describes the equations solved by this program the methods of systems analysis that are available and program handling An additional document contains a series of extensively documented tutorial examples Reichert 1998 A brief survey on the capabilities of version 1 0 of the program Reichert 1994a as well as a description of program implementation techniques Reichert 1995 can be found in scientific journals Finally there exists an extensive technical report on all aspects of version 1 0 of the program Reichert 1994b Examples of program applications can be found in the following publications Mixed reactor systems Biofilm systems Advective diffusive reactor systems Saturated soil column systems von Schulthess et al 1994 Wild et al 1994 Reichert et al 1995 Siegrist et al 1995 Wild et al 1995 von Schulthess and Gujer 1996 Uehlinger et al 1996 Kuba et al 1996 Murnleitner et al 1997 Novack
15. The buttons of the dialog box allow the user to perform the following operations with variables By clicking the button New new variables can be created from scratch Alternatively by clicking the button Dupli cate the selected varible can be duplicated With the button Edit or by double clicking the variable name in the list box a variable can be edited The type of a variable can be changed by clicking the button Edit Type During this procedure type specific data of the variable gets lost Furthermore by selecting two variables and clicking Exchange it is possible to exchange two variables in all other variables processes compartments links and definitions of sensitivity analyses and parameter estimations where they occur as arguments This feature allows the user to quickly change models without losing data Finally the button Delete allows the program users to delete variables Deletion of a variable is only possible if the variable is not an argument of another variable of a process of a compartment of a link or of a definition of a sensitivity analysis or of a parameter estimation The buttons Duplicate Edit Edit Type Exchange and Delete are inactive 3 1 VARIABLES 13 Edit Yariables New Duplicate Type Formula Variable Figure 3 3 Dialog box for editing variables as long as no variable is selected Clicking the Close button results in closing this dialog box It c
16. are given in order to give the user a quick overview on the improvement that could be achieved by the parameter estimation procedure More details on the performance of the parameter estimation algorithm is given on the file specified after clicking the button Start in the dialog box shown in Fig 4 16 This file looks as follows 2 gt kK 2 K gt FK 2 FK FK FK FK FK FK FK FKK K K K K FK FK FK gt 2 K K K K K FK FK FK FK FK K K K K FK FK gt FK 2 K K K K K FK FK FK FK FKK K K K K FK FK FK FK gt i K K K K 2k K AQUASIM Version 2 0 win mfc Parameter Estimation File aK 2k kK kK K gt K K FK 2 FK FK FK FK FK FKK K K K K FK FK FK FK 2 K K K K K FK FK FK FK FK K K K 2 FK FK FK FK 2 K K K K 2 FK FK FK FK FK K K K K K FK FK 2 FK FK K K K K 2 FK K Date and time of listing 07 29 1997 13 56 09 Number of parameters 5 Number of data points 22 Estimation method secant Parameters Name Unit Start Minimum Maximum Cinil mg l 12 0 20 Cini2 mg l 0 8 0 2 K mg 1 2 0 10 rmax1 mg l h 2 0 10 rmax2 mg l h 2 0 10 4 3 PARAMETER ESTIMATION 159 Calculations Cinil Cini2 K rmax1 rmax2 Chi 2 mg 1 mg 1 mg 1 mg 1 h mg 1 h 12 0 8 2 2 2 1749 41 12 2 0 8 2 2 2 1700 74 12 0 82 2 2 2 1725 51 12 0 8 2 2 2 1656 36 12 0 8 2 2 1 2 1928 34 12 0 8 2 2 2 1 1795 93 11 9411 0 80557 2 3 2 01325 2 01687 1516 94 11 8094 0 82432 2 9 2 06794 2 13019 1191 95 10 1604 1 00113 1 04662 1 04293 0 51529 22 6634 10 1531 1 00421 1 03489 1 03858 0 51
17. increase the upward discharge negative values outflows decrease the upward discharge The second equation describes the behaviour of the horizontal flow velocity 3 85 U 10 OU sien QU 1dA OU 10 oe ae 4G A gee al 3 86 The horizontal flow velocity spreads diffusively first term it is dissipated if diffusive vertial downward transport ends at the sediment second term it follows the advective motion of the water column third term and an arbitrary pressure gradient ry can be specified by the program user fourth term The third equation describes the behaviour of turbulent kinetic energy OM 2 Ot eee 1 A AA eA t Adz Op Oz A dz o Oz 10 ate 1 dA Prottom A Oz A dz p Pint 3 87 Qk P G e In order to derive this equation from the equations 3 74 to 3 77 the gradient of the density p was neglected Turbulent kinetic energy spreads diffusively first term it is 3 3 COMPARTMENTS 105 dissipated if diffusive vertial downward transport ends at the sediment second term it follows the advective motion of the water column third term it is produced by the shear forces of the horizontal flow fourth term it is produced in an unstable water column or consumed in a stable water column by turbulent mixing fifth term it is dissipated sixth term it is produced by bottom friction of seiche oscillations seventh term and it is produced by the shear of seiche oscillations produced wi
18. is the coefficient of turbulent diffusion of substances dissolved or suspended in the water column Pr is the Prandtl number Q is the vertical discharge induced by water in or outflows in the lake depth positive upwards and Wsed i is the sedimentation velocity of the particles X positive downwards Terms of equation 3 75 that contain v or K describe vertical mixing by turbulent diffusion those containing Q describe vertical advection with water flow and the term containing Wsed i vertical movement due to sedimentation There is no vertical flux in the sediment because the z axis describes the vertical coordinate in the lake and not the depth within the sediment The exchange between sediment layers is specified with the aid of source terms as given below The following one dimensional source terms are required to complete the set of lake 3 3 COMPARTMENTS 101 equations q mal 4A Ug 2 dz dz pee dA ApP ApG Ape Ge T bottom ag Appint a 1 sign 2H dA Vt O pk dz ok Oz 1 sign 2E dA Vt O pe Apr es dz oe Oz dA D 0 ae nae CL Csi ae ATC Heer qC tat e qCT 4 enlu aN dA dA S g geai Gy wedi X Li F gz ret sa Arx 20 qX latyi e qX Li dA dA dz e2Cs 4 ER Gy sedi Cs i dA dA Gz Xs T Gy sedi Xs yi 3 77 where au P 3 78 a Z 3 78 is the shear production of turbulent kinetic energy v g Op cad Pp Kamin pog P7 Hh gt Kamin 3
19. s of the column According to equation 3 39 due to the lateral inflow q this results in a discharge of Le Qe Qe fade 3 42 Ts at the end of the compartment The boundary conditions for equation 3 40 are given by the continuity of the sub stance loadings entering the compartment and by a transmission boundary condition Shamir and Harleman 1967 at the end of the compartment OC QC zs AD IF s Iin c 3 43a OC 0 3 43b On where Jinc is the total given mass input of the substance described by the concentration Ci per unit of time The second of these boundary conditions 3 43b is omitted for dispersion free transport User Definitions Figure 3 41 shows the dialog box used for defining or editing an advective diffusive reactor compartment The edit field Name is used to specify the name of the compartment Edit Advective Diffusive Compartment Name PlugFlowReact Comp Index pooo Description o Options Variables Processes Init Cond Input Start Coord jo End Coord 200 Cross Sect Bo Diffusion without diffusion C with diffusion Num Grid Pts 202 Resolution C low high Acc IV active for calculation Cancel Figure 3 41 Dialog box for editing an advective diffusive reactor compartment 62 CHAPTER 3 MODEL FORMULATION Each compartment needs a unique name as an identifier A name of a compartment consists of a sequence of letters
20. transport of substances dissolved or suspended in the water An empirical substance independent diffusion coefficient is used to describe the longitudinal mixing effect due to dispersion In order to formulate the one dimensional conservation laws o 3 56 compartment specific expressions for the one dimensional density amount of conserved quantity per unit compartment length for the one dimensional flux j amount of the conserved quantity transported per unit time and for the one dimensional source term f amount produced per unit compartment length and per unit time must be derived For the case of a river section compartment 3 types of components of a conservation law must be distinguished The array of one dimensional densities of these types of components is given as follows p AC 3 57 The first component of equation 3 57 describes the conservation of water volume within the river water is approximated to be incompressible The one dimensional density of water volume in the river volume per unit length is given by the wetted cross sectional area A of the water body The second component of equation 3 57 describes substances transported with the water flow along the river Their one dimensional densities are given as the product of the cross sectional area A of the water body and the laterally averaged 86 CHAPTER 3 MODEL FORMULATION concentration C The last component of equation 3 57 describes subst
21. 27 39 End of calculation indicates that more time steps are required to reach the next point of output time than was specified as the value of the numerical parameter Maximum Number of Internal Time Steps for One External Time Step in the present example the value of this param eter was set equal to 1000 cf section 3 5 This limitation of the number of internal steps for one external step was made in order to show numerical problems without loosing too much computing time Under usual circumstances the requirement for more than 1000 internal steps for one external step indicates the existence of a numerical problem There are two important exceptions from this general rule If a dynamic simulations starts with a relaxation to an equilibrium state and this is done with one output step only because the relaxation dynamics is not of interest a large number of internal steps may be re quired in order to calculate the single external output step The message shown above may also appear during a parameter estimation for which a simulation could be run without problems This is the case if the temporal distance between data points is much larger than the output interval selected for the simulation For such cases it is necessary to increase the numerical parameter Maximum Number of Internal Time Steps for One External Time Step as discussed in section 3 5 In other cases it may be more appro priate to try to find out why the integration algorithm perf
22. 3 shows the dialog box used for defining or editing a plot definition This Edit Plot Definition x Name Sens1 Description Title Sens Functions for Exp 1 Abscissa Time Space Label time h Ordinate Label delta_ar mg l Curves Type Yariable Par CalcNum Comp Zone Time Space Sens R C Cinil 1 Reactor Bulk Yolume 0 Sens h Clrmax1 1 Reactor Bulk volume 0 Sens R CIK 1 Reactor Bulk Yolume 0 gi Scaling Add Edit Delete _Seaing _ fat __ Delete Cancel Figure 5 3 Dialog box for editing a plot definition dialog box is opened by clicking one of the buttons New Edit or Duplicate of the dialog box shown in Fig 5 2 Each plot definition needs a unique Name as an identifier A name of a plot definition consists of a sequence of letters A Z a z digits 0 9 and underline characters The first character may not be a digit To improve documentation of plot definitions a Description can be given optionally The edit field Title is used to specify the title of the plot The radio buttons Abscissa can be used to select the meaning of the abscissa The user has the choice between the abscissa Time which is used for plotting time series at given locations in the system described with AQUASIM and the absissa Space used for plotting spatial profiles at given points of time this last option is not meaningful for mixed reactors that have no
23. 4 2 Diffusive Link Overview A diffusive link connects two diffusive connections of compartments It is used to model dif fusive mass exchange of substances between compartments through membranes or bound ary layers There is no water flow through a diffusive link Equations Solved by AQUASIM The mass flux of a substance 7 through a diffusive link from compartment 1 to compartment 2 is given by the equation I dex i fiCi 1 Ci2 3 110 where Ci and Cj are the concentrations of substance 7 in the compartment 1 and 2 respectively dex is the exchange coefficient and f is a conversion factor that allows for the description of phase transitions This conversion factor is unity if both compartments 1 and 2 contain the same solvent If compartment 1 is a mixed reactor compartment modelling a gas phase compartment 2 models a water phase the conversion factor is the inverse of the non dimensional Henry coefficient of substance i fi 3 111 In many cases the mass exchange coefficient qez is given as the product of the surface area of the membrane or boundary layer A and a mass transfer coefficient k dex i Aki 3 112 130 CHAPTER 3 MODEL FORMULATION which itself is often given as the ratio of the diffusion on coefficient D of the substance in the boundary layer or membrane and the thickness Ly of the boundary layer or membrane ki DiLm 3 113 Instead of these expressions an empirical exchange coefficient
24. 5 4 3 109 j l respectively The program user is responsible that the sum of the bifurcating water flows which all must be nonnegative does not exceed the water inflow to the link In contrast the bifur cating substance flows may be negative modeling substance input from the bifurcation 3 4 LINKS 127 and the sum of all bifurcating fluxes may be larger than the input flux this leads to a negative input flux to the compartment to which the link is connected in some cases this may be meaningful e g to model the effect of an oxygen saturation deficit User Definitions Figure 3 103 shows the dialog box used for defining or editing an advective link The edit Edit Advective Link x Name Linkse Link Index booo Description a From Compart Reactors F Connection Outflow To Compartt eet Connection a Bifurcations Edit ha Delete Cancel Figure 3 103 Dialog box for editing an advective link field Name is used to specify the name of the link Each link needs a unique name as an identifier A name of a link consists of a sequence of letters A Z a z digits 0 9 and underline characters _ The first character may not be a digit The edit field Link Index can be used to specify a nonnegative number as a link index This value can be accessed with the aid of the program variable Link Index to make variables dependent on the link To improve documentation of links the edit fiel
25. 6 orders of magnitude smaller than typical values of the state variable See section 3 5 for more information on parameters of the numerical algorithms used in AQUASIM 3 1 2 Program Variables Program variables refer to predefined quantities of the modelled system From a math ematical point of view program variables can represent independent variables time or space parameters calculation number compartment index etc or solutions to dif ferential algebraic systems of equations discharge reactor volume etc The idea of program variables is to make the corresponding quantities which anyway are present in model formulation available for use in the system of variables In some cases program variables can also be used to specify initial conditions within compartments cf section 3 3 Besides program variables for time and space coordinates and for compartment spe cific quantities the set of program variables also includes a Calculation Number which allows the user to distinguish different calculations Figure 3 6 shows the dialog box used for defining or editing a program variable As Edit Program Variable Ed Name Eoo Description Times SSSSSO Unit j Sts Reference to Time f Cancel Figure 3 6 Dialog box for editing a program variable each variable a program variable needs a unique Name as an identifier A name of a variable consists of a sequence of letters A Z a z digits 0 9 and underl
26. AQUASIM use are given occasionally at EAWAG A topical overview of AQUASIM related information such as on the most recent program version on references of program applications on planned AQUASIM courses and on known bugs or problems can be found on the EAWAG home page at http www eawag ch 6 3 TROUBLESHOOTING 177 6 3 1 Problem Self Diagnosis In this subsection hints are given for how to find the cause of problems in program use In the first subsection problems of loading AQUASIM system files are discussed in the second subsection problems of editing models and in the third subsection problems during calculations Problems of Loading Files Format of AQUASIM System Files Before discussing possible problems of loading files in this paragraph some explanations to the file format used by AQUASIM are given In order to guarantee compatibility between different operating systems AQUASIM systems are stored as ASCII text files Line breaks guarantee compatibility with file editors and with e mail programs During the loading process all special characters ASCII code below 32 e g line break and carriage return characters are stripped from the file and the file is converted to a simple character stream this is important because line breaks are represented differently on different operating systems AQUASIM items are structured with the aid of curly braces and Text between two successive opening or closing braces is ignored
27. Figs 4 5 and 4 17 Simulation time Identifier for compartments value set in the dialog box shown in Fig 3 78 Identifier for zones within compartments returns 0 in the water column and the value specified in the dialog box 3 98 in the sediment layers Volumetric flow rate Volumetric fraction of water returns a value of 1 Depth coordinate in the compartment Area of water body perpendicular to the flow direction re turns the horizontal area of the lake Density of the water Gradient of the cross sectional area as a function of depth Stability frequency of the water column Velocity of horizontal wind driven flow Turbulent kinetic energy TKE per unit mass of water in the lake Production of TKE due to shear of horizontal velocity Production or loss of TKE due to density differences Dissipation of turbulent kinetic energy Total energy stored in Seiche motion Table 3 9 Program variables available in the lake compartment 3 4 LINKS 125 3 4 Links The compartments introduced in section 3 3 can be connected by links in order to model water and substance exchange between the compartments Two types of links are distin guished e Advective Links are used to describe water flow and advective substance transport from one compartment to another e Diffusive Links model diffusive boundary layers or membranes between com partments which can be diffusively penetrated by certain substances Figure 3 101
28. Figure 5 7 shows the dialog box used to edit the options for plotting in PostScript 168 CHAPTER 5 VISUALIZATION OF RESULTS Edit List to File Options Ed Sign Digits E Separator Tab C Comma C Space cmos Figure 5 8 Dialog box for editing list to file options or Encapsulated PostScript format to a file This dialog box is opened by clicking the button File Opt of the dialog box shown in Fig 5 3 It allows the program user to select the Paper Size and the Orientation and to specify the number of Columns and Rows of plots on the sheet the Margins the Legend Width and the Font Size for the Title the axes Labels the Legend and the tick Numbers Furthermore the user can select to plot in color or black white to use cm or inch as measurement units for distances and to select PostScript or Encapsulated PostScript as the file format PostScript is suited for printing Encapsulated Postscript for including AQUASIM plots in other documents F dyphora Production Iof x Juk oe 2s F300uE im 2 s Deak oe 2 s 23 00uE hn 2s T z T amp T S ea Figure 5 9 Example of a plot window on the screen Figure 5 8 shows the dialog box used to edit the options for listing calculated results corresponding to a plot definition to a text file This dialog box is opened by clicking the 169 button List Opt of
29. In addition it may be advantageous to plot important system variables that do not show correct behaviour and to turn off processes one after the other in order to find out which process caused the problem Then this process can be studied in more detail Problems of Integration Interrupts If the integration algorithm detects a serious problem that cannot be solved by reducing the integration step size and order the integration process is interrupted with the message box shown in Fig 6 3 If this dialog box appears in most cases there will be a message on AQUASIM Ea 3 Problem during dynamic simulation see log file for details Figure 6 3 Example of a dialog box indicating a numerical problem the log file of AQUASIM that may give hints with respect to the nature of the problems 6 3 TROUBLESHOOTING 185 Two types of error should be distinguished Error messages by the integration algorithm DASSL Petzold 1983 which start with the keyword DASSL and error messages by AQUASIM Some examples of such error messages are discussed in the following two subsections DASSL Errors DASSL errors are more difficult to interpret than AQUASIM errors because no specific reference to AQUASIM system definitions can be given The DASSL error message 05 13 1998 15 27 39 Start of calculation 05 13 1998 15 27 39 Integration at time 0 DASSL AT CURRENT T 0 00990773 1000 STEPS DASSL TAKEN ON THIS CALL BEFORE REACHING TOUT 05 13 1998 15
30. Lateral Input Concentration x Variable X Input Conc Figure 3 76 Dialog box for editing a single lateral input to a river section compartment of variables can be specified but only inflow concentrations for dynamic volume state variables are used by the program The reason for allowing to define inflow concentrations for variables of other types is to facilitate the users switching between models with different state variables A user can change a state variable to a variable of another type without the requirement of editing the lists of lateral inflow concentrations of the compartments The button Acc of the dialog box shown in Fig 3 70 is used to specify the numerical accuracies of program variables Fig 3 77 shows the dialog box used for this purpose It allows the user to specify relative and absolute accuracies of the program variables Discharge Q Cross Sectional Area A Water Level elevation zo and for the Dispersion coefficient E in the compartment Good behaviour at the numerical algorithms is usually achieved if the absolute accuracy and the product of the relative accuracy times a typical value of the variable both are 4 to 6 oders of magnitude smaller than typical values of the variable 3 3 COMPARTMENTS Edit Accuracies of Program Variables Ed Discharge Cross Section Water Level Dispersion Rel Accuracy fo o01 Abs Accuracy bo oo Rel Accuracy fo o01 Abs A
31. Selection of Upstream Input in the dialog box shown in Fig 3 72 opens the dialog box shown in Fig 3 73 The edit field Water Inflow of this dialog box is used to specify Edit Upstream Inputs x Water Inflow 3600 Q_inFi1 Loadings Variable Loading C S 3600 0 inAl C Sin C_del02 3600 G_inAil C_del02in i ass a Cancel Figure 3 73 Dialog box for editing upsteam inputs to a river section compartment the discharge of water into the compartment Qin and the list box contains substance loadings lin c into the river section For each variable only one unique upstream input loading can be specified The list of upstream substance loadings can be edited using the buttons Add Edit and Delete If a loading is selected while adding a new loading 3 3 COMPARTMENTS 95 the new lowding is inserted in the list immediately before the selected loading otherwise it is appended to the end of the list of input loadings This gives the user the possibility to influence the order of the loadings the order is irrelevant for the program but it may be convenient for the user to have a certain order Figure 3 74 shows the dialog box used to specify a single upstream loading of a substance In this dialog box the fields Variable Edit Upstream Input Loading Ed Variable cs Loading 3600 G_inR1 C_Sin Cancel Figure 3 74 Dialog box for editing a single upstream input to a river s
32. The appearance of the curve can be specified by Line and Marker attributes The check boxes active are used to turn on and off the lines between data pairs and the markers at the data pairs respectively As described above the data pairs of plots with the abscissa Time are usually determined by the output time steps of the calculation the data pairs of plots with the abscissa Space by the grid points of the compartment If the value of a real list variable with the program variable corresponding to the space coordinate of the compartment as its argument is plotted in a plot with the abscissa Time or if the value of a real list variable with the program variable Time as its argument is plotted in a plot with the abscissa Space instead the data pairs of the real list variable Edit Plot to File Options Ed Paper Size fas2i0n297mm O Orientation Portrait C Landscape Plots Columns 2 Rows a Margins Left a Top fo Right i Bottom i Legend Width 25 Font Size Title fio Labels Ee Legend a Numbers Ee Color color C black white Units om inch File Format postscript C encapsulated postscript 167 Defaults Cancel Figure 5 7 Dialog box for editing plot to file options are used In order to plot the actually used interpolated values that may be different from linear interpolation according to the selection of the Interpolation Method in the dialog box shown in Fig 3 9 a formula vari
33. Wanner O and Gujer W 1986 A multispecies biofilm model Biotechnology amp Bio engineering 28 314 328 Wanner O and Reichert P 1996 Mathematical modelling of mixed culture biofilms Biotechnology amp Bioengineering 49 172 184 Wild D von Schulthess R and Gujer W 1994 Synthesis of denitrification enzymes in activated sludge Modelling with structured biomass Wat Sci Tech 30 6 113 122 Wild D von Schulthess R and Gujer W 1995 Structured modelling of denitrification intermediates Wat Sci Tech 31 2 45 54 Yen B 1973 Open channel flow equations revisited Journal of the Mechanical Engi neering Division ASCE 99 979 1009 194 BIBLIOGRAPHY Yen B 1979 Unsteady flow mathematical modeling techniques In Shen H editor Modeling of Rivers pages 13 1 13 33 John Wiley New York Index about abs file menu 8 formula variable 24 abscissa plot 163 absolute accuracy program variable advective diffusive reactor compart ment 67 biofilm reactor compartment 57 lake compartment 123 mixed reactor compartment 38 river section compartment 96 saturated soil column compartment 84 state variable 14 134 accuracy program variable 132 134 142 advective diffusive reactor compart ment 62 67 biofilm reactor compartment 51 56 lake compartment 110 123 mixed reactor compartment 35 38 river section compartment 91 96 saturated soil column compartme
34. a sequence of smaller steps in order to resolve the time course of the excitation accurately However if no step leads to an evaluation of the input or process rate during the excitation period the algorithm steps over the excitation and fails to model the system correctly In such 3 5 NUMERICAL PARAMETERS 133 situations the numerical parameter Maximum Internal Step Size can be used to bound the internal step size to a value slightly smaller than the duration of the excitation period in order to avoid this problem The second parameter Maximum Integration Order in the dialog box shown in Fig 3 108 makes it possible to bound the order of the temporal discritization scheme By default the integration order is chosen dynamically between one and five in order to optimise the integration efficiency while maintaining the requested integration accuracy see below for how to specify the integration accuracy of state and program variables A smaller maximum integration order leads to smaller time steps required to maintain the integration accuracy For this reason it is usually advisable to leave the value of the numerical parameter Maximum Integration Order at its default value of five The third parameter Number of Codiagonals of the Jacobian Matrix can be used to increase the calculation efficiency for systems with a linear geometry The implicit integration algorithm applied by DASSL Petzold 1983 requires the evaluation of the m
35. adequacy of the model User Interfaces Three versions of the program AQUASIM with different user interfaces are provided The window interface version aquasimw uses the machines own graphical user interface The use of this version is strongly recommended for editing models for defining sensitivity analyses and parameter estimations for specifying plot definitions for performing short calculations and for viewing results The second version is the character interface version aquasimc This version is intended for users having a simple terminal without graphical capabilities It provides all features available in the window interface version except the capability of plotting results directly on the screen listing results and preparing plots for printing however is also possible with this program version The third version is the batch version aquasimb which is designed for submitting long calculations as batch jobs it should be noted that simulations and especially sensitivity analyses and parameter estimations may require much computation time This version allows the user to start a calculation for an AQUASIM system defined with one of the interactive program versions by specifying one simple command line It is also possible to specify a series of AQUASIM jobs on a command file so that the consecutive execution of calculations together with 4 CHAPTER 1 INTRODUCTION listing and plotting results can be combined to a single batch j
36. advective diffusive reactor compartment can be specified by clicking the button Input of the dialog box shown in Fig 3 41 This action opens the dialog box shown in Fig 3 46 In this dialog box the user can select which type of input to edit There exist two different types of inputs to an advective diffusive reactor compartment The radio button Inlet Input can be used to describe water and substance flow at the inlet of the compartment and the radio button Lateral Input makes it possible to specify water and substance inflow along the compartment In the following paragraphs the dialog boxes used to define each of these input types are described 3 3 COMPARTMENTS 65 Edit Initial Conditions Ea Init Conds Variable Initial Condition Figure 3 44 Dialog box for editing initial conditions for an advective diffusive reactor compartment Edit Initial Condition x Variable a Me Zone Water Body z Init Cond Cancel Figure 3 45 Dialog box for editing a single initial condition for an advective diffusive reactor compartment Selection of the radio button Inlet Input in the dialog box shown in Fig 3 46 opens the dialog box shown in Fig 3 47 The edit field Water Inflow of this dialog box is used to specify the discharge of water into the compartment Qin and the list box contains substance loadings jn c into the compartment For each variable only one unique inlet loading can be
37. and Sigg 1997 Glod et al 1997a Musvoto et al 1997 Eisenbeis et al 1997 Peeters et al 1997 Glod et al 1997b Filipe and Daigger 1997 Wanner et al 1994 Janning et al 1995 Horn and Hempel 1995 Wanner et al 1995 Wanner 1996 Wanner and Reichert 1996 Reichert and Wanner 1997 Vrany et al 1997 Horn and Hempel 1997 Mirpuriet al 1997 Arcangeli and Arvin 1997b Arcan geli and Arvin 1997a Sanderson and Stew art 1997 Suci et al 1998 Beaudoin et al 1997 von Gunten et al 1997 Simon et al 1997 Fesch et al 1998b Fesch et al 1998a 2 CHAPTER 1 INTRODUCTION River systems Londong et al 1994 Albrecht et al 1995 Jancarkova et al 1997 Maryns and Bauwens 1997 Lake systems i An updated list of references of AQUASIM applications can be found at the EAWAG home page at http www eawag ch Program Design Comparison of measurements with model calculations is the most important method of testing theories in the natural sciences Most mathematical models of environmental systems consist of a set of nonlinear ordinary or partial differential equations A com puter program which solves these equations numerically is usually required for calculating model predictions Most programs available for this purpose can be put into one of three categories universal simulation software environmental simulation programs and sys tem identification programs Universal simulation
38. and they can only depend on the program variables Calculation Number Time and Space Coordinate Z Input to a lake compartment can be specified by clicking the button Input of the dialog box shown in Fig 3 78 This action opens the dialog box shown in Fig 3 83 In this Select Input Type x C Lateral Input Point Inputs C Sediment Input Cancel Figure 3 83 Dialog box for selecting an type for a lake compartment dialog box the user can select which type of input to edit There exist four different types of inputs to a lake compartment The radio button Surface Input can be used to describe water and substance exchange over the lake surface the radio buttons Lateral Input and Point Input are two alternative ways of describing water and substance in or outflow distributed over the depth of the lake and the radio button Sediment Input is used to describe substance exchange between the sediment layer described by the model and deeper sediment layers In the following paragraphs the dialog boxes used to define each of these input types are described Selection of the radio button Surface Input in the dialog box shown in Fig 3 83 opens the dialog box shown in Fig 3 84 This dialog box contains a list box for defining the substance mass fluxes tsurf c and isurf x accross the lake surface For each variable only one unique surface input flux can be specified The surface input fluxes c
39. appended to the end of the list of inflow concentrations This gives the user the possibility to influence the order of the 3 3 COMPARTMENTS 67 Edit Inlet Input Loading x Variable C2 X Loading jo in C2in Cancel Figure 3 48 Dialog box for editing a single upstream input to an advective diffusive reactor compartment Edit Lateral Inputs x Weater Inflow fo Input Cones Variable Input Concentration Figure 3 49 Dialog box for editing lateral inputs to an advective diffusive reactor com partment inflow concentrations the order is irrelevant for the program but it may be convenient for the user to have a certain order Figure 3 50 shows the dialog box used to specify a single lateral inflow concentration of a dynamic volume state variable In this dialog box the fields Variable and Inflow Conc allow the user to select a variable and specify a lateral inflow concentration Cig A lateral inflow concentration of an advective diffusive reactor compartment may depend on the program variables Discharge and on state variables These variables return the discharge and the current values of state variables in the compartment as a function of the location x Inflow concentrations for any type of variables can be specified but only inflow concentrations for dynamic volume state variables are used by the program The reason for allowing to define inflow concentrations for variables of other types is to facilitat
40. are 4 to 6 orders of magnitude smaller than typical values of the variable Edit Accuracies of Program Variables Ea Discharge Rel Accuracy 0 0001 Abs Accuracy 1e 006 Dispersion Rel Accuracy 1e 006 Abs Accuracy fle 006 Cancel Figure 3 66 Dialog box for editing the accuracies of program variables of a saturated soil column compartment In Table 3 7 the program variables available in a saturated soil column compartment are summarized for a complete overview of all program variables see Table 3 1 on page 17 Calculation Number Identifier for calculations value set in the dialog boxes shown in Figs 4 5 and 4 17 Time Simulation time Compartment Index Identifier for compartments value set in the dialog box shown in Figs 3 53 Zone Index Identifier for zones within compartments returns a value of 0 in the mobile zone and a value set in the dialog box shown in Fig 3 64 in the mixed immobile zones Discharge Volumetric flow rate Water Fraction Volumetric fraction of water returns the value of the poros ity Space Coordinate X Space coordinate along the compartment Cross Sectional Area Area of water body perpendicular to the flow direction advective diffusive compartment saturated soil column compartment river section compartment Table 3 7 Program variables available in the saturated soil column compartment 3 3 COMPARTMENTS 85 3 3 5 River Section Compartment Overview The river se
41. as is of solid matrix volume The first component of equation 3 10 describes the advective and diffusive flow of solids within the biofilm matrix The second component of equation 3 10 describes advection and diffusion of solids suspended in the pore volume of the biofilm The first term of this component describes advection with the water flow produced by growth and decay of organisms in the biofilm matrix Because the organisms consist mainly of water in a growing biofilm the water contained in the organisms moving outward at the velocity up in the solid matrix must be compensated by water flowing through the pore water into the biofilm The first term describes advection of suspended solids with this water flow The second term describes diffusion or Brownian motion of the solids in the pore water The third and fourth terms of the second component describe advection with the water flow induced by diffusion of solids in the solid matrix and in the pore water respectively The third component of equation 3 10 describes advection and diffusion of dissolved substances in the pore volume of the biofilm The terms have the same meaning as those in the second component for suspended solids The last component of equation 3 10 represents the flow of free volume in the biofilm Free volume is transported advectively with velocity ur analogously to the solid matrix but diffusive transport in the solid matix has a reverse effect on free volume 44 CHA
42. compartment in which the comparison takes place In this case no interpolation is performed but the variable to be compared with the real list variable is evaluated at the positions of the data pairs and the differences between the values of the two variables are 20 CHAPTER 3 MODEL FORMULATION Edit Real List Variable x Name 310103 Description temperature profile day 33247 Unit c Argument z k Std Deviat global C individual Rel Std Dev fo Abs Std Dev 0 05 Minimum jo Maximum fi e 009 Argument Value Std Deviation Pairs 19 Replace Interpolation linear spline C smooth I active for sensitivity analysis Smooth widths fi Canoe i Figure 3 9 Dialog box for editing a real list variable summed up according to equation 4 13 using the standard deviations specified for the real list variable Figure 3 9 shows the dialog box used for defining or editing a real list variable As each variable a real list variable needs a unique Name as an identifier A name of a variable consists of a sequence of letters A Z a z digits 0 9 and underline characters The first character may not be a digit The following reserved names are not allowed as variable names div mod and or not if then else endif pi sin cos tan asin acos atan sinh cosh tanh deg rad exp log ln log10 sign abs sqrt min max To improve documentation of variables a Description and a
43. dialog box shown in Fig 3 54 The two list boxes of this dialog box show the active variables and the available variables respectively The button Activate is used to activate available variables selected in the right list box and the button Inactivate is used to inactivate active variables selected in the left list box If an active variable is selected while activating another variable the new active variable is inserted in the list of active variables immediately before the selected variable otherwise it is appended to the end of the list of active variables This gives the user the possibility to influence the order of active variables the order is irrelevant for the program but it may be convenient for the user to have a certain order The list of active variables may contain variables of any type but activation has only an effect to state variables Inactive state variables return a value of zero The reason for allowing other types of variables in the list of active state 3 3 COMPARTMENTS TT Select Active State Variables x Active Variables Available Variables Actyate Inactivate tL Figure 3 54 Dialog box for activating and inactivating state variables in a compartment variables is to facilitate switching between different models that do not contain the same state variables A user can change a state variable to a variable of another type without the requirement of editing the lists of active variable
44. dynamic volume state variables resulting from all advective links connected to the inlet 80 CHAPTER 3 MODEL FORMULATION Edit Inlet Inputs x Water Inflow lin Loadings Variable Loading El Add Edit OK Cancel Figure 3 59 Dialog box for editing inlet inputs to a soil column compartment Edit Inlet Input Loading x Variable v Loading 0 inCin Cancel Figure 3 60 Dialog box for editing a single inlet input to a soil column compartment of the column Input loadings for any type of variables can be specified but only input loadings for dynamic volume state variables are used by the program The reason for allowing to define loadings for variables of other types is to facilitate the users switching between models with different state variables A user can change a state variable to a variable of another type without the requirement ot editing the lists of loadings of the compartments Selection of the radio button Lateral Input in the dialog box shown in Fig 3 58 opens the dialog box shown in Fig 3 61 The edit field Water Inflow of this dialog box is used to specify the discharge of water per unit length into the mobile zone of the column q and the list box contains substance concentrations Cjgt in the inflowing water A positive value of q represents a flow into the column a negative value represents an outflow According to the equations 3 47 and 3 49 the inflow concentrati
45. e fit2 log test_res aqu test_res aqu test2 fit e fit3 log test_res aqu test_res aqu test3 fit s sim log test_res aqu test_res aqu sim cmd p plot log test_res aqu plot cmd executes a parameter estimation based on the AQUASIM system file test aqu restarts this estimation twice then for the fitted parameter values starts a simulation according to the specification given in the simulation command file sim cmd e g for improving the plot resolution and plots the results according to the specifications given in the plot command file plot cmd to PostScript files 176 CHAPTER 6 APPENDIX 6 3 Troubleshooting AQUASIM was developed in the computer and systems sciences department of EAWAG primarily for internal use Since EAWAG is an institution for research and teaching and not a software company it is not possible for us to provide end user support Instead the following possibilities are offered e In this chapter hints are given for self diagnosis and solution of problems section 6 3 1 e A user group is maintained as an e mail list through which questions can be sent to other AQUASIM users In this way AQUASIM users can find help within the user community of AQUASIM section 6 3 2 e Bug reports and suggestions for program improvements are welcome at any time Although there is no technical support on program use we try to fix all bugs and provide bug fixed program versions to licensed program users section 6 3 3 e Courses on
46. end of the list of initial conditions This gives the user the possibility to influence the order of the initial conditions the order is irrelevant for the program but it may be convenient for the user to have a certain order The dialog box used for editing a single initial condition is shown in Fig 3 82 In this dialog box the fields Variable Zone and Init Cond allow the user to select a variable and a zone and to specify an initial condition Note that in the lake compartment the two zones Water Column and Sediment Layer are available Initial conditions for any type of variables can be specified but only initial conditions for state variables and for the program variables Brunt Vaisala Frequency N Horizontal Velocity U Turbulent Kinetic Energy and Energy of Seiche Oscillation are used by the program The reason for allowing to define initial conditions for variables of other types is to facilitate the users switching between models with different state variables A user can change a state variable to a variable of another type without the requirement 3 3 COMPARTMENTS 113 Edit Initial Condition x Vaie E Zone Water Column X Init Cond E 10_910109 AlgwetT oDry Cancel Figure 3 82 Dialog box for editing a single initial conditions for a lake compartment ot editing the lists of initial conditions of the compartments Initial conditions of a lake compartment may not depend on state variables
47. first component of equation 3 45 describes the conservation of water volume within the mobile zone of the soil column water is approximated to be incompressible and the volume of the immobile zones remains constant The one dimensional density of water volume in the mobile zone of the column volume in the mobile zone per unit length of the column is given by the product of the cross sectional area A and the porosity of the mobile zone Ono of the column The second component of equation 3 45 describes dissolved substances in the mobile zone of the saturated soil column Their one dimensional densities are given as the product of the cross sectional area A the porosity of the mobile zone 6 and the laterally averaged concentration in the mobile zone Cmop i The third component of equation 3 45 describes dissolved substances in the mixed zone k of the immobile region j Their one dimensional densities are given as the product of the cross sectional area A the porosity of the zone 6jm and the laterally averaged concentration Cimynsi The two last components of equation 3 45 describe substances sorbed to surfaces in contact with the mobile zone or with the mixed zone k of the immobile region 7 respectively The value of the variable A must be specified as a function of the distance along the compartment x Its value is then accessible by the program variable Cross Sectional Area The variables Cmob and Cim are represented by
48. flow as given below Variable Flux C_NH4 G_tecire C_NH4 NO3 0 recire C_NO3 z Add Edit Delete Cancel Figure 3 104 Dialog box for editing a bifurcation of an advective link The edit field Name is used to specify the name of the bifurcation Each link needs a unique name as an identifier A name of a link consists of a sequence of letters A Z a z digits 0 9 and underline characters _ The first character may not be a digit To improve documentation of links the edit field Description can optionally be used to store comments on specific implementation features of a link The list buttons To Compartment and Connection allow the user to select to which input connection of which compartment the water and substance fluxes of the bifurcation are flowing The field To Compartment can be left blank in which case these fluxes leave the modelled system The bifurcating Water Flow Qpjf can be specified as an algebraic expression of globally available variables the program variables Time Calculation Number and Link Index and of the program variable Discharge which evaluates here to the inflow to the link Flows of substances the concentrations of which are represented by dynamic volume state variables can either be selected to divide with water flow or to be as given below in the list box of mass Fluxes In the first case the mass fluxes of all dynamic vo
49. flow 126 128 connection 127 description 127 equations 126 127 link index 127 name 127 overview 126 state variable 126 128 129 dynamic 126 128 129 volume 126 128 129 substance flow 126 user definitions 127 129 water flow 126 advective diffusive reactor compartment 10 32 59 69 accuracy of program variables 62 67 active for calculation 62 active processes 62 63 active state variables 62 area 59 62 boundary condition 61 compartment index 62 cross section 62 description 62 diffusion coefficient 60 62 68 discharge 60 dispersion coefficient 60 62 end coordinate 62 equations 59 61 initial conditions 62 63 inlet input 64 65 input 62 64 inlet 64 65 lateral 64 66 lateral inflow 60 lateral input 64 66 name 61 number of grid points 62 overview 59 resolution 62 space coordinate x 62 start coordinate 62 state variable 59 62 64 65 67 INDEX dynamic 59 65 67 equilibrium 59 surface 59 volume 59 65 67 user definitions 61 69 applications of AQUASIM 1 aquasim log 8 137 181 183 area advective diffusive reactor compart ment 59 62 biofilm reactor compartment 42 50 lake compartment 99 109 river section compartment 85 89 saturated soil column compartment 71 76 area gradient lake compartment program variable 124 program variable 17 argument real list variable 18 20 variable list variable 22 asin formula variable 24 atan formula variabl
50. integration algorithm gradually increases the size of its time step If then a short term excitation with a duration shorter than the time step occurs the algorithm may hit the excitation or it may step over the excitation In the first case the algorithm recognises the integration problem and it follows the excitation accurately by decreasing the integration step size appropriately In the second case the algorithm steps over the excitation without recognising it and the simulation result becomes erroneous The simplest way of solving this problem is to decrease the value of the maximum internal step size of the integration algorithm to a value smaller than the duration of the excitation as described in section 3 5 If this slows down the integration too much during the smooth behaviour periods an alternative may be to decrease the output time step to a value smaller than one tenth of the duration of the excitation during the excitation only this also leads to better results for the plots and let the output time step to be large during the smooth periods This also works because the size of the internal time step is not allowed to increase to values larger than ten times the output time step b If changes in reaction rates may occur abruptly as a function of a variable calculated by the program e g a calculated concentration a similar problem as described under a may occur The difference of the present problem to the one described above is that
51. is smaller than or equal to zero outflow For each variable only one unique lateral inflow concentration can be specified The list of inflow concentrations can be edited using the buttons Add Edit and Delete If an inflow concentration is selected while adding a new inflow concentration the new inflow concentration is inserted in the list immediately before the selected inflow concentration otherwise it is appended to the end of the list of inflow concentrations This gives the user the possibility to influence the order of the inflow concentrations the order is irrelevant for the program but it may be convenient for the user to have a certain order Figure 3 76 shows the dialog box used to specify a single lateral inflow concentration of a dynamic volume state variable In this dialog box the fields Variable and Inflow Conc allow the user to select a variable and specify a lateral inflow concentration Cjq A lateral inflow concentration of a river section compartment may depend on the program variables Discharge and on state variables These variables return the discharge and the current values of state variables in the compartment as a function of the location x Inflow concentrations for any type 96 CHAPTER 3 MODEL FORMULATION Edit Lateral Inputs x Weater Inflow jo Input Cones Variable Input Concentration Figure 3 75 Dialog box for editing lateral inputs to a river section compartment Edit
52. is inactive if the compartment contains only one zone Edit Plot to Screen Options Ed Window Width Height 400 Margins Left 25 Top 25 Right 25 Bottom 25 Legend Width fo Font Size Title 20 Labels fia Legend fiz Numbers fio I cascade Defaults Cancel Figure 5 6 Dialog box for editing plot to screen options Finally the edit field Time Space is used to complete the specification of when and where to evaluate the curve If the abscissa of the plot is Time a spatial location valid for the compartment selected above must be given here If the check box rel space is ticked relative coordinates between 0 and 1 must be given otherwise absolute spatial locations must be specified The values of the variable of function to be plotted are then linearly interpolated between the values at the neighbouring grid points of the compartment In the case of a mixed reactor compartment the value of this edid field is ignored because there is no spatial resolution If the abscissa of the plot is Space the edit field Time Space is used to specify the time at which the curve is evaluated In this case the check box rel space is ignored points in time must always be given as absolute values The values are linearly interpolated between the neighbouring output time steps specified in one of the dialog boxes shown in Figs 4 5 and 4 17 In the edit field Legend the user can specify a legend entry for the curve
53. is irrelevant for the program but it may be convenient for the user to have a certain order Figure 3 35 shows the dialog box used to specify a single input loading of a substance In this dialog box the fields Variable and Loading allow the user to select Edit Input Loading x Variable Cs v Loading 0 irc_5 in Cancel Figure 3 35 Dialog box for editing a single input loading to a biofilm reactor compartment a variable and to specify a loading linc or Lin x Note that this loading represents a mass per unit of time A loading to a biofilm reactor compartment may depend on the program variables Discharge and on dynamic volume state variables These variables return the discharge and the concentrations of dynamic volume state variables resulting from all advective links connected to the inlet of the reactor Loadings for any type of variables can be specified but only loadings for dynamic volume state variables are used by the program The reason for allowing to define loadings for variables of other types is 3 3 COMPARTMENTS 55 to facilitate the user switching between models with different state variables A user can change a state variable to a variable of another type without the requirement of editing the lists of input loadings of the compartments The button Particulate Variables of the dialog box shown in Fig 3 29 allows the user to specify properties of particulate variables Figure 3 36 shows th
54. kinetic energy by turbulent mixing in the presence of stratification This buoyancy production term is negative for the case of a stable stratification Op 0z lt 0 because mixing increases the potential energy of the water column In contrast during phases of convective mixing 0p 0z gt 0 turbulent kinetic energy is produced The third term of the third component of equation 3 77 describes loss of turbulent kinetic energy by dissipation e The fourth and fifth terms describe production of turbulent kinetic energy by bottom friction Photo and internal shear Pint of seiche oscillations respectively and the last term describes loss of turbulent kinetic energy k at the sediment surface during vertical diffusive downward transport the factor 1 sign d pk dz 2 makes this term only to be effective if turbulent kinetic energy is transported downwards The fourth component of equation 3 77 describes the one dimensional source terms for dissipation of turbulent kinetic energy The first term is a general source term to be defined by the program user The expression for this term for the standard k e model is given as 2 E i 3 83 Te Cl P c3G i with the nondimensional model parameters c1 cz and c3 Rodi 1980 Rodi 1987 Bur chard and Baumert 1995 The second term of the fourth component describes loss of dissipation at the sediment surface during vertical diffusive downward transport the factor 1 sign d pk
55. leading to the minimum of 4 13 In contrast the secant method has more problems with bad starting values and poorly defined minima of y but it leads to much faster end convergence close to a well defined minimum Estimates for the standard errors of the estimated parameters and for the parameter correlation matrix are only calculated by the secant method and only if no parameter estimated is on one of the bounds Pmin i Or Pmaz i Of the parameter Figure 4 16 shows the dialog box used for defining and starting a parameter estimation This dialog box is opened with the Parameter Estimation command in the Calc menu shown in Figure 4 1 The two upper list boxes in this dialog box show the active and the available Pa rameters to be estimated constant variables respectively With the aid of the buttons Activate and Inactivate parameters selected in the right list box can be activated and parameters selected in the left list box can be inactivated this is equivalent to tog 154 CHAPTER 4 SIMULATION AND DATA ANALYSIS Parameter Estimation x Parameters active available Activate activate Calculations active available ft2 7 __ New Activate gi Inactivate z Method secant C simplex Maximum Number of Iterations 100 sa Figure 4 16 Dialog box for editing a parameter estimation gle the check box active for parameter estimation in the dialog box used for editing constant va
56. letters A Z a z digits 0 9 and underline characters _ The first character may not be a digit To improve documentation of calculations the edit field Description can optionally be used to store comments on the purpose of the calculation definition The edit field Cale Number allows the program user to identify a calculation by a nonnegative integer number Variables and thus also processes etc can be made dependent on this calculation number with the aid of the program variable Calculation Number Active calculations must have different values of their calculation numbers Each calculation must be initialized before it can be started In the edit field Initial Time the time at which a calculation is initialized can be specified The user has the choice between two types of the Initial State to be used by the program The default option given made consistent applies the initial state as given by the user a value of zero is the default initial condition for all state variables for which the user did not explicitly specify an initial condition If this initial state violates constraints on boundary conditions or algebraic equations of equilibrium processes the program tries to fulfill these constraints by small modifications to the initial state given by 142 CHAPTER 4 SIMULATION AND DATA ANALYSIS Edit Calculation Definition x Name calc1 Description Simulation for calculation number 1
57. menu Edit chapter 3 the mathematical model and measured data can be entered and edited The menu Calc chapter 4 is used to define and perform simulations sensitivity analyses and parameter estimations Finally the menu View chapter 5 is used to specify plot definitions and to list and plot results The appendix chapter 6 contains additional information specific to the different program versions and some hints for troubleshooting How to Proceed The following procedure is recommended for learning to use the program AQUASIM 1 Read the introduction to this manual chapter 1 to obtain a general idea of program concepts and capabilities 2 Skim over the chapters 2 5 to increase your knowledge of program concepts and to start learning to use the program interface If you plan to work with the character interface version read section 6 1 also 3 Study the tutorial exercises described in a separate document Reichert 1998 and carefully read the corresponding sections of the chapters 2 5 of this user manual if you have problems in understanding the solutions 4 Start using the program as a scientific and or didactic tool It may be helpful to implement the first model by modifying one of the example applications or one of the tutorial system files instead of starting from scratch If problems arise look at section 6 3 for hints on troubleshooting CHAPTER 1 INTRODUCTION Chapter 2 File Handling Fig 2 1
58. of a system of ordinary and or partial differ ential equations and algebraic equations which deterministically describes the behaviour of a given set of important state variables of an aquatic system The differential equations for water flow and substance transport can be selected by the choice of environmental or technical compartments which can be connected by links The source terms of these equations which describe the effect of transformation processes can be freely specified by the user The definition of such transformation processes follows closely the notation of biochemical processes as it is familiar to environmental scientists and engineers The definition of processes compartments and links is done with the aid of variables which represent objects taking a possibly context sensitive numerical value Fig 3 1 visualizes the mutual depedencies between the four subsystems of variables processes compart ments and links It is evident that the variables form the basic subsystem required for Compartments Figure 3 1 Main elements of model structure the formulation of processes compartments and links Processes must be defined before they can be activated in compartments Finally links can be used to connect compart ments that are already defined After a short overview of the four subsystems of the AQUASIM model structure in this chapter the definition of objects of these subsystems is explained in detail sectio
59. of problems during calculations The following listing shows a typical log file written during an interactive simulation of the activated sludge example delivered with AQUASIM and described in section 8 2 of the report on the concepts of AQUASIM Reichert 1994b aK K K 2K 2K 2K 2K 2K FK K 2K FK K 2K FK 2K 2K K FK FK K FK 2 FK K 2 FK FK FK 2 2 FK FK K FK FK 2 FK K FK FK FK K 2 FK K FK K FK FK 2 K 2K FK K 2K K FK FK K FK 2 2 K FK K FK FK K K K K AQUASIM Version 2 0 win mfc Log File 2K K 2k 2k ak ak gt k 2k 2k ak 2k 2k 2K 2A 3k 2k k gt k 2K K 2K 2k 2K 3k 2 2 gt K gt k gt K 2K EK 21 2K gt k 2 2K 2K 2k 3K 3k 2k 2K K gt K K 2K 2 9 2 2k OEE 21 2 2 2 9 gt K 2K K EOE 2k gt K aK Start of Session 05 12 1998 20 58 43 Calculation of consistent initial condition Number of codiagonals considered 1000 Time of initial condition 50 05 12 1998 22 03 04 Start of calculation 05 12 1998 22 03 04 End of calculation Number of equations 50 Number of integers needed for calculation 50 Number of reals needed for calculation 5400 Number of steps taken 0 Number of evaluations of the jacobian 0 Dynamic calculation Number of codiagonals considered 1000 Maximum internal step size 1 05 12 1998 22 03 04 Start of calculation 05 12 1998 22 03 04 Integration at time 50 05 12 1998 22 03 07 Integration at time 49 98 05 12 1998 22 03 08 Integration at time 49 96 05 12 1998 22 03 08 Integration at time 49 94 05 12 1998 22 03 08 Integratio
60. of the conversion program conv1011 which is delivered with AQUASIM in the subdirectory bin Files from AQUASIM 1 1x and from pre releases of AQUASIM 2 0 can then be read by AQUASIM 2 0 however it is not possible to save a system in an older file format with AQUASIM 2 0 Files from newer versions than AQUASIM 2 0 cannot be loaded with AQUASIM 2 0 AQUASIM system files are compatible between all operating systems supported by AQUASIM One problem may occur on the Mac if an AQUASIM system file is transferred to the Mac from another operating system If the file type is not AQU the file is not displayed in the file open dialog box of AQUASIM For this reason after the transfer to the Mac the file type must be set to this value AQUASIM system files created on the Mac automatically obtain this file type This can be done in various ways 178 CHAPTER 6 APPENDIX e The file is moved on the application AQUASIM Typer which is delivered with the Mac distribution of AQUASIM e The file is loaded with the character interface version of the Mac and saved by this program version e The file type is changed to AQU_ with another tool e g with the Mac resource editor After a parameter estimation the estimated standard deviations may become unde fined due to inversion of an ill defined matrix On some operating systems especially on the Mac we did not succeed in finding a function to check for such undefined values If on these systems such
61. order combined with a flux limiter that is used to avoid numerical oscillations 3 6 DELETING CALCULATED STATES 135 3 6 Deleting Calculated States Calculations as described in chapter 4 lead to the storage of calculated states of the user defined system In this section it is described how the user can check which states are currently stored in memory and how selected states can be deleted In the dialog box Delete Calculated States shown in Fig 3 109 which is used to check which states are available and to delete selected states is opened with the Delete States command in the Edit menu Selective deletion of calculated states may be advan Delete Calculated States Ea Calc Numbers States 151 220 Delete Delete Figure 3 109 Dialog box for deleting calculated states tageous to save memory during program operation or disk space if the calculated states are saved together with the system definitions if no calculated states are to be saved it is not necessary to delete them before saving because the user is asked during the saving process if the calculated states are to be saved in addition to the system definitions As an example the user can delete all states with the exception of the last one in order to be able to continue the simulation from a relatively small saved file calculated states may enlarge the file size considerably The left list box of the dialog box shown in Fig 3 109 shows the calcu
62. points is set to ngp the river section is resolved longitudinally into 2 boundary points and ng 2 grid points located in the middle of ngp 2 cells of equal thickness For this division of the x axis the low resolution method applies a simple first order discretization scheme that is very robust but can have significant numerical diffusion The high resolution method uses a second order discretization scheme that applies flux limiters to avoid oscillations of the numerical solutions Reichert 1994b chapter 6 The button Acc is used to specify the numerical accuracies of program variables as described later in this subsection The check box active for calculation can be used to activate or inactivate the compartment from the calculations This check box has the same functionality as the buttons Activate and Inactivate in the dialog box shown in Fig 3 19 As for each compartment the user has to select which state variables are active This is done by clicking the button Variables of the dialog box shown in Fig 3 67 This action opens the dialog box shown in Fig 3 68 The two list boxes of this dialog box show the Select Active State Variables x Active Variables Available Variables C_del02 Inactivate C_del0 in CS C_Sin c_T d Figure 3 68 Dialog box for activating and inactivating state variables in a compartment 92 CHAPTER 3 MODEL FORMULATION active variables and
63. program Dynamic state variables are further divided into dynamic volume state variables and dynamic surface state variables Dynamic volume state variables are used to describe concentrations of substances transported with the water flow and quantified as mass per unit volume of water whereas dynamic surface state variables are used to describe substances which are not transported with the water flow Usually this type of state variables is used to describe substances attached to a surface which are quantified as total mass as mass per unit length or as mass per unit of surface area surface density The distinction into volume and surface variables is not needed for equilibrium state variables The edit fields Rel Accuracy and Abs Accuracy can be used to specify the precision of the numerical calculations The integration algorithm uses the absolute accuracy plus the relative accuracy times the current value as an error criterion 3 1 VARIABLES 15 to control the size of the time step Therefore not both of these accuracies are allowed to be zero but pure absolute or pure relative error criteria are possible It is important to specify reasonable values for these accuracies in order to obtain good behaviour of the integration algorithm Good behaviour of the numerical algorithms is usually achieved if the absolute accuracy and the product of a typical value of the state variable times the relative accuracy both are 4 to
64. section 3 5 AQUASIM Errors In most cases it is easier to find the cause for AQUASIM error messages The following example shows an error message that occurs when in the advective diffusive compartment a negative diffusion coefficient is specified 05 13 1998 15 44 46 Start of calculation ADVCOMP numerical problem Diffusion coefficient is not positive 05 13 1998 15 44 46 End of calculation If the error message is not clear enough it is recommended to read the section of the user manual in which the edit field of the referenced quantity is described 6 3 TROUBLESHOOTING 187 6 3 2 Finding Help in the AQUASIM User Group In order to facilitate communication on program use and application among AQUASIM users an electronic user group is maintained at the EAWAG mail server To join the AQUASIM user group send the mail message subscribe aquasim users lt mail address gt to majordomo eawag ch In the mail message lt mail address gt must be replaced by the mail address that should be added to the user group Because the mail is processed automatically it is very important that the mail message has exactly the format given above and does not include any further comments The text must be given in the body of the message and not as a subject In order to leave the AQUASIM user group send the mail message unsubscribe aquasim users lt mail address gt to majordomo eawag ch Your mail address is then deleted from the user group lis
65. shows the dialog box for editing links This dialog box is opened with the Edit Links New Duplicate Edit Delete im Close mu Type Advective Link Figure 3 101 Dialog box for editing links Links command in the Edit menu shown in Figure 3 2 It is of modeless type in order to facilitate the editing process The names of all links already defined are listed alphabeti cally in the list box of this dialog box The type of the currently selected compartment is indicated at the bottom of this dialog box The buttons of this dialog box allow the user to perform the following operations with links New links may be created directly or old links may be duplicated in both cases the new link needs a new name The data items of a link can be edited Finally it is possible to delete links The buttons Duplicate Edit and Delete are inactive as long as no link is selected Clicking the Close button results in closing this dialog box It can be reopened by choosing the Links command in the Edit menu shown in Fig 3 2 After clicking the button New in the dialog box shown in Fig 3 101 the link type can be selected in the dialog box shown in Fig 3 102 The two types of links shown in this dialog box are described in more detail in the following two subsections 126 CHAPTER 3 MODEL FORMULATION Select Link Type Ed C Diffusive Link Cancel Figure 3 102 Dialog box for selecting the type of a link 3 4 1 Advective Li
66. software is very flexible with regard to model formulation but it is difficult to use especially for non specialists Environmental simulation programs are much easier to handle but they usually implement a specific model selected by the designer of the program This makes their use for the comparison of different models impossible Finally system identification programs provide important tools for model comparison and parameter estimation but the class of models considered in these programs is in most cases restricted to linear or algebraic models and models cannot be formulated in a way familiar to environmental scientists Although the clas sification of simulation programs into these categories is not strict and there are also a few programs that cover tasks belonging to more than one of these categories a univer sal identification and simulation program is not yet available The intention behind the design of the program AQUASIM was to provide a more universal iden tification and simulation tool for a class of aquatic systems important in the environmental sciences An additional important program design criterion was user friendliness which was achieved not only by providing a graphical user interface but also by utilizing a communication language familiar to environmental scientists AQUASIM is extremely flexible in allowing the user to specify transformation processes and in addition to perform simulations for the user specifie
67. spatial variation in state variables The edit fields Label can be used to specify a label for the Abscissa and for the Ordinate respectively A plot definition contains an arbitrary number of definitions of Curves All curve definitions are listed in the list box of the dialog box shown in Fig 5 3 The buttons Add Edit and Delete below this list box are used to edit the list of curve definitions If no 164 CHAPTER 5 VISUALIZATION OF RESULTS curve definition is selected clicking the button Add leads to the insertion of a new curve definition at the end of the list of curve definitions If a curve definition is selected the new curve definition is inserted before the selected curve definition Finally the button Scaling is used to choose options for bounds and ticks of the axes of the plot Figure 5 4 shows the dialog box used for defining or editing a curve definition within a plot This dialog box is opened by clicking one of the buttons Add or Edit of the dialog Edit Curve Definition Ed Type Value C Eror Contribution C Abs bs C RelAbs AbsRel C RelRel Variable C v Parameter Imax Calculation Number Roripertment Aone Bulk Volume Time Space Tl telspace pooo Legend mat tt ss S Line M active Style dashed 7 Width 2 Color oen sis Marker P active Style circle Size fe Color black H Cancel Figure 5 4 Dialog box for edit
68. specified The list of inlet loadings can be edited using the buttons Add Edit and Delete If a loading is selected while adding a new loading the new loading is inserted in the list immediately before the selected loading otherwise it is appended to the end of the list of the loadings This gives the user the possibility to influence the order of the loadings the order is irrelevant for the program but it may be convenient for the user to have a certain order Figure 3 48 shows the dialog box used to specify a single inlet loading of a substance In this dialog box the fields Variable and Loading allow the user to select a variable and specify an inlet loading Ijn c Note that this input loading represents a mass per unit of time An inlet loading to an advective diffusive reactor compartment may depend on the program variables Discharge and on dynamic volume state variables These variables return the discharge and the concentrations of dynamic volume state variables resulting from all advective links connected to the inlet 66 CHAPTER 3 MODEL FORMULATION Select Input Type x Inlet Input Lateral Input Cancel Figure 3 46 Dialog box for selecting an input type for an advective diffusive reactor compartment Edit Inlet Inputs x Water Inflow ain Loadings Variable Loading C1 Qin C1in a C2 Qin C2in zi Add Edit OK Cancel Figure 3 47 Dialog box for editing
69. the Sensitivity Analysis command in the Calc menu shown in Figure 4 1 The two upper two list boxes in this dialog box show the active and the available Parameters constant variables and real list variables respectively With the aid of the buttons Activate and Inactivate parameters selected in the right list box can be 148 CHAPTER 4 SIMULATION AND DATA ANALYSIS Sensitivity Analysis Ed Parameters active available Actwate Ractyate Calculation Definitions active available a New calc2 Duplicate Edit Delete eih Activate Start Figure 4 11 Dialog box for editing a sensitivity analysis activated and parameters selected in the left list box can be inactivated this is equivalent to toggle the check box active for sensitivity analysis in the dialog boxes shown in Figs 3 7 and 3 9 The two lower list boxes show the active and the available Calculations respectively These are the same calculation definitions as are needed to execute simulations as described in section 4 1 The buttons New Duplicate Edit and Delete used for editing calculations have the same functionality as the same buttons described for the dialog box shown in Fig 4 4 in section 4 1 The calculations are edited as described in section 4 1 with the aid of the dialog box shown in Fig 4 5 With the aid of the buttons Activate and Inactivate calculations selected
70. the case of two parameters to be estimated The parameter array leading to the highest value of x is first reflected at the plane defined by the other parameter arrays see Fig 4 14 1 this is a rough guess for the downhill direction If the value of x at this reflected array of parameter values is between the lowest and the highest value of the old simplex this reflected array of parameter values is accepted and replaces the array leading to the highest value of y If the value of x at the reflected parameter array is smaller than the lowest value on the old simplex a new parameter array with an increased step size is calculated see Fig 4 14 2 by an expansion of the simplex If the value of y at this 152 CHAPTER 4 SIMULATION AND DATA ANALYSIS 1 reflection 2 reflection and expansion high high low low 3 contraction in one dimension 4 contraction in all dimensions high high low low Figure 4 14 Basic steps of the simplex algorithm for function minimization illustrated for the case of two parameters The solid line simplex is replaced by one of the hashed simplexes new array of parameter values is smaller than the lowest value on the old simplex it is accepted otherwise the reflected array without expansion is accepted in both cases the new array replaces the array leading to the highest value of x of the old simplex
71. the cometabolic biodegradation of trichloroethylene by toluene oxidizing bacteria in a biofilm system Environmental Science amp Technology 31 3044 3052 Arcangeli J P and Arvin E 1997b Modelling of the growth of a methanotrophic biofilm Water Science and Technology 36 1 199 204 Beaudoin D Bryers J Cunningham A and Peretti S 1997 Mobilization of broad host range plasmid from Pseudomonas putida to established biofilms of Bacillus azoto formans II modeling Biotechnology amp Bioengineering 57 3 280 286 B hrer H and Ambihl H 1975 Die Einleitung von gereinigtem Abwasser in Seen Schweizerische Zeitschrift fur Hydrologie 37 347 369 Burchard H and Baumert H 1995 On the performance of a mixed layer model based on the k e turbulence closure J Geophys Res 100 C5 8523 8540 Chow V 1959 Open channel hydraulics McGraw Hill New York de St Venant M 1871 Th orie du mouvement non permanant des eaux crues des rivi res et l introduction des mar es dans leur lit Comptes Rendus 73 147 154 amp 237 240 Eisenbeis M Bauer Kreisel P and Scholz Muramatsu H 1997 Studies of the dechlo rination of tetrachloroethene to cis 1 2 dichloroethene by dehalospirilium multivorans in biofilms Water Science and Technology 36 1 191 198 Fesch C Lehmann P Haderlein S Hinz C Schwarzenbach R and Fliuhler H 1998a Effect of water content on solute transport in aggr
72. the inflow concentration is irrelvant if q is smaller than or equal to zero outflow For each variable only one unique lateral inflow concentration can be specified The list of inflow concentrations can be edited using the buttons Add Edit and Delete If an inflow concentration is selected while adding a new inflow concentration the new inflow concentration is inserted in the list immediately before the selected inflow concentration otherwise it is appended to the end of the list of inflow concentrations This gives the user the possibility to influence the order of the inflow concentrations the order is irrelevant for the program but it may be convenient for the user to have a certain order Figure 3 87 shows the dialog box used to specify a single lateral inflow concentration of a dynamic volume state variable In this dialog box the fields Variable and Inflow Conc allow the user to select a variable and specify a lateral inflow concentration Cigz A lateral inflow concentration of a lake compartment may depend on the program variables Discharge and on state variables These variables return the discharge and the current values of state variables in the compartment as a function of the depth z Inflow concentrations for any type of variables can be specified but only inflow concentrations for dynamic volume state variables are used by the program The reason for allowing to define inflow concentrations for variabl
73. types is to facilitate the users switching between models with different state variables A user can change a state variable to a variable of another type without the requirement of editing the lists of initial conditions of the compartments Initial conditions of a biofilm reactor compartment may not depend on state variables and they can only depend on the program variables Calculation Number Time and Space Coordinate Z Input to a biofilm reactor compartment can be specified by clicking the button Input of the dialog box shown in Fig 3 29 This action opens the dialog box shown in Fig 3 34 54 CHAPTER 3 MODEL FORMULATION The edit field Water Inflow of this dialog box is used to specify the discharge of water Water Inflow Bian Loadings Variable Loading C_NH4 G_in C_NH4in 02 0 in C_O2in Figure 3 34 Dialog box for editing inputs to a biofilm reactor compartment into the bulk volume of the reactor Qin and the list box contains substance loadings Tin c and Iin x into the bulk volume For each variable only one unique loading can be specified The list of loadings can be edited using the buttons Add Edit and Delete If a loading is selected while adding a new loading the new loading is inserted in the list immediately before the selected loading otherwise it is appended to the end of the list of loadings This gives the user the possibility to influence the order of the loadings the order
74. variable or does not depend on the water level elevation is illegal As an example of a simple river geometry a rectangular channel with slope Sg can be described by the three functions A z 20 zo Sox w 3 67a for the cross sectional area P x zo w 2 z Sox 3 67b for the wetted perimeter and w x zo w 3 67c for the constant water surface width The edit field Frict Slope is used to specify an empirical formula for the non dimensional friction slope The two most widely used expressions for the friction slope are NO f KRB AP R423 A2 558a according to Manning Strickler and f1 3 68b I 89 RA 3 68b according to Darcy Weisbach Chow 1959 Henderson 1966 French 1985 In these equations Ks is the friction coefficient according to Strickler n is the friction coefficient according to Manning A R 3 69 s 3 69 is the hydraulic radius and f is the non dimensional friction factor As a next option in the dialog box shown in Fig 3 67 the user can select how to model Dispersion If the user selects the radio button without dispersion a purely advec tive equation with 0 is solved note however that due to the spatial discretization numerical diffusion can occur If the user selects the radio button with dispersion a positive dispersion coefficient must be specified in the edit field below the radio buttons An estimation of the dispersion coefficient can be calc
75. variable volume Name MUHOS IV active for calculation Acc Cancel Figure 3 21 Dialog box for editing a mixed reactor compartment To improve documentation of compartments the edit field Description can option ally be used to store comments on specific implementation features of a compartment The buttons Variables Processes Init Cond and Input are used to activate and inactivate state variables to activate and inactivate processes to specify initial conditions and to define inputs to a compartment respectively These options are described later in this subsection The next option allows the user to select the reactor type Selection of the radio button constant volume leads to the use of a reactor the volume of which does not change selection of the radio button variable volume leads to a reactor the volume of which is calculated dynamically according to the equation given above The edit field Volume is used to specify the volume of the reactor For a reactor with variable volume the number given here is used as the initital volume at the start time of the simulation unless an initial condition for the program variable Reactor Volume is defined In the latter case this initial condition is used For a reactor with variable volume in the edit field Outflow the outflow of the reactor must be specified the inflow is given in the dialog box opened by clicking the but
76. with TKE If the sediment submodel is turned on its options must be specified in a dialog box appearing after clicking the button Sed Prop Similarly if the submodel for the calculation of turbulent kinetic energy TKE is turned on its options must be specified by clicking the button TKE Prop The dialog boxes for the specification of these submodels are discussed later in this subsection As last options Num Grid Pts Resolution and Acc in the dialog box used for the definition of a lake compartment Fig 3 78 the user can select the number of grid points the discretization order of the numerical algorithm and the accuracies of program variables The number of grid points is used to specify by how many discrete points the continuous z axis is approximated If the number of grid points is set to ngp the depth of the lake is resolved by 2 boundary points and ng 2 grid points located in the middle of ng 2 cells of equal thickness For this division of the z axis the low resolution method applies a simple first order discretization scheme that is very robust but can have significant numerical diffusion The high resolution method uses a second order discretization scheme that applies flux limiters to avoid oscillations of the numerical solutions Reichert 1994b chapter 6 The button Acc is used to specify the numerical accuracies of program variables as described later in this subs
77. 0 31 description 31 equation 31 name 30 equilibrium state variable 14 error bounds of 146 contribution to 146 propagation of 146 error contribution 146 165 plot 161 error propagation 146 exchange coefficient diffusive link 129 131 saturated soil column compartment 82 83 exit file menu 8 exp formula variable 24 expression formula variable 23 file menu 4 7 8 file options 162 168 first order 138 fit target parameter estimation 156 flux limiter 138 format print file 8 long 8 short 8 system file 177 formula variable 10 12 23 25 abs 24 acos 24 asin 24 atan 24 cos 24 cosh 24 deg 24 description 23 exp 24 expression 23 functions 24 25 In 24 202 log 24 log10 24 max 24 min 24 name 23 pi 24 rad 24 sign 24 sin 24 sinh 24 sqrt 25 tan 25 tanh 25 unit 23 free volume growth rate of biofilm reactor compartment 43 friction factor river section compartment 90 friction slope program variable 17 river section compartment 86 90 Darcy Weisbach 90 Manning Strickler 90 program variable 97 Gear integration technique 138 140 gravitational acceleration lake compartment 108 river section compartment 89 growth velocity of biofilm biofilm reactor compartment program variable 58 program variable 16 hardware platforms 4 high resolution 138 horizontal velocity lake compartment 99 103 104 program variable 100 112 123 124 program variab
78. 0 84 compartment index advective diffusive reactor compart ment 62 program variable 62 69 biofilm reactor compartment 49 program variable 49 58 lake compartment 108 program variable 108 124 mixed reactor compartment 34 program variable 34 39 program variable 16 river section compartment 88 program variable 88 97 saturated soil column compartment 75 program variable 75 84 compartment type 10 32 compartments INDEX edit menu 11 computing platforms 4 conductivity lake compartment 109 confined reactor biofilm reactor compartment 48 50 connection advective link 127 constant variable 10 12 17 21 151 active for parameter estimation 17 153 active for sensitivity analysis 17 description 17 maximum 17 minimum 17 name 17 standard deviation 17 unit 17 value 17 constant volume mixed reactor compartment 35 continue simulation 141 conversion factor diffusive link 129 131 saturated soil column compartment 83 correlation coefficients 144 cos formula variable 24 cosh formula variable 24 critical water level river section compartment 91 cross section advective diffusive reactor compart ment 62 lake compartment 109 river section compartment 89 saturated soil column compartment 76 cross sectional area advective diffusive reactor compart ment program variable 62 69 lake compartment program variable 100 124 program variable 16 199 river section compartment prog
79. 20 individual 211 real list variable 20 21 real list variable 18 20 21 relative real list variable 18 20 standard error 144 start parameter estimation 153 154 sensitivity analysis 148 simulation 141 start coordinate advective diffusive reactor compart ment 62 river section compartment 89 saturated soil column compartment 75 start row real list variable 21 state variable 10 12 14 15 absolute accuracy 14 134 accuracy 14 132 134 142 advective link 126 128 129 advective diffusive reactor compart ment 59 62 64 65 67 biofilm reactor compartment 42 49 54 description 14 diffusive link 131 dynamic 14 advective link 126 128 129 advective diffusive reactor compart ment 59 65 67 biofilm reactor compartment 42 49 54 diffusive link 131 lake compartment 100 108 114 116 118 120 mixed reactor compartment 34 38 river section compartment 86 95 saturated soil column compartment 71 79 83 equilibrium 14 advective diffusive reactor compart ment 59 mixed reactor compartment 34 river section compartment 86 saturated soil column compartment 71 lake compartment 100 108 110 112 212 114 116 118 121 mixed reactor compartment 34 38 name 14 relative accuracy 14 134 river section compartment 86 89 91 93 95 saturated soil column compartment 71 75 76 79 81 88 surface 14 advective diffusive reactor compart ment 59 mixed reactor compartment 34 ri
80. 22 production of dissipation 122 resolution 110 resuspension 104 resuspension velocity 121 sediment input 113 117 sediment layer 99 102 105 106 porosity 99 thickness 99 sediment submodel 110 121 sedimentation 103 sedimentation velocity 100 119 seiche oscillation 103 104 shear production of TKE 101 stability frequency 109 110 state variable 100 108 110 112 114 116 118 121 dynamic 100 108 114 116 118 120 volume 100 108 114 116 118 120 surface input 113 surface shear 122 temperature 109 204 thickness sediment layer 121 top coordinate 109 turbulence submodel 110 121 turbulent diffusion coefficient 99 100 109 turbulent kinetic energy 99 103 104 user definitions 108 124 volume flux 121 wind excitation 104 123 zones 98 lateral inflow advective diffusive reactor compart ment 60 lake compartment 103 104 river section compartment 87 saturated soil column compartment 72 lateral input advective diffusive reactor compart ment 64 66 lake compartment 113 114 river section compartment 94 95 saturated soil column compartment 79 80 legend curve 166 line curve 166 linear interpolation real list variable 18 variable list variable 22 link 10 125 131 advective link 10 125 129 diffusive link 10 125 129 131 link index advective link 127 program variable 127 128 diffusive link 130 program variable 16 link type 10 links edit menu 11 liquid
81. 3 94 shows the dialog box used to specify the properties of a particulate variable in a lake The edit fields Edit Particulate Yariable x i ia Density fi e 006 Sed Veloc Jv_sed cmos Figure 3 94 Dialog box for editing a single particulate variable for a lake compartment Variable Density and Sedimentation Velocity allow the user to select a variable and to specify a density px and a sedimentation velocity Wsed i The density px is used in equation 3 82 to calculate the volume flux of particles between the sediment layers A positive sedimentation velocity Wsea describes downward movement According to the differential equations desciribed above this downward movement includes movement through the water column and settling to the sediment if the lake cross sectional area decreases with increasing depth of the lake If for some special purposes a negative sedimentation velocity is used this indicates upward movement In this case an increase of the lake cross sectional area with decreasing depth leads to a dilution of the moving particles Note that properties of particulate variables can be specified for any type of 120 CHAPTER 3 MODEL FORMULATION variables but that only properties of dynamic volume state variables have an effect The larger class of variables is allowed in order to facilitate the users to switch between models with different state variables The button Dissolved Variable
82. 4 11 for all state variables in all zones of all compartments and for all calculations For models with many parameters this ranking is very useful to quickly find out which are the most important parameters influencing the state variables in the different compartments 4 3 PARAMETER ESTIMATION 151 4 3 Parameter Estimation Model parameters represented by constant variables can be estimated by AQUASIM by minimizing the sum of the squares of the weighted deviations between measurements and calculated model results 4 13 Ymeas i yi DP Omeas i In this equation ymeas is the i th measurement Omeas i is its standard deviation y p is the calculated value of the model variable corresponding to the i th measurement and evaluated at the time and location of this measurement p pj Pm are the model parameters and n is the number of data points The measurements Ymeas i for i 1 n must be represented by real list variables with the argument either the program variable Time or the program variable corresponding to the space coordinate of the compartment in which the comparison takes place The standard deviations Omeas can be defined individually for each data point or globally for all data points of each real list variable in the dialog box used for editing real list variables shown in Fig 3 9 The sum 4 13 extends over all data points of all real list variables specified as fit targets as shown below Simulta
83. 681 22 5086 Parameter estimation successfully finished convergence criterion met Cinil Cini2 K rmax1 rmax2 mg 1 mg 1 mg 1 mg 1 h mg 1 h Estimated values of the parameters 10 1531 1 00421 1 03489 1 03858 0 51681 Estimated standard errors of the parameters 0 22133 0 03057 0 27284 0 07084 0 09739 Estimated correlation matrix of the parameters 1 0 17923 0 53889 0 77737 0 52576 0 17923 1 0 34116 0 30991 0 46943 0 53889 0 34117 1 0 92990 0 98009 0 77737 0 30991 0 92990 1 0 901655 0 52576 0 46943 0 98009 0 90166 1 Contribution of data series to Chi 2 Calculation Data Series Chi 2 ini Chi 2 end Fitl Cmeas 1 801 34 12 1706 Fit2 Cmeas2 948 074 10 338 1749 41 22 5086 Number of steps performed 27 Number of simulations performed 39 After the header on this file the number of parameters and the number of data points active for the current parameter estimation and the method selected for the numerical min 160 CHAPTER 4 SIMULATION AND DATA ANALYSIS imization algorithm are indicated Then the file contains a listing of all active parameters with unit start value minimum and maximum Then a listing of the parameter values and of the values of x for all calculations performed during the parameter estimation process is given After this listing the parameter estimates are given If the estimation algorithm was the secant method and no parameter estimate was on the border of its legal range an estim
84. 79 0 else is the buoyancy production or destruction of turbulent kinetic energy buoyancy pro duction and destruction are set to zero if the turbulent diffusion coefficient is very small this avoids negative values of turbulent kinetic energy in a stably stratified lake with no wind forcing ten Cs i is the flux of the dissolved component i into the sediment layer j 102 CHAPTER 3 MODEL FORMULATION given as D 0 7 Cr Cs 4 2 D min 6 0 Pim Ohicg Osii for j 1 2 D min 0 1 9 e aaa lex Cs i hj h 17 jx Dj min 6 95 41 hi thie D min n ea 1 On sea Cs i C8144 for 1 lt j lt Nsea hn z1 hn sed Csa a i Csr cast 2 tsed C for j sed 3 80 assuming the number of layers nseq to be larger than 2 and neglecting advection due to sedimentation and tez Xs is the flux of the particulate component 7 into the sediment layer j given as XL iWsedyi kresX s yi a ae Fool tot 2 a a es 1 sign F yo tot 2 vol tot 2 A vol tot e X for 1 2 1 b S2 sl J sign Fyol tot DE Fyol tot j Xs 1 i 65 1 Sj 1 1 sign Fyot tot j va stot Xs gt 0 1 sign Fyol tot j 1 Fie jtot j 1 Xe 2 S542 1 6 eR groit Pyot tot j 2 2 lez Xs i ee nr X Sja for 1 lt j lt Nsea 1 sign F Pyol tot neea vol tot Nsed 2 Nsed 1 gt UNsea 1 1 sera tot ng ea vol tot nsed i On Snse
85. 8 Dialog box for editing a sediment layer each sediment layer a Zone Index the sediment layer Thickness and the Porosity must be specified The button TKE Prop of the dialog box shown in Fig 3 78 is used to specify the properties of the submodel for the calculation of turbulent kinetic energy The definitions 122 CHAPTER 3 MODEL FORMULATION of this submodel are only relevant if the radio button with TKE is selected Fig 3 99 shows the dialog box used for this purpose The edit field Prandtl Number is used to Edit Lake Turbulent Kinetic Energy Submodel Ea Prantl Number E Sigma TKE fi Sigma Diss fi 3 Minimum Diffusion Coefficient for buoyancy production of TKE fo Surf Shear fo Press Grad 0 Prod Diss c1 P c3 G eps TKE c2 eps 2 TKE Wind Excitat fo Bottom Frict J0 Internal Frict J0 Cancel Figure 3 99 Dialog box for editing the turbulent kinetic energy submodel of a lake com partment define the value of the Prandtl number Pr The numbers Sigma TKE and Sigma Diss are used to define the values of the modification parameters og and ce for diffusion of turbulent kinetic energy and dissipation respectively The edit field Minimum Diffusion Coefficient for buoyancy production of TKE is used to specify the value of K min used in equation 3 79 The edit field Surf Shear is used to specify the shear at the lake surface Tsurf The
86. A name of a compartment consists of a sequence of letters A Z a z digits 0 9 and underline characters _ The first character may not be a digit The edit field Comp Index can be used to specify a nonnegative inter number as a compartment index This value can be accessed with the aid of the program variable Compartment Index to make variables or process rates dependent on the compartment To improve documentation of compartments the edit field Description can option ally be used to store comments on specific implementation features of a compartment 3 3 COMPARTMENTS 89 Edit River Section Compartment Ed Comp Index fo Description DS Options Variables Processes Init Cond Input Grav Accel fi 27e 008 Start Coord jo End Coord o0 Cross Sect hont w_A1 Perimeter hR a Width wR Frict Slope ASMA o PAI Name Dispersion without dispersion with dispersion Method C kinematic diffusive End Level C normal critical given zB Ri del_z Num Grid Pts 27 Resolution low high Acc IV active for calculation Cancel Figure 3 67 Dialog box for editing a river section compartment The buttons Variables Processes Init Cond and Input are used to activate and inactivate state variables to activate and inactivate processes to specify initial conditions and to define inputs to a compartment These options are described later in this subsecti
87. AQUASIM 2 0 User Manual Computer Program for the Identification and Simulation of Aquatic Systems Peter Reichert Swiss Federal Institute for Environmental Science and Technology EAWAG CH 8600 D bendorf Switzerland September 1998 ISBN 3 906484 16 5 Preface The ideas for the realization of the program AQUASIM described in this manual grew from the experiences made in a lot of interdisciplinary studies at the Swiss Federal Institute for Environmental Science and Technology EAWAG CH 8600 Diibendorf Switzerland in which I have been involved It is not possible to mention all persons who contributed with the discussion of their data interpretation and modelling problems to the concepts of this program By far the largest influence to the concepts of this program are due to Oskar Wanner and J rg Ruchti The large number of common data analysis and parameter estimation projects with Oskar Wanner let us recognise the usuefulness of a more universal program than those available at that time Jurg Ruchti raised my interest in object oriented pro gramming and for the programming language C that was used for the implementation The discussions with him significantly improved the design of the program The realization of the program BIOSIM specifically designed for biofilm modelling together with Oskar Wanner and J rg Ruchti had also an important influence on this project AQUASIM includes the functionality of BIOSIM as a speci
88. Add Edit and Delete If an initial condition is selected while adding a new initial condition the new initial condition is inserted in the list immediately before the selected initial condition otherwise it is appended to the end of the list of initial conditions This gives the user the possibility to influence the order of the initial conditions the order is irrelevant for the program but it may be convenient for the user to have a certain order The dialog box used for editing a single initial condition is shown in Fig 3 45 In this dialog box the fields Variable and Init Cond allow the user to select a variable and to specify an initial condition The field Zone is inactive because the advective diffusive reactor compartment contains only one zone Water Body Initial conditions for any type of variables can be specified but only initial conditions for state variables are used by the program The reason for allowing to define initial conditions for variables of other types is to facilitate the users switching between models with different state variables A user can change a state variable to a variable of another type without the requirement ot editing the lists of initial conditions of the compartments Initial conditions of an advective diffusive reactor compartment may not depend on state variables and they can only depend on the program variables Calculation Number Time and Space Coordinate X Input to an
89. Calc Number fi Initial Time jo Initial State given made consistent C steady state Output Steps Step Size Num of Steps Delete ba Status IV active for simulation IV active for sensitivity analysis Cancel Figure 4 5 Dialog box for editing a calculation definition the user This procedure is called to make the initial state consistent With the selection of the alternative option steady state the program tries to find the steady state solution of the user defined model under external parameter values evaluated at the initial time and uses this steady state solution as the initial condition Note however that not all models have a steady state solution and that even if such a solution exists the numeric algorithm used by AQUASIM may fail to find it In such a situation the convergence can be improved by a good choice of initial conditions which are used as starting values for the iterative search process for the steady state solution If this does not help the steady state solution must be found by relaxation i e by executing a dynamic simulation with constant boundary conditions In the list box Output Steps the user can define sequences of time steps that are executed consecutively To do this the Step Size and Number of Steps must be entered in the edit fields below the list box and then one of the buttons Add or Replace must be clicked If no row of the list box is selected Add lead
90. Conds Variable Initial Condition x _AfBulk Volume 2 Aini a m ss gt HiBulk Yolumel x Hini _I Bulk Volume _lini gt _P Bulk Volume _Pini z Add Edit Delete Cancel Variable Aone Buk Volume z IntCond Khi SSCS cows Figure 3 25 Dialog box for editing a single initial condition for a mixed reactor compart ment and the concentrations of dynamic volume state variables resulting from all advective links connected to the inlet of the reactor Loadings for any type of variables can be specified but only loadings for dynamic volume state variables are used by the program The reason for allowing to define loadings for variables of other types is to facilitate the user switching between models with different state variables A user can change a state variable to a variable of another type without the requirement of editing the lists of loadings of the compartments The button Acc of the dialog box shown in Fig 3 21 is used to specify the numerical accuracies of program variables Figure 3 28 shows the dialog box used for this purpose It allows the user to specify relative and absolute accuracies of the program variables Discharge Q and reactor Volume Vp in the compartment Good behaviour of the numerical algorithms is usually achieved if the absolute accuracy and the product of the relative accuracy times a typical value of the variable both are 4 to 6 orders of magnitude s
91. EL FORMULATION is only roughly described with the aid of a mass transfer resistance Wanner and Reichert 1996 The equation for particulate components is given as KL X XLi XBi Ar e 3 28 A similar expression describes the behaviour of the dissolved components Cra Cri he 3 29 Alr V In these equations sz x and sz c are the diffusive resistances for the substances X and C and Xp and Cp are the concentrations in the bulk volume Note that for the case of a resistance of zero a continuity equation for the concentrations in the liquid layer adjacent to the biofilm and in the bulk volume results As a last series of equations the equations for the bulk volume must be given The mass balance for particulate substances in the bulk volume is given as d qg VB XB linx XB iQef I1 x Varx 3 30 where Vg is the bulk volume Iin x is the total input of the substance described by the concentration X into the bulk volume through advective and diffusive links and as specified as input in the compartment definition The mass balance equation for dissolved substances in the bulk volume is given as d q Vee BCB i linc 1 BCBiQes Inc Vere 3 31 where g is the liquid phase volume fraction in the bulk volume the porosity is equal to unity in the bulk volume In AQUASIM two types of reactors are distinguished A confined rreactor has a constant total reactor volume for the biofilm and th
92. Experimental results and numerical simulation Biotechnology and Bioengineering 53 4 363 371 BIBLIOGRAPHY 191 Jancarkova I Larsen T and Gujer W 1997 Distribution of nitrifying bacteria in a shallow stream Water Science and Technology 36 8 9 161 166 Janning K Harremo s P and Nielsen M 1995 Evaluating and modelling the kinetics in a full scale submerged denitrification filter Wat Sci Tech 32 8 115 123 Kuba T Murnleitner E van Loosdrecht M and Heiijnen J 1996 A metabolic model for biological phosphorus removal by denitrifying orgnisms Biotechnology and Bioengineering 52 6 685 695 LeVeque R J 1990 Numerical Methods for Conservation Laws Birkhauser Basel Londong J Borchardt D Firk W Reichert P Stein M and Strotmann U 1994 Nitrit in Fliessgewassern Korrespondenz Abwasser 11 94 2069 2076 Maryns F and Bauwens W 1997 The application fo the activated sludge model no 1 to a river environment Water Science and Technology 36 5 201 208 Mirpuri R Sharp W Villaverde S Jones W Lewandowski Z and Cunningham A 1997 Predictive model for Toluene degradation and microbial phenotypic profiles in flat plate vapor phase bioreactor Journal of Environmental Engineering 6 97 586 592 Murnleitner E Kuba T van Loosdrecht M and Heiijnen J 1997 An integrated metabolic model for the aerobic and denitrifying biological phosphorus remov
93. If the value of x at the reflected point is higher than the highest value at the old simplex a new array of parameter values is constructed by contracting the point with the highest value of x of the old simplex in direction to the other points of the simplex see Fig 4 14 3 If this leads to a value of x that is smaller than the highest value at the old simplex this array is accepted otherwise all arrays of parameter values of the old simplex with exception of that leading to the lowest value of x are contracted in direction to the array leading to the lowest value see Fig 4 14 4 This procedure is repeated until all values of x at the points of the simplex are close enough together in order to fulfill the convergence criterion This unconstrained simplex technique is extended to constrained minimization by the coordinate transformation of the parameters p e G 2pi Pmaz i Prin 4 15 Pmaz i Pmin i shown in Fig 4 15 Application of the unconstrained technique to the parameters p is equivalent to constrained minimization of the parameters p If the unconstrained estimates of the parameters p are found the parameters p can be calculated by the inverse formula 1 arctan p Pi 5 Pmaz i Pmin i Pmaz i T a 4 16 2 T Similarly to the simplex technique described above the secant technique starts with a set of m 1 arrays of parameters But now the secant technique uses the special form of the funct
94. MODEL FORMULATION 3 3 6 Lake Compartment Overview The lake compartment of AQUASIM can be used to describe the stratification of the water column vertical mixing and advection of substances dissolved or suspended in the water column sedimentation and resuspension of particles exchange of dissolved substances between water column and pore water of the top sediment layer advective and diffusive exchange between an arbitrary number of sediment layers and transformation processes in the water column as well as in the sediment layers A one dimensional description is used that averages all variables over horizontal cross sections This limits the applicability of this compartment to situations in which the dimensions of the lake the stratification and the time scales of the investigated processes make a horizontally averaged description reasonable The current version of the lake compartment has no connections to advective or diffusive links so that it can only be used to describe a single lake with given inputs and processes Equations Solved by AQUASIM The lake equations solved by AQUASIM consist of a combination of a conventional advection diffusion equation for the water column Ulrich et al 1995 with a sediment model describing an arbitrary number of sediment layers and with a k e turbulence model Rodi 1980 Rodi 1987 Burchard and Baumert 1995 that has been extended by a sim ple model of energy storage in seiche motion in the lake
95. ORMULATION period with higher numerical resolution this numerical parameter can lead to unwanted interrupts of the integration during the initialization phase In this case the value of this parameter can be increased to avoid this behaviour In most other cases however an interruption of a simulation caused by this parameter is a strong indication for numerical integration problems In addition to the general numerical parameters of the time integration algorithm shown in Fig 3 108 the required integration accuracies of the state variables and of those program variables that are integrated by AQUASIM are additional important numerical parameters as well The integration accuracy of the state variables can be specified in the edit fields Rel Accuracy and Abs Accuracy of the dialog box shown in figure 3 5 In the dialog boxes used for the definition of the compartments see Figs 3 21 3 29 3 41 3 53 3 67 and 3 78 the button Acc allows the program users to specify the integration accuracy of program variables which are integrated in the current compartment see Figs 3 28 3 40 3 51 3 66 3 77 and 3 100 As a last point in the dialog boxes used for editing compartments see Figs 3 29 3 41 3 53 3 67 and 3 78 the Number of Grid Points and the Resolution of the algorithm can be selected by the user Low Resolution corresponds to a first order discretization in space High Resolution corresponds to a discretization of at least second
96. PTER 2 FILE HANDLING the item Revert to Saved is inactive Furthermore as long as a loaded system is not yet modified the items Save and Revert to Saved are inactive AQUASIM system files should not be edited with other programs because such an attempt can result in inconsis tent or unreadable files AQUASIM system files can be transfered between all supported platforms using text ASCII data transfer The file format is also compatible with elec tronic mail mailed system files can directly be opened on any platform together with their mail headers To keep a reasonable file size it is recommended to delete calculated states before saving to an AQUASIM system file that is planned to be included in a mail message The menu item Print Options allows to select the print file format As shown in Fig 2 2 along anda short format can be selected In the long format nearly Edit Print Options Ed File Format long short Cancel Figure 2 2 Dialog box for editing print options all user specifications are listed whereas the short form allows to have a compact listing of the most essential model elements To facilitate program portability the menu item Print to File does not directly print the system definitions but only writes them to a text file the name of which can be specified by the user Such text files have then to be submitted to a printer by the user either directly or after loading them into an editor or a
97. PTER 3 MODEL FORMULATION 3 3 1 Mixed Reactor Compartment Overview This simplest compartment of AQUASIM describes inflow outflow and transformation processes of substances in a completely stirred reactor with constant or variable volume Equations Solved by AQUASIM If the volume is selected to be variable the current volume of the compartment is calculated as the solution to the differential equation dV ae Qin Qout 3 3 where t is time Vg is the reactor volume Qin the volumetric inflow and Qout the volumetric outflow Otherwise the volume remains constant the outflow is then equal to the inflow The temporal change of the concentration of substances dissolved or suspended in the water is given as dC Linc Qin C 3 4 dt Vr Vr ttle j where C is the substance concentration represented by a dynamic volume state variable Iin c is the loading of the substance described by the concentration C into the reactor mass per unit of time and rc is the transformation rate of the substance described by the concentration C This concentration rate is given as the sum of the products of the process rates times the stoichiometric coefficients of the substance described by the concentration C of all processes active in the compartment The temporal change of substances attached to a surface is given by Ts 3 5 where S is the concentration surface density or mass of the attached substance repre sented by a d
98. PTER 3 MODEL FORMULATION The following one dimensional source terms are required to complete the set of biofilm equations Arm x Akde vol x X M i Akat vol X X Pi Arp x Akde wol X XM Akat wol X X Pi Arc Arg 3 13 gt II In these equations r are transformation rates and kdewol x and katwvol x are substance dependent volume detachment and attachment coefficients respectively The terms containing the detachment and attachment coefficients describe exchange of solids between the pore water and the solid matrix of the biofilm Application of the general expression for differential conservation laws 3 6 to the definitions given by the equations 3 7 to 3 13 leads to the following set of 4 differential equations The first equation describes the behaviour of the constituents of the biofilm solid matrix aX us Xm 10 aX us J emo yea ey Gem Dt OR gg T Aor No UR pz TAM x The second equation describes the behaviour of solids suspended in the pore water of the biofilm 3 14 rya a kde vol X Mi Kat vol X Pi I Xk Xp i XPi o ca pAn 55 Me Xps Ot Oz Oz o A PX 0 X 1 a 5 0 1 0 Fae 04ra 1a a5 Pues Diao 3 15 rae PX 0 Le a Dex H xri A PX Oz 0 TEP Pix T Kae vol X X Myi Katwol X X pj The third equation describes the behaviour of substances dissolved in the pore water 3 3 COMPARTMENTS 45 of the biofilm
99. Sti iz S S unconfined Bulk Volume fo co01 Pore Volume liquid phase only with suspended solids Biofilm Matrix rigid C diffusive Surf Detach individual rate global velocity if u_F gt 0 then u_F else 0 endif Biofilm Area fo 1 Rate Porosity fo Num Grid Pts fio Resolution low high Acc IV active for calculation Cancel Figure 3 29 Dialog box for editing a biofilm reactor compartment compartment needs a unique name as an identifier A name of a compartment consists of a sequence of letters A Z a z digits 0 9 and underline characters _ The first character may not be a digit The edit field Comp Index can be used to specify a nonnegative integer number as a compartment index This value can be accessed with the aid of the program variable Compartment Index to make variables or process rates dependent on the compartment To improve documentation of compartments the edit field Description can option ally be used to store comments on specific implementation features of a compartment The buttons Variables Processes Init Cond and Input are used to activate and inactivate state variables to activate and inactivate processes to specify initial conditions and to define inputs to a compartment respectively These options are described later in this subsection The buttons Particulate Variables and Dissolved Variables are used to define properties of d
100. Target Ed Data hd Variable Prod ja Eompatmert eactor 7 Bulk Yolume Time Space jo I relative space Zone Cancel Figure 4 18 Dialog box for editing a fit target opened by clicking one of the buttons Add or Edit of the dialog box shown in Fig 4 17 In the first field Data of this dialog box a data series can be selected This data series is represented by a real list variable with the argument either the program variable Time or the program variable corresponding to the space coordinate of the compartment in which the comparison with the calculated variable takes place 4 3 PARAMETER ESTIMATION 157 The next four fields of the dialog box shown in Fig 4 18 are used to define which calculated value of the model should be compared with the data series specified in the first field In the field Variable a variable must be selected In many cases measured data is compared with values of a state variable of the model but in AQUASIM any variable can be used E g a formula variable can be used for conversion of units for building combinations of state variables e g a sum of state variables that is measured etc In the field Compartment the compartment must be selected in which the variable to be compared with the data has to be evaluated This field is inactive if there exists only one compartment In the field Zone the zone of the compartment must be selected in which the variable
101. The larger class of variables is allowed in order to facilitate the users to switch between models with different state variables 3 3 COMPARTMENTS 121 The button Sed Prop of the dialog box shown in Fig 3 78 is used to specify the properties of the sediment submodel of the lake compartment The definitions of this submodel are only relevant if the radio button with Sediment is selected Fig 3 97 shows the dialog box used for this purpose The edit field Vol Flux is used to specify a Edit Lake Sediment Submodel Ed Vol Flux fo Resusp Yeloc fo Sed Layers Zone Index Thickness Porosity 1 0 01 0 5 Figure 3 97 Dialog box for editing the sediment submodel of a lake compartment volume flux of particles to the sediment This volume flux makes it possible to consider a particle flux to the sediment of particles that are not modelled as state variables In the edit fiels Resusp Veloc a resuspension velocity can be specified The resuspension velocity can be used to model resuspension events The list box Sediment Layers shows the properties of all sediment layers currently defined The sediment layers can be edited with the aid of the buttons Add Edit and Delete below the list box The dialog box shown in Fig 3 98 is used to edit the properties of a single sediment layer For Edit Sediment Layer x Zone Index 2 Thickness jo 05 Porosity 0 5 Cancel Figure 3 9
102. The two types of processes shown in Select Process Type x C Equilibrium Process Cancel Figure 3 15 Dialog box for selecting the type of a process this selection box are described in more detail in the following two sections 3 2 1 Dynamic Processes A clear presentation of dynamic biochemical processes is very important to facilitate users of the program to obtain a survey of the interactions between the components of the system The method of presentation used in AQUASIM was made popular for technical biochemical systems by the report of the IAWQ task group on mathematical modelling for design and operation of biological wastewater treatment Henze et al 1986 It is based on work on chemical reaction engineering Petersen 1965 Dynamic processes describe transformations by their contribution to the temporal rate of change of dynamic state variables Usually a biological or chemical process transforms several substances in fixed stoichiometric proportions Therefore it is advantageous to separate a common factor as a process rate and to describe a process by this rate and by stoichiometric coefficients for all substances involved in the process The contribution of a process to the temporal change of the concentration of a substance is then given as the product of the common process rate and the substance specific stoichiometric coefficient This decomposition of process rates into a common process rate and individual stoi
103. a i fork 1 imjii dez imjp i OC TE Mo O fex imjpi Cimri Ot a E E T Abim rce Clim jx z feximjnsiCimjnss si for 1 lt k lt Nz j iMiki dezimjn i Abiman rc iMjn j T ezimjn iCimin i for k Nz j mij ssi Inz j 3 50 The first row of this equation describes the behaviour of a dissolved substance within the first mixed zone of an immobile region the second row the behaviour in an inner zone and the third row that in an end zone of the immobile region The fourth and fifth equations describe the behaviour of sorbed substances in the mobile zone and the immobile zones respectively OS mobi ape TSmob i 3 51 OSim jp si E a T Sinisi 3 52 The concentrations are only influenced by transformation processes Note that sorption must also be formulated as a transformation process transforming the dissolved species C to the sorbed species S When describing sorbing substances the conventional notation 74 CHAPTER 3 MODEL FORMULATION of C is mass of a substance per unit liquid volume and of S is mass of a substance per unit mass of the solid phase If the concentrations are expressed as mass per unit of total column volume C in zone zo must be converted to 0zoC multiplication of C with the porosity of the zone and S must be converted to Spsouia 1 0 multiplication with the density of the solid phase and with the volume fraction of the solid phase Considering these conversi
104. a list of all initial conditions already Edit Initial Conditions Ea Init Conds Variable Initial Condition QfAdvective Zone 0 in Figure 3 56 Dialog box for editing initial conditions for a saturated soil column compart ment Edit Initial Condition Ed Variable Q z Zone Advective Zone ba Init Cond Oin Cancel Figure 3 57 Dialog box for editing a single initial conditions for a saturated soil column compartment specified Each line of the list box contains the name of a variable followed by the zone of the compartment for which the initial condition is specified in brackets and by the algebraic expression specifying the initial value For each combination of a variable with a zone only one unique initial condition can be specified The list of initial conditions can be edited using the buttons Add Edit and Delete If an initial condition is selected while adding a new initial condition the new initial condition is inserted in the list immediately before the selected initial condition otherwise it is appended to the end of the list of initial conditions This gives the user the possibility to influence the order of 3 3 COMPARTMENTS 79 the initial conditions the order is irrelevant for the program but it may be convenient for the user to have a certain order The dialog box used for editing a single initial condition is shown in Fig 3 57 In this dialog box the fields Variabl
105. able with the name of the real list variable as its algebraic expression may be defined and specified as the variable to be plotted this is in fact the way the data for the plot shown in Fig 3 8 has been generated Several line attributes grouped as Style Width and Color attributes can be used to obtain a clear distinction between plotted curves Similarly for markers Style Size and Color attributes are available Figure 5 5 shows the dialog box used to specify the scaling of the plot This dialog box is opened by clicking the button Scaling of the dialog box shown in Fig 5 3 For both Abscissa and Ordinate a Minimum a Maximum a Tick Po sition and a Tick Distance can either be specified or selected to be automatically determined The possibility of specifying a tick position makes the positions of the ticks independent of the bounds of the axis Figure 5 6 shows the dialog box used to edit the options for plotting to the screen This dialog box is opened by clicking the button Scr Opt of the dialog box shown in Fig 5 3 It allows the program users to specify the Width and the Height of the plot window the width of the Margins and the Legend Width In addition the user can select the Font Size for the plot Title for the axes Labels for the Legend and for the tick Numbers All measurement units are pixels
106. ake surface and the lake bottom The boundary conditions for the equation 3 89 describing the behaviour of dissolved substances in the water colun of the lake are given by the continuity of the fluxes over the boundary oCh i K eB Okdiffi Cri zB Csilen 3 97a z and OCT K 20 isur fC 3 97b where isur fc is the given flux of the dissolved substance i through the lake surface as mass per unit lake surface area and per unit time positive The boundary conditions for the equation 3 90 describing the behaviour of particles in the water column of the lake are given by the continuity of the fluxes over the boundary OX 1 5 Ko zp kresX s 3 98a Oz and XLi K 20 ee 3 98b where isy f x is the given flux of substance X through the lake surface as mass per unit lake surface area and per unit time positive 108 CHAPTER 3 MODEL FORMULATION User Definitions Within a lake compartment two zones the water column and the sediment layer are distinguished Variables and process rates can be made dependent on the zone by using the program variable Zone Index which takes the value 0 in the water column and 1 in the sediment Figure 3 78 shows the dialog box used for defining or editing a lake compartment The Edit Lake Compartment x Name LakeZuerich Comp Index fo Description FO Options Variables Processes Init Cond Input Properties of Particulate Variables Dissolved V
107. al Biotechnology and Bioengineering 54 5 434 450 Musvoto E Wentzel M Loeventhal R and Ekama G 1997 Kinetic based model for mixed weak acid base systems Water SA 23 4 311 322 Nelder J and Mead R 1965 A simplex method for function minimization Computer Journal 7 308 313 Novack B and Sigg L 1997 Dissolution of Fe II hydr oxides by metal EDTA com plexes Geochimica et Cosmochimica Acta 61 5 951 963 Peeters F Kipfer R Hohmann R Hofer M Imboden D Kodenev G and Khozder T 1997 Modeling transport rates in lake Baikal Gas exchange and deep water renewal Environ Sci Technol 31 2973 2982 Petersen E 1965 Chemical Reaction Analysis Prentice Hall Englewood Cliffs New Jersey Petzold L 1983 A description of DASSL A differential algebraic system solver In Stepleman R e editor Scientific Computing pages 65 68 IMACS North Holland Amsterdam Ralston M and Jennrich R 1978 DUD a derivative free algorithm for nonlinear least squares Technometrics 20 1 7 14 Reichert P 1994a AQUASIM A tool for simulation and data analysis of aquatic systems Wat Sci Tech 30 2 21 30 192 BIBLIOGRAPHY Reichert P 1994b Concepts underlying a computer program for the identification and simulation of aquatic systems Schriftenreihe der EAWAG 7 Swiss Federal Institute for Environmental Science and Technology EAWAG CH 8600 D bendorf Switzer la
108. al If the Number of Codiagonals of the Jacobian Matrix is given a too small value the algorithm will fail to converge and the integration is stopped with an error message A value at least equal to the number of equations minus one leads to the use of the full Jacobian matrix It is not dangerous to try to find a good value of this numerical parameter because if convergence is obtained convergence is always to the correct solution even if the Jacobian matrix is not correct this is a very useful property of the Gear algorithm which makes it possible to use the same Jacobian matrix for several time steps and update it only if convergence becomes slow The recommended value for this parameter is twice the number of state and program variables integrated in the compartment for systems with a linear geometry and a value larger than the number of equations for a system with recirculations this leads to the use of the full Jacobian matrix The fourth parameter Maximum Number of Internal Time Steps for One External Time Step is useful for the detection of integration problems In many cases the fact that a huge number of steps is required for one output time step is an indication of an integration problem For this reason this number can be limited in the edit field Maximum Number of Internal Time Steps for One External Time Step If a solution is calculated with a very large output time step for relaxation followed by a 134 CHAPTER 3 MODEL F
109. al case Version 1 0 of the AQUASIM was documented in a technical report that contained information on modeling in general on the selection of program tasks on numerical algo rithms on object oriented implementation concepts and on examples of program applica tion Reichert 1994b The user manual with a brief tutorial was given in the appendix of this report Because of the addition of a new variable type probe variable of several new compartments advective diffusive reactor saturated soil column lake significant extensions of the biofilm reactor compartment and several new features for simulation and batch processing this user manual got out of date In addition a new user interface for the most widely used platform Microsoft Windows made the use of the program more comfortable Because most users are only interested in the use of the program and not in the implementation concepts I decided to write a new user manual and as a sep arate volume a new more attractive tutorial Reichert 1998 In this new user manual the equations solved by the program are given in the same chapter as the program use is described This should facilitate the understanding of what the program does For persons interested in numerical methods or in the implementation concepts the technical report is still the most complete source of information In addition a brief description of the major program features Reichert 1994a and a summary of the implem
110. an be edited using the buttons Add Edit and Delete If an input flux is selected while adding a new input flux the new input flux is inserted in the list immediately before the selected input flux otherwise it is appended to the end of the list of input fluxes This gives the user the possibility to influence the order of the input fluxes the order is irrelevant for 114 CHAPTER 3 MODEL FORMULATION Edit Surface Inputs Ea Input Fluxes Variable Input Flux C O2 y 02 ex C 02 02sat zi Add Edit Delete Cancel Figure 3 84 Dialog box for editing surface inputs to a lake compartment Edit Surface Input Flux x T Input Flux f v_0 2_ex C_02 02sat Cancel Figure 3 85 Dialog box for editing a single surface input to a lake compartment the program but it may be convenient for the user to have a certain order Figure 3 85 shows the dialog box used to specify a single surface input flux of a dynamic volume state variable In this dialog box the fields Variable and Input Flux allow the user to select a variable and to specify a surface input flux tsurf C OY tsurf x Note that this input flux represents a mass flux per unit lake surface area and per unit of time A positive value of a surface flux represents a flux into the lake a negative value a flux out of the lake A surface input flux of a lake compartment may depend on dynamic volume state variables These variables retu
111. an be reopened by clicking the Variables command in the Edit menu shown in Fig 3 2 The variables defined with the subdialogs to the dialog box shown in Fig 3 3 serve as a pool of variables for use in other AQUASIM objects A new variable may depend on any variables already defined circular references are not allowed It is important to define all necessary variables before starting to define an object of one of the other subsystems of processes compartments and links After clicking one of the buttons New or Edit Type in the dialog box shown in Fig 3 3 the variable type can be selected in the dialog box shown in Fig 3 4 The seven types of Select Variable Type x C Constant Variable C Real List Variable Variable List Variable C Formula Variable Probe Variable cmo Figure 3 4 Dialog box for selecting the type of a variable variables shown in this selection box are described in more detail in the following seven subsections 14 CHAPTER 3 MODEL FORMULATION 3 1 1 State Variables State variables describe properties of water or of a surface in contact with water e g tem perature masses or concentrations of dissolved or suspended substances or of substances attached to a surface State variables obtain their meaning indirectly by the processes in which they are involved Figure 3 5 shows the dialog box used for defining or editing a state variable As each Edit State Variable x Name c_NH4 Description
112. an undefined value is saved on the AQUASIM system file AQUASIM is not able to read this value during loading Because the save file format of AQUASIM is a text file such an undefined value can be found with a text editor and can be corrected see comments on the file format above The string indicating an undefined value may depend on the operating system e g NaN 6 3 TROUBLESHOOTING 179 Problems of Editing a Model Errors of two major types can occur during model editing Errors assigned to an edit field of the active dialog box and more general errors of incompatibility of the newly edited structure with the rest of the system definitions Errors assigned to an edit field can usually easily be identified Figure 6 1 shows an example of such an error The error message indicates an error in the edit field Expression mUAQUASIM File Edit Cale View Window Help Dise see safe ae l xj Edit Yariables Duplicate Edit Formula Yariable x Illegal Expression Name fvar3 escription FS Expression fart al2 H OK Figure 6 1 Example of an error assigned to an edit field of the dialog box If this error message occurs it is recommended to first check the existence of all variables used in the edit field and to check the correctness of the algebraic expression In the present case Fig 6 1 as is seen in the dialog box Edit Variables in the background the variable x used in the algebraic expression o
113. ance Figure 3 16 shows the dialog box used for defining or editing a dynamic process As Edit Dynamic Process x Name Description Decay of heterotrophs Rate bH _H Stoichiometry Variable Stoichiometric Coefficient fp D i XB f_p i xP B Add Edit Delete Cancel Figure 3 16 Dialog box for editing a dynamic process each process a dynamic process needs a unique Name as an identifier A name of a process consists of a sequence of letters A Z a z digits 0 9 and underline characters _ The first character may not be a digit To improve documentation of processes a Description can be given optionally The Rate contains the common factor of the transformation rates of all variables involved As shown in Fig 3 17 for each Variable involved in the process an individual Stoichiometric Coefficient given 30 CHAPTER 3 MODEL FORMULATION as an algebraic expression according to the syntax of formula variables cf section 3 1 6 has to be specified The list of stoichiometric coefficients can be edited using the buttons Edit Stoichiometric Coefficient Variable Stoich Coeff Ji B p xP Cancel Figure 3 17 Dialog box for editing a stoichiometric coefficient of a dynamic process Add Edit and Delete The contribution of the process to the transformation rate of a variable is given as the product of the common rate with the individual
114. ances settled to the bottom or sorbed to surfaces of the river bed The value of the variable A must be specified as a function of the distance along the river x and of the elevation of the water level zo Its current value is then generally acces sible by the program variable Cross Sectional Area The variables C are represented by dynamic volume state variables and the variables S are represented by dynamic surface state variables For equilibrium state variables algebraic equations specified as equilibrium processes are solved everywhere along the compartment The one dimensional fluxes of the substances with one dimensional densities as de scribed by equation 3 57 are given as follows Q j gagar 3 58 Ox 0 In this equation Q refers to the volumetric discharge through the compartment and E is the coefficient of longitudinal dispersion Calculation of river hydraulics requires the formulation of the cross sectionally averaged friction force as an empirical function of averaged flow properties Usually instead of the friction force the non dimensional friction slope Sy the ratio of the friction force to the gravity force of the water body is parameterized empirically as a function of wetted cross sectional area wetted perimeter and discharge The discharge Q for the kinematic or the diffusive approximation to the St Venant equations is then given as the solution to one of the following equations respectively zB Qk
115. arguments It is possible to Add Replace and Delete data pairs to Read them from text files tab space or comma delimited missing lines and values as well as text columns allowed and to Write them to text files The radio buttons linear spline and smooth make it possible to select the interpolation technique For each real list variable it can be decided if it is active for sensitivity analysis Fig 3 10 shows the dialog box used for reading data pairs from a text file This dialog box is opened by clicking the button Read in the dialog box shown in Fig 3 9 The user can specify the data area by the Start Row and End Row and by the Column Number of Argument the Column Number of Values and the Column Number of Standard Deviations Standard deviation only if individual standard deviations are selected in the dialog box shown in Fig 3 9 Furthermore the user can choose to Delete existing data pairs or to add the data read from the file to the existing data 3 1 5 Variable List Variables Variable list variables are similar to real list variables but instead of a value another variable is given corresponding to each value of the argument If these variables are variable list variables or real list variables variable list variables can be used for multidimensional interpolation if they are constant variables parameter estimations of time series or o
116. ariables Grav Accel 7 32010 Top Coord fo Bottom Coord 1136 Cross Sect JA_Zuerich Density how Turb Diffusion Ke Zuerich st ss lt lt is sSOSOSCSSSSSC lt Modes C without Sediment with Sediment Sed Prop without TKE with TKE Kere Num Grid Pts 70 Resolution low C high Ace IV active for calculation Cancel Figure 3 78 Dialog box for editing a lake compartment edit field Name is used to specify the name of the compartment Each compartment needs a unique name as an identifier A name of a compartment consists of a sequence of letters A Z a z digits 0 9 and underline characters The first character may not be a digit The edit field Comp Index can be used to specify a nonnegative integer number as a compartment index This value can be accessed with the aid of the program variable Compartment Index to make variables or process rates dependent on the compartment To improve documentation of compartments the edit field Description can option ally be used to store comments on specific implementation features of a compartment The buttons Variables Processes Init Cond and Input are used to activate and inactivate state variables to activate and inactivate processes to specify initial conditions and to define s to a compartment These options are described later in this subsection The buttons Particulate Variables an
117. ate of the standard error and of the parameter correlation matrix is also given Then in addition to the value of x which represents the sum of the deviations for all fit targets the contributions of all fit targets to the final value of x are given individually Finally the number of iterative steps and the number of simulations performed are given Chapter 5 Visualization of Results Fig 5 1 shows the menu View of AQUASIM The item Results of this menu is used EIAQUASIM lawprel File Edit Calc Cle kl Results v Toolbar v Status Bar Figure 5 1 View menu to specify plot definitions to plot results to the screen or in PostScript or Encapsulated PostScript format to a file and to list results to a text file for external postprocessing The item Toolbar is used to activate or hide the AQUASIM toolbar and the item Status Bar is used to activate or hide the status bar of AQUASIM the status bar is not used in the current version of AQUASIM Figure 5 2 shows the dialog box used for editing plot definitions and for plotting and listing results This dialog box is opened with the command Results of the menu View shown in Fig 5 1 The list box in this dialog box contains a list of plot definitions Each of these plot definitions contains general plot specifications such as meaning labels and scaling of axes and a list of curves to be drawn in the plot Each of these curves contains specifications such as th
118. atrix of partial derivatives of the components of the right hand side of the system of ordinary differential equations obtained after spatial discretization with respect to the components of the state vector of the system the so called Jacobian matrix The state vector of the system consists of the sequence of all active state variables and those program variables that are calculated by time integration or as the solution of algebraic equations at all grid points For systems with a linear geometry e g a river the time derivative of a component of the state vector depends only on the components representing other state or program variables at the same or at the neighbouring grid points This leads to a Jacobian matrix in which all elements that are not zero are close to the main diagonal of the matrix The limitation of the number of codiagonals to twice the number of state or program variables at one grid point then increases the efficiency of the algorithm considerably because all elements further away from the main diagonal which are zero are not evaluated by the program It is evident that such a limitation to a banded Jacobian by selecting a small number in the edit field Number of Codiagonals of the Jacobian Matrix leads to problems in the case of recirculation because then the time derivative at the first grid point depends on the values in the last grid point what leads to nonzero elements of the Jacobian matrix far away from its main diagon
119. basin The user can specify the coefficient of vertical turbulent diffusion as a given function of time and space but it is also possible to use a parameterization depending on the stability of the water column and on turbulent kinetic energy and dissipation In this subsection the full set of equations is described However in order to make the use of simpler models easier and faster the sediment submodel and the turbulence submodel can be inactivated independently of each other In order to formulate the one dimensional conservation laws ata 3 73 compartment specific expressions for the one dimensional density 6 amount of conserved quantity per unit compartment length for the one dimensional flux j amount of the conserved quantity transported per unit time and for the one dimensional source term f amount produced per unit compartment length and per unit time must be derived Several zones are distinguished in the lake compartment one zone for the water column and one zone for each sediment layer Variables present in all zones are distinguished by the index L for the lake water column and the index S for the sediment layer j The vertical dimension of the lake is resolved by the space coordinate z In the following the lake equations are formulated with the z axis pointing upwards however the program runs with both definitions of the direction of the z axis In order to formulate the lake equations 8 types of components o
120. bing a strategy of weir regulation AQUASIM provides the options to select a normal zo n or a critical zo c end water level These water levels are given as the solutions to the following algebraic equations zon Sp Ozp Oxr 3 65a Qw Z0 C JA 3 65b The equation 3 65a describes the water level as used in the kinematic approximation to the St Venant equations This water level is also approached in the diffusive case with a prismatic river bed at distances far away from hydraulic controls This boundary condition can be used if the calculation ends within a uniform reach where the water level is not influenced by hydraulic structures The critical depth is a boundary condition reasonable at drops The boundary conditions for equation 3 62 are given by the continuity of the sub stance mass flows entering the river section and by a transmission boundary condition Shamir and Harleman 1967 at the end of the compartment ac Q x5 C AE Aa Inc 3 66a PC ar O 3 66b where Jin c is the total given mass input of substance described by the concentration Ci per unit of time The second of these boundary conditions 3 66b is omitted for dispersion free transport User Definitions Figure 3 67 shows the dialog box used for defining or editing a river section compartment The edit field Name is used to specify the name of the compartment Each compartment needs a unique name as an identifier
121. c ing variable step variable order Gear integration technique Gear 1971b Gear 1971a Gear 1971c Spatial discretization of partial differential equations is done using conservative finite difference schemes LeVeque 1990 The differential conservation laws 3 6 3 35 3 44 3 56 and 3 73 Op OF Es ee de 4 1 a Oz tt en are discretized as cn _ __ Inum i41 2 umiyat Zit 4 2 dt Li41 2 Li 1 2 eit using the division of the spatial coordinate axis in grid points as shown in Fig 4 2 The user cell 1 cell 2 celli 2 celli 1 celli cell n 2 lt gt gt lt gt lt gt lt gt lt gt cele jojojo jee xX X X3 Xi 1 f Xi f Xiri Xn 1 Xn Xi 1 2 Xi 1 2 Figure 4 2 Division of the spatial coordinate axis in cells and grid points for spatial discretization of partial differential equations note that the number of cells is equal to the number of grid points minus 2 and that the grid spacing is smaller at the boundaries n is the number of grid points specified in the dialog boxes shown in Figs 3 29 3 41 3 53 3 67 and 3 78 has the choice between a low resolution first order and a high resolution second order with flux limiter numerical flux jrum For the high resolution flux the van Leer flux limiter is applied van Leer 1974 Sweby 1984 LeVeque 1990 Because time integration uses a high order discretization numerical diffusion for the first order technique can be estimated to be vAL
122. cal meaning Note that it depends on the compartment or link type which program variables are defined Program variables always return current values of the corresponding physical quantity as a function of simulation time and space coordinate within a compartment Calculation Number Identifier for calculations all compartments and links value set in the dialog boxes shown in Figs 4 5 and 4 17 Time Simulation time all compartments and links Compartment Index Identifier for compartments all compartments value set in the dialog boxes shown in Figs 3 21 3 29 3 41 3 53 3 67 and 3 78 Zone Index Identifier for zones within compartments all compartments cf section 3 3 for a description of possible values Link Index Identifier for links all links Discharge Volumetric flow rate all compartments advective link Water Fraction Volumetric fraction of water all compartments in some com partments always equal to 1 Space Coordinate X Space coordinate along the compartment advective diffusive reactor compartment saturated soil column compartment river section compartment Space Coordinate Z Depth coordinate in the compartment biofilm reactor com partment lake compartment Reactor Volume Total volume of the reactor mixed reactor compartment biofilm reactor compartment Bulk Volume Volume of mixed water zone mixed reactor compartment biofilm reactor compartment Biofilm Thickness Thickness of the biofilm b
123. can be used User Definitions Figure 3 106 shows the dialog box used for defining or editing a diffusive link Edit Diffusive Link x Name Membrane Link Index ooo Description Silicone tube 4 mm in diameter 0000 Comp 1 Tubing ss Gonnecton Buk Volume z Comp 2 Reactor vj Connection Biofim Base Ex Coeff Variable Exchange Coefficient Conversion Factor 1 C xYL Ak MxYL 17H XL C 02 A k M02 1 H 02 l Add Edit Delete Cancel Figure 3 106 Dialog box for editing a diffusive link The edit field Name is used to specify the name of the link Each link needs a unique name as an identifier A name of a link consists of a sequence of letters A Z a z digits 0 9 and underline characters _ The first character may not be a digit The edit field Link Index can be used to specify a nonnegative number as a link index This value can be accessed with the aid of the program variable Link Index to make variables dependent on the link To improve documentation of links the edit field Description can optionally be used to store comments on specific implementation features of a link The list buttons Compartment 1 and Compartment 2 allow the user to select the two compartments to be linked diffusively If a selected compartment has more than one diffusive connection the list button Connection can be used to select one of these An arbitrary number of d
124. ccuracy po 8 0St Rel Accuracy fo Abs Accuracy fe006 o Rel Accuracy 1e 006 Abs Accuracy le006 97 Cancel Figure 3 77 Dialog box for editing the accuracies of program variables of a river section compartment In Table 3 8 the program variables available in a river section compartment are sum marized for a complete overview of all program variables see Table 3 1 on page 17 Calculation Number Time Compartment Index Zone Index Discharge Water Fraction Space Coordinate X Water Level Elevation Cross Sectional Area Perimeter Length Surface Width Friction Slope Identifier for calculations value set in the dialog boxes shown in Figs 4 5 and 4 17 Simulation time Identifier for compartments value set in the dialog box shown in Fig 3 67 Identifier for zones within compartments returns a value of 0 Volumetric flow rate Volumetric fraction of water returns a value of 1 Space coordinate along the compartment Elevation of water level above an absolute reference level Area of water body perpendicular to the flow direction Length of the interface between water and the river bed per pendicular to the flow velocity Length of the interface between water and the atmosphere perpendicular to the flow velocity Nondimensional friction force Friction force divided by grav ity force Table 3 8 Program variables available in the river section compartment 98 CHAPTER 3
125. chiometric coefficients is not unique to make it unique one of the stoichiometric coefficients is usually set to unity Physical processes or transfer processes which due to spatial averaging also have the mathematical form of a source term of the differential equation can be integrated easily into this general scheme The notion of a stoichiometric coefficient has then a more general meaning and can include geometric factors as well With this concept the total transformation rate of a substance s is given by S iT 3 1 i 3 2 PROCESSES 29 where r ML T is the total transformation rate of the substance sj vij is the stoichiometric coefficient of the substance sj for the process p and rp ML T is the rate of the process p A clear presentation of a process model is given by writing the stoichiometric matrix v j supplemented by the process rates p in an additional column This results in a process matrix as shown in Table 3 3 The nonzero elements of a row of Process Substances Table 3 3 Representation of a process model with the aid of a process matrix such a matrix show which substances are affected by a given process whereas the nonzero elements of a column indicate which processes have an influence to a given substance It is a useful convention to use positive process rates In this case the signs of the stoichiometric coefficients indicate consumption or production of the corresponding subst
126. ction compartment of AQUASIM can be used to describe river hydraulics advective dispersive transport of substances dissolved or suspended in the water column exchange of substances between the water column and the sediment and transformation processes of substances in the water column or the sediment in a river section without abrupt hydraulic controls In the presence of significant hydraulic structures or tributaries several river sections can be linked advectively to model the river reach of interest The description of the river section is one dimensional This means that all variables are averaged over the river cross section and the depth of the sediment is not resolved Such a description is in many cases adequate when the main interest is to model transformation processes over relatively long distances but it makes the application of the river section compartment to local mixing phenomena impossible Equations Solved by AQUASIM One dimensional river hydraulics can be described by a set of two partial differential equa tions representing a mass and a momentum balance de St Venant 1871 Chow 1959 Henderson 1966 Yen 1973 Yen 1979 French 1985 The two most important approxi mations to these so called St Venant equations the kinematic and diffusive wave approx imations Yen 1979 are implemented in AQUASIM to describe river hydraulics The equations for river hydraulics are coupled with advection diffusion equations to describe
127. ctors In this dialog box the fields Edit Exchange Parameters x Variable G Me Exch Coeff Jaex_05 Cony Fact fi Cancel Figure 3 65 Dialog box for editing an exchange coefficient of a mixed zone of a soil column compartment Variable Exch Coeff and Conv Fact allow the user to select a variable and specify an exchange coefficient dex im i and a conversion factor fex im i Exchange coefficients for any type of variables can be specified but only exchange coefficients for dynamic volume state variables are used by the program The reason for allowing to define inflow concentrations for variables of other types is to facilitate the users switching between models with different state variables A user can change a state variable to a variable of another type without the requirement of editing the lists of lateral inflow concentrations of the compartments The button Acc of the dialog box shown in Fig 3 53 is used to specify the numerical accuracies of program variables Fig 3 66 shows the dialog box used for this purpose 84 CHAPTER 3 MODEL FORMULATION It allows the user to specify relative and absolute accuracies of the program variable Discharge Q and of the Dispersion coefficient E in the compartment Good behaviour of the numerical algorithms is usually achieved if the absolute accuracy and the product of the relative accuracy times a typical value of the variable both
128. d Description can optionally be used to store comments on specific implementation features of a link The list button From Compartment allows the user to select the compartment from which the advective fluxes feed into the link If the selected compartment has more than one advective output connection the list button Connection to the right of the list button From Compartment allows the user to select the connection Because the outflow from the connection of the compartment selected here determines water and substance fluxes into the link a compartment must be selected with the aid of the list button From Compartment The list buttons To Compartment and Connection to the right of the list button To Compartment allow the user to select to which input connection of which compartment the water and substance fluxes not bifurcating at the link are flowing The field To Compartment can be left blank in which case these fluxes leave the modelled system The list box Bifurcations contains the names of all bifurcations that have been defined for the link These bifurcations can be edited using the buttons Add Edit and Delete 128 CHAPTER 3 MODEL FORMULATION The dialog box used for editing a bifurcation is shown in Figure 3 104 Edit Bifurcation Ed Name Recirc Description ee To Compatt Reactol DGnnecton finfiow Water Flow Qese ti i i O O OOOO Fluxes with water
129. d Dissolved Variables are used to define properties of dissolved or particulate substances for dynamic volume state variables These options are also described later in this subsection The edit field Grav Acceleration is used to specify the value of the gravitational acceleration g in the units as used by the user of the program Typical values of the 3 3 COMPARTMENTS 109 gravitational acceleration are 9 81m s 1 27 108m h or 7 32 10 m d The gravitational acceleration is required in order to calculate the stability or Brunt Vaisala frequency N defined by equation 3 99 below The edit fields Top Coord and Bottom Coord are used to define the location of the water surface zo and of the deepest point of the lake zg respectively Although all equations in this subsection are formulated with the z axis pointing upwards zo gt zp the program works also correctly with a reverse z axis z lt zg Both of these locations z and zp are fixed numbers It is not possible to describe varying water levels or changes in volume due to sedimentation with the current version of the lake compartment of AQUASIM The edit field Cross Sect is used to specify the cross sectional area of the lake A as a function of the vertical coordinate z which is accessible by the program variable Space Coordinate Z For most applications to real systems the cross sectional area A will be defined as a real list variable wit
130. d sed Pyol tot nsea Xs i 1 Onsa sed 1 sign Fyol ek Hut Fyol tot seat 1 a On seat La tot N ged js for 7 Nsed 3 81 Xn oo4 a with the total volume flux of particles from layer j 1 to layer j Fyot tot j layer 0 corre sponds to the water column layer nseq 1 to the sediment below the modelled sediment layers where the particle concentrations are assumed to be equal to those in the sediment layer nsed given as XL iWsed i Fyoi tot 1 5 1 t Fyot 1 61 hres 3 82a 7 PX 3 3 COMPARTMENTS 103 Xs yt Fyol tot j 1 Fyol tot j hsed j 3 82b l PX The first component of equation 3 77 describes the lateral water inflow as volume per unit lake depth q The second component of equation 3 77 describes the loss of horizontal velocity U at the sediment surface during vertical diffusive downward transport the factor 1 sign dU dz 2 makes this term only to be effective if velocity is transported downwards and it includes a user defined source term ry for velocity that can be interpreted as a pressure gradient per unit of water mass The third component of equation 3 77 describes the one dimensional source terms for turbulent kinetic energy The first term describes production of turbulent kinetic energy by the shear forces induced by a gradient of the wind driven horizontal velocity U The second term describes production or consumption of turbulent
131. d model it provides elementary methods for parameter identifiability analysis for parameter estimation and for uncertainty analysis Version 1 0 of AQUASIM was developed in the years 1991 1994 in the Computer and Systems Sciences department of the Swiss Federal Institute for Environmental Science and Technology EAWAG CH 8600 D bendorf Switzerland and it is maintained and extended since then The program was designed mainly for internal use in research and teaching but is also available to the public Information on the newest developments of AQUASIM can be found at the EAWAG home page at http www eawag ch Program Tasks AQUASIM is a program for the identification and simulation of aquatic systems It per forms the four tasks of e simulation e identifiability analysis e parameter estimation e uncertainty analysis Due to the similarity of the mathematical techniques involved identifiability and uncer tainty analyses are combined to yield sensitivity analysis The first task of AQUASIM is to allow the user to perform model simulations By comparing calculated results with measured data such simulations reveal whether certain model assumptions are compatible with measured data The existence of systematic devi ations between calculations and measurements provides a hint that additional important processes may have to be considered or corrections must be made in the way processes are formulated AQUASIM allows the user to c
132. dary points and ngp 2 grid points located in the middle of ng 2 cells of equal thickness For this division of the a axis the low resolution method applies a simple first order discretization scheme that is very robust but can have significant numerical diffusion The high resolution method uses a second order discretization scheme that applies flux limiters to avoid oscillations of the numerical solutions Reichert 1994b chapter 6 The button Acc is used to specify the numerical accuracies of program variables as described later in this subsection The check box active for calculation can be used to activate or inactivate the compartment from the calculations This check box has the same functionality as the buttons Activate and Inactivate in the dialog box shown in Fig 3 19 As for each compartment the user has to select which state variables are active This is done by clicking the button Variables of the dialog box shown in Fig 3 41 This action 3 3 COMPARTMENTS 63 opens the dialog box shown in Fig 3 42 The two list boxes of this dialog box show the Select Active State Variables x Active Variables Available Variables Achyate Inactivate Cancel Figure 3 42 Dialog box for activating and inactivating state variables in a compartment active variables and the available variables respectively The button Activate is used to activate available variables selected in
133. description 163 label 163 name 163 scaling 167 title 163 plot to file 162 plot to screen 162 point input lake compartment 113 116 pore volume biofilm reactor compartment 41 porosity biofilm reactor compartment 42 mobile zone saturated soil column compartment 71 76 rate of change biofilm reactor compartment 51 saturated soil column compartment 71 sediment layer lake compartment 99 121 Prandtl number lake compartment 100 122 pressure gradient lake compartment 103 122 print file format 8 long 8 short 8 print options INDEX file menu 8 long 8 short 8 print to file file menu 8 probe variable 10 12 26 compartment 26 description 26 location 26 name 26 unit 26 variable 26 zone 26 problem during calculation 181 186 editing a model 179 loading files 177 178 process 10 27 31 dynamic process 10 27 30 equilibrium process 10 27 30 31 process matrix 29 process rate 28 29 process type 10 processes edit menu 11 27 28 production of dissipation lake compartment 122 program variable 10 12 15 17 40 accuracy 132 134 142 accuracy of advective diffusive reactor compart ment 62 67 biofilm reactor compartment 51 56 lake compartment 110 123 mixed reactor compartment 35 38 river section compartment 91 96 saturated soil column compartment 76 83 area gradient 17 lake compartment 124 attachment velocity of biofilm 16 biofilm reactor compartment 58 bi
134. digit To improve documentation of processes a Description can be given optionally For the selected Variable the Equation to be solved can be given as an algebraic expression which is set equal to zero The syntax of this algebraic expression is the same as that of formula variables described in section 3 1 6 The variable itself has to be an argument of this expression In a similar way as in the case of dynamic processes an equilibrium process has only an effect if the selected variable is of the type of an equilibrium state variable Although equilibrium state variables and equilibrium processes can be defined in AQUASIM the difficulty for the numerical algorithm to find the solution to the system of nonlinear algebraic equations and limitations of the description of transport processes make the implementation of fast processes with dynamic state variables and fast dynamic processes often more advantageous as the implementation with equilibrium state variables 32 CHAPTER 3 MODEL FORMULATION 3 3 Compartments The geometrical configuration of an AQUASIM system consists of a set of compartments of given types In order to be flexible enough to describe the desired system six types of compartments are distinguished e Mixed Reactor Compartments are used to describe well mixed domains as e g stirred reactors mixed lakes etc e Biofilm Reactor Compartments are used to describe growth and population dynamics of biofil
135. dynamic volume state vari ables and the variables Smob i and Simpi are represented by dynamic surface state variables For equilibrium state variables algebraic equations specified as equilibrium processes are solved in all zones everywhere along the column The one dimensional fluxes of the substances with one dimensional densities as de scribed by equation 3 45 are given as follows p QC mob i AO non Bee j 0 a 3 46 0 0 In this equation Q refers to the volumetric discharge through the mobile zone of the saturated soil column and E is the coefficient of longitudinal dispersion There are no fluxes in the direction along the column within the immobile zones and sorbed substances are not transported at all The lateral diffusive exchange processes of dissolved substances between the mobile zone and the immobile regions and within the immobile regions are described as source terms in the next paragraph 72 CHAPTER 3 MODEL FORMULATION The following one dimensional source terms are required to complete the set of equa tions for the saturated soil column q Np 5 dex im1 i Cmob i a fex imj iCimj ji a AO mob Cob j l HD gC hati 2 Cmo dex imi Cmob i a fex imj iCimy ji Geximja i Cim i Jex imj2 iCim a i fork 1 AGimj Otay i Gea simp yi Cimri lt Few jy i Cir jx si Geximjn4rsi Cima si fewimjnsriCimjpa si forl lt k lt Nz j Abim rC iMiki qez imjn iMjn j1 Jez imin j im
136. dz 2 makes this term only to be effective if dissipation is trans ported downwards The fifth component of equation 3 77 describes the effect of the exchange of dissolved substances between water column and the pore water of the first sediment layer the effect of transformation processes and the effect of water in or outflows on the mass of dissolved substances in the water column In this source term D is the molecular diffusion coefficient of the dissolved substance 7 in the sediment pore water rc is the production rate per unit time and unit water volume due to transformation processes and Ciat i is the concentration of the dissolved substance 7 in the lateral inflow The terms 1 tsign q 2 switch between the concentration in the inflow Ciat for an inflow q gt 0 and the concentration in the lake Cz for an outflow q lt 0 The sixth component of equation 3 77 describes the effect of sedimentation resus pension transformation processes and in or outflows on the mass of particles in the water column The first two terms describe the loss and gain of particles by sedimentation and 104 CHAPTER 3 MODEL FORMULATION resuspension respectively In the second term kres describes the resuspension velocity of the sediment The third term of the fifth component of equation 3 77 describes pro duction of particles by transformation processes and the last two terms describe changes in particle concentration in the lake by
137. e Zone and Init Cond allow the user to select a variable and a zone and to specify an initial condition Initial conditions for any type of variables can be specified but only initial conditions for state variables are used by the program The reason for allowing to define initial conditions for variables of other types is to facilitate the users switching between models with different state variables A user can change a state variable to a variable of another type without the requirement ot editing the lists of initial conditions of the compartments Initial conditions of a saturated soil column compartment may not depend on state variables and they can only depend on the program variables Calculation Number Time and Space Coordinate X Input to a saturated soil column compartment can be specified by clicking the button Input of the dialog box shown in Fig 3 53 This action opens the dialog box shown in Fig 3 58 In this dialog box the user can select which type of input to edit There Select Input Type Ed Inlet Input Lateral Input Cancel Figure 3 58 Dialog box for selecting an input type for a soil column compartment exist two different types of inputs to a saturated soil column compartment The radio button Inlet Input can be used to describe water and substance flow at the inlet of the column and the radio button Lateral Input makes it possible to specify water and substance inflow al
138. e 24 attachment biofilm reactor compartment 41 attachment coefficient surface biofilm reactor compartment 46 56 volume biofilm reactor compartment 44 56 attachment velocity biofilm reactor compartment 45 46 attachment velocity of biofilm biofilm reactor compartment program variable 58 program variable 16 batch version 3 4 8 173 175 bifurcation advective link 126 127 biofilm area biofilm reactor compartment 50 biofilm matrix diffusive biofilm reactor compartment 45 50 INDEX rigid biofilm reactor compartment 46 50 biofilm reactor compartment 10 32 41 58 accuracy of program variables 51 56 active for calculation 51 active processes 49 52 active state variables 49 51 area 42 50 attachment 41 attachment coefficient surface 46 56 volume 44 56 attachment velocity 45 46 biofilm area 50 biofilm matrix diffusive 45 50 rigid 46 50 biofilm thickness 41 45 boundary condition 46 47 bulk volume 41 48 50 compartment index 49 confined reactor 48 50 density 56 description 49 detachment 41 global velocity 50 individual rate 50 detachment coefficient surface 45 56 volume 44 56 detachment velocity 45 diffusion coefficient biofilm matrix 56 pore volume 56 diffusive solid matrix 50 dissolved substances 41 dissolved variables 49 56 equations 41 48 free volume growth rate of 43 initial conditions 49 52 input 49 53 liquid phase 50 l
139. e activating another process the new active process is inserted in the list of active processes immediately before the selected process otherwise it is appended to the end of the list of active processes This gives the user the possibility to influence the order of active processes the order is irrelevant for the program but it may be convenient for the user to have a certain order Initial conditions for a mixed reactor compartment can be specified by clicking the button Init Cond of the dialog box shown in Fig 3 21 This action opens the dialog box shown in Fig 3 24 This dialog box shows a list of all initial conditions already specified Each row of the list box contains the name of a variable followed by the zone of the compartment for which the initial condition is specified in brackets and by the algebraic expression specifying the initial value For each combination of a variable with a zone only one unique initial condition can be specified The list of initial conditions can be edited using the buttons Add Edit and Delete If an initial condition is selected while adding a new initial condition the new initial condition is inserted in the list immediately before the selected initial condition otherwise it is appended to the end 3 3 COMPARTMENTS 37 Select Active Processes Eg Active Processes Available Processes AerationAl AerationR23 Ammonific AutDecay AutGrodero HetDecay HetGratero HetGra4
140. e as an identifier A name of a compartment consists of a sequence of letters A Z a z digits 0 9 and underline characters _ The first character may not be a digit The edit field Comp Index can be used to specify a nonnegative inter number as a compartment index This value can be accessed with the aid of the program variable Compartment Index to make variables or process rates dependent on the compartment To improve documentation of compartments the edit field Description can option ally be used to store comments on specific implementation features of a compartment The buttons Variables Processes Init Cond and Input are used to activate and inactivate state variables to activate and inactivate processes to specify initial conditions and to define inputs to a compartment These options are described later in this subsection The edit fields Start Coord and End Coord are used to define the location of the column inlet zs and of the column outlet e respectively The values of variables are resolved continuously with the space coordinate x between these two locations Although all equations in this subsection are formulated with the x axis pointing in flow direction 76 CHAPTER 3 MODEL FORMULATION s lt e the program works also correctly with an x axis defined in the reverse direction s gt Te The edit field Cross Sect is used to specify the total cross sec
141. e bulk water For this reactor type the bulk volume is calculated as Lp Vp Vr faa Vr const 3 32a 0 where Vp is the constant total reactor volume The unconfined reactor type describes a reactor with a constant bulk volume For this reactor type the total reactor volume Vpr is not constant but is given as the sum of the variable biofilm volume and the bulk volume as Lp Vr f aaz Vp Vp const 3 32b 0 The effluent discharge Qef depends on the influent and on the varying reactor volume In the case of the confined rector Qef Qin 3 33a whereas due to the varying total volume for the unconfined reactor Qef Qin Aur 3 33b 3 3 COMPARTMENTS 49 User Definitions Within a biofilm reactor compartment three zones the Bulk Volume the Biofilm Matrix and the Pore Water are distinguished Variables and process rates can be made dependent on the zone by using the program variable Zone Index which takes the value 0 in the bulk volume zone 1 in the biofilm matrix zone and 2 in the pore water zone Figure 3 29 shows the dialog box used for defining or editing a biofilm reactor com partment The edit field Name is used to specify the name of the compartment Each Edit Biofilm Reactor Compartment Name Comp Index fo Description a Options Variables Processes Init Cond Input Properties of Particulate Variables Dissolved Variables Reactor Type C confined Reactor Volume bo
142. e depth range from Mean Depth minus one half of Range to Mean Depth plus one half of Range the input depth range is bounded by the lake bottom and the lake surface The definitions of Mean Depth and Range can depend on time in order to simulate temporary events of higher density of a river during a storm event The edit field Water Inflow is used to specify the discharge of water of the point inflow A positive value of this variable represents an inflow into the lake a negative value an outflow The list box Concentrations contains the concentrations of substances represented by dynamic volume state variables For each variable only one unique inflow concentration can be specified The infow concentrations specified here are irrelevant if the water inflow if negative or zero The list of inflow concentrations can be edited using the buttons Add Edit and Delete If an inflow concentration is selected while adding a new concentration the new inflow concentration is inserted in the list immediately before the selected concentration otherwise it is appended to the end of the list of inflow concentrations This gives the user the possibility to influence the order of the inflow concentrations the order is irrelevant for the program but it may be convenient for the user to have a certain order Figure 3 90 shows the dialog box used to specify an inflow concentration for a selected state variable to a lake In this dialog box t
143. e dialog box Edit Calculation Definition shown in Fig 4 5 only defines the points of time at which the model results are stored in memory to be available for plot ting and postprocessing of results The internal step size used by the integration algorithm is chosen dynamically in order to optimise the integration efficiency while maintaining the requested integration accuracy see below for how to specify the integration accuracy of state and program variables The maximum size of these internal time steps is ten times the output step size In addition the step size is bounded by the number specified in the field Maximum Internal Step Size of the dialog box shown in Fig 3 108 A too small value of this numerical parameter makes the integration inefficient slow because too many steps must be performed by the algorithm Under most circumstances a very large value has no negative effect because the step actually used is then bounded by the accuracy requirement for the solution There is one very important exception from this general rule If a system has a very smooth temporal behaviour that is interrupted by very short excitations inputs or process rates then due to the large time step selected during the smooth period the integration algorithm may step over some of the excitations If one integration step leads to an evaluation of the input or process rate during an excita tion period the algorithm recognises the problem and repeats the step by
144. e dialog box used for this purpose It contains a list box with the names of all defined particulate variables Edit Particulate Yariables x Part Yars Cancel Delete pe Figure 3 36 Dialog box for editing properties of particulate variables in a biofilm reactor compartment Note that a variable can only be in one of the lists of particluate and dissolved variables The buttons Add Edit and Delete allow the user to edit this list Figure 3 37 shows the dialog box used to specify the properties of a particulate variable in a biofilm reactor compartment The field Variable allows the user to select a variable for which Edit Particulate Yariable x Variable Density Surf Att Coeff O00 Surf Det Coeff O00 vaat Cok 0 Vol Det Coeff fo Bound L Res 0 Pore Diff OO Matris Dif 0 cmos Figure 3 37 Dialog box for editing properties of a single particulate variable in a biofilm reactor compartment 56 CHAPTER 3 MODEL FORMULATION particulate properties are to be defined The edit field Density is used to specify the density px of the variable The expression for the density may not depend on time The edit fields Surf Att Coeff Surf Det Coeff Vol Att Coeff and Vol Det Coeff are used to specify expressions for the surface and volume attachment and detachment coefficients Kat surf Kde surfs Katwol and kdeyol respectively No
145. e four categories seven types of variables are distinguished e State Variables represent concentrations or other properties to be determined by a model according to user selected transport and user defined transformation processes e Program Variables make quantities such as time space coordinates discharge etc that are used for model formulation available as variables e Constant Variables describe single measured quantities that can also be used as parameters for sensitivity analyses or parameter estimations e Real List Variables are used to provide measured data or to formulate depen dencies on other variables with the aid of interpolated data pairs e Variable List Variables are used to interpolate between other variables at given values of an arbitrary argument e g for multidimensional interpolation e Formula Variables allow the user to build new variables as algebraic expres sions of other variables e Probe Variables make the values of other variables evaluated at a given loca tion in a compartment globally available Figure 3 3 shows the dialog box used for editing variables This dialog box is opened with the Variables command in the Edit menu shown in Figure 3 2 It is of modeless type in order to facilitate the editing process The names of all variables already defined are listed alphabetically in the list box of this dialog box The type of the currently selected variable is indicated at the bottom of the dialog box
146. e fraction is given as S5 Xpi eaer 0 5 3 8 izi PX where px is the density of the particulate species described by the concentration X nx is the number of particulate species and 0 is the porosity of the biofilm given as unity minus the volume fraction of the solid matrix nx Xm 0 1 9 i 3 9 i PX The last component of equation 3 7 describes the porosity of the biofilm The one dimensional density for this variable free volume per unit biofilm depth is given as the product of the porosity 6 and the area parallel to the substratum A The one dimensional fluxes of the substances with one dimensional densities as de 3 3 COMPARTMENTS 43 scribed by equation 3 7 are given as follows OX mi AurX mu T ADm x z fa Xpi X 5 pine i 0 et Oz yy Aa U ay Ont a S X pj Oz 0 j kz PX Pa pet PXk 3 10 1 e 7 AurCp e r ADP C on Xpx Hib a Pte PAME Op 4 aiy ee 0DP x a R k 1 pal PXk 3z D Ox 6Aur at ay M Xk M k kai PXs 94 In this equation up is the advective velocity of the biofilm matrix given by S a a M Xk 1 1 a L atk A UP f aS Be dz 3 11 0 i where ry is the excess growth of porosity defined by i Ee pins tare TM Xe 3 12 g 1 0 kay PXk and r is the growth rate of free volume between the solid matrix With this notation the porosity of a biofilm remains constant if rg 0 because the same fraction of free volume is produced
147. e information on the initialization process Information on dynamic calculations starts with the values of the numerical parameters Number of Codiagonals of the Jacobian Matrix and Maximum Internal Step Size cf section 3 5 The next block of information shows the time consumption of the simulation by giving the time at each output time step As a next group of parameters the number of equations solved by the numerical algorithm and the memory requirements for the application of the differential algebraic system solver DASSL Petzold 1983 expressed as a number of integer variables and a number of real variables are listed The next block of information shows the current at the end of the simulation values of integration time step size and integration order gives a summary on the number of integration steps taken of function evaluations and of evaluations of the jacobian matrix and gives the numbers of error test failures and convergence test failures of the algorithm DASSL Petzold 1983 Especially these last two numbers may be interesting for simu lation performance improvements An error test failure indicates that the algorithm tries to perform a too large time step and it has to repeat the step with a smaller step size in order to fulfill the accuracy criteria of all state and program variables cf section 3 5 A change of the accuracies of state and program variables cf section 3 5 may decrease the number of error test failur
148. e product of the area parallel to the substratum A and the concentration of particulate species in the biofilm matrix averaged over this area Xjy The second component of equation 3 7 describes the particulate species in the biofilm pore water Similarly to the first component the one dimensional density of these species is given as the product the area parallel to the substratum A and the concentration of these species averaged over this area Xp Note that this implies a definition of a concentration of particulate species as mass per unit of total volume and not only per unit of pore water volume This definition makes the concentrations X m and Xp comparable with each other Note however that this leads to a step in the concentration Xp at the biofilm surface because there is no solid matrix in the bulk volume and the concentration of suspended solids is continuous if defined as mass per unit of water phase volume The third component of equation 3 7 describes substances dissolved in the pore water of the biofilm The concentration of dissolved substances is defined as mass per unit of water phase volume Therefore their one dimensional density is given as the product of the area parallel to the substratum A the liquid phase volume fraction e r and the concentration of the dissolved species averaged over the area A Cp All concentrations X and Cj are represented in AQUASIM as dynamic volume state variables The liquid phase volum
149. e the users switching between models with different state variables A user can change a state variable to a variable of another type without the requirement of editing the lists of lateral inflow concentrations of the compartments The button Acc of the dialog box shown in Fig 3 41 is used to specify the numerical accuracies of program variables Fig 3 51 shows the dialog box used for this purpose It allows the user to specify relative and absolute accuracies of the program variable 68 CHAPTER 3 MODEL FORMULATION Edit Lateral Input Concentration Figure 3 50 Dialog box for editing a single lateral inflow concentration to an advective diffusive reactor compartment Edit Accuracies of Program Variables Figure 3 51 Dialog box for editing the accuracies of program variables of an advective diffusive compartment Discharge Q and for the Diffusion coefficient D in the compartment Good behaviour of the numerical algorithms is usually achieved if the absolute accuracy and the product of the relative accuracy times a typical value of the variable both are 4 to 6 orders of magnitude smaller than typical values of the variable 3 3 COMPARTMENTS 69 In Table 3 6 the program variables available in a advective diffusive compartment are summarized for a complete overview of all program variables see Table 3 1 on page 17 Calculation Number Identifier for calculations value set in the d
150. e type of the curve value sensitivity function or error contribution of a variable the variable the calculation number the compartment the 161 162 CHAPTER 5 VISUALIZATION OF RESULTS View Results New Duplicate Edit Delete 4 seee UE Close Plot to Screen Scr Opt Plot to File File Opt List to File List Opt Figure 5 2 Dialog box for editing plot definitions and plotting and listing results zone the spatial location if the abscissa of the plot is time or the time if the abscissa of the plot is the spatial coordinate of the compartment at which the curve should be drawn and the signature of the curve All these definitions can be specified independently of the existence of the calculated states necessary for actually drawing the curves The recommended strategy is therefore to spend some time to carefully specify a series of plot definitions which can later on be used very efficiently to present an overview of the current simulation results The buttons at the right of the list box of plot definitions allow the user to perform the following operations By clicking the button New new plot definitions can be specified Alternatively by clicking the button Duplicate the selected plot definition can be duplicated With the button Edit or by double clicking the plot definition name in the list box a plot definition can be edited The button Delete allows the program user to del
151. ection As for each compartment the user has to select which state variables are active This is done by clicking the button Variables of the dialog box shown in Fig 3 78 This action opens the dialog box shown in Fig 3 79 The two list boxes of this dialog box show the active variables and the available variables respectively The button Activate is used to activate available variables selected in the right list box and the button Inactivate is used to inactivate active variables selected in the left list box If an active variable is selected while activating another variable the new active variable is inserted in the list of active variables immediately before the selected variable otherwise it is appended to the end of the list of active variables This gives the user the possibility to influence the order 3 3 COMPARTMENTS 111 Select Active State Variables x Active Variables Available Variables 4 a AlgwetT oDry alg_ini amp Zuerich b BIO_910109 C_alg d Figure 3 79 Dialog box for activating and inactivating state variables in a compartment of active variables the order is irrelevant for the program but it may be convenient for the user to have a certain order The list of active variables may contain variables of any type but activation has only an effect to state variables Inactive state variables return a value of zero The reason for allowing other types of variables in the li
152. ection compartment and Loading allow the user to select a variable and to specify an upstream loading Iin c Note that this loading represents mass per unit of time An upstream loading to a river section compartment may depend on the program variables Discharge and on dynamic volume state variables These variables return the discharge and the current values of dynamic volume state variables resulting from all advective links connected to the upstream end of the river section Input loadings for any type of variables can be specified but only input loadings for dynamic volume state variables are used by the program The reason for allowing to define loadings for variables of other types is to facilitate the users switching between models with different state variables A user can change a state variable to a variable of another type without the requirement ot editing the lists of input loadings of the compartments Selection of the radio button Lateral Input in the dialog box shown in Fig 3 72 opens the dialog box shown in Fig 3 75 The edit field Water Inflow of this dialog box is used to specify the discharge of water per unit length into the river section q and the list box contains substance concentrations Cigz in the inflowing water A positive value of q represents a flow into the compartment a negative value represents an outflow According to the equations 3 60 and 3 62 the inflow concentration is irrelvant if q
153. egated porous media J Contaminant Hydrology 33 1 2 211 230 Fesch C Simon W Reichert P Haderlein S and Schwarzenbach R 1998b Non linear sorption and nonequilibrium transport of organic contaminants in saturated porous media experiments process identification and modeling J Contaminant Hydrology 31 3 4 373 407 189 190 BIBLIOGRAPHY Filipe C and Daigger G 1997 Development of a revised metabolic model for the growth of phosphorus accumulating organisms Water Environment Research 70 1 67 79 Fischer H List E Koh C Imberger J and Brooks N 1979 Mizing in Inland and Coastal Waters Academic Press New York French R 1985 Open channel hydraulics McGraw Hill Stuttgart New York Gear C 1971la Algorithm 407 DIFSUB for solution of ordinary differential equations Communications ACM 14 3 185 190 Gear C 1971b The automatic integration of ordinary differential equations Commu nications ACM 14 3 176 179 Gear C 1971c Numerical initial value problems in ordinary differential equations Prentice Hall Stuttgart Englewood Cliffs N J Gill P Murray W and Wright M 1981 Practical Optimization Academic Press London Glod G Angst W Holliger C and Schwarzenbach R 1997a Corrinoid mediated reduction of Tetrachloroethene Trichloroethene and Trichlorofluoroethene in homo geneous aqueous solution Reaction kinetics and reaction mechanisms Env
154. ek ita POR a ce ae 18 3 1 5 Variable List Variables 0 0 0002 eee ee ee 21 3 1 6 Formula Variables 2 0 0 0 2 ee a o a 23 Sf Probe Variables iera o es ede caps Poa ae ei Ge a ek 26 B 2e sPTOCESSES ets sare a E oe tae age E a ao sth Me aa Se ve tie eas ite eat 27 32 1 Dynamic Proce ss s lt s u L rook ke bo ee a ee ed 28 3 2 2 Equilibrium Processes 2 0 ee 30 3 0 Compartments lt ga ra bg oo aioe Bee eee eS oe eb ee es 32 3 3 1 Mixed Reactor Compartment 2 02 22008 34 3 3 2 Biofilm Reactor Compartment 02 02008 41 3 3 3 Advective Diffusive Reactor Compartment 59 3 3 4 Saturated Soil Column Compartment 70 3 3 5 River Section Compartment 0 02 022000 85 3 3 6 Lake Compartment 2 0 000 ee es 98 Ord Thinks sy fb de ek roe ge ote we A got ela ge oe eed ee ete A wea A 125 3 41 Advective Bink neg oor oe Be taht Se Mae be OS 126 SAF Withasivednimk sea te esi ee ett eh eR ees See ee te 129 3 5 Numerical Parameters 2 20 0 ee 132 3 6 Deleting Calculated States ooa a ee ee 135 4 Simulation and Data Analysis 137 AA Simulation g se ba once ie E e eS BR a a es 138 Ay Sensitivity Analysis y 2 00 dees ete y Doe ee des Gee heer S E 144 4 3 Parameter Estimation s sese am eod 0 ee ee 151 5 Visualization of Results 161 iii iv CONTENTS 6 Appendix 171 6 1 Character Interface Version 2 2 2 171 6 2
155. eld Calc Number allows the program user to identify a calculation by a nonnegative integer number Variables and thus also processes etc can be made dependent on this calculation number with the aid of the program variable Calculation Number Active calculations must have different values of their calculation numbers Each calculation must be initialized before it can be started In the edit field Initial Time the time at which a calculation is initialized can be specified The user has the choice between two types of the Initial State to be used by 156 CHAPTER 4 SIMULATION AND DATA ANALYSIS the program The default option given made consistent applies the initial state as given by the user a value of zero is the default initial condition for all state variables for which the user did not explicitly specify an initial condition If this initial state violates constraints on boundary conditions or algebraic equations of equilibrium processes the program tries to fulfill these constraints by a minimal number of modifications to the initial state given by the user This procedure is called to make the initial state consistent With the selection of the alternative option steady state the program tries to find the steady state solution of the user defined model under external parameter values evaluated at the initial time and uses this steady state solution as the initial condition Note however that not all model
156. en the substance concentration in the pore water and the concentration in the other compartment connected to the diffusive link the substance specific constants of proportionality are defined in the link definition The boundary condition at the biofilm surface is a continuity condition for the concentration in the water Cpi Lr Chi 3 25b The equation 3 17 does not require any boundary conditions The total flows of solids out of the biofilm negative values for flows into the biofilm are given as OX vj Ir x AurXmuyi ADF Lr Xpi o xX r 1 ees ors an dz 3 26 Dux OX uk XP A ODP X a 0 Xp 5 PX Oz oO rg Ort PX Oz 0 Lr k 1 Au X uji Lr k 1 This expression is the sum of the flow from the solid matrix and the pore volume at z Lp plus the last term correcting for the movement of the biofilm surface The total flows of dissolved substances out of the biofilm negative values for flows into the biofilm are given as OC p Irc 1 0 Be AurCpi Lr a rADpc p Lr Ea 5 gt Puas Pa Ai p k 3 27 XPk 4 ur 4S ODp x A 5 XP Lr 0 peg Oe Oz 0 AureirCp i Lr This expression is the flow at z Lp plus a correction that considers the movement of the interface The equations for the biofilm described so far are connected to the bulk volume of the biofilm reactor through a liquid boundary layer In AQUASIM the liquid boundary layer 48 CHAPTER 3 MOD
157. entation concepts Reichert 1995 are also available I would like to thank J rg Ruchti for the implementation of the formula variables and the plotting facilities and Werner Simon for the realization of the saturated soil column compartment Furthermore Oskar Wanner contributed to the design of the extensions of the biofilm compartment Claudia Fesch and Stefan Haderlein to the design of the ii soil column compartment and Gerrit Goudsmit and Johny W est to the design of the lake compartment G rard Mohler Bouziane Outiti and Raoul Schaffner gave support in solving technical problems involving different hardware platforms and Martin Omlin introduced me into the ATEX system used for typesetting this manuscript In addition many program users gave hints on program errors and on possibilities for improvements Most parts of this manual have been newly written I apologize for all errors that it may contain If you detect errors or unclear paragraphs please send a note to reichert eawag ch I will improve this manual during the next years and try to eliminate as many errors as possible Peter Reichert September 1998 Contents 1 Introduction 1 2 File Handling 7 3 Model Formulation 9 Sil SWariables ei sii ae art eta ee Wate ag A ORE as Riot ee A 12 3 1 1 State Variables 0 es 14 3 1 2 Program Variables ssor eis caot soran A ew A eae s 15 3 1 3 Constant Variables oaoa es 17 Tba Real Eiet Variables sa ta eNe a a e
158. ents of the list the interpolated value is given by cubic polynomials between neigh bouring data points which are determined by the conditions of continuous first and second derivatives at inner data points and by zero first derivative at 3 1 VARIABLES 19 o data linear A DOD O O spline Ve nee o smooth 1 0 0 smooth 1 5 o data linear spline pbs smooth 0 4 smooth 1 0 0 2 4 6 8 10 Figure 3 8 Comparison of interpolation and smoothing methods the end points Smoothing The values are defined by a curve smoothing the data points This curve is given by the fit of a parabola through neighboring data points For this fit the data points are weighted with a normal distribution with a standard deviation chosen by the user smooth ing width and centered at the actual value of the argument The larger the width of this distribution the smoother the behavior of the curve Fig 3 8 shows interpolation of two real list variables with different interpolation and smoothing methods Note that spline interpolation may lead to undesired oscillations in case of very abrupt changes in the data series An alternative use of real list variables is their use as target variables for parameter estimations This is only possible if the argument of the real list variable is either the program variable for time or the program variable describing the space coordinate of the
159. equations with the explicit technique 4 6 left and with the implicit technique 4 7 right Because the f f Figure 4 3 Numerical solution of a stiff system of differential equations using the explicit left and the implicit right Euler algorithm with the same size of the time step numerical solution with the implicit technique is tangent to the true solution at the end of each time step and not at the beginning the technique can use much larger time steps For stiff systems of differential equations this advantage leads to a faster integration although a implicit system of nonlinear equations must be solved at each time step the explicit 140 CHAPTER 4 SIMULATION AND DATA ANALYSIS technique requires only the evaluation of explicit functions at each time step Whereas Fig 4 3 demonstrates the main idea of achieving a stiffly stable integration algorithm by backward differencing the Gear algorithm Gear 1971b Gear 1971a Gear 1971c uses a more sophisticated generalization of this idea to a multi step variable step size and variable order originally up to 6 in the implementation DASSL up to 5 algorithm The first disadvantage of the Gear integration technique and the implementation DASSL Petzold 1983 is its inability to step over discontinuities of inputs or process rates Such step discontinuities can be approximated by a linear increase or decrease of the quantity of interest over a very short time interva
160. equence of the existence of widely varying time scales within a system is that the concentrations determined by fast processes converge so fast to their current equilibrium values which themself depend on slower processes that the transient phase is not important for the behavior of the system on the slower time scale In such situations a separation of time scales which solves concentrations determined by fast processes di rectly for their equilibrium solution can be advantageous This leads to a replacement of differential equations of fast processes by algebraic equations Therefore the following two types of processes are introduced e Dynamic Processes describe substance transformations the dynamics of which is important on the time scale of the simulation e Equilibrium Processes describe the effect of very fast processes which lead to permanent equilibrium values of the corresponding state variables Figure 3 14 shows the dialog box for editing processes This dialog box is opened with Edit Processes New AerationA23 Armmonific AutDecay AutGra amp ero Duplicate Edit HetDecay HetGro4ero HetGro amp nox HydrolOrg HydrolOrgN SludgeRemoval Delete l Close o Heie Type Dynamic Process Figure 3 14 Dialog box for editing processes the Processes command in the Edit menu shown in Figure 3 2 It is of modeless type in order to facilitate the editing process The names of all processes already defined a
161. er the lake border at a given depth Xs The gradient dA dz in these expressions specifies the sediment area per unit depth of the lake this area is approximated by its horizontal projection Note that the sediment submodel of AQUASIM does not resolve the depths of the sediment continuously Instead an arbitrary number of sediment layers can defined by the user to roughly resolve 100 CHAPTER 3 MODEL FORMULATION the sediment depths These sediment layer always describe the top of the sediment The influence of the sediment underneath these layers can be described by substance fluxes into and out of the bottom sediment layer described by AQUASIM The variables A U k and in the first four components of the one dimensional density array 3 74 are accessible by the program variables Cross Sectional Area Horizontal Velocity Turbulent Kinetic Energy and Dissipation The variables Cza C s Xz and Xs are represented by dynamic volume state variables with dissolved Cz and Cs or particulate Xz and Xs properties The one dimensional fluxes of the substances with one dimensional densities as de scribed by equation 3 74 are given as follows Q Oz Att Wek Ok Oz v O pe f SA e aoe F 3 75 OCL AK OO Oz QXL i AWseai XLi 0 0 Qpk OX rj SAR z where n PrK 3 76 is the turbulent viscosity ocg and o are factors to change diffusion of k and from turbulent viscosity K
162. es A convergence test failure indicates that the algorithm had to decrease the size of the time step because it was not able to find the solution of 6 3 TROUBLESHOOTING 183 the nonlinear system of algebraic equations for the solution after the time step the iter ative equation solver did not converge cf section 4 1 One cause for a large number of convergence test failures may be a too low value of the numerical parameter Number of Codiagonals of the Jacobian Matrix Problems of Wrong Calculation Results Due to the robustness of the integration algorithm used by DASSL Petzold 1983 it is very rare that wrong simulation results occur To our knowledge the only cases in which wrong calculation results occur are cases related to the automatic selection of integration time steps If the integration time step is large in comparison to a short term change in system behaviour the algorithm may step over such a change in behavior The consequence of this problem is that the change in behaviour is not recognised by the calculation There are two very important examples of this problem The first is related to short term external excitation of a system the second to short term changes in process rates due to changes in the values of variables calculated from the solution a If the driving forces of a system process rates and inputs usually only vary slowly in time but show some short term excitations then during the slow variation phase the
163. es of dissolved variables in a biofilm reactor compartment that a variable can only be in one of the lists of particluate and dissolved variables The buttons Add Edit and Delete allow the user to edit this list Figure 3 39 shows the dialog box used to specify the properties of a dissolved variable in a biofilm reactor compartment The field Variable allows the user to select a variable for which dissolved properties are to be defined The edit field Bound L Res is used to specify the boundary layer resistance k7 c for the dissolved species described by the concentration Ci The last edit field Pore Diff is used to specify the coefficient for pore volume diffusion Dp c of the dissolved species described by the concentration C3 The button Acc of the dialog box shown in Fig 3 29 is used to specify the numerical accuracies of program variables Fig 3 40 shows the dialog box used for this purpose 3 3 COMPARTMENTS 57 Edit Dissolved Variable x Variable C_NH4 Bound L Res jo Pore Diff D_NH4 cmos Figure 3 39 Dialog box for editing properties of a single dissolved variable in a biofilm reactor compartment It allows the user to specify relative and absolute accuracies of the program variables Discharge Q reactor or bulk Volume Vp or Vg Biofilm Thickness Lp and Water Fraction q r the last value is also used as the accuracy of the vol
164. es of other types is to 116 CHAPTER 3 MODEL FORMULATION facilitate the users switching between models with different state variables A user can change a state variable to a variable of another type without the requirement of editing the lists of lateral inflow concentrations of the compartments Selection of the radio button Point Inputs in the dialog box shown in Fig 3 83 opens the dialog box shown in Fig 3 88 This dialog box contains a list of the names Edit Point Inputs Ea Point Inps re Add Edit zi Delete Cancel Figure 3 88 Dialog box for editing point inputs to a lake compartment of all point inputs to the lake typically rivers or technical discharges This list can be edited with the aid of the buttons Add Edit and Delete Figure 3 89 shows the dialog box used to specify a single point input to a lake The edit field Name is used to specify the name of the point input Each point input needs a unique name as an identifier A name of a point input consists of a sequence of letters A Z a z digits 0 9 and underline characters _ The first character may not be a digit To improve documentation of point inputs the edit field Description can optionally be used to store comments on specific implementation features of a compartment The edit fields Mean Depth and Range are used to determine the vertical loaction of the input The input is equidistributed over th
165. essible by the program variable Space Coordinate X Note that when the advective diffusive reactor compartment is used to model a porous medium A is given as the product of the porosity and the total cross sectional area It is not allowed to use a time dependence or a dependence on state variables for the specifiction of the cross sectional area As a next option Diffusion in the dialog box shown in Fig 3 41 the user can select how to model diffusion or dispersion If the user selects the radio button without diffusion a purely advective equation with D 0 is solved note however that due to the spatial discretization numerical diffusion can occur If the user selects the radio button with diffusion a positive diffusion or dispersion coefficient D must be specified This coefficient can be made dependent on time discharge or cross sectional area by using the program variables Time Discharge or Cross Sectional Area As last options Num Grid Pts Resolution and Acc in the dialog box used for the definition of an advective diffusive reactor compartment Fig 3 41 the user can select the number of grid points the discretization order of the numerical algorithm and the accuracies of program variables The number of grid points is used to specify by how many discrete points the continuous z axis is approximated If the number of grid points is set to Ngp the compartment is resolved longitudinally into 2 boun
166. esults described below This process can be interrupted loosing the ranking without loosing the calculated states The sensitvity ranking file looks as follows K gt k 2 k gt K FK FK gt FK FK FK FK FK FK FK K K K K K FK FK FK FK K K K K K FK FK FK FK FK K K K K FK FK FK FK FK FK K K K K K FK FK FK FK K K K K K FK FK FK FK 2 K K K K K K AQUASIM Version 2 0 win batch Sensitivity Analysis File 2 2 ak ak k ak ak k ak ak 2k ak ak 2k ak akak 2k ak ak 3K 2k ak ak 3K 3k ak ak 3K ak ak ak 3K ak akak 3K ak akak 3K ak ak 3K ak ak ak 2K ak akak 2K ak akak 3K ak ak 2K EE Eo oko Ok oO 2k Date and time of listing 07 28 1997 09 01 42 Ranking of mean absolute sensitivities and error contributions Calculation Number 1 Compartment Reactor Zone Bulk Volume Variable C Parameter Sens AR Parameter Error Contr mg 1 mg 1 1 Cinil 5 606 rmax 1 0 1093 2 rmaxi 3 166 K 0 1069 3 K 0 7936 Cinil 0 1032 4 Cini2 0 Cini2 0 5 rmax2 0 rmax2 0 150 Calculation Number 2 Compartment Zone Bulk Volume Variable C Pwd Be 5 Parameter Cini2 rmax2 K rmax1 Cinil Reactor CHAPTER 4 SIMULATION AND DATA ANALYSIS Sens AR mg 1 0 0769 0 0632 0 0530 0 0 Parameter K rmax2 Cini2 rmax1 Cinil Error Contr mg 1 0 0071 0 0031 0 0030 0 0 It gives a ranking of the averages of the absolute values of the absolute relative sensitivity functions 4 9c and of the error contributions
167. ete plot definitions The buttons Duplicate Edit and Delete are inactive as long as no plot definition is selected The dialog boxes used for editing plot definitions are discussed later in this section Figs 5 3 to 5 5 The three buttons Plot to Screen Plot to File and List to File are used to draw a plot corresponding to the currently selected plot definition to the screen to write it in PostScript or Encapsulated PostScript format to a file and to write it in text format to a file respectively The PostScript or Encapsulated PostScript file must be handled by the user Typically a PostScript file is sent to a printer with the aid of an appropriate program available as a shareware program an Encapsulated PostScript file is included as a figure into a text processing program All the three actions described above are only possible if calculated data for at least one curve of the currently selected plot definition exists and if no curve contains undefined values as they can occur e g by division by zero or by taking logarithms of negative numbers in the variable to be plotted The three buttons Scr Opt File Opt and List Opt are used to specify 163 general options for plotting to the screen for plotting to a PostScript file and for listing plot data to a text file respectively The dialog boxes used for specifying these options are discussed later in this section Figs 5 6 to 5 8 Figure 5
168. eter K in comparison to the sensitivity to the parameter rma leads to a larger uncertainty of the estimate of K than that of rmaz In uncertainty analysis the uncertainty of model parameters is propagated to the uncertainty of model results model structure uncertainty is not addressed as an auto mated task of AQUASIM however predictions with different model structures can be compared manually In the current version of AQUASIM only the simplest error prop agation method is implemented the linearized propagation of standard devitions of un correlated parameters The error propagation formula using the linearized model and neglecting the parameter correlation is given by 4 10 where p are the uncertain model parameters op are their standard deviations y p1 Pm is the solution of the model equations for a given variable at a given location and time and oy is the approximate standard deviation of the model result Figure 4 9 shows a F Parest_b Concentration Iof x Concentration Figure 4 9 Example of a plot of simulation results with estimated error bounds plot of measured data and the simulation result with error bounds limiting the range of values of the result plus and minus one standard deviation The error contribution of each parameter is given as Oy gern Op 4 11 4 2 SENSITIVITY ANALYSIS 147 The error contributions of the three parameters of the example shown in the Figs 4 8 and 4 9 are show
169. etermined by the lateral inflow q Positive values of q inflow increase the downstream discharge negative values outflow decrease the downstream discharge The second equation describes the behaviour of substances transported in the com partment Dea 160 EE o A OG EE ADS aoe Oo aos Oz Se 3 39 e 2 Cin To 3 40 The concentration is affected by advection with the water flow first term dispersion or diffusion second term transformation processes third term and by lateral inflow or outflow fourth and fifth terms The third equation describes the behaviour of settled or sorbed substances or of sessile organisms aS aoe 3 41 ga S 3 41 The concentration of such substances is only affected by transformation processes Note that settling or sorption must also be formulated as a transformation process transforming dissolved species C to settled or sorbed species S In order to make the solution to the above system of differential equations unique one boundary condition for the ordinary differential equation 3 39 and two boundary conditions for the partial differential equation 3 40 are required The ordinary differen tial equation 3 41 that does not contain spatial derivatives does not require boundary conditions 3 3 COMPARTMENTS 61 The boundary condition for equation 3 39 that describes discharge through the com partment is given by Q zs Qin 3 42a at the start point
170. f amount produced per unit compartment length and per unit time must be derived For the case of the advective diffusive reactor compartment 3 types of components of a conservation law must be distinguished The array of one dimensional densities of these types of components is given as follows p AC 3 36 The first component of equation 3 36 describes the conservation of water volume within the compartment water is approximated to be incompressible The one dimensional density of water volume in the compartment volume per unit length is given by the cross sectional area A of the compartment The second component of equation 3 36 describes substances transported dissolved or suspended with the water flow Their one dimensional densities are given as the product of the cross sectional area rA and the laterally averaged concentration C The last component of equation 3 36 describes substances settled to the bottom or sorbed to surfaces within the compartment The value of the variable A must be specified as a function of the distance along the compartment x Its current value is then generally accessible by the program variable Cross Sectional Area The variables C are represented by dynamic volume state vari ables and the variables S are represented by dynamic surface state variables For equilibrium state variables algebraic equations specified as equilibrium processes are solved everywhere along the compartment The o
171. f spatial profiles are possible Figure 3 11 shows the dialog box used for defining or editing a variable list variable As each variable a variable list variable needs a unique Name as an identifier A name of a variable consists of a sequence of letters A Z a z digits 0 9 and underline characters _ The first character may not be a digit The following reserved names are not allowed as variable names div mod and or not if then else endif pi sin cos tan asin acos atan sinh cosh tanh deg rad exp log In log10 sign abs sqrt min max To improve documentation of variables a Description and a Unit can be specified Similarly to 22 CHAPTER 3 MODEL FORMULATION Edit Yariable List Variable x Temperature profiles over time Ssiioatn vviGttts Figure 3 11 Dialog box for editing a variable list variable real list variables an Argument must be specified It is possible to Add Replace and Delete argument variable pairs The Interpolation Method must also be selected Look at the preceeding section on real list variables for a description of these interpolation techniques Note that for variable list variables spline interpolation and smoothing are not very efficient because these methods need evaluation of all variables of the list for each evaluation of the variable list variable 3 1 VARIABLES 23 3 1 6 Formula Variables Formula va
172. f a conservation law must be distinguished The array of one dimensional densities of these types of components 3 3 COMPARTMENTS 99 is given as follows A AU Apk Ape p ACL 3 74 AX j sea i04Cs i sets X54 The first component of equation 3 74 describes the conservation of the water volume wa ter is approximated to be incompressible The one dimensional density of water volume volume per unit of depth is given by the cross sectional area A of the lake The sec ond component of equation 3 74 describes a horizontal water flow induced by the surface shear of the wind This component is used in mixing models to calculate the production of turbulent kinetic energy by shear forces of wind induced water flow The one dimensional density of horizontal water discharge is given as the product of the cross sectional area A and the horizontally averaged horizontal flow velocity U The third component of equation 3 74 describes turbulent kinetic energy The one dimensional density of turbulent kinetic energy is given as the product of the cross sectional area of the lake A the density of water p and the turbulent kinetic energy k turbulent kinetic energy per unit mass of water The fourth component of equation 3 74 is an equation for the dissipation of turbulent kinetic energy This quantity together with k can be used to estimate the coefficient of turbulent diffusion K of substances dissolved or suspended in t
173. f the abscissa of the plot is Space and the variable specifed in the curve definition it is a real list variable with the program variable corresponding to the spatial extent of the compartment as the argument the data pairs of the real list are used instead of the interpolated values at the simulation times or grid points This makes it possible to plot measured data without interpolation see alsow Figs 5 9 and 5 10 Selection of one of the radio buttons Error Contrib and Sens Function leads only to a curve if a sensitivity analysis corresponding to the specifications below has been performed Selection of the radio button Error Contrib leads to the plot of the error contribution of a parameter p to the total error of a variable y given by equation 4 11 Selection of the radio button Sensitivity Function leads to the plot of a sensitivity function Selection of the radio button AbsAbs leads to the plot of the absolute absolute sensitivity function given by equation 4 9a selection of RelAbs to the plot of the relative absolute sensitivity function given by equation 4 9b selection of AbsRel to the plot of the absolute relative sensitivity function given by equation 4 9c and selection of RelRel to the plot of the relative relative sensitivity function given by equation 4 9d Edit Plot Scaling Ea Abscissa Minimum MV jaute fo Maximum M auto 415 Tick Pos M auto 0 Tick Dist I auto 5 Ordinate
174. f the formula variable does not exist If syntax and existence checks do not help uncovering the problem it is recommended to carefully read the explanating text to the referenced edit field in the user manual Besides errors in algebraic equations illegal dependencies may occur Examples of illegal dependencies are use of a program variable that is not meaningful in the context of the current compartment or the absence of obligatory dependencies Inconsistency errors of the newly defined object with existing system definitions are more difficult to find In many cases as shown in the example shown in Fig 6 2 the name of the object may already exist Also in this case it is recommended to carefully read the comments to the dialog box in the user manual 180 CHAPTER 6 APPENDIX Figure 6 2 Example of an error assigned to an edit field of the dialog box 6 3 TROUBLESHOOTING 181 Problems During Calculation The Log File of AQUASIM The most important source of information on problems during calculation is the log file of AQUASIM For each interactive section a log file aquasim log is written to the program directory of AQUASIM the log file from the previous session is overwritten As explained in section 6 2 for batch jobs the user can specify the name of the log file in the command line or in the job file The contents of the log file can usually be ignored However it may contain useful information in case
175. factors can be defined for any type of variables but only exchange coefficients for dynamic volume state variables have an effect 132 CHAPTER 3 MODEL FORMULATION 3 5 Numerical Parameters In order to integrate the differential equations of the user specified model in AQUASIM as a first step the partial differential equations are discretized in space Then the spa tially discretized partial differential equations together with the ordinary differential equa tions and the algebraic equations are integrated numerically in time with the algorithm DASSL Petzold 1983 which is based on the implicit backward differencing variable step variable order Gear integration technique Gear 1971b Gear 1971a Gear 1971c In the dialog box Edit Numerical Parameters shown in Fig 3 108 which is opened with the Numerical Parameters command in the Edit menu the general numerical pa rameters of the time integration algorithm DASSL Petzold 1983 can be edited Edit Numerical Parameters Ea Maximum Internal Step Size fll Maximum Integration Order 1 5 5 Number of Codiagonals of the Jacobian Matrix fi 000 Maximum Number of Internal Time Steps for One External Time Step fi 000 Cancel Figure 3 108 Dialog box for editing numerical parameters The first parameter Maximum Internal Step Size makes it possible to bound the step size used internally by the numerical integration algorithm The output step size specified in th
176. ficients describing the relative effect to different variables Time evolu tion of variables affected by dynamic processes is determined by the solution of differential equations The second type of processes are equilibrium processes which determine the value of the corresponding variables by the solution of algebraic equations Such processes are used to model processes which are so fast that the corresponding variables can always be approximated to take their current equilibrium values The variables of the system of variables may be used and are needed to formulate processes The next subsystem of the AQUASIM model structure is the system of compart ments This subsystem is designed to spatially divide the system under investigation The following types of compartments are implemented in the current version of the pro gram Mixed reactor compartments are used to describe systems that can be approxi mated by an arrangement of well mixed domains e g stirred reactors mixed lakes etc biofilm reactor compartments are used to describe the growth and population dynamics of biofilms in which substrate gradients over depth are important advective diffusive reactor compartments can be used to describe systems with a longitudinal given water flow e g plug flow reactors rivers with given water flow etc saturated soil column compartments are used to model advective dispersive transport exchange with stagnant pore volumes adsorption and transf
177. file vcmdfile rcmdfile resfile p logfile loadfile pcmdfile l logfile loadfile lcmdfile The parameters used in these command lines have the following meaning jobfile AQUASIM job file This file can contain one or more command lines in the style of the other command lines These command lines are executed one after the other so that a job specified in a command line can use the savefile of one of the previous jobs as its loadfile When used within such a job file the program name aquasimb may be omitted and the line can directly start with s a e c p or 1 Within a job file a sign terminates input for the current line and makes it possible to add comments Perform a simulation Perform a sensitivity analysis Perform a parameter estimation Perform a calculation of y values Calculate results for given parameter sets and given variables Plot results to a PostScript file 174 1 logfile loadfile savefile scmdfile sensfile fitfile vcmdfile chifile rcmdfile CHAPTER 6 APPENDIX List results to a text file Name of an output text file for job log information The information written to this file may be useful in case of problems during calculation CAUTION an existing file with this name is overwritten without warn ing Name of the input AQUASIM system file containing the model definitions This file must be created with one of the interactive program versions Name of an outpu
178. g objects of the corresponding subsystem If the screen is large enough it is recommended to open all these dialog boxes together to accelerate editing the model this can be done by selecting the System item in the Edit menu The hierarchy of dialogs controlled by each of these dialog boxes is described in the following sections 3 1 to 3 4 As additional options the Edit menu allows the user to change the values of Numerical Parameters and to Delete States calculated by the program These options are described in the sections 3 5 and 3 6 respectively 12 CHAPTER 3 MODEL FORMULATION 3 1 Variables The basic objects for the formulation of models are variables Variables are identified by their name They are characterized by the property of taking a possibly context sensitive numerical value There are four main ranges of application of variables Variables can be used for quantities to be determined by the model e g by the solution of algebraic or differential equations or which have a predefined meaning in a compartment e g time and space coordinates they can be used to provide data e g model parameters or measured data series they can be used to build functions depending on other variables e g for the specification of process rates or stoichiometric coefficients or they can be used as probes which make the values of other variables evaluated at a given location in a compartment globally available According to thes
179. gram variables Calculation Number and Time Input to a mixed reactor compartment can be specified by clicking the button Input of the dialog box shown in Fig 3 21 This action opens the dialog box shown in Fig 3 26 The edit field Water Inflow of this dialog box is used to specify the discharge of water into the bulk volume of the reactor Qin and the list box contains substance loadings Iin c into the reactor For each variable only one unique loading can be specified The list of loadings can be edited using the buttons Add Edit and Delete If a loading is selected while adding a new loading the new loading is inserted in the list immediately before the selected loading otherwise it is appended to the end of the list of loadings This gives the user the possibility to influence the order of the loadings the order is irrelevant for the program but it may be convenient for the user to have a certain order Figure 3 27 shows the dialog box used to specify a single input loading of a substance In this dialog box the fields Variable and Loading allow the user to select a variable and to specify a loading Tin c Note that all loadings must be specified as mass per unit of time A loading of a mixed reactor compartment may depend on the program variable Discharge and on dynamic volume state variables These variables return the discharge 38 CHAPTER 3 MODEL FORMULATION Edit Initial Conditions x Init
180. h the argument z and the name of this real list variable is then entered in this field However it is also possible to specify the cross sectional area as an algebraic expression Note that the cross sectional area must be a non increasing function with increasing depth of the lake and that the value of the surface cross sectional area at zg must still be positive It is not allowed to use a time dependence in the cross sectional area The edit field Density is used to specify the density p of water as a function of temperature and concentrations of dissolved and suspended substances An irrelevant constant value can be entered here if the coefficient of turbulent diffusion K is given without reference to the stratification of the water column and if the value of the stability or Brunt Vaisala frequency ea 3 99 poz is not used In the case of a freshwater lake the following formula can be used to approximate the density of the lake water Bithrer and Ambiihl 1975 p 999 84298 kg m 10 3kg m 65 4891 o i T 8 56272 C T 0 059385 C 3 T 1 i Bxk20 3 100 where T is temperature 6 is given as Br amp 0 705 10 em pS 3 101 and K is the electrical conductivity at 20 C that can be calculated from the conductivity at temperature T kr according to Kip SRP 1 72118 0 0541369 C T 1 14842 lt 10 C T 1 222651 107 CT 3 102 The edit field Diffusion is used to specify t
181. hange model structure and parameter values easily AQUASIM s second task is to perform sensitivity analyses with respect to a set of selected variables This feature allows the user to calculate linear sensitivity functions of arbitrary variables with respect to each of the parameters included in the analysis These sensitivity functions help in assessing the identifiability of model parameters identifiability analysis Furthermore the derivatives calculated in sensitivity analyses allow the user to estimate the uncertainty in any variable according to the linear error propagation formula The calculation of the contribution of each parameter to the total uncertainty facilitates the detection of major sources of uncertainty uncertainty analysis The third important task of AQUASIM is to perform parameter estimations au tomatically for a given model structure using measured data This is not only impor tant for obtaining neutral estimates of parameters but is also a main prerequisite for efficiently comparing different models Several calculations each of them describing a single experiment with the possibility for several target variables as well as universal and experiment specific model parameters can be combined to a single parameter estima tion process The quantitative measure of the deviation between model calculations and measurements which is minimized by the parameter estimation algorithm is useful for statistically assessing the
182. he 3 3 COMPARTMENTS 117 Edit Point Input Ea Name Seedamn Description finflowSeedamm ss Mean Depth PO Range foo Water Inflow finlwods Input Cones Variable Input Concentration C_PO4 inflow PO4 1000 C NO3 inflow NO3 1000 C_NH4 inflow_NH4 1000 Add Edit Delete Figure 3 89 Dialog box for editing a single point input to a lake compartment Edit Point Input Concentration x io i Input Conc finflow_NO3 1 000 Figure 3 90 Dialog box for editing a point input concentration for a lake compartment fields Variable and Inflow Conc allow the user to select a variable and specify an inflow concentration Inflow concentrations for any type of variables can be specified but only inflow concentrations for dynamic volume state variables are used by the program The reason for allowing to define inflow concentrations for variables of other types is to facilitate the users switching between models with different state variables A user can change a state variable to a variable of another type without the requirement of editing the lists of inflow concentrations of the compartments Selection of the radio button Sediment Input in the dialog box shown in Fig 3 83 opens the dialog box shown in Fig 3 91 This dialog box contains a list box for defining the substance mass fluxes tseq c and tsea x into the lake sediment For each variable only one unique sediment input flu
183. he coefficient of turbulent diffusion K K can be given as any function of time space stability etc Some formulations for K are described in the following The coefficient of turbulent diffusion can be parameterized as a simple function of space and time K given function of z and t 3 103a 110 CHAPTER 3 MODEL FORMULATION The parameters of such a function can be estimated by AQUASIM using measured data of temperature or substances without or with known transformation processes An alterna tive can be to parameterize the coefficient of vertical turbulent diffusion using the stability or Brunt Vaisala frequency N 3 99 that is accessible as the program variable Brunt Vaisala Frequency A parameterization often used in the literature is given by a i oy T K 3 103b i 2 a Kz mas if N lt 0 or gt Kz mar m The parameters a and b of this expression can be estimated by AQUASIM using several temperature profiles of the lake An additional option is to use the turbulence submodel to estimate the coefficient of vertical turbulent diffusion A possible parameterization is k 1 K T 3 103c The factor 1 Pr is necessary in order to convert from the turbulent viscosity 14 to the diffusion coefficient for substances and temperature There are four Modes of calculation for the lake compartment that can be selected with the radio buttons without Sediment with Sediment without TKE and
184. he substance specific exchange coefficent is dex im i Tepresents the volume exchange rate per unit length of the soil column for the substance described by the concentration Cj Application of the general law for differential conservation laws 3 44 to the definitions given by the equations 3 45 to 3 47 leads to the following set of 5 differential equations The first equation describes water flow through the soil column OQ _ Ox g the spatial gradient of the discharge Q is determined by the lateral inflow q Positive values of q inflow increase the downstream discharge negative values outflow decrease the downstream discharge 3 48 3 3 COMPARTMENTS 73 The second equation describes the behaviour of dissolved substances in the mobile zone of the column OC mob i 1 0 1 o OC mob i EE EE aici F ___ A pas Ot AOmob Ox 2Cmons i AO mob Ox ae Ox Nr q Myr st a 5 Fa Cmobi ae fex imj iCimj i TCmob i j l mob Cmob i 3 49 mob ob The concentration is affected by advection with the water flow first term dispersion second term exchange with the immobile zones adjacent to the mobile zone third term transformation processes fourth term and by lateral inflow or outflow fifth and sixth terms The third equation describes the behaviour of dissolved substances in the mixed zone k of the immobile region j AE Codi fex imj Cimp ji imj B dez imjz i Abim ro Cimj i E Jex imj2 iCim
185. he water column see below The fifth and the sixth components of equation 3 74 describe dissolved and suspended substances in the water column of the lake Both of these one dimensional densities are given as the product of the cross sectional area of the lake A and the horizontally averaged volumetric concentration of the substance In the following concentrations of dissoved substances are described with the symbol C concen trations of particles with the symbol X The index L refers to the water column of the lake and the index 7 indicates that an arbitrary number of such substances can be used simultaneously The last two components of equation 3 74 describe the concentrations of dissolved substances and of particles in the pore volume of sediment layers of the lake The one dimensional density of dissolved substances is given as the product of the gradient of the cross sectional area of the lake dA dz the thickness of the sediment layer hsed the porosity of the sediment layer 0j and the concentration of the dissolved substance in the pore water of the sediment layer averaged over the depth of the sediment layer and over the lake border at a given depth C s The one dimensional density of particles is given as the product of the gradient of the cross sectional area of the lake dA dz the depth of the sediment layer hsea and the concentration of the particles in the sediment layer averaged over the depth of the sediment layer and ov
186. i Tech 31 2 205 214 Simon W Reichert P and Hinz C 1997 Properties of exact and approximate travel ling wave solutions for transport with nonlinear and nonequilibrium sorption Water Resources Research 33 5 1139 1147 Suci P Vrany J and Mittelman M 1998 Investigation of interactions between antimicrobial agents and bacterial biofilms using attenuated total reflection Fourier transform infrared spectroscopy Biomaterials 19 327 339 Sweby P 1984 High resolution schemes using flux limiters for hyperbolic conservation laws SIAM J Numer Anal 21 5 995 1011 Uehlinger U Biihrer H and Reichert P 1996 Periphyton dynamics in a floodprone prealpine river Evaluation of significant processes by modelling Freshwater Biology 36 249 263 Ulrich M Imboden D and Schwarzenbach R 1995 MASAS A user friendly simu lation tool for modeling the fate of anthropogenic substances in lakes Environmental Software 10 3 177 198 BIBLIOGRAPHY 193 van Leer B 1974 Towards the ultimate conservative difference scheme ii Monotonicity and conservation combined in a second order scheme Journal of Computational Physics 14 361 370 von Gunten U Elovitz M and Kaiser H 1997 Characterization of ozonation pro cesses with conservative and reactive tracers Prediction of the degradation of mi cropollutants Analusis Magazine 25 7 29 31 von Schulthess R and Gujer W 1996 Release of n
187. ial equation 3 85 and two boundary conditions for each of the partial differential equations 3 86 to 3 90 are required The ordinary differential equations 3 91 and 3 92 that do not contain spatial derivatives do not require boundary conditions The boundary condition for the equation 3 85 describing vertical discharge at the lake bottom is given by Q zz 0 3 93a According to the equation 3 85 this results in a discharge of 20 Q 20 J qdz 3 93b ZB at the lake surface This discharge is assumed to leave if it is positive or to enter if it is negative the lake at its suface in order to keep the lake volume constant The boundary conditions for the equation 3 86 describing the wind driven horizontal flow are given by U zg 0 3 94a and OU prez 20 Tsur f 3 94b where Tsurf is the wind shear at the lake surface The boundary conditions for the equation 3 87 describing the turbulent kinetic energy are approximated to be no flux conditions Ok and Ok These boundary contitions neglect changes in turbulent kinetic energy due to effects of the lake surface and the lake bottom 3 3 COMPARTMENTS 107 The boundary conditions for the equation 3 88 describing the dissipation of turbulent kinetic energy are approximated to be no flux conditions Oe gP 0 3 96a and Xa 0 3 96b These boundary contitions neglect changes in dissipation of turbulent kinetic energy due to effects of the l
188. ialog boxes shown in Figs 4 5 and 4 17 Time Simulation time Compartment Index Identifier for compartments value set in the dialog box shown in Fig 3 41 Zone Index Identifier for zones within compartments returns a value of 0 Discharge Volumetric flow rate Water Fraction Volumetric fraction of water returns a value of 1 Space Coordinate X Space coordinate along the compartment Cross Sectional Area Area of water body perpendicular to the flow direction Table 3 6 Program variables available in the advective diffusive compartment 70 CHAPTER 3 MODEL FORMULATION 3 3 4 Saturated Soil Column Compartment Overview The saturated soil column compartment of AQUASIM can be used to describe advective dispersive transport of dissolved substances in a saturated soil column exchange processes with immobile regions consisting of serially connected mixed zones and transformations of dissolved and sorbed substances Within the soil column fast sorption processes can be used to describe equilibrium sorption and slower sorption processes to model the effects of sorption kinetics The use of any linear or nonlinear sorption isotherm is possible The inlet and outlet of the soil column compartment can be advectively linked to other AQUASIM compartments Equations Solved by AQUASIM In order to formulate the one dimensional conservation laws dp Oj Op A _ 44 r ae oe compartment specific expressions for the one dimensional den
189. iately before the selected initial condition otherwise it is appended to the end 3 3 COMPARTMENTS 53 Edit Initial Conditions Ea Init Conds Variable Initial Condition L_F Biofilm Matrix L_ Fini Xx AlBiofilm Matris rho X eps Ani gt _H Biofilm Matrix rho_ eps_Hini l aai OK Cancel Figure 3 32 Dialog box for editing initial conditions for a biofilm reactor compartment of the list of initial conditions This gives the user the possibility to influence the order of the initial conditions the order is irrelevant for the program but it may be convenient for the user to have a certain order The dialog box used for editing a single initial condition is shown in Fig 3 33 In this dialog box the fields Variable Zone and Init Edit Initial Condition x Variable XA v Zone Biofilm Matrix red Init Cond ihoXepsAini sssi lt sSCS Cancel Figure 3 33 Dialog box for editing a single initial condition for a biofilm reactor compart ment Cond allow the user to select a variable and a zone and to specify an initial condition In a biofilm compartment there are the zones Bulk Volume Biofilm Matrix and Pore Volume Initial conditions for any type of variables can be specified but only initial conditions for state variables and for the program variable Biofilm Thickness are used by the program The reason for allowing to define initial conditions for variables of other
190. iffusive links can be connected to the same diffusive connection of a compartment If both compartments contain the same solvent it is irrelevant which compartment is connected as compartment 1 and which as compartment 2 This is only relevant if the conversion factor of a substance is not unity In this case it has to be noted that the concentration in compartment 1 is multiplied with the conversion factor in equation 3 110 3 4 LINKS 131 The list box in the dialog box shown in Fig 3 106 shows the list of exchange coefficients dex i and conversion factors fi This list can be edited using the buttons Add Edit and Delete Figure 3 107 shows the dialog box used for defining the exchange coefficient and the Edit Exchange Coefficient x Variable C_02 7 Exch Coeff KMO2 Cony Fact 1 1 H_O2 Cancel Figure 3 107 Dialog box for editing an exchange coefficient of a diffusive link conversion factor of a substance The list button Variable is used to select the state variable in the edit field Exchange Coefficient the exchange coefficient qer i can be specified and in the edit field Conversion Factor 1 the value of the conversion factor fi for the substance concentration in compartment 1 can be given The program variables Time Calculation Value and Link Index can be used for these definitions in addition to all globally available variables Exchange coefficients and conversion
191. in SaF Sp 3 59a zo seo Ane 3 59b Quiff a l where zg and Zp are the elevation of the river bed and of the the water surface respec tively The applicability of the kinematic approximation given by the equation 3 59a is limited by the necessity of a geometry of the river bed that is monotonicly decreasing and simple enough that the bed slope 0zg 0z can reasonably be defined This approximation assumes the driving gravity force to be equilibrated by the friction force everywhere along the river In addition to the gravity and the friction forces the diffusive approximation given by the equation 3 59b considers longitudinal pressure gradients occuring when the water level is not parallel to the river bed In contrast to the kinematic approach the diffusive approximation allows to describe backwater effects of weirs or other hydraulic controls and it can be applied if the river bed is not monotonically decreasing The following one dimensional source terms are required to complete the set of equa tions for the river section compartment q P Aro H Crati 0 qC 3 60 rs 3 3 COMPARTMENTS 87 The first component of equation 3 60 describes the lateral water inflow as volume per unit length of the compartment g This variable can be used to describe the integral effect of small tributaries or the effect of groundwater in or exfiltration Larger tributaries must be modelled as upstream input boundary conditions to a new r
192. in and outflows analogously to the dissolved substances in the fourth component The seventh component of equation 3 77 describes changes in mass of dissolved sub stances in the sediment layer j due to diffusive exchange with neighbouring sediment layers and due to transformation processes The effect of advection on dissolved substances is neglected because always the top sediment layers are described by AQUASIM changes in sediment depth leads to an advective exchange between the sediment layers The eighth component of equation 3 77 describes changes in mass of particulate substances in the sediment layer 7 due to advection caused by sedimentation or by trans formation processes In addition to the continuous conservation laws defined above the energy stored in seiche oscillations is calculated by AQUASIM according to the following equation 20 Pwind A 20 Pbottom f vAvimaz 3 84 ZB dEseiche dt where Eseiche is the energy stored in seiche oscillations and P jngq ist the power of wind excitation of the seiche motion Application of the general law for differential conservation laws 3 73 to the definitions given by the equations 3 74 to 3 77 leads to the following set of 8 differential equations The first equation describes vertical water flow in the lake 3 _ gT The spatial gradient of the discharge Q is determined by the lateral inflow per unit lake depth q Positive values of q inflow into the lake
193. in the right list box can be activated and calculations selected in the left list box can be inactivated this is equivalent to toggle the check box active for sensitivity analysis in the dialog box shown in Fig 4 5 The button Start is used to start the sensitivity analysis the button Close to close this modeless dialog box After clicking the button Start the user is asked to specify the name of a file for a sensitivity ranking If the user clicks Cancel in the file open dialog box no sensitivity ranking is produced this may be advantageous to save computation time if the ranking is not required During execution of the sensitivity analysis the dialog box shown in Fig 4 12 is displayed This dialog box shows the progress of the calculation and it allows the user to interrupt the sensitivity analysis When all simulations have been performed and if a sensitivity ranking file has been specified the dialog box shown 4 2 SENSITIVITY ANALYSIS 149 calculating sensitivity analysis Number of Simulations 14 Current Simulation 8 Figure 4 12 Dialog box for interrupting a sensitivity analysis during calculation in Fig 4 13 appears Now the program calculates a ranking of the sensitivity functions as calculating sensitivity analysis Number of Simulations 14 Current Simulation Sens Ranking Figure 4 13 Dialog box for interrupting a sensitivity ranking without loosing the other sensitivity analysis r
194. ine characters The first character may not be a digit The following reserved names are not allowed as variable names div mod and or not if then else endif pi sin cos tan asin acos atan sinh cosh tanh deg rad exp log ln log10 sign abs sqrt min max To improve documentation of variables a Description and a Unit can be specified With the aid of the list selection box Reference to the user can select the quantity to which the program variable refers to It is not possible to create more than one program variable referring to the same quantity Table 3 1 lists the siginificance of all program variables considered in the current program version Note that not all program variables are available in all compartments and links In section 3 3 for each compartment a list of available program variables is given The program variable Calculation Number is 16 CHAPTER 3 MODEL FORMULATION a non negative integer used for distinguishing different calculations cf section 4 The program variables Compartment Index Zone Index and Link Index are used to make variables depend on compartments zones within compartments and links The values taken by the program variable Zone Index depends on the compartment the values of the program variables Compartment Index and Link Index can be set in the dialog boxes for the definition of compartments and link cf sections 3 3 and 3 4 All other program variables have a physi
195. ing reserved names are not allowed as variable names div mod and or not if then else endif pi sin cos tan asin acos atan sinh cosh tanh deg rad exp log In log10 sign abs sqrt min max To improve documentation of variables a Description and a Unit can be specified The user has to specify the Value of the variable which is used for simulations In sensitivity analyses the Standard Deviation is used to investigate the influence of uncertainty of model parameters to simulation results The Minimum and Maximum bound the range of legal values These bounds also hold for internal changes during sensitivity analyses and parameter estimations For each constant variable it can be decided if it is active for sensitivity analysis and if it is active for parameter estimation These states can also be accessed with the aid of the dialog boxes shown in Figs 4 11 and 4 16 18 CHAPTER 3 MODEL FORMULATION Edit Constant Variable Ed Name Description Maximum specific growth rate for heterotrophic biomass at 20 deg Unit 1 d Value E Std Dev 2 Minimum 3 Maximum fi 5 I active for sensitivity analysis I active for parameter estimation Cancel Figure 3 7 Dialog box for editing a constant variable 3 1 4 Real List Variables Quantities measured as a function of another variable e g time series or spatial profiles are represented by real list variables F
196. ing the definition of a curve within a plot box shown in Fig 5 3 The radio buttons Type are used to select the type of the curve The user has the choice between the following options The radio button Value is selected in order to plot the value of a variable The value of all variables can be plotted if calculated states corresponding to the specifications given below are available If not only a simulation but a sensitivity analysis has been performed the curve for the value of the variable is supplemented by thin lines indicating the value plus and minus one standard deviation calculated according to the linear error propagation formula which ignores parameter correlations 4 10 Usually if the abscissa of the plot is Time the curve for the value of a variable is plotted as linear interpolation between values evaluated at each output time step specified in the dialog box shown in Fig 4 5 for plots drawn after a simulation or a 165 sensitivity analysis or by the time steps of the data specified as fit targets in the dialog box shown in Fig 4 18 for plots drawn after a parameter estimation If the abscissa of the plot is Space similarly the grid points of the spatial resolution of the compartment are used There is one important exception from this general rule If the abscissa of the plot is Time and the variable specified in the curve definition is a real list variable with the program variable Time as the argument or i
197. inlet inputs to an advective diffusive reactor compart ment of the reactor Loadings for any type of variables can be specified but only loadings for dynamic volume state variables are used by the program The reason for allowing to define loadings for variables of other types is to facilitate the users switching between models with different state variables A user can change a state variable to a variable of another type without the requirement ot editing the lists of loadings of the compartments Selection of the radio button Lateral Input in the dialog box shown in Fig 3 46 opens the dialog box shown in Fig 3 49 The edit field Water Inflow of this dialog box is used to specify the discharge of water per unit length into the compartment q and the list box contains substance concentrations Cigz in the inflowing water A positive value of q represents a flow into the compartment a negative value represents an outflow According to the equations 3 38 and 3 40 the inflow concentration is irrelvant if q is smaller than or equal to zero outflow For each variable only one unique lateral inflow concentration can be specified The list of inflow concentrations can be edited using the buttons Add Edit and Delete If an inflow concentration is selected while adding a new inflow concentration the new inflow concentration is inserted in the list immediately before the selected inflow concentration otherwise it is
198. iofilm reactor compartment Growth Velocity of Biofilm Advective velocity of biofilm solid matrix biofilm reactor compartment Interface Velocity of Biofilm Velocity of the interface between biofilm and bulk fluid biofilm reactor compartment Detachment Velocity of Biofilm Detachment velocity of particles from the biofilm surface biofilm reactor compartment Attachment Velocity of Biofilm Attachment velocity of particles onto the biofilm surface biofilm reactor compartment Water Level Elevation Elevation of water level above an absolute reference level river section compartment Cross Sectional Area Area of water body perpendicular to the flow direction advective diffusive compartment saturated soil column compartment river section compartment Perimeter Length Length of the interface between water and the river bed per pendicular to the flow velocity river section compartment 3 1 VARIABLES 17 Surface Width Length of the interface between water and the atmosphere perpendicular to the flow velocity river section compart ment Friction Slope Nondimensional friction force Friction force divided by grav ity force river section compartment Density Density of the water lake compartment Area Gradient Gradient of the cross sectional area as a function of depth lake compartment Brunt Vais l Frequency Stability frequency of the water column lake compartment Horizontal Velocity Velocity of horizontal wi
199. ion and Acc in the dialog box used for the definition of a saturated soil column compartment Fig 3 53 the user can select the number of grid points the discretization order of the numerical algorithm and the accuracies of program variables The number of grid points is used to specify by how many discrete points the continuous z axis is approximated If the number of grid points is set to Ngp the column is resolved longitudinally into 2 boundary points and ngp 2 grid points located in the middle of ng 2 cells of equal thickness For this division of the z axis the low resolution method applies a simple first order discretization scheme that is very robust but can have significant numerical diffusion The high resolution method uses a second order discretization scheme that applies flux limiters to avoid oscillations of the numerical solutions Reichert 1994b chapter 6 The button Acc is used to specify the numerical accuracies of program variables as described later in this subsection The check box active for calculation can be used to activate or inactivate the compartment from the calculations This check box has the same functionality as the buttons Activate and Inactivate in the dialog box shown in Fig 3 19 As for each compartment the user has to select which state variables are active This is done by clicking the button Variables of the dialog box shown in Fig 3 53 This action opens the
200. ion x 4 13 to be minimized There is exactly one linear function in the parameters that passes through all function values y p for all m 1 parameter sets For this linear function the expression 4 13 is a quadradic form with exactly one well defined minimum The idea of the secant technique Ralston and Jennrich 1978 is to 4 3 PARAMETER ESTIMATION 153 Pi Pi P min i IP maxi Pi Figure 4 15 Scaled tan function used to transform the bounded interval Pmin i Pmaz i Of the parameter p to the whole real axis for the parameter p replace one of the m 1 parameter arrays with the array leading to the minimum for the linear approximation of the model functions y p at each iteration step In order to take into account the constraints of the parameters the secant technique was combined with the active set technique Gill et al 1981 for the implementation in AQUASIM In the active set technique the inequality constraints 4 14 are replaced by a number of active equality constraints for which some of the parameters are exactly on one of their boundary values After each iteration step this set of active constraints is checked for validity and changes to this set are made if this seems to be necessary Because it looks for a downward direction in a very robust way the simplex technique may be applied even to a poorly defined parameter estimation process with starting values of the parameters far from those
201. iquid phase volume fraction 42 mass transfer resistance 48 56 name 49 number of grid points 51 197 overview 41 particulate variables 49 55 pore volume 41 porosity 42 rate of change 51 reactor type 50 reactor volume 48 50 resolution 51 rigid solid matrix 50 solid matrix 41 space coordinate z 41 state variable 42 49 54 dynamic 42 49 54 volume 42 49 54 substratum 41 surface attachment coefficient 56 surface detachment coefficient 56 suspended solids 41 50 unconfined reactor 48 50 user definitions 49 58 velocity of biofilm matrix 43 volume bulk 48 reactor 48 volume attachment coefficient 56 volume detachment coefficient 56 zones 41 biofilm thickness biofilm reactor compartment 41 45 program variable 53 57 58 program variable 16 bottom coordinate lake compartment 109 bottom friction lake compartment 103 123 boundary condition advective diffusive reactor compart ment 61 biofilm reactor compartment 46 47 lake compartment 106 107 river section compartment 87 88 saturated soil column compartment 74 Brunt Vaisala frequency lake compartment 109 110 program variable 110 112 124 program variable 17 bulk volume 198 biofilm reactor compartment 41 48 50 program variable 57 58 mixed reactor compartment program variable 39 program variable 16 buoyancy production of TKE lake compartment 101 103 program variable 124 program variable 17 calc me
202. iron Sci Technol 31 253 260 Glod G Brodmann U Angst W Holliger C and Schwarzenbach R 1997b Cobalamin mediated reduction of cis and trans dichloroethene 1 1 dichloroethene and vinyl chloride in homogeneous aqueous solution reaction kinetics and mechanis tic considerations Environ Sci Technol 31 3154 3160 Goudsmit G H Reichert P and W est A 1996 Modelling of physical and bio geochemical properties in lakes using AQUASIM In M ller A editor Hydroinfor matics 96 pages 779 786 Balkema Rotterdam Gujer W and Wanner O 1990 Modeling mixed population biofilms In Characklis W and Marshall K editors Biofilms pages 397 443 John Wiley amp Sons New York Henderson F 1966 Open channel flow Macmillan New York Henze M Grady C Gujer W Marais G and Matsuo T 1986 Activated sludge model no 1 Scientific and Technical Report 1 AWPRC Task Group on Math ematical Modelling for Design and Operation of Biological Wastewater Treatment Processes AWPRC London Hindmarsh A 1983 ODEPACK a systematized collection of ODE solvers In Steple man R editor Scientific Computing pages 55 64 IMACS North Holland Horn H and Hempel D 1995 Mass transfer coefficients for an autotrophic and a heterotrophic biofilm system Wat Sci Tech 32 8 199 204 Horn H and Hempel D 1997 Substrate utilization and mass transfer in an autotrophic biofilm system
203. issolved or particulate substances for dynamic volume state variables These options are also described later in this subsection 50 CHAPTER 3 MODEL FORMULATION The next option allows the user to select the reactor type Selection of the radio button confined leads to the use of a reactor with a constant total volume for biofilm and bulk fluid The value for this total reactor volume can be specified in the edit field labelled Reactor Vol In such a reactor growth of the biofilm leads to a decrease in bulk volume as described by equation 3 32a Selection of the radio button unconfined leads to the use of a reactor with a constant bulk volume In this case a growing biofilm leads to a growth in total reactor volume The value of the bulk volume can be specified in the edit field Bulk Volume This option can be used to model free surface water flow over a biofilm The next option is used to select the properties of the pore volume Selection of the radio button liquid phase only leads to a model without suspended solids in the pore water Such a model is adequate to describe a dense biofilm with very small pores in which there is no relevant motion of suspended solids Selection of the radio button with suspended solids leads to a model in which solids can penetrate a biofilm within the pore water Such a model is suitable to describe biofilms with a high porosity The radio buttons rigid and diffusive
204. itrous oxide from denitrifying acti vated sludge Verification and application of a mathematical model Water Research 30 3 521 530 von Schulthess R Wild D and Gujer W 1994 Nitric and nitrous oxides from denitrifying activated sludge at low oxygen concentration Wat Sci Tech 30 6 123 132 Vrany J Stewart P and Suci P 1997 Comparison of Recalcitrance to Ciprofloxacin and Levofloxacin exhibited by Pseudomonas aeruginosa biofilms displaying rapid transport characteristics Antimicrobial Agents and Chemotherapy 41 6 1352 1358 Wanner O 1994 Modeling of mixed population biofilm accumulation In Geesey G Levandowski Z and Flemming H C editors Biofouling and Biocorosion in Indus trial Water Systems pages 37 62 Lewis Publishers Boca Raton Wanner O 1995 New experimental findings and biofilm modelling concepts Wat Sci Tech 32 133 140 Wanner O 1996 Modelling of biofilms Biofouling 10 1 3 31 41 Wanner O Cunningham A and Lundman R 1995 Modeling biofilm accumulation and mass transport in a porous medium under high substrate loading Biotechnology amp Bioengineering 47 703 712 Wanner O Debus O and Reichert P 1994 Modelling the spatial distribution and dynamics of a xylene degrading microbial population in a membrane bound biofilm Wat Sci Tech 29 10 11 243 251 Wanner O and Gujer W 1984 Competition in biofilms Wat Sci Tech 17 27 44
205. ive Processes Available Processes Degradation Reaeration Degradation Reaeration Inactivate a Cancel Figure 3 69 Dialog box for activating and inactivating processes in a compartment boxes in this dialog box show the active processes and the available processes respectively The button Activate is used to activate available processes selected in the right list box and the button Inactivate is used to inactivate a active processes selected in the left list box If an active process is selected while activating another process the new active process is inserted in the list of active processes immediately before the selected process otherwise it is appended to the end of the list of active processes This gives the user the possibility to influence the order of active processes the order is irrelevant for the program but it may be convenient for the user to have a certain order Initial conditions for a river section compartment can be specified by clicking the button Init Cond of the dialog box shown in Fig 3 67 This action opens the dialog box shown in Fig 3 70 This dialog box shows a list of all initial conditions already specified Each line of the list box contains the name of a variable followed by the zone of the compartment for which the initial condition is specified in brackets and by the 3 3 COMPARTMENTS 93 Edit Initial Conditions Init Conds Variable Initial Condition
206. iver section compartment The second component of equation 3 60 describes the effect of transformation processes in the compartment and the effect of lateral inflows or outflows Chat is the concentration in the lateral inflow q The last component describes the effect of transformation processes on settled or sorbed substances or on growing organisms Application of the general law for differential conservation laws 3 56 to the definitions given by the equations 3 57 to 3 60 leads to the following set of 3 differential equations The first equation describes water flow through the compartment OA OQ OL pA q 3 61 The temporal change in the wetted cross sectional area A is determined by the spatial gradient of the discharge Q and by the lateral inflow q A negative spatial gradient of the discharge causes an increase in the wetted cross sectional area because more water flows into a river segment from upstream then leaves it downstream Obviously a positive lateral inflow also increases the wetted cross sectional area Note that the equation 3 61 must be solved simultaneously with one of the equations 3 59a or 3 59b The second equation describes the behaviour of substances transported with the water flow AC 87 8 8G Be ge a 48 NG Hage qC at i Hage qC 3 62 The concentration is affected by advection with the water flow first term longitudinal dispersion second term transformation proces
207. ives the user the possibility to influence the order of active processes the order is irrelevant for the program but it may be convenient for the user to have a certain order Initial conditions for a lake compartment can be specified by clicking the button Init Cond of the dialog box shown in Fig 3 78 This action opens the dialog box shown in Fig 3 81 This dialog box shows a list of all initial conditions already specified Edit Initial Conditions Ed Init Conds Variable Initial Condition C_O02 Water Column 02_910109 PO4 Water Column PO4 910109 C_NO3 Water Column NO3_910109 C_NH4 Water Column NH4_910109 C_alg Sediment Layer C_alg_ini_sed C_NH4 Sediment Layer C_NH4_ini_sed x Add Edit Delete Cancel Figure 3 81 Dialog box for editing initial conditions for a lake compartment Each row of the list box contains the name of a variable followed by the zone of the compartment for which the initial condition is specified in brackets and by the algebraic expression specifying the initial value For each combination of a variable with a zone only one unique initial condition can be specified The list of initial conditions can be edited using the buttons Add Edit and Delete If an initial condition is selected while adding a new initial condition the new initial condition is inserted in the list immediately before the selected initial condition otherwise it is appended to the
208. j j Ab o ro f for k nz Ming j Cimin pi 2 9 T Sinobi Sim syst 3 47 The first component of equation 3 47 describes the lateral water inflow as volume per unit length of the column g The second component describes the effect on the mobile zone concentrations of the exchange between the mobile zone and the first mixed zones 7m 11 tO iMn Of the n immobile regions that are adjacent to the mobile zone the effect of transformation processes in the mobile zone and the effect of lateral inflows or outflows Ciat is the concentration in the lateral inflow q The third component describes the effect of the exchange with neighbouring zones of the n j serially connected mixed zones of the immobile region j The first row of this component describes the exchange of the first mixed zone with the mobile zone and the second mixed zone the second row the exchange of an intermediate mixed zone with the neighbouring mixed zones and the last row the exchange of the last mixed zone with the second to last mixed zone of the immobile region j All exchange processes are assumed to be proportional to the difference between the concentration in one of the adjacent zones and a concentration multiplied with a conversion factor fea imx sis in the other zone The consideration of a conversion factor makes the description of systems with different solvents possible If all zones are filled with the same solvent all conversion factors are unity T
209. kae surf X M k Ude 3 21b T 6 Lr PX 3 210 k 1 46 CHAPTER 3 MODEL FORMULATION The attachment velocity is calculated similarly to the equation 3 21b as 1 Kat surf X X L k Uat a 3 22 TOE a pe a where kat surf x is the surface attachment coefficient for the solids described by the concentrations X In all the above equations Xz is the concentration of solids of type i in the liquid boundary layer above the biofilm immediately adjacent to the biofilm surface In order to make the solution of the above system of differential equations unique boundary conditions must be specified For the case of a rigid biofilm matrix all Dyy x 0 no boundary condition is required for equation 3 14 at the substratum biofilm interface For the case of a diffusive biofilm matrix all Dm x gt 0 equation 3 14 is solved with the following boundary condition at the substratum biofilm interface OX Mi 57 z 0 0 3 23a The boundary condition for equation 3 14 at the biofilm surface is determined by attach ment and detachment processes For a rigid biofilm matrix all Dm x 0 the boundary condition is given by ude a Uat X ui Lr for Ude gt Uat Pew at surf X X14 Uat up up Xui Lr 3 23b ude Uat for Ude lt Uat For a diffusive biofilm matrix the boundary condition for equation 3 14 at the biofilm surface is given by OX Mi L Oz Lr kde surf x Xm il Lr K
210. l compared to the typical time scale of the problem of interest With this approximation the algorithm still has to decrease the time step considerably at the points where the time derivative is discontinuous the integration order is also reduced to 1 As an alternative a smoothed step function with continuous derivatives can be used e g a step approximated by third order spline polynomials for which in addition to the value of the function also the first and second derivatives are continuous A second disadantage of the Gear algorithm is that it requires the evaluation of the jacobian matrix _ OF 5 I 4 8 for solving the nonlinear system of algebraic equations at each time step The implemen tation DASSL Petzold 1983 allows only the choice between using the full or a banded jacobian matrix For linearly arranged systems of compartments and in AQUASIM if the alphabetic order of compartments corresponds to the sequence of flow the option of a banded jacobian matrix with a number of codiagonals cf section 3 5 equals to twice the number of equations solved at one grid point leads to a very efficient solution pro cedure However in the case of branched systems or systems with recirculations due to typically only a few nonzero elements of the jacobian matrix far from its main diagonal the option of a full jacobian matrix must be used The evaluation of the jacobian matrix then consumes much computation time and can make
211. l it is assumed that the user is familiar with system specific handling of menus windows list boxes buttons etc The description mainly concentrates on the window interface version of the program The functionality of the character interface version is the same with the exception that it is not possible to plot graphics to the screen with this program version In section 6 1 a brief introduction to the character interface version is given In section 6 2 it is shown how batch jobs can be submitted Figure 1 1 shows the main window of AQUASIM with the header the menu bar and a button bar which facilitates the access to the most important menu commands from left to right File New File 0pen File Save Edit Cut inactive Edit Copy inactive Edit Paste inactive Edit System Edit Delete States Calc Simulation Calc gt Sensitivity Analysis Calc gt Parameter Estimation View Re sults ViewClose Dialogs The commands in the four menus File Edit Calc and View are described in the chapters 2 5 of this user manual The menu File chapter 2 is used for saving loading and printing the current AQUASIM system which consists of EIAQUASIM lawprel File Edit Calc View Window Help Dls fee a oola eel Figure 1 1 Main window of AQUASIM the mathematical model measured data definitions of sensitivity analyses and parame ter estimations plot definitions and calculated states With the aid of the
212. lation numbers for which calculated states are currently available The right list box of this dialog box shows the states that are available for the calculation number selected in the left list box the right list box is empty if in the left list box no or more than one calculation numbers are selected The button Delete below the left list box makes it possible to delete all calculated states for all selected calculation numbers the button Delete below the right list box can be used to delete the selected calculated states for the calculation number selected in the left list box Note that initializing a simulation for a given calculation number also leads to the dele tion of all calculated states for this calculation number and that editing operations which lead to a change in the number of differential equations to be solved e g addition deletion of a compartment activation inactivation of state variables changes of the numbers of 136 CHAPTER 3 MODEL FORMULATION grid points of comartments etc also leads to the deletion of all calculated states for all calculation numbers Chapter 4 Simulation and Data Analysis Fig 4 1 shows the menu Calc of AQUASIM The item Simulation of this menu is EIAQUASIM lawprel File Edit View Window Help k Simulation Sensitivity Analysis Parameter Estimation Figure 4 1 Calc menu used to define and execute simulations for the user defined model the i
213. le 17 identifiability analysis 3 144 146 immobile region saturated soil column compartment 70 76 81 82 inflow mixed reactor compartment 34 initial conditions INDEX advective diffusive reactor compart ment 62 63 biofilm reactor compartment 49 52 lake compartment 108 112 mixed reactor compartment 35 36 river section compartment 89 92 saturated soil column compartment 75 78 initial state calculation parameter estimation 155 sensitivity analysis 141 simulation 141 initial time calculation parameter estimation 155 sensitivity analysis 141 simulation 141 initialize simulation 140 inlet input advective diffusive reactor compart ment 64 65 saturated soil column compartment 79 input advective diffusive reactor compart ment 62 64 biofilm reactor compartment 49 53 inlet advective diffusive reactor compart ment 64 65 saturated soil column compartment 79 lake compartment 108 113 lateral advective diffusive reactor compart ment 64 66 lake compartment 113 114 river section compartment 94 95 saturated soil column compartment 79 80 mixed reactor compartment 35 37 point lake compartment 113 116 river section compartment 89 94 saturated soil column compartment 75 79 sediment INDEX lake compartment 113 117 surface lake compartment 113 upstream river section compartment 94 interface velocity of biofilm biofilm reactor compartment program variable 58 pr
214. le contains the parameter values and the corresponding values for all result definitions specified in the result definition file CAUTION an existing file with this name is overwritten without warning Name of an input text file plot command file specifying the names of the plot definitions that are used to generate plots and the file names to which the plots are written in PostScript format A plot command file contains an arbitrary number of lines of the form plot psfile where plot is the name of a plot definition and psfile is the name of a PostScript file to which the plot is appended Name of an input text file list command file specifying the names of the plot definitions that are used to generate listings of results and the file names to which these results are written in ascii format A list command file contains an arbitrary number of lines of the form plot lisfile where plot is the name of a plot definition and lisfile is the name of a text file to which the results are appended If the batch version of AQUASIM is started without command line arguments e g on systems that do not support this feature the program looks for a file aquasim job in the current directory If it finds such a file this file is interpreted as an AQUASIM job file if no file with this name exist the programs terminates with an error message As an example an AQUASIM job file containing the lines e fiti log test aqu test_res aqu test1 fit
215. licate the selected compartment can be duplicated With the button Edit or by double clicking the compartment name in the list box a com partment can be edited Finally the button Delete allows the program users to delete 3 3 COMPARTMENTS 33 compartments Deletion of a compartment is only possible if the compartment is not an argument of a link or of a definition of a sensitivity analysis or of a parameter estimation The buttons Duplicate Edit and Delete are inactive as long as no compartment is se lected The buttons Activate and Inactivate can be used to activate and inactivate compartments from the calculation The names of inactive compartments are indented in the list box of the dialog box shown in Fig 3 19 Clicking the Close button results in closing this dialog box It can be reopened by choosing the Compartments command in the Edit menu shown in Fig 3 2 After clicking one of the buttons New in the dialog box shown in Fig 3 19 the com partment type can be selected in the dialog box shown in Fig 3 20 The six types of Select Compartment Type x Biofilm Reactor Compartment C Advective Diffusive Reactor Compartment Saturated Soil Column Compartment C River Section Compartment Lake Compartment Cancel Figure 3 20 Dialog box for selecting the type of a compartment compartments shown in this selection box are described in more detail in the following six subsections 34 CHA
216. list variable 10 12 21 22 add argument value pairs 22 argument 22 delete argument value pairs 22 description 21 name 21 replace argument value pairs 22 unit 21 variable type 10 12 13 variable volume mixed reactor compartment 35 variables dissolved biofilm reactor compartment 56 lake compartment 120 edit menu 11 13 particulate biofilm reactor compartment 55 lake compartment 118 velocity biofilm matrix biofilm reactor compartment 43 horizontal 17 123 124 velocity of biofilm matrix biofilm reactor compartment 43 view menu 5 161 170 volume bulk 16 39 41 57 58 biofilm reactor compartment 48 constant mixed reactor compartment 34 35 mixed reactor compartment 34 35 pore 41 reactor 16 35 38 39 57 58 biofilm reactor compartment 48 mixed reactor compartment 34 variable mixed reactor compartment 34 35 volume attachment coefficient biofilm reactor compartment 56 volume detachment coefficient biofilm reactor compartment 56 volume flux lake compartment 121 volume fraction mobile zone 214 saturated soil column compartment 76 saturated soil column compartment 82 volume state variable 14 volumetric inflow mixed reactor compartment 34 volumetric outflow mixed reactor compartment 34 water flow advective link 126 bifurcation 126 128 water fraction advective diffusive reactor compart ment program variable 69 biofilm reactor compartment program variable 57 58 lake com
217. lume state variables divide proportional to the division of water flow as it is typical for dissolved substances in the second case the mass fluxes of all substances transported through the bifurcation have to be specified This second option can be used to define mass separation e g increase in concentrations of particulate substances at the bottom outlet of a settler If the mass fluxes are selected to be given they are displayed in the list box and can be edited using the buttons Add Edit and Delete 3 4 LINKS 129 Figure 3 105 shows the dialog box used for defining a mass flux for a substance the Edit Bifurcation Flux x Variable C_02 E Flux Q_recirc C_02 Figure 3 105 Dialog box for editing a mass flux within a bifurcation of an advective link concentration of which is represented by a dynamic volume state variable The list button Variable is used to select the state variable in the edit field Flux the mass flux I can be specified as an algebraic expression In this expression globally available variables the program variables Time Calculation Number and Link Index the program variable Discharge representing the inflow to the link not the bifurcating flow and dynamic volume state variables representing link inflow concentrations can be used Bifurcation mass fluxes can be defined for any type of variable but only those for dynamic volume state variables have an effect 3
218. maller than typical values of the variable 3 3 COMPARTMENTS 39 Water Inflow Oin Loadings Variable Loading C_ALK G_in C_ALKin CI G_in C_lin C_ND G_in C_NDin G_in C_NH4in Figure 3 26 Dialog box for editing inputs to a mixed reactor compartment In Table 3 4 the program variables available in a mixed reactor compartment are sum marized for a complete overview of all program variables see Table 3 1 on page 17 Calculation Number Identifier for calculations value set in the dialog boxes shown in Figs 4 5 and 4 17 Time Simulation time Compartment Index Identifier for compartments value set in the dialog box shown in Fig 3 21 Zone Index Identifier for zones within compartments returns a value of 0 Discharge Volumetric flow rate Water Fraction Volumetric fraction of water returns a value of 1 Reactor Volume Total volume of the reactor Bulk Volume Volume of mixed water zone returns the value of the reactor volume Table 3 4 Program variables available in the mixed reactor compartment 40 CHAPTER 3 MODEL FORMULATION Edit Input Loading Edit ccuracies of Program Yariables ae Figure 3 28 Dialog box for editing the accuracies of program variables of a mixed reactor compartment 3 3 COMPARTMENTS 41 3 3 2 Biofilm Reactor Compartment Overview A biofilm consists of a solid matrix with pore water that can contain dissolved substances a
219. ms in which substrate gradients over the depth are important e Advective Diffusive Reactor Compartments are used to describe systems with a longitudinal given water flow such as plug flow reactors e Saturated Soil Column Compartments are used to model transport ad sorption and transformation of substances in saturated soil columns including exchange with dead zones or immobile pore volume e River Section Compartments are used to describe the hydraulics transport and transformation processes in rivers e Lake Compartments are used to model stratification mixing transport and transformation processes in horizontally well mixed lakes Figure 3 19 shows the dialog box for editing compartments This dialog box is opened Edit Compartments Ed e Reactor3 _ Activate Inactivate z Type Mixed Reactor Compartment Figure 3 19 Dialog box for editing compartments with the Compartments command in the Edit menu shown in Figure 3 2 It is of modeless type in order to facilitate the editing process The names of all compartments already defined are listed alphabetically in the list box of this dialog box The type of the cur rently selected compartment is indicated at the bottom of this dialog box The buttons of this dialog box allow the user to perform the following operations with compartments By clicking the button New new compartments may be created from scratch Alternatively by clicking the button Dup
220. n unity The list box of the dialog box shown in Fig 3 64 shows the exchange coefficients dex im i and the conversion factors Jez imx sis of the substances exchanged between the current mixed zone and the mixed zone immediately adjacent to the current mixed zone in direction to the mobile zone for the first mixed zone this is the exchange coefficient with the mobile zone The conversion factor can be used to describe transitions between different solvents in the pores If all pores are filled with the same solvent the conversion factors are unity The list of exchange coefficients and conversion factors can be edited with the buttons Add Edit and Delete If an exchange coefficient is selected while adding a new exchange coefficient the new exchange coefficient is inserted in the list immediately before the selected exchange coefficient otherwise it is appended to the 3 3 COMPARTMENTS 83 Edit Mixed Zone Eg Zone Index 5 Vol Fraction theta_im_05 Exch Pars Variable Exchange Coefficient Conversion Factor Figure 3 64 Dialog box for editing a mixed zone of a soil column compartment end of the list of exchange coefficients This gives the user the possibility to influence the order of the exchange coefficients the order is irrelevant for the program but it may be convenient for the user to have a certain order The Figure 3 65 shows the dialog box used for defining exchange coefficients and conversion fa
221. n 2 0 win mfc List File 2K ak gt K 2k 2k 2k 2k gt K 2K 2A 3k 2k 2k 2k 2K K 2A 2 2 2A gt K K 2K 2K 2K 2k 2k gt k gt K gt k gt K 2 9 2 9 EE EK K 2 2 2K 2 9 EEE 24 2 2K 2 gt k 92K EOE Ek Date and time of listing 05 05 1998 11 47 00 Name of plot Val_Prod Type Argument Value Argument Value Variable t Prodi t Prod Parameter CalcNum 0 1 Compart Reactor Reactor Zone Bulk Volume Bulk Volume Time Space 0 0 Unit s mg0 1 h s mg0 1 h Legend 90uE m2 s 90uE m2 s 150 0 095 0 0 300 0 16 20 0 01492 600 0 16 40 0 02858 900 0 14 60 0 04106 1200 0 13 80 0 05248 1500 0 13 100 0 06291 1800 0 13 120 0 07246 2100 0 13 140 0 08118 160 0 08915 180 0 09644 200 0 1031 220 0 1092 240 0 1147 260 0 1198 280 0 1244 300 0 1286 320 0 1325 340 0 136 360 0 1392 380 0 1421 400 0 1447 420 0 1471 440 0 1493 460 0 1513 480 0 1531 500 0 1548 Chapter 6 Appendix 6 1 Character Interface Version Besides the window interface version of AQUASIM described in the other sections of this manual there exists a character interface version with the same functionality exept that it is not able to draw plots to the screen This version is designed for editing AQUASIM system files and for executing simulations sensitivity analyses and parameter estimations via simple character oriented terminal connections and for automating editing tasks with the aid of scripts of the operating system For normal usage of the program the window interface versio
222. n at time 49 92 05 12 1998 22 03 08 Integration at time 49 9 182 CHAPTER 6 APPENDIX 05 12 1998 22 03 13 Integration at time 0 9 05 12 1998 22 03 13 Integration at time 0 92 05 12 1998 22 03 13 Integration at time 0 94 05 12 1998 22 03 13 Integration at time 0 96 05 12 1998 22 03 13 Integration at time 0 98 05 12 1998 22 03 13 Integration at time 1 05 12 1998 22 03 13 End of calculation Number of equations 50 Number of integers needed for calculation 70 Number of reals needed for calculation 2990 Current integration time 1 0055 Current step size 0 00915549 Current order of integration 3 Number of steps taken 420 Number of function evaluations 864 Number of evaluations of the jacobian 48 Number of error test failures 10 Number of convergence test failures 2 First information on the initialization process is given The value of the numerical param eter Number of Codiagonals of the Jacobian Matrix cf section 3 5 and the time at which the initial condition is evaluated are given Then start time and end time of the initialization procedure are given As a next group of parameters the number of equations solved by the numerical algorithm and the memory requirements for the initialization process expressed as a number of integer variables and a number of real variables are listed The number of steps and the number of evaluations of the jacobian matrix required for the calculation of the initial state conclude th
223. n in Fig 4 10 It is interesting that the magnitudes of the error contributions F Parest_b Error Contributions ol x Error Contributions gt E S e ea Figure 4 10 Example of a plot of error contributions of three model parameters on a calculated concentration due to the parameters K and rmaz are of a similar size despite the difference in sensitivity shown in Fig 4 8 The reason for this effect is the higher uncertainty in the estimate of K resulting form the smaller sensitivity The derivatives required for calculating the sensitivity functions 4 9a to 4 9d the standard deviations of calculated variables according to equation 4 10 and the contri butions of parameter uncertainties to the total uncertainty according to equation 4 11 are calculated using the finite difference approximation Oy __ ylpi Api y i 4 12 Opi Api where Ap is chosen to be 1 of the standard deviation op of the parameter p In order to make the program as flexible as possible the solutions for the basic parameter values p1 Pm and for all sets of parameter values where one of the p s is replaced by p Ap are calculated one after the other and stored simultaneously Using these m 1 stored states all the expressions 4 9a to 4 9d 4 10 and 4 11 can be evaluated easily for any variable y Figure 4 11 shows the dialog box used for defining and starting a sensitivity analysis This dialog box is opened with
224. n is much more attractive Because the menu and dialog structure of the character interface version is exactly the same as that of the window interface version the other chapters of this manual can be used as a manual for the character interface version also In the following some specific hints on the usage of the character interface version are given and a simple example demonstrates how to start and exit the character interface version In the character interface version user input is prompted with a sign j and each user input must be followed by pressing Return Menu items have to be selected by typing the number preceeding the item and pressing Return Within menus and submenus Return without giving an input before leads back to the previous menu level Default values proposed in square brackets can be accepted by pressing Return without giving a new input before The following sequence shows how to start and exit the character interface version of AQUASIM the two menus correspond to the menu bar of the window shown in Fig 1 1 and to the menu File shown in Fig 2 1 171 172 CHAPTER 6 APPENDIX gt aquasimc 2A ak 2 3K aK ak ak 2A 2A 3K 2 aK ak 3K 3K K 222A 3K 2K 3K aK 2K 2K 2K aK 9K 3K aK aK 2K 3K 2K aK 3K 3K 2K K 3K 2 2 2 AQUASIM Simulation of Aquatic Systems aK K 2K 2K 2K 2K 2K 2K 2K K 2K 2K 2K 2K 2K 2K FK K FK FK K FK 2 FK FK FK K 2K FK K 2K FK FK FK FK FK 2 kk K FK FK K K K K
225. n the biofilm pore volume Volumetric flow rate Volumetric fraction of water Depth coordinate in the biofilm zero at the substratum biofilm interface Total volume of the reactor Volume of mixed water zone outside of the biofilm Thickness of the biofilm Advective velocity of biofilm solid matrix Velocity of the interface between biofilm and bulk fluid Detachment Velocity of Biofilm Detachment velocity of particles from the biofilm surface Attachment Velocity of Biofilm Attachment velocity of particles onto the biofilm surface Table 3 5 Program variables available in the biofilm reactor compartment 3 3 COMPARTMENTS 59 3 3 3 Advective Diffusive Reactor Compartment Overview The advective diffusive reactor compartment of AQUASIM can be used to describe one dimensional advective diffusive transport of substances in a flow through reactor exchange with settled sorbed or sessile substances or organisms and substance transformations The inlet and outlet of the advective diffusive reactor compartment can be linked advec tively to other AQUASIM compartments Equations Solved by AQUASIM In order to formulate the one dimensional conservation laws ap A compartment specific expressions for the one dimensional density 6 amount of conserved quantity per unit compartment length for the one dimensional flux j amount of the conserved quantity transported per unit time and for the one dimensional source term
226. nd Reichert P 1995 Design techniques of a computer program for the identification of processes and the simulation of water quality in aquatic systems Environmental Software 10 3 199 210 Reichert P 1998 AQUASIM 2 0 Tutorial Technical report Swiss Federal Institute for Environmental Science and Technology EAWAG CH 8600 D bendorf Switzerland Reichert P von Schulthess R and Wild D 1995 The use of AQUASIM for estimating parameters of activated sludge models Wat Sci Tech 31 2 135 147 Reichert P and Wanner O 1997 Movement of solids in biofilms Significance of liquid phase transport Water Science and Technology 36 1 321 328 Rodi W 1980 Turbulence models and their applications in hydraulics State of the art paper International Association for Hydraulic Research IAHR Delft Netherlands Rodi W 1987 Examples of calculation methods for flow and mixing in stratified flows J Geophys Res 92 5305 5328 Sanderson S and Stewart P 1997 Evidence of bacterial adaptation to monochlo ramine in Pseudomonas aeruginosa biofilms and evaluation of biocide action model Biotechnology amp Bioengineering 56 2 201 209 Shamir U and Harleman D 1967 Numerical solutions for dispersion in porous medi ums Water Resources Research 3 2 557 581 Siegrist H Krebs P B hler R Purtschert I Rock C and Rufer R 1995 Deni trification in secondary clarifyers Wat Sc
227. nd driven flow lake compartment Turbulent Kinitic Energy TKE Turbulent kinetic energy TKE per unit mass of water in the lake lake compartment Shear Production of TKE Production of TKE due to shear of horizontal velocity lake compartment Buoyancy Production of TKE Production or loss of TKE due to density differences lake compartment Dissipation Dissipation of turbulent kinetic energy lake compartment Energy of Seiche Oscillation Total energy stored in Seiche motion lake compartment Table 3 1 Significance of program variables 3 1 3 Constant Variables Constant variables can be used to describe single measured quantities consisting of a value and its accuracy characterized by the standard deviation Alternatively constant variables can be used as model parameters the values and standard deviations of which are estimated by the program In this case the minimum and the maximum bound the legal range of values For simulations only the value of a constant variable is used It remains constant during the simulation The standard deviation together with the legal range is used during sensitivity analyses Figure 3 7 shows the dialog box used for defining or editing a constant variable As each variable a constant variable needs a unique Name as an identifier A name of a variable consists of a sequence of letters A Z a z digits 0 9 and underline characters _ The first character may not be a digit The follow
228. nd on state variables These variables return the discharge and the current values of state variables in the compartment as a function of the location x Inflow concentrations for any type of variables can be specified but only inflow concentrations for dynamic volume state variables are used by the program The reason for allowing to define inflow concentrations for variables of other types is to facilitate the users switching between models with different state variables A user can change a state variable to a variable of another type without the requirement of editing the lists of lateral inflow concentrations of the compartments The buttons Add Edit and Delete of the dialog box shown in Fig 3 53 allow to define immobile zones Several immobile regions each of which with an arbitrary number of serially connected mixed zones can be defined Figure 3 63 shows the dialog box used for defining an immobile region The edit field Name is used to specify the name of the immobile region Each immobile region needs a unique name as an identifier A name of 82 CHAPTER 3 MODEL FORMULATION Edit Immobile Region Ed Name pores Description pore volume Mixed Zones Zone Index Volume Fraction theta_im_01 theta_im_02 theta_im_03 theta im 04 theta_im_06 gt theta_im_O xi Add Edit OK Cancel Im o N Figure 3 63 Dialog box for editing an immobile region of a saturated soil column com
229. nd suspended solids The growth or decay of organisms forming the solid matrix leads to expansion or shrinking of the biofilm The consumption of substrate of the organisms present at a high concentration in the biofilm solid matrix can lead to a growth limitation by the diffusive mass transfer into the depth of the biofilm The biofilm reactor compartment of AQUASIM describes a reactor with a completely mixed bulk water volume and with a biofilm growing on a substratum surface in the reactor Solids can attach or detach at the surface of the biofilm and in its interior Any transformation processes can be defined The description of the biofilm in AQUASIM is one dimensional Only the direction perpendicular to the substratum which has the largest concentration gradients is resolved All variables are averaged over areas parallel to the substratum Biofilm reactor compartments can be linked advectively or diffusively to other AQUASIM compartments Equations Solved by AQUASIM The equations solved in the biofilm reactor compartment are based on the development of a one dimensional mixed culture biofilm model since 1984 Wanner and Gujer 1984 Wanner and Gujer 1986 Gujer and Wanner 1990 Wanner 1994 Wanner 1995 Wanner and Reichert 1996 Reichert and Wanner 1997 The equations as they are solved by AQUASIM are described in the last two papers of this list In the following a summary of these equations is given In order to formulate
230. ne dimensional fluxes of the quantities with one dimensional densities as de scribed by equation 3 36 are given as follows Q QC AD Ons 3 37 Ox 0 C I 60 CHAPTER 3 MODEL FORMULATION In this equation Q refers to the volumetric discharge through the compartment and D is the coefficient of longitudinal diffusion or dispersion The following one dimensional source terms are required to complete the set of equa tions for the advective diffusive reactor compartment q Arc 20 qCiat i e qc 3 38 rs gt II The first component of equation 3 38 describes the lateral water inflow as volume per unit length of the compartment q In many cases this longitudinal inflow is zero and the only inflow is that at the compartment inlet This inflow is specified as a boundary condi tion below 3 42a The second component describes the effect of transformation processes in the compartment and the effect of lateral inflows or outflows Cilat is the concentra tion in the lateral inflow q The last component describes the effect of transformation processes on settled of sorbed substances or of growing organisms Application of the general law for differential conservation laws 3 35 to the definitions given by the equations 3 36 to 3 38 leads to the following set of 3 differential equations The first equation describes water flow through the compartment oQ _ de q The spatial gradient of the discharge Q is d
231. neous comparisons of data for measurements corresponding to different variables compartments and zones are possible AQUASIM performs a minimization of the sum of squares 4 13 with the constraints Pmin i S Pi S Pmaz i 4 14 where Pminj and Pmaz i are the minimum and maximum of the constant variable repre senting p The values for Pmin i and Pmaz are specified in the dialog box used for editing constant variables shown in Fig 3 7 Due to the possible nonlinearity of the model equations and due to the numerical inte gration procedure the sum 4 13 must be minimized numerically The user has the choice between two numerical minimization algorithms The simplex algorithm Nelder and Mead 1965 and the secant algorithm Ralston and Jennrich 1978 Both of these tech niques are well suited for the minimization of numerically integrated equations because they avoid the calculation of derivatives of the solutions with respect to the parameters The simplex technique starts with a set of m 1 m is the number of parameters arrays of parameter values buildung a simplex with nonzero volume in parameter space in AQUASIM this set consists of one array with the user defined start values and m arrays in which exactly one parameter value differs from its start value At each iteration step the simplex of arrays of parameter values is replaced by a new simplex according to the following strategy Nelder and Mead 1965 illustrated in Fig 4 14 for
232. nk Overview An advective link connects an outflow connection of a compartment with an inflow con nection of another compartment An advective link can have an arbitrary number of bifurcations through which any fractions of water and substance flow can bifurcate to a further compartment To each outflow connection of a compartment at most one advective link can be connected To each inflow connection of a compartment an arbitrary number of outflows or bifurcations of advective links can be connected Instead of connecting outflows or bifurcations of advective links to an inflow connection of a compartment the connection can be left open so that the flows through such a link or bifurcation leave the modelled part of the system Equations Solved by AQUASIM The water inflow Qin as well as the mass flow of substances into the link Iin are given by the outflow from the compartment to which the inflow of the link is connected The water and substance flows through the bifurcation j Qyj and Toif j i can be specified by the user as functions of the water inflow Qin and of the substance inflow concentrations Lini Qin The index 7 runs over all dynamic volume state variable which model concentrations of substances transported with the water flow The water and substance outflows of the link are then calculated by AQUASIM according to the equations Cini 3 107 Nbif Qef Qin 5 Qoif j 3 108 j 1 and Nbif lefi Ling D Toif
233. nox Ammonific AutDecay HetDecay AutGrodero HetGradero HetGra amp nox Inactivate HydrolOrg SludgeRemoval re SludgeRemoval he Cancel Figure 3 23 Dialog box for activating and inactivating processes in a compartment of the list of initial conditions This gives the user the possibility to influence the order of the initial conditions the order is irrelevant for the program but it may be convenient for the user to have a certain order The dialog box used for editing a single initial condition is shown in Fig 3 25 In this dialog box the fields Variable Zone and Init Cond allow the user to select a variable and a zone and to specify an initial condition In a mixed reactor compartment there is only one zone Bulk Volume Initial conditions for any type of variables can be specified but only initial conditions for state variables and in the case of a reactor with variable volume initial conditions for the program variable Reactor Volume are used by the program The reason for allowing to define initial conditions for variables of other types is to facilitate the users switching between models with different state variables A user can change a state variable to a variable of another type without the requirement of editing the lists of initial conditions of the compartments Initial conditions of a mixed reactor compartment may not depend on state variables and they can only depend on the pro
234. ns 3 1 to 3 4 All these definitions together form the model 10 CHAPTER 3 MODEL FORMULATION used by AQUASIM for simulation and data analysis The basic subsystem of the AQUASIM model structure is the system of variables Variables are objects which are characterized by the property of taking a numerical value This value may depend on the values of other variables Six types of variables are distinguished State variables are used to describe properties of water or of a surface in contact with water to be calculated by the model Program variables make auxiliary quantities used in the program available to the system of variables Constant variables and real list variables are used to provide measured quantities for use in the system of variables In addition constant variables are used as model parameters in sensitivity analyses and parameter estimations Variable list variables and formula variables are used to build functional relations out of other variables Finally probe variables make the values of variables evaluated at a given location in a compartment globally available The system of variables serves as a pool of variables for the formulation of the other subsystems The next subsystem of the AQUASIM model structure is the system of processes Two types of processes are distinguished Dynamic processes implement transformation or transfer processes which are characterized by a common process rate and by individual stoichiometric coef
235. nt 76 83 state variable 14 132 134 142 acos formula variable 24 active for calculation advective diffusive reactor compart ment 62 biofilm reactor compartment 51 lake compartment 123 mixed reactor compartment 35 river section compartment 91 saturated soil column compartment 76 195 for parameter estimation calculation 154 constant variable 17 153 for sensitivity analysis calculation 143 constant variable 17 147 real list variable 21 147 for simulation calculation 143 active for parameter estimation calculation 154 constant variable 17 153 active for sensitivity analysis calculation 143 constant variable 17 147 real list variable 21 147 active for simulation calculation 143 active processes advective diffusive reactor compart ment 62 63 biofilm reactor compartment 49 52 lake compartment 108 111 mixed reactor compartment 35 36 river section compartment 89 92 saturated soil column compartment 75 77 active state variables advective diffusive reactor compart ment 62 biofilm reactor compartment 49 51 lake compartment 108 110 mixed reactor compartment 35 river section compartment 89 91 saturated soil column compartment 75 76 add argument value pairs variable list variable 22 add data pairs real list variable 21 196 advective link 10 125 129 bifurcation 126 127 description 128 name 128 substance flow 126 128 water
236. nt 96 saturated soil column compartment 84 state variable 14 134 replace argument value pairs variable list variable 22 replace data pairs real list variable 21 resolution advective diffusive reactor compart ment 62 biofilm reactor compartment 51 lake compartment 110 river section compartment 91 209 saturated soil column compartment 76 resuspension lake compartment 104 resuspension velocity lake compartment 121 revert to saved file menu 7 8 rigid solid matrix biofilm reactor compartment 50 river bed elavation river section compartment 86 river section compartment 10 32 85 97 accuracy of program variables 91 96 active for calculation 91 active processes 89 92 active state variables 89 91 area 85 89 boundary condition 87 88 compartment index 88 critical water level 91 cross section 89 description 88 diffusive approximation 86 91 discharge 86 dispersion coefficient 86 90 96 end coordinate 89 equations 85 88 friction slope 86 90 Darcy Weisbach 90 Manning Strickler 90 gravitational acceleration 89 initial conditions 89 92 input 89 94 lateral 94 95 upstream 94 kinematic approximation 86 91 lateral inflow 87 lateral input 94 95 name 88 normal water level 91 number of grid points 91 overview 85 perimeter length 89 resolution 91 river bed elevation 86 start coordinate 89 state variable 86 89 91 93 95 210 dynamic 86 95 equilibrium 86 su
237. nt program variable 124 mixed reactor compartment program variable 39 program variable 16 river section compartment program variable 97 saturated soil column compartment program variable 76 84 time space curve 166 fit target 157 title plot 163 top coordinate INDEX lake compartment 109 troubleshooting 176 188 turbulence submodel lake compartment 110 121 turbulent diffusion coefficient lake compartment 99 100 109 turbulent kinetic energy lake compartment 99 103 104 program variable 100 112 123 124 program variable 17 type compartment 10 32 curve 164 link 10 process 10 state variable 14 variable 10 12 13 uncertainty analysis 3 146 147 unconfined reactor biofilm reactor compartment 48 50 unit constant variable 17 formula variable 23 probe variable 26 program variable 15 real list variable 20 state variable 14 variable list variable 21 upstream input river section compartment 94 user group 176 187 user interfaces 3 4 batch version 3 4 8 173 175 character interface version 3 4 171 172 window interface version 3 4 value constant variable 17 plot 161 variable 10 12 26 constant variable 10 12 17 21 151 fit target 157 formula variable 10 12 23 25 probe variable 10 12 26 program variable 10 12 15 17 40 real list variable 10 12 18 21 151 state variable 10 12 14 15 213 variable list variable 10 12 21 22 variable
238. nu 5 137 160 calculation 148 parameter estimation 155 156 calculation number 155 description 155 initial state 155 initial time 155 name 155 sensitivity analysis 140 143 calculation number 141 description 141 initial state 141 initial time 141 name 140 141 number of steps 142 output steps 142 step size 142 simulation 140 143 description 141 initial state 141 initial time 141 name 140 141 number of steps 142 output steps 142 step size 142 calculation number advective link program variable 128 advective diffusive reactor compart ment program variable 69 biofilm reactor compartment program variable 58 calculation parameter estimation 155 sensitivity analysis 141 simulation 141 INDEX curve 165 lake compartment program variable 113 124 mixed reactor compartment program variable 39 program variable 15 16 river section compartment program variable 97 saturated soil column compartment program variable 84 character interface version 3 4 171 172 close file menu 7 column number of argument real list variable 21 column number of standard deviations real list variable 21 column number of values real list variable 21 compartment 10 32 124 advective diffusive reactor 10 32 59 69 biofilm reactor 10 32 41 58 curve 166 fit target 157 lake 10 32 98 124 mixed reactor 10 32 34 40 probe variable 26 river section 10 32 85 97 saturated soil column 10 32 7
239. ob In the batch version of AQUASIM models cannot be modified Hardware Platforms and Operating Systems AQUASIM is written in the standardized object oriented programming language C There is a strict separation between the core program and the different user interface layers There exist two versions of the user interface layer for the window interface version of the program The first uses a graphical user interface library which is available for various hardware platforms and operating systems This program design makes AQUASIM highly portable A second implementation of the user interface version of the window interface version is specifically designed for the Microsoft Windows operating system The character interface version and the batch version can be compiled on nearly any platform and operating system without the need of special libraries Table 1 1 gives a survey on all currently supported computing platforms Program Hardware Operating System Window System Version w c b Sun SparcStation Solaris 2 x OpenWindows X X X Motif 1 2 X X X IBM RS 6000 AIX 3 2 x X X HP 700 series HP UX 9 x X X DEC Alpha series VMS 6 x X X DEC Unix X X Intel 80486 Pentium MS DOS 5 or 6 Windows 3 1 Win32s X Windows 95 native X X X Windows NT native X X X Apple Power Macintosh MacOS 7 x native X X X Table 1 1 Computing platforms supported by the current AQUASIM version Organization of this Manual Throughout this user manua
240. ocesses respectively The button Activate is used to activate available processes selected in the right list box and the button Inactivate is used to inactivate an active processes selected in the left list box If an active process is selected while activating another process the new active process is inserted in the list of active processes immediately before the selected process otherwise it is appended to the end of the list of active processes This gives the user the possibility to influence the order of active processes the order is irrelevant for the program but it may be convenient for the user to have a certain order Initial conditions for a biofilm reactor compartment can be specified by clicking the button Init Cond of the dialog box shown in Fig 3 29 This action opens the dialog box shown in Fig 3 32 This dialog box shows a list of all initial conditions already specified Each row of the list box contains the name of a variable followed by the zone of the compartment for which the initial condition is specified in brackets and by the algebraic expression specifying the initial value For each combination of a variable with a zone only one unique initial condition can be specified The list of initial conditions can be edited using the buttons Add Edit and Delete If an initial condition is selected while adding a new initial condition the new initial condition is inserted in the list immed
241. ocesses selected in the right list box and the button Inactivate is used to inactivate a active processes selected in the left list box If an active process is selected while activating another process the new active process is inserted in the list of active processes immediately before the selected process otherwise it is appended to the end of the list of active processes This gives the user the possibility to influence the order of active processes the order is irrelevant for the program but it may be convenient for the user to have a certain order Initial conditions for an advective diffusive reactor compartment can be specified by clicking the button Init Cond of the dialog box shown in Fig 3 41 This action opens the dialog box shown in Fig 3 44 This dialog box shows a list of all initial conditions 64 CHAPTER 3 MODEL FORMULATION Select Active Processes Eg Active Processes Available Processes lhachyate i Cancel Figure 3 43 Dialog box for activating and inactivating processes in a compartment already specified Each line of the list box contains the name of a variable followed by the zone of the compartment for which the initial condition is specified in brackets and by the algebraic expression specifying the initial value For each combination of a variable with a zone only one unique initial condition can be specified The list of initial conditions can be edited using the buttons
242. ofilm thickness 16 biofilm reactor compartment 53 57 58 Brunt Vaisala frequency 17 lake compartment 110 112 124 bulk volume 16 207 biofilm reactor compartment 57 58 mixed reactor compartment 39 buoyancy production of TKE 17 lake compartment 124 calculation number 15 16 advective link 128 advective diffusive reactor compart ment 69 biofilm reactor compartment 58 lake compartment 113 124 mixed reactor compartment 39 river section compartment 97 saturated soil column compartment 84 compartment index 16 advective diffusive reactor compart ment 62 69 biofilm reactor compartment 49 58 lake compartment 108 124 mixed reactor compartment 34 39 river section compartment 88 97 saturated soil column compartment 75 84 cross sectional area 16 advective diffusive reactor compart ment 62 69 lake compartment 100 124 river section compartment 96 97 saturated soil column compartment 76 84 density 17 lake compartment 124 description 15 detachment velocity of biofilm 16 biofilm reactor compartment 58 discharge 16 advective link 128 advective diffusive reactor compart ment 62 65 67 69 biofilm reactor compartment 54 57 58 lake compartment 115 123 124 mixed reactor compartment 37 39 river section compartment 93 95 97 saturated soil column compartment 76 79 81 84 dissipation 17 208 lake compartment 100 123 124 energy of seiche oscillation 17 lake compartment
243. ogram variable 16 internal friction lake compartment 123 internal shear lake compartment 103 interpolation multidimensional 21 real list variable 21 interpolation method linear 18 real list variable 18 19 smoothing 19 spline 18 19 variable list variable 22 kinematic approximation river section compartment 86 91 label plot 163 lake compartment 10 32 98 124 accuracy of program variables 110 123 active for calculation 123 active processes 108 111 active state variables 108 110 area 99 109 bottom coordinate 109 bottom friction 103 123 boundary condition 106 107 Brunt Vaisala frequency 109 110 buoyancy production of TKE 101 103 compartment index 108 conductivity 109 cross section 109 density 109 119 description 108 diffusion coefficient molecular 103 120 turbulent 99 100 109 203 discharge 100 104 dissipation 99 103 105 dissolved variables 108 120 equations 98 107 gravitational acceleration 108 horizontal velocity 99 103 104 initial conditions 108 112 input 108 113 lateral 113 114 point 113 116 sediment 113 117 surface 113 internal friction 123 internal shear 103 lateral inflow 103 104 lateral input 113 114 molecular diffusion coefficient 103 120 name 108 number of grid points 110 overview 98 particulate variables 108 118 point input 113 116 porosity sediment layer 121 Prandtl number 100 122 pressure gradient 103 1
244. on The edit fields Start Coord and End Coord are used to define the location of the upstream and downstrem ends of the river section s and e respectively The values of variables are resolved continuously with the space coordinate x between these two locations Although all equations in this subsection are formulated with the x axis pointing in flow direction s lt e the program works also correctly with an z axis defined in the reverse direction gt Xe The edit field Grav Acceleration is used to specify the value of the gravitational acceleration g in the units as used by the user of the program Typical values of the gravitational acceleration are 9 81m s 1 27m h or 7 32 10 m d The gravitational acceleration is required in order to calculate the critical water level 3 65b that can be selected as a downstream boundary condition if the diffusive wave approximation is selected to calculate river hydraulics The three edit fields Cross Sect Perimeter and Width are used to specify the geometry of the river bed described by the cross sectional area A the wetted perime ter P and the surface width w as functions of the coordinate x along the river and the elevation of the water level zo These two variables are accessible by the program variables Space Coordinate X and Water Level Elevation A cross sectional area 90 CHAPTER 3 MODEL FORMULATION that depends on a state
245. on factors sorption can be described by a dynamic sorption process with a process rate of ki Seai Cr z Si 3 53a and with stoichiometric coefficients of 1 90 C Psolid g 3 53b zo for the dissolved concentration the index of the zone zo must be replaced by mob or iMjk Ci and S Al 3 53c for the sorbed concentration S In these equations psolia is the density of the solid material in the soil column Seq i C is the equilibrium isotherm and the process describes relaxation of the actually sorbed concentration to the equilibrium concentration with a rate constant k If k is set to a sufficiently large value this model is a good approximation to equilibrium sorption In order to make the solution to the above system of differential equations unique one boundary condition for the ordinary differential equation 3 48 and two boundary conditions for the partial differential equation 3 49 are required The ordinary differential equations 3 50 to 3 52 that do not contain spatial derivatives do not require boundary conditions The boundary condition for equation 3 48 that describes discharge through the soil column is given by Q z Qin 3 54a at the start point zs of the column According to equation 3 48 due to the lateral inflow q this results in a discharge of Le Q Ze Qes fade 3 54b at the column outlet The boundary conditions for equation 3 49 are given by the continui
246. on is irrelvant if q is smaller than or equal to zero outflow For each variable only one unique lateral inflow concentration can be specified The list of inflow concentrations can be edited using the buttons Add Edit and Delete If an inflow concentration is selected while adding a new inflow concentration the new inflow concentration is inserted in the list immediately before the selected inflow concentration otherwise it is appended to the end of the list of inflow concentrations This gives the user the possibility to influence the 3 3 COMPARTMENTS 81 Edit Lateral Inputs Ea Water Inflow fo Input Cones Variable Input Concentration Figure 3 61 Dialog box for editing lateral inputs to a soil column compartment Edit Lateral Input Concentration x Vaite Input Conc Cancel Figure 3 62 Dialog box for editing a single lateral input to a soil column compartment order of the inflow concentrations the order is irrelevant for the program but it may be convenient for the user to have a certain order Figure 3 62 shows the dialog box used to specify a single lateral inflow concentration of a dynamic volume state variable In this dialog box the fields Variable and Inflow Conc allow the user to select a variable and specify a lateral inflow concentration Cjq A lateral inflow concentration of a saturated soil column compartment may depend on the program variables Discharge a
247. on the dialog box shown in Fig 4 19 is displayed This dialog box shows the initial value of y the best smallest value already AQUASIM Ea estimating parameters Initial Chi 2 1749 4139 Best Chi 2 23 523309 Current Chi 2 24 549683 Figure 4 19 Dialog box for interrupting a parameter estimation found and the value for the current parameter set This dialog box allows the user to interrupt the calculation 158 CHAPTER 4 SIMULATION AND DATA ANALYSIS In case of normal termination of the parameter estimation algorithm the dialog box shown in Fig 4 20 is displayed to give the user a brief survey of the fit results The first AQUASIM Ea Status convergence criterion met Number of iterations performed 27 Parameter Start gt End Minimum Maximum Cinil 12 gt 10 153059 0 20 Cini2 0 8 gt 1 0042088 0 2 K 2 gt 1 0348885 0 10 maxi 2 gt 1 0385763 0 10 max2 2 gt 051681391 0 10 Initial Chi 2 1749 4139 Final Chi 2 22 508572 Figure 4 20 Dialog box for displaying a summary of fit results row of this dialog box shows the termination status of the algorithms the second row the number of iterations performed In the following list box for each parameter that was active for parameter estimation its initial value its final value found by the parameter estimation algorithm and its minimum and maximum is given Finally below the list box the initial and the final value of x
248. ong the column In the following paragraphs the dialog boxes used to define each of these input types are described Selection of the radio button Inlet Input in the dialog box shown in Fig 3 58 opens the dialog box shown in Fig 3 59 The edit field Water Inflow of this dialog box is used to specify the discharge of water into the compartment Qin and the list box contains substance loadings jn c into the compartment For each variable only one unique inlet loading can be specified The list of inlet loadings can be edited using the buttons Add Edit and Delete If a loading is selected while adding a new loading the new loading is inserted in the list immediately before the selected loading otherwise it is appended to the end of the list of input loadings This gives the user the possibility to influence the order of the input loadings the order is irrelevant for the program but it may be convenient for the user to have a certain order Figure 3 60 shows the dialog box used to specify a single inlet loading of a substance In this dialog box the fields Variable and Loading allow the user to select a variable and specify an inlet loading Jin c Note that this loading represents mass per unit of time An inlet loading of a saturated soil column compartment may depend on the program variables Discharge and on dynamic volume state variables These variables return the discharge and the concentrations of
249. only text between an opening and a closing brace of the same level without any braces in between is interpreted by AQUASIM A program convedit convert AQUASIM system file for editing with a text editor is provided with AQUASIM in the subdirectory bin which converts the originally more compact file format to a format that is much easier to read line breaks and indents are inserted at each opening brace and between closing braces of different level and is equivalent for AQUASIM there is no tool to reverse this process because this is not necessary since AQUASIM can read the converted file the original format can easily be restored by loading and saving the file with AQUASIM This tool may be used to allow advanced AQUASIM users to analyse causes for file loading problems or even to edit an AQUASIM system file directly with a text editor or a programming language e g with Perl scripts This last possibility may be efficient for the automation of repeated complicated editing processes However it is also dangerous because with the aid of a text editor or a scripting language minor errors can make a file unreadable by AQUASIM Problems During the Loading Process The most important cause for problems in loading files is that a file from one of the very old versions AQUASIM 1 0x or from a newer AQUASIM version than that used for loading is tried to be loaded Files from AQUASIM 1 0x must be converted to the file format for AQUASIM 1 1 with the aid
250. oo Variable CNHs tis Compartment React E Zone Buk Volume z Location ooo I relative Cancel Figure 3 13 Dialog box for editing a probe variable Figure 3 13 shows the dialog box used for defining or editing a formula variable As each variable a formula variable needs a unique Name as an identifier A name of a variable consists of a sequence of letters A Z a z digits 0 9 and underline characters The first character may not be a digit The following reserved names are not allowed as variable names div mod and or not if then else endif pi sin cos tan asin acos atan sinh cosh tanh deg rad exp log ln log10 sign abs sqrt min max To improve documentation of variables a Description and a Unit can be specified Then a Variable must be selected and the Compartment Zone and the Location in the compartment where the variable has to be evaluated must be specified If the check box relative is ticked the location must be specified as relative coordinates between 0 and 1 otherwise the location must be given in absolute coordinates 3 2 PROCESSES 27 3 2 Processes Transformation processes can be defined by a set of process rates each of which describes the contribution of the process to the temporal change of the concentration of a given substance Characteristic times of such processes may vary over several orders of mag nitude The cons
251. or the definition of a real list variable a variable representing the argument a list of argument value data pairs the standard deviations of the data and an interpolation method must be specified The standard deviations can be given as global relative and absolute standard deviations or as individual standard deviations for all data values Real list variables are usually evaluated as follows In a first step the variable given as the argument is evaluated Then the value of the variable is calculated by employing the selected interpolation method at the value of the argument as follows Linear interpolation If the value of the argument is smaller than the ar gument of the first list element the value of the first list element is returned If the value of the argument is larger than the value of the argument of the last list element the value of the last list element is re turned If the value of the argument is within the range of the arguments of the list the value on the connecting straight line between neighbouring data points corresponding to the argument is returned Cubic spline interpolation If the value of the argument is smaller than the ar gument of the first list element the value of the first list element is returned If the value of the argument is larger than the value of the argument of the last list element the value of the last list element is re turned If the value of the argument is within the range of the argum
252. orm A 2nLey Tey 2 3 34b describes a biofilm growing on the outside of a cylinder with radius rey and length Ley a surface area of the form A 2T Ley fey 2 3 34c describes a biofilm growing on the inside of a cylinder with radius rey and length Ley and a surface area of the form A Anny Tsp 2 3 34d describes biofilms growing on nsp spherical particles of radius rsp 3 3 COMPARTMENTS 51 The edit field Rate Porosity is used to specify the excess growth rate of porosity rg defined in equation 3 12 If this rate is set to zero and if no volume attachment or detachment is active the porosity of the biofilm remains constant As last options Num Grid Pts Resolution and Acc in the dialog box used for the definition of a biofilm reactor compartment Fig 3 29 the user can select the number of grid points the discretization order of the numerical algorithm and the accuracies of program variables The number of grid points is used to specify by how many discrete points the continuous z axis is approximated If the number of grid points is set to Ngp the depth of the biofilm is resolved into 2 boundary points and ng 2 grid points located in the middle of ngp 2 cells of equal thickness Two additional grid points are used to describe the boundary layer and the bulk volume For the division of the z axis described above the low resolution method applies a simple first order di
253. ormation of substances in saturated soil columns river section com partments are used to describe hydraulics transport and transformation processes in rivers and lake compartments are used to model stratification mixing transport and transformation processes in horizontally well mixed lakes The last subsystem of the AQUASIM model structure is the system of links The objects of this subsystem are used to connect the compartments to the desired spatial configuration To connect the compartments listed above two types of links are distin guished Advective links describe water flow and advective substance transport between compartments These links can not only directly connect compartments but also bi furcations and junctions can be built Diffusive links model diffusive boundary layers or membranes between compartments These elements can be diffusively penetrated by certain substances The menu Edit of AQUASIM shown in Fig 3 2 is based on the model structure 11 described above Each of the four menu items Variables Processes Compart EIAQUASIM lawprel File Cale View Window Help Variables Processes Compartments Links Numerical Parameters Delete States Figure 3 2 Edit menu ments and Links opens or activates if it is already open a modeless dialog box containing a list of objects already defined and control elements for defining new objects and for editing and deletin
254. orms poorly with very small time steps The DASSL error message that is most difficult to interpret is the following 05 13 1998 15 32 44 Start of calculation 05 13 1998 15 32 44 Integration at time 0 05 13 1998 15 32 44 Integration at time 0 1 05 13 1998 15 32 44 Integration at time 0 2 05 13 1998 15 32 44 Integration at time 0 3 05 13 1998 15 32 44 Integration at time 0 4 05 13 1998 15 32 44 Integration at time 0 5 05 13 1998 15 32 44 Integration at time 0 6 05 13 1998 15 32 44 Integration at time 0 7 05 13 1998 15 32 44 Integration at time 0 8 05 13 1998 15 32 44 Integration at time 0 9 DASSL AT T 1 AND STEPSIZE H 2 06912e 024 DASSL THE ERROR TEST FAILED REPEATEDLY DASSL OR ABS H HMIN 05 13 1998 15 32 44 End of calculation 186 CHAPTER 6 APPENDIX This or a similar error message results if the algorithm repeatedly tried to reduce the integration step size without being able to fulfill the error test criterion It is then the difficult task of the program user to find the cause of the numerical problem The point in time at which the problem occurs may help to find the cause A rate or an input could be discontinuous at this point in time It may be useful to look at time series plots of important system variables in order to detect strange behaviour at this point in time It may also be useful to change the accuracy of program and state variables in order to find out if the problem occurs always at the same time cf
255. oscillation lake compartment 103 104 sensitivity analysis 3 17 20 144 150 164 165 start 147 148 sensitivity function 144 165 absolute absolute 144 165 absolute relative 145 165 plot 161 relative absolute 145 165 relative relative 145 165 sensitivity ranking 148 149 shear production of TKE lake compartment 101 program variable 124 program variable 17 short print file format 8 sign formula variable 24 simplex algorithm 151 153 154 INDEX simulation 2 3 138 143 continue 141 start 141 sin formula variable 24 sinh formula variable 24 smoothing real list variable 19 variable list variable 22 solid matrix biofilm reactor compartment 41 sorption isotherm saturated soil column compartment 74 saturated soil column compartment 74 space coordinate x advective diffusive reactor compart ment 62 program variable 62 69 program variable 16 river section compartment program variable 89 97 saturated soil column compartment program variable 76 84 space coordinate z biofilm reactor compartment 41 program variable 50 58 lake compartment program variable 109 113 124 program variable 16 spatial discretization 138 spline interpolation real list variable 18 19 variable list variable 22 sqrt formula variable 25 stability frequency lake compartment 109 110 standard deviation 146 151 absolute real list variable 18 20 constant variable 17 global real list variable
256. ot sur f X XL i 3 23c ur ut Xuyi Lr Dux The boundary conditions for equation 3 15 that describes the behaviour of suspended solids in the biofilm pore water are given by a no flux condition at the substratum biofilm interface OX py a 2 0 0 3 24 and by a continuity equation of the concentrations in the water at the biofilm surface Xpi Lr Lr X12 3 24b Note that due to the definition of Xp as mass per total of biofilm volume including the solid matrix this continuity condition for concentrations in the water phase leads to a discontinuity of the values of Xp at the biofilm surface The advantage of the definition of X p as mass per unit of total biofilm volume is that the concentrations Xp can directly be compared with the concentrations X m of solids in the biofilm matrix 3 3 COMPARTMENTS 47 The boundary conditions of equation 3 16 that describes the behaviour of substances dissolved in the pore water of the biofilm are as follows At the substratum biofilm in terface the boundary condition is given as a continuity equation of the flow through the substratum oC pi Oz Ae r Dpc z 0 substr C 3 25a The total flow through the substratum Tsubstr C is zero impermeable substratum unless a diffusive link is connected to the bottom of the biofilm in order to model a permeable membrane In the latter case the flow through the substratum is proportional to the difference betwe
257. ox If an active variable is selected while activating another variable the new active variable is inserted in the list of active variables immediately before the selected variable otherwise it is appended to the 52 CHAPTER 3 MODEL FORMULATION end of the list of active variables This gives the user the possibility to influence the order of active variables the order is irrelevant for the program but it may be convenient for the user to have a certain order The list of active variables may contain variables of any type but activation has only an effect to state variables Inactive state variables return a value of zero The reason for allowing other types of variables in the list of active state variables is to facilitate switching between different models that do not contain the same state variables A user can change a state variable to a variable of another type without the requirement of editing the lists of active variables of the compartments Similarly to the activation of state variables the user has to select which processes are active in a compartment This is done by clicking the button Processes of the dialog box shown in Fig 3 29 This action opens the dialog box shown in Fig 3 31 The two list Select Active Processes Ea Active Processes Available Processes Figure 3 31 Dialog box for activating and inactivating processes in a compartment boxes in this dialog box show the active processes and the available pr
258. ox shown in Fig 3 78 is used to specify the numerical accuracies of program variables Fig 3 100 shows the dialog box used for this purpose It allows the user to specify relative and absolute accuracies of the variables Discharge Q Horizontal Velocity U Turbulent Kinetic Energy k Dissipation e and Seiche Energy Eeiche in the compartment Good behaviour of the numerical algorithms is usually achieved if the absolute accuracy and the product of the relative accuracy times a typical value of the variable both are 4 to 6 orders of magnitude smaller than typical values of the variable The check box active for calculation can be used to activate or inactivate the compartment from the calculations This check box has the same functionality as the buttons Activate and Inactivate in the dialog box shown in Fig 3 19 124 CHAPTER 3 MODEL FORMULATION In Table 3 9 the program variables available in a lake compartment are summarized for a complete overview of all program variables see Table 3 1 on page 17 Calculation Number Time Compartment Index Zone Index Discharge Water Fraction Space Coordinate Z Cross Sectional Area Density Area Gradient Brunt Vaisala Frequency Horizontal Velocity Turbulent Kinitic Energy TKE Shear Production of TKE Buoyancy Production of TKE Dissipation Energy of Seiche Oscillation Identifier for calculations value set in the dialog boxes shown in
259. partment program variable 124 mixed reactor compartment program variable 39 program variable 16 river section compartment program variable 97 saturated soil column compartment program variable 84 water level elevation program variable 16 river section compartment 86 program variable 89 96 97 width river section compartment 89 wind excitation lake compartment 123 molecular lake compartment 104 window interface version 3 4 write data pairs real list variable 21 zone curve 166 fit target 157 probe variable 26 zone index advective diffusive reactor compart ment INDEX program variable 69 biofilm reactor compartment program variable 49 58 lake compartment program variable 108 124 mixed reactor compartment program variable 39 program variable 16 river section compartment program variable 97 saturated soil column compartment 82 program variable 75 82 84 zones biofilm reactor compartment 41 lake compartment 98 saturated soil column compartment 70
260. phase biofilm reactor compartment 50 liquid phase volume fraction biofilm reactor compartment 42 list options 162 168 INDEX list to file 162 In formula variable 24 loading files 7 problems 177 178 location probe variable 26 log formula variable 24 log file 8 137 181 183 log10 formula variable 24 long print file format 8 low resolution 138 mail electronic 8 marker curve 166 mass transfer resistance biofilm reactor compartment 48 56 max formula variable 24 maximum constant variable 17 formula variable 24 real list variable 20 maximum integration order 133 maximum internal step size 132 182 183 maximum number of internal time steps 133 185 maximum number of iterations parameter estimation 154 menu calc 5 137 160 parameter estimation 151 160 sensitivity analysis 144 150 simulation 138 143 edit 5 9 136 compartments 32 124 delete states 135 136 links 125 131 numerical parameters 132 134 processes 27 31 variables 12 26 file 4 7 8 view 5 161 170 INDEX menu bar 4 min formula variable 24 minimum constant variable 17 formula variable 24 real list variable 20 mixed immobile zone saturated soil column compartment 70 82 mixed reactor compartment 10 32 34 40 constant volume 34 accuracy of program variables 35 38 active for calculation 35 active processes 35 36 active state variables 35 compartment index 34 constant volume 35 descrip
261. ram variable 96 97 saturated soil column compartment program variable 76 84 curve plot 163 DASSL 132 133 139 182 183 185 data fit target 156 data pairs real list variable 18 deg formula variable 24 delete argument value pairs variable list variable 22 delete data pairs real list variable 21 delete states 135 136 edit menu 11 density biofilm reactor compartment 56 lake compartment 109 119 program variable 124 program variable 17 saturated soil column compartment 74 description advective link 127 bifurcation 128 advective diffusive reactor compart ment 62 biofilm reactor compartment 49 calculation parameter estimation 155 sensitivity analysis 141 simulation 141 constant variable 17 diffusive link 130 dynamic process 29 equilibrium process 31 formula variable 23 immobile region saturated soil column compartment 82 lake compartment 108 mixed reactor compartment 35 plot 163 200 probe variable 26 program variable 15 real list variable 20 river section compartment 88 saturated soil column compartment 75 state variable 14 variable list variable 21 design of AQUASIM 2 detachment biofilm reactor compartment 41 global velocity biofilm reactor compartment 50 individula rate biofilm reactor compartment 50 detachment coefficient surface biofilm reactor compartment 45 56 volume biofilm reactor compartment 44 56 detachment velocity of biofilm biofilm reactor compa
262. re listed alphabetically in the list box of this dialog box The type of the currently selected process is indicated at the bottom of the dialog box The buttons of this dialog box allow the user to perform the following operations with processes By clicking the button New new processes may be created from scratch Alternatively by clicking the button Duplicate the selected process can be duplicated With the button Edit or by double clicking the process name in the list box a process can be edited Finally the button Delete allows the program users to delete processes Deletion of a process is only possible if it is not active within a compartment The buttons Duplicate Edit and Delete are inactive as long as no process is selected Clicking the Close button results in closing of this dialog 28 CHAPTER 3 MODEL FORMULATION box It can be reopened by clicking the Processes command in the Edit menu shown in Fig 3 2 For the definition of transformation processes with the subdialogs assigned to the dialog box shown in Fig 3 14 all variables listed in the dialog box shown in Fig 3 3 may be used The processes serve as a pool for use in compartments Each process can be activated or inactivated in each compartment if it does not contain illegal dependencies cf section 3 3 After clicking the button New in the dialog box shown in Fig 3 14 the process type can be selected in the dialog box shown in Fig 3 15
263. read diffusively first term they follow the advective motion of the water column second term they sink through the water column with their sedimentation ve locity third term they can be resuspended from the sediment fourth term they can be converted by transformation processes fifth term and they are influenced by inflows and outflows sixth and seventh terms respectively The seventh equation describes the behaviour of dissolved substances in the pore water of sediment layer 7 OCS i E lex Cs i TOs Bt Dl O 3 91 Substances dissolved in the pore water of the sediment layer are exchanged with the neighbouring layers first term and they are changed by transformation processes second 106 CHAPTER 3 MODEL FORMULATION term Note that the process rates must be formulated as mass per unit of time and per unit of total sediment volume and not only per pore water volume This facilitates the formulation of mass conversion for transformation processes from the particulate to the dissolved phase The last equation describes the behaviour of particles in the sediment OX sg i ler Xs F Xei 3 92 ot hsed j 3 The particle concentrations in the sediment layer are exchanged with the neighbouring layers first term and they are changed by transformation processes second term In order to make the solution of the above system of differential equations unique one boundary condition for the ordinary different
264. rface 86 volume 86 95 upstream input 94 user definitions 88 97 water level elevation 86 width 89 saturated soil column compartment 10 32 70 84 accuracy of program variables 76 83 active for calculation 76 active processes 75 77 active state variables 75 76 area 71 76 boundary condition 74 compartment index 75 cross section 76 density 74 description 75 immobile region 82 dispersion coefficient 71 76 84 end coordinate 75 equations 70 74 exchange coefficient 82 immobile region 70 76 81 82 initial conditions 75 78 inlet input 79 input 75 79 inlet 79 lateral 79 80 lateral inflow 72 lateral input 79 80 mixed immobile zone 70 82 83 mobile zone 70 name 75 immobile region 81 number of grid points 76 overview 70 porosity 71 mobile zone 71 76 resolution 76 sorption 74 isotherm 74 start coordinate 75 state variable 71 75 76 79 81 83 dynamic 71 79 83 INDEX equilibrium 71 surface 71 volume 71 79 83 user definitions 75 84 volume fraction 82 mobile zone 76 zone index 82 zones 70 save file menu 7 8 save as file menu 7 scaling plot 167 screen options 162 167 secant algorithm 151 154 second order 138 sediment input lake compartment 113 117 sediment layer lake compartment 99 102 105 106 sediment submodel lake compartment 110 121 sedimentation lake compartment 103 sedimentation velocity lake compartment 100 119 seiche
265. riable Discharge are used by the program An initial condition for this program variable is required The reason for allowing to define initial conditions for variables of other types is to facilitate the users switching between models with different state variables A user can change a state variable to a variable of another type without the requirement ot editing the lists of initial conditions of the 94 CHAPTER 3 MODEL FORMULATION compartments Initial conditions of a river section compartment may not depend on state variables and they can only depend on the program variables Calculation Number Time and Space Coordinate X Input to a river section compartment can be specified by clicking the button Input of the dialog box shown in Fig 3 67 This action opens the dialog box shown in Fig 3 72 In this dialog box the user can select which type of input to edit There exist two different Select Input Type x Upstream Input Lateral Input Cancel Figure 3 72 Dialog box for selecting an input type for a river section compartment types of inputs to a river section compartment The radio button Upstream Input can be used to describe water and substance flow at the upstream end of the river section and the radio button Lateral Input makes it possible to specify water and substance inflow along the river In the following paragraphs the dialog boxes used to define each of these input types are described
266. riables allow the user to build functional relations as algebraic expressions using previously defined variables cyclic references are not allowed Figure 3 12 shows the dialog box used for defining or editing a formula variable As Edit Formula Variable Ea Name Description Decay coefficient for autotrophic biomass Unit 12d Expression b_A20 explthe_ba T 20 Cancel Figure 3 12 Dialog box for editing a formula variable each variable a formula variable needs a unique Name as an identifier A name of a variable consists of a sequence of letters A Z a z digits 0 9 and underline characters _ The first character may not be a digit The following reserved names are not allowed as variable names div mod and or not if then else endif pi sin cos tan asin acos atan sinh cosh tanh deg rad exp log In log10 sign abs sqrt min max To improve documentation of variables a Description and a Unit can be specified An algebraic Expression using the previously defined variables can be given to define the new variable The formula syntax is given by an lt expression gt defined as given below where lt varident gt must be the name of a variable already defined lt varident gt lt letter gt lt letter_or_digit gt lt letter gt Al Zlal Iz lt letter_or_digit gt lt letter gt lt digit gt lt digit gt O l1 12 13 1 4 15 6171 1819 lt expression gt
267. riables shown in Fig 3 7 The two lower list boxes show the active and the available Calculations respec tively The calculation definitions for parameter estimation can be edited with the aid of the buttons New Duplicate Edit and Delete as discussed below With the aid of the buttons Activate and Inactivate calculations selected in the right list box can be activated and calculations selected in the left list box can be inactivated this is equivalent to toggle the check box active for parameter estimation in the dialog box shown in Fig 4 17 The radio buttons secant and simplex can be used to select the numerical minimization Method above The basic ideas and references for both possible selections are given above In the edit field Maximum Number of Iterations the number of iterations can be bounded A value of zero leads to the calculation of the value of xy without trials to improve this value The button Start is used to start the parameter estimation the button Close to close this modeless dialog box After clicking the button Start the user is asked to specify 4 3 PARAMETER ESTIMATION 155 the name of a file on which the parameter and x values for all iteration steps are reported and which contains a final summary of parameter estimates estimated standard errors and correlation coefficients for the secant method not leading to estimates on the bound
268. rical algorithms first order spatial discretization 138 flux limiter technique 138 Gear integration technique 138 140 high resolution spatial discretization 138 206 low resolution spatial discretization 138 secant minimization algorithm 151 154 second order spatial discretization 138 simplex minimization algorithm 151 153 154 numerical parameters 132 edit menu 11 maximum integration order 133 maximum internal step size 132 182 183 maximum number of internal time steps 133 185 number of codiagonals of the jaco bian matrix 133 open file menu 7 operating systems 4 options list to file 162 168 plot to file 162 168 plot to screen 162 167 print to file 8 outflow mixed reactor compartment 34 output steps calculation sensitivity analysis 142 simulation 142 parameter 165 parameter estimation 3 17 19 21 151 160 calculation 155 156 active for parameter estimation 154 fit target 156 compartment 157 data 156 time space 157 variable 157 zone 157 maximum number of iterations 154 start 153 154 particulate variables biofilm reactor compartment 49 55 lake compartment 108 118 perimeter length INDEX program variable 16 river section compartment 89 program variable 97 pi formula variable 24 platforms 4 8 plot abscissa 163 curve 163 calculation number 165 compartment 166 legende 166 line 166 marker 166 time space 166 type 164 zone 166
269. rithm of the argument Function with one argument returning the logarithm with base 10 of the argument Function with two arguments returning the maximum of the two arguments Function with two arguments returning the minimum of the two arguments Constant returning the value of m 3 1415926 Function with one argument returning the argument converted from degrees to radi ans Function with one argument returning the sign of the argument 1 for positive ar guments 1 for negative arguments 0 for arguments equal to zero Function with one argument returning the sinus function evaluated at the argument that must be given in radians 3 1 VARIABLES 25 sinh Function with one argument returning the hyperbolic sinus function evaluated at the argument that must be given in radians sqrt Function with one argument returning the square root of the argument tan Function with one argument returning the tangens function evaluated at the argument that must be given in radians tanh Function with one argument returning the hyperbolic tangens function evaluated at the argument that must be given in radians Table 3 2 Functions and constants that can be used in formula variables 26 CHAPTER 3 MODEL FORMULATION 3 1 7 Probe Variables Probe variables are used to make the value of another variable evaluated at a given location in a compartment globally available Name Description NH4 NO3 nirogen evaluated in reactor 1 Unit po
270. rn the values of state variables in the lake immediately at the surface The use of state variables makes it possible to model diffusive fluxes through the surface boundary layer Input fluxes for any type of variables can be specified but only input fluxes for dynamic volume state variables are used by the program The reason for allowing to define input fluxes for variables of other types is to facilitate the users switching between models with different state variables A user can change a state variable to a variable of another type without the requirement ot editing the lists of input fluxes of the compartments Selection of the radio button Lateral Input in the dialog box shown in Fig 3 83 opens the dialog box shown in Fig 3 86 The edit field Water Inflow of this dialog box is used to specify the discharge of water per unit depth into the lake q and the list box contains substance concentrations Cjgz OY Xiat i in the inflowing water A positive value 3 3 COMPARTMENTS 115 Edit Lateral Inputs Ea Water Inflow m Input Cones Variable Input Concentration Figure 3 86 Dialog box for editing lateral inputs to a lake compartment Edit Lateral Input Concentration x vit AT Input Conc Cancel Figure 3 87 Dialog box for editing a single lateral input to a lake compartment of q represents a flow into the lake a negative value represents an outflow According to the equations 3 77 3 89 and 3 90
271. rtment 45 program variable 58 program variable 16 diffusion coefficient advective diffusive reactor compart ment 60 62 68 biofilm matrix biofilm reactor compartment 56 lake compartment turbulent 99 molecular lake compartment 103 120 pore volume biofilm reactor compartment 56 turbulent lake compartment 100 109 diffusive approximation river section compartment 86 91 diffusive link 10 125 129 131 conversion factor 129 131 description 130 equations 129 130 exchange coefficient 129 131 link index 130 name 130 overview 129 state variable 131 INDEX dynamic 131 volume 131 user definitions 130 131 diffusive solid matrix biofilm reactor compartment 50 discharge advective link program variable 128 advective diffusive reactor compart ment 60 program variable 62 65 67 69 biofilm reactor compartment program variable 54 57 58 lake compartment 100 104 program variable 115 123 124 mixed reactor compartment program variable 37 39 program variable 16 river section compartment 86 program variable 93 95 97 saturated soil column compartment program variable 76 79 81 84 discretization first order 138 high resolution 138 low resolution 138 second order 138 spatial 138 dispersion coefficient advective diffusive reactor compart ment 60 62 river section compartment 86 90 96 saturated soil column compartment 71 76 84 dissipation lake compartment 99 103 105 program
272. s of the dialog box shown in Fig 3 78 allows the user to specify properties of dissolved variables for dynamic volume state variables Figure 3 95 shows the dialog box used for this purpose It contains a list box with the names and Edit Dissolved Variables Ea Diss Yars Variable Molecular Diffusion Coefficient C_PO4 0 000156 c 02 0 00018 C NO3 0 000164 C_NH4 0 000141 Figure 3 95 Dialog box for editing dissolved variables of a lake compartment molecular diffusion coefficients of all defined dissolved variables Note that a variable can only be once in both lists of particluate and dissolved variables The buttons Add Edit and Delete allow the user to edit this list Figure 3 96 shows the dialog box used to specify the properties of a dissolved variable in a lake The edit fields Variable and Edit Dissolved Variable Ed vei Mol Diffusion fo 0001 64 Cancel Figure 3 96 Dialog box for editing a single dissolved variable of a lake compartment Mol Diffusion allow the user to select a variable and to specify a molecular diffusion coefficient D This diffusion coefficient determines the exchange of dissolved substances between the sediment layers and between the top sediment layer and the water column of the lake Note that properties of dissolved variables can be specified for any type of variables but that only properties of dynamic volume state variables have an effect
273. s of the constraining interval only and a list of the contributions of each data series to the total value of x see below for an example of such a file As discussed above the buttons New Edit and Duplicate in the dialog box shown in Fig 4 16 are used to define calculations for parameter estimation Figure 4 17 shows the di alog box used for defining and editing a single calculation The items Name Description Edit Calculation for Parameter Estimation Ed Name fie Description FO Cale Number fi Initial Time jo Initial State given made consistent steady state Fit Targets Data Variable Compartment Zone Time Space Prodi Prod Reactor Bulk Volume Ol Add Edit Delete Status IV active for parameter estimation Cancel Figure 4 17 Dialog box for editing a parameter estimation calculation Calc Number Initial Time and Initial State have the same meaning as for calcula tions for simulation and sensitivity analysis in the dialog box shown in Fig 4 5 The edit field Name is used to specify the name of the calculation Each calculation needs a unique name as an identifier A name of a calculation consists of a sequence of letters A Z a z digits 0 9 and underline characters _ The first character may not be a digit To improve documentation of calculations the edit field Description can optionally be used to store comments on the purpose of the calculation definition The edit fi
274. s have a steady state solution and that even if such a solution exists the numeric algorithm used by AQUASIM may fail to find it In such a situation the convergence can be improved by a good choice of initial conditions which under this option for the initial state are used as starting values for the iterative search process for the steady state solution If this does not help the steady state solution must be found by relaxation i e by executing a dynamic simulation with constant boundary conditions After these five items which have the same meaning as those discussed for simulation and sensitivity analysis Fig 4 5 instead of step sizes and numbers of steps the user must specify Fit Targets the step sizes are selected automatically by the program to meet the points in time at which data are available All fit targets already defined are listed in the list box of the dialog box shown in Fig 4 17 Each fit target consists of a data series and a specification of which variable evaluated in which zone of which compartment and at which point in time or space should be compared with the data The list of fit targets is edited with the buttons Add Edit and Delete below the list box Finally the calculation can be made active for parameter estimation if no other calculation with the same calculation number is already active The Fig 4 18 shows the dialog box used to specify a fit target This dialog box is Edit Fit
275. s of the compartments Similarly to the activation of state variables the user has to select which processes are active in a compartment This is done by clicking the button Processes of the dialog box shown in Fig 3 53 This action opens the dialog box shown in Fig 3 55 The two list Select Active Processes Ed Active Processes Available Processes Activate Inactivate Figure 3 55 Dialog box for activating and inactivating processes in a compartment boxes in this dialog box show the active processes and the available processes respectively The button Activate is used to activate available processes selected in the right list box and the button Inactivate is used to inactivate a active processes selected in the left list box If an active process is selected while activating another process the new active 78 CHAPTER 3 MODEL FORMULATION process is inserted in the list of active processes immediately before the selected process otherwise it is appended to the end of the list of active processes This gives the user the possibility to influence the order of active processes the order is irrelevant for the program but it may be convenient for the user to have a certain order Initial conditions for a saturated soil column compartment can be specified by clicking the button Init Cond of the dialog box shown in Fig 3 53 This action opens the dialog box shown in Fig 3 56 This dialog box shows
276. s to insertion of the new step sequence at the end of the list otherwise the new step sequence is inserted before the selected row Replace leads to the replacement of the selected row by the step sequence specified in the edit fields below the list box Clicking the button Delete leads to the deletion of the selected rows of the list Note that the output steps defined for a calculation specify the points of time at which the calculated states are stored in memory and are available later on for plotting results and for exporting results to other programs The internal step size used by the integration algorithm however is determined according to the requirement of fulfilling the accuracy requirements of the state and program variables as described in section 3 5 This internal step size is usually much smaller than the output step size however it can increase to ten times the output step size if all variables 4 1 SIMULATION 143 change only smoothly in time the solution at the output steps is then determined by interpolation The size of the internally used time step can be bounded as described in section 3 5 this may be useful in order to avoid that the algorithm steps over short excitations Finally the check boxes active for simulation and active for sensitivity anal ysis are used to activate the calculation for the specified task During the execution of a simulation the dialog box shown in Fig 4 6 shows the
277. scretization scheme that is very robust but can have significant numerical diffusion The high resolution method uses a second order discretization scheme that applies flux limiters to avoid oscillations of the numerical solutions Reichert 1994b chapter 6 The high resolution method is not yet implemented in the biofilm compartment of the current version of AQUASIM The button Acc is used to specify the numerical accuracies of program variables as described later in this subsection The check box active for calculation can be used to activate or inactivate the compartment from the calculations This check box has the same functionality as the buttons Activate and Inactivate in the dialog box shown in Fig 3 19 As for each compartment the user has to select which state variables are active This is done by clicking the button Variables of the dialog box shown in Fig 3 29 This action opens the dialog box shown in Fig 3 30 The two list boxes of this dialog box show the Select Active State Variables Ed Active Variables Available Variables Inactivate Cancel Figure 3 30 Dialog box for activating and inactivating state variables in a compartment active variables and the available variables respectively The button Activate is used to activate available variables selected in the right list box and the button Inactivate is used to inactivate active variables selected in the left list b
278. ses third term and by lateral inflow or outflow fourth and fifth term respectively The third equation describes the behaviour of settled or sorbed substances or of sessile organisms tere 3 63 a h 3 63 The concentration is only affected by transformation processes Note that settling or sorp tion must also be formulated as a transformation process from the dissolved or suspended species Ci to the sorbed or settled species S In order to make the solution to the above system of differential equations unique one or two boundary conditions are necessary for equation 3 61 depending on the choice of the kinematic or the diffusive approximation and two boundary conditions are required for the partial differential equation 3 62 The ordinary differential equation 3 63 that does not contain spatial derivatives does not require boundary conditions The first boundary condition for the equation 3 61 that describes discharge through the river section is given by Q zs Qin 3 64a 88 CHAPTER 3 MODEL FORMULATION at the start point s of the river section In the case of the diffusive approximation according to equation 3 59b which makes it possible to describe backwater effects an additional downstream boundary condition is required Such a boundary condition can be specified as a given discharge dependent water level 20 Le Zgiven Q 3 64b at the end of the river section Besides an arbitrary function descri
279. shows the menu File of AQUASIM The first 6 items of this menu are used to save m2 AQUASIM lawprel Edit Cale View Window Help Open Ctl 0 Close Save Ctri S Save As Revert to Saved Print Options Print to File Ctrl P About Exit Figure 2 1 File menu and load AQUASIM systems consisting of the user specified mathematical model mea sured data definitions of sensitivity analyses and parameter estimations plot definitions and calculated states The item New is used to free memory from the current system to allow the user to enter a new system With the item Open a system previously stored with Save or Save As can be reloaded Clicking the item Close results in deletion of the current system from memory however saved versions are not changed The item Save is used to save a system overwriting its old version on the disk With the item Save As the current system can be saved under a new name By clicking the item Revert to Saved the saved version of a system edited interactively can be reloaded Note that the items Close Save Save As and Revert to Saved are inactive if no system has been opened or interactively entered For a system interactively entered and not yet saved the item Save results in the same operation as Save As and therefore allows to specify a file name Before specification of a file name by loading or saving an AQUASIM system 8 CHA
280. sity 6 amount of conserved quantity per unit compartment length for the one dimensional flux j amount of the conserved quantity transported per unit time and for the one dimensional source term f amount produced per unit compartment length and per unit time must be derived The soil column compartment has a variable number of zones Variables present in more than one zone are distinguished by the index mob for the mobile zone and imjx for the mixed zone k of the immobile region j Figure 3 52 shows schematically the arrangement and enumeration of the zones The length of the soil column is resolved by immobile region 3 Cin f completely mixed zone 2 mobile zone of the immobile region 3 immobile region 2 mob immobile region 1 Figure 3 52 Schematic cross section through the soil column indicating the enumeration of the immobile zones in the example there are 3 types of immobile regions consisting of 1 2 and 5 mixed zones respectively 3 3 COMPARTMENTS 71 the space coordinate x x can increase or decrease along the column however in the following the equations are formulated with increasing x in flow direction In order to formulate the equations for the saturated soil column 5 types of components of a conservation law must be distinguished The array of one dimensional densities of these types of components is given as follows AO mos AO mob Cmob i Abim Cimri 3 45 Smob i Simpi D II The
281. st of active state variables is to facilitate switching between different models that do not contain the same state variables A user can change a state variable to a variable of another type without the requirement of editing the lists of active variables of the compartments Similarly to the activation of state variables the user has to select which processes are active in a compartment This is done by clicking the button Processes of the dialog box shown in Fig 3 78 This action opens the dialog box shown in Fig 3 80 The two list Select Active Processes Ed Active Processes Available Processes production mineral_aero nitrification mineral_anae mineral_anox min ral_anox nitrification mineral_aero Pictivate production Inactivate Figure 3 80 Dialog box for activating and inactivating processes in a compartment 112 CHAPTER 3 MODEL FORMULATION boxes in this dialog box show the active processes and the available processes respectively The button Activate is used to activate available processes selected in the right list box and the button Inactivate is used to inactivate a active processes selected in the left list box If an active process is selected while activating another process the new active process is inserted in the list of active processes immediately before the selected process otherwise it is appended to the end of the list of active processes This g
282. stoichiometric coefficient During simulations a dynamic process has only an effect to variables which are of the type of dynamic state variables The fact that in the list of stoichiometric coefficients any type of variables is allowed makes it easier to switch between different models e g if variables are changed from calculated dynamic state variables to measured real list variables the processes have not to be changed 3 2 2 Equilibrium Processes Equilibrium processes are used for processes which are much faster than the processes which determine the typical time scale of the simulation A variable determined by such a process can be treated as taking always the value corresponding to its equilibrium state Therefore its value is given as the solution of an algebraic equation Teg 0 3 2 where freg depends on the variable involved and on other variables influencing the equilib rium value Edit Equilibrium Processes x Name ul AIAZ Description Equilibrium cond Variable C_A2 Me Equation O C_A1 2 3 P C_A2 Cancel Figure 3 18 Dialog box for editing an equilibrium process Figure 3 18 shows the dialog box used for defining or editing an equilibrium process As each process an equilibrium process needs a unique Name as an identifier A name 3 2 PROCESSES 31 of a process consists of a sequence of letters A Z a z digits 0 9 and underline characters _ The first character may not be a
283. sures the absolute change in y per unit of change 4 2 SENSITIVITY ANALYSIS 145 in p the relative absolute sensitivity function 4 9b measures the relative change in y per unit of change in p the absolute relative sensitivity function 4 9c measures the absolute change in y for a 100 change in p and the relative relative sensitivity function 4 9d measures the relative change in y for a 100 change in p All these changes are calculated in linear approximation only The most useful sensitivity functions are the absolute relative sensitivity function 4 9c and the relative relative sensitivity function 4 9d because their units do not depend on the unit of the parameter This makes quantitative comparisons of the effect of different parameters p on a common variable y possible Because the relative relative sensitivity function 4 9d is non dimensional this sensitivity function can not only be used to compare the effect of different parameters on a common variable but also the effects of different parameters on different variables However the disadvantage of this relative relative comparison is that it gives not very useful results if the value of the variable y becomes small during a simulation because large relative changes of a value that is close to zero are not relevant Fig 4 7 illustrates the meaning of the absolute relative sensitivity function 4 9c The linear approximation to the change in y for a 100 change in p can easil
284. surface shear is used to drive the horizontal motion described by the velocity U It appears in the boundary condition 3 94b The surface shear can be estimated as follows Amorocho and de Vries 1980 Tsurf Pairc2U amp 10m 3 104 with 0 001 for Uw iom lt 7m s cz 4 0 001 0 00015 s m Uw 10m 7m s for 7m s lt Uyjom lt 17 m s 0 0025 for 17m s lt Uw iom lt 20m s 3 105 The edit field Press Grad is used to specify the source term ry for the horizontal velocity used in equations 3 77 and 3 86 The edit field Prod Diss is used to specify the production of dissipation of turbulent kinetic energy The expression used in the standard k e model is E e Cl P c3G T E aT 3 106 3 3 COMPARTMENTS 123 The edit fields Wind Excitation Bottom Frict and Internal Frict are used to specify the parameters Pyind Phottom and Pint Empirical formulations for these parameters are required Goudsmit et al 1996 Edit Accuracies of Program Variables x Discharge Rel Accuracy Abs Accuracy focor Horiz Velocity Rel Accuracy focoor ts Abs Accuracy foo o ooo Turb Kin E Rel Accuracy 0 0001 Abs Accuracy foo Dissipation Rel Accuracy fooor Abs Accuracy fico ooo Seiche Energy Rel Accuracy foo Abs Accuracy joon Cancel Figure 3 100 Dialog box for editing the accuracies of program variables of a lake com partment The button Acc of the dialog b
285. t Questions to be distributed or responses to distributed questions that should again be distributed must then be sent to aquasim users eawag ch All messages sent to this address are automatically distributed to all members of the list Usually it is recommended to send your responses to distributed questions also to the user group in order to allow all user group members to participate in the discussion However individual answers to the person who sent out the question are also possible 188 CHAPTER 6 APPENDIX 6 3 3 Reporting Program Bugs and Suggestions for Improvements Please report program errors as well as suggestions for program improvements to Peter Re ichert EAWAG CH 8600 D bendorf Switzerland or by email to peter reichert eawag ch An accurate description of the error accompanied by an AQUASIM system file which leads to the problem is very important We will provide information on known program errors on workarounds and on bug fixed program versions on the EAWAG home page at http www eawag ch Bibliography Albrecht A Reichert P Beer J and Liick A 1995 Evaluation of the importance of reservoir sediments as sinks for reactor derived radionuclides in riverine systems J Environ Radioactivity 28 3 239 269 Amorocho J and de Vries J 1980 A new evaluation of the wind stress coefficient over water surface J Geophys Res 85 433 442 Arcangeli J P and Arvin E 1997a Modelling of
286. t lt expression gt Note that this syntax makes it possible to specify algebraic expressions using variables usual operations and elementary functions and that even conditional branching with if then else endif constructions is possible The trigonometric functions use radians as the unit of the argument Table 3 2 gives an overview on the functions and constants available in formula variables abs acos asin atan cos cosh deg exp In log log10 max min pi rad sign sin Function with one argument returning the absolute value of the argument Function with one argument returning the inverse of the cosinus function in units of radians evaluated at the argument Function with one argument returning the inverse of the sinus function in units of radians evaluated at the argument Function with one argument returning the inverse of the tangens function in units of radians evaluated at the argument Function with one argument returning the cosinus function evaluated at the argument that must be given in radians Function with one argument returning the hyperbolic cosinus function evaluated at the argument that must be given in radians Function with one argument returning the argument converted from radians to de grees Function with one argument returning e to the power of the argument Function with one argument returning the natural logarithm of the argument Function with one argument returning the natural loga
287. t AQUASIM system file on which the results are stored This file can be opened with an interactive program version or from a succeeding batch job for processing results CAUTION an existing file with this name is overwritten without warning Name of an optional input text file simulation command file containing the instructions for initialization and step sizes of simulations If no such file is provided the active calculations specified in the simulation dialog box are executed If a simulation command file is provided for each calcu lation number for which simulations should be performed a line providing the two numbers calcnum inittime calcnum calculation number inittime initial time must be pro vided This line is followed by an arbitrary number of lines of the form calcnum timestep numsteps calcnum calculation number timestep output step size for time integration numstes numper of steps to be performed Name of an optional output text file to which a ranking of mean absolute sensitivity and error functions is written CAUTION an existing file with this name is overwritten without warning Name of an output text file to which detailed results of the parameter estimation are written CAUTION an existing file with this name is over written without warning Name of an input text file parameter value file specifying the names and values of parameters The first line of this file must contain the names of
288. t may depend on dynamic volume state variables These variables return the values of state variables in the lake sediment The use of state variables makes it possible to model diffusive fluxes from deeper sediment layers to the sediment layer described by the lake model Input fluxes for any type of variables can be specified but only input fluxes for dynamic volume state variables are used by the program The reason for allowing to define input fluxes for variables of other types is to facilitate the users switching between models with different state variables A user can change a state variable to a variable of another type without the requirement ot editing the lists of input fluxes of the compartments The button Particulate Variables of the dialog box shown in Fig 3 78 allows the 3 3 COMPARTMENTS 119 user to specify properties of particulate variables for dynamic volume state varibles Figure 3 93 shows the dialog box used for this purpose It contains a list box with the Edit Particulate Variables x Part Vars Variable Density Sedimentation Velocity C alq 1e 006 y se Figure 3 93 Dialog box for editing particulate variables of a lake compartment names densities and sedimentation velocities of all defined particulate variables Note that a variable can only be once in both lists of particluate and dissolved variables The buttons Add Edit and Delete allow the user to edit this list Figure
289. te rmaz is very simple to integrate the concentration may jump over the whole range of small and negative rates to large negative values of C where the rate is again approximately equal to rmaz and the degradation process continues to larger negative values of C This problem only occurs if typical concentrations C are much larger than K and a fast decrease of C to zero is possible An elegant way to solve this problem is to extend the function given above in a different way to negative concentrations to avoid the problem that again rma is returned If the rate is extended linearly by Tmas for C gt 0 ea ae 6 2 KY for C lt 0 the problem is avoided without changing the function in the domain of resonable pos itive concentrations C If now the algorithm steps to negative concentrations it obtains negative degradation rates that differ significantly from the positive value of rmaz Such a rapid change in the rate during a single time step is not acceptable for the error test criterion and the step size is decreased For this reason the correct smooth approach to zero is achieved and negative concentrations do not occur in the final model results they may only occur during integration steps that are not accepted In most cases errors in the user input are the cause for wrong simulation results It is advantageous to print out the system definitions and to check these definitions carefully in order to find the cause of the problem
290. te that the values entered for the surface detachment coefficient only has an effect if the radio button individual rate of the option Surf Detach of the dialog box shown in Fig 3 29 is selected Similarly the expressions entered for volume attachment and detachment coefficients are only used if the radio button with free particles is selected for the option Pore Volume of the dialog box shown in Fig 3 29 The edit field Bound L Res is used to specify the boundary layer resistance K x for the particulate species described by the concentration X The last two edit fields Pore Diff and Matrix Diff are used to specify the coefficients for pore volume diffusion Dp x and Dm x respectively Note that the first of these values has only an effect if the radio button with free particles is selected for the option Pore Volume of the dialog box shown in Fig 3 29 and that the second value only has an effect if the radio button diffusive for the option Biofilm Matrix is selected Otherwise the values entered here are ignored The button Dissolved Variables of the dialog box shown in Fig 3 29 allows the user to specify properties of dissolved variables Figure 3 38 shows the dialog box used for this purpose It contains a list box with the names of all defined dissolved variables Note Edit Dissolved Variables Eg Add Edit z Delete Cancel Diss Yars Figure 3 38 Dialog box for editing properti
291. tem Sensitivity Analysis is used to define and execute sensitivity analyses and the item Parameter Estimation is used to define parameter estimation procedures and to estimate model parameters These three items of the menu Calc are described in detail in the three sections of this chapter During all calculation operations information on the system of equations currently solved on the progress of the integration sensitivity analysis or parameter estimation algorithm and on numerical problems is written to the log file aquasim log in the program directory of AQUASIM In the case of numerical problems this information may be very useful in order to help to locate the source of the error Some help for the interpretation of the information contained on this file is given in section 6 3 The file is overwritten every time AQUASIM is started 137 138 CHAPTER 4 SIMULATION AND DATA ANALYSIS 4 1 Simulation Execution of a simulation is equivalent to numerically integrating a system of ordinary and partial differential equations in time and simultaneously solving the algebraic equations In AQUASIM as a first step the partial differential equations are discretized in space Then the spatially discretized partial differential equations together with the ordinary differential equations and the algebraic equations are integrated numerically in time with the algorithm DASSL Petzold 1983 which is based on the implicit backward differen
292. text processing program Printing an AQUASIM system is very useful because the clear arrangement of all system definitions facilitates checking user input or understanding the meaning of objects loaded from an AQUASIM system file created by someone else Note however that an AQUASIM system cannot be reloaded from a print file The menu item About gives information on the installed program version This information is also written to any output file written by AQUASIM Finally clicking the menu item Exit results in program termination If system defi nitions have been edited or if states have been calculated or deleted the user is asked to save the changes For each interactive AQUASIM session a log file with the name aquasim log is written to the startup directory of the program in the batch version the name of the log file can be specified by the user This log file contains information on the progress of calculations In the case of normal program termination the log file can be ignored and deleted in the case of problems during calculation the information provided in the log file may help locating the problem Restarting AQUASIM in the same directory as before leads to overwriting the old version of the log file so that only the log files of the most recent sessions in different directories are available unless an old log file has been renamed Chapter 3 Model Formulation In the program AQUASIM a model consists
293. the time at which it occurs is unknown This makes the second solution procedure proposed above inapplicable decreasing the time step only in the critical ranges of time The first solution decreasing the internal time step may improve the results however the appropriate size of the time step is more difficult to estimate because it depends on the time scale of changes of the values of system variables which are calculated by the program For this reason and to make the integration faster it is better to solve this problem by changing the formulation of the rate expressions in a way that makes the problem detectable by the integration algorithm This procedure is illustrated with a simple example A rate expression of Monod type _ Tmar C See 1 E o e where r is the degradation rate of the substance described by the concentration C Tmax is the maximum degradation rate and K is the concentration at which the degradation 184 CHAPTER 6 APPENDIX rate is half of its maximum value may cause such a problem if the value of K is very small in comparison to typical initial values of C and if degradation continues to zero For large concentrations C gt gt K the degradation rate is approximately equal to rmaz for decreasing concentrations it tends to zero However for large negative concentrations the degradation rate is also equal to rmaz If now the integration algorithm makes huge time steps because the decrease of C with a constant ra
294. the available variables respectively The button Activate is used to activate available variables selected in the right list box and the button Inactivate is used to inactivate active variables selected in the left list box If an active variable is selected while activating another variable the new active variable is inserted in the list of active variables immediately before the selected variable otherwise it is appended to the end of the list of active variables This gives the user the possibility to influence the order of active variables the order is irrelevant for the program but it may be convenient for the user to have a certain order The list of active variables may contain variables of any type but activation has only an effect to state variables Inactive state variables return a value of zero The reason for allowing other types of variables in the list of active state variables is to facilitate switching between different models that do not contain the same state variables A user can change a state variable to a variable of another type without the requirement of editing the lists of active variables of the compartments Similarly to the activation of state variables the user has to select which processes are active in a compartment This is done by clicking the button Processes of the dialog box shown in Fig 3 67 This action opens the dialog box shown in Fig 3 69 The two list Select Active Processes x Act
295. the dialog box shown in Fig 5 3 The user can select the number of Significant Digits and the Separator between numbers on the output file Figure 5 9 shows a plot window on the screen This plot window is generated by clicking the button Plot to Screen in the dialog box shown in Fig 5 2 It contains four curves Two of them represented by markers are real list variables with the program variable Time as the argument In this case the data pairs of the real list variables are plotted The other two curves represented by a dashed and a solid line respectively are simulation results and are plotted with a high temporal resolution Figure 5 10 shows the same plot written in Encapsulated PostScript format to a file and imported to this document This file is obtained by selecting the option Encapsulated PostScript in the dialog box shown in Fig 5 7 and then clicking the button Plot to Screen in the dialog box shown in Fig 5 2 Finally the following listing shows the plot of two of the curves shown above as obtained by clicking the button List to File in the dialog box shown in Fig 5 2 Production 90uE m2 s 1300uE m2 s 90uE m2 s 1300uE m2 s g 6 Eo E 3 g 1e 003 2e 003 3e 003 time s Figure 5 10 Example of an Encapsulated PostScript plot 170 CHAPTER 5 VISUALIZATION OF RESULTS 2K ak 222K 2K 2 2222 2K 2 gt K 2A gt k gt K EEK gt k 221 2 2 92 9 EK K 2 2 2 2 9 EEE 24 2k 2k 2 gt k 92 EOE 2K 2K 2K AQUASIM Versio
296. the integration inefficient Figure 4 4 shows the dialog box used for defining and starting simulations This dialog box is opened with the Simulation command in the Calc menu shown in Figure 4 1 It is of modeless type in order to facilitate performing simulations A simulation consists of one or more calculations The names ofall active calculations are listed in the left list box of the dialog box shown in Fig 4 4 those of all available calculations in the right list box The buttons between these two list boxes allow the user to perform the following operations By clicking the button New new calculations can be defined Alternatively by clicking the button Duplicate the selected calculation can be duplicated With the button Edit or by double clicking the calculation name in the list box a calculation can be edited The button Delete allows the program users to delete calculations The buttons Duplicate Edit and Delete are inactive as long as no calculation is selected With the button Activate calculations selected in the right list box can be activated with the button Inactivate calculations selected in the left list box can be inactivated Active calculations must have different values of their calculation numbers This means that activation of a calculation is impossible if there is already an active calculation with the same calculation number Execution of a simulation leads to the storage of calc
297. the one dimensional conservation laws op a t Oz compartment specific expressions for the one dimensional density 6 amount of conserved quantity per unit compartment length for the one dimensional flux j amount of the conserved quantity transported per unit time and for the one dimensional source term f amount produced per unit compartment length and per unit time must be derived f 3 6 Three zones are distinguished in the biofilm reactor compartment Variables present in different zones are distinguished by the index M for the solid matrix P for the pore volume and B for the bulk volume In addition the index F is used for biofilm when the distinction into solid matrix and pore volume is not relevant e g for the biofilm thickness Lpr The spatial dimension perpendicular to the substratum is resolved by the space coordinate z This coordinate takes a value of zero at the substratum and it increases with increasing distance from the substratum up to the biofilm thickness Lp In order to formulate the biofilm equations 4 types of components of a conservation law must be distinguished The array of one dimensional densities of these types of components is given as follows AX uy AX pj Ae rC pi AO 3 7 D II 42 CHAPTER 3 MODEL FORMULATION The first component of equation 3 7 describes particulate species in the biofilm matrix The one dimensional density of these species is given as th
298. the parameters constant variables on succeeding lines values of these parameters must be specified each line containing one set of values for all parameters the value of each parameter must be within the legal range of the parameter bounded by its minimum and maximum Name of an output text file to which the results of the calculations of x values are written After a header each line of this file contains the parameter values and the corresponding value of x CAUTION an ex isting file with this name is overwritten without warning Name of an input text file result definition file defining when and where to calculate results This file must contain lines of the following form var calcnum comp zoneind time space relabs where var is the name of a variable calcnum is the calculation number of an active calculations comp is the name of a compartment zoneind is an allowed zone index for this compartment time is a point of time within 6 2 BATCH VERSION 175 resfile pemdfile lcmdfile the simulation time range space is a location within the compartment and relabs is equal to the letter a for absolute space coordinates or equal to the letter r for relative space coordinates The space coordinate must also be specified for mixed reactor compartments however in this case its value is ignored Name of an output text file to which the results of the calculations are written After a header each line of this fi
299. the right list box and the button Inactivate is used to inactivate active variables selected in the left list box If an active variable is selected while activating another variable the new active variable is inserted in the list of active variables immediately before the selected variable otherwise it is appended to the end of the list of active variables This gives the user the possibility to influence the order of active variables the order is irrelevant for the program but it may be convenient for the user to have a certain order The list of active variables may contain variables of any type but activation has only an effect to state variables Inactive state variables return a value of zero The reason for allowing other types of variables in the list of active state variables is to facilitate switching between different models that do not contain the same state variables A user can change a state variable to a variable of another type without the requirement of editing the lists of active variables of the compartments Similarly to the activation of state variables the user has to select which processes are active in a compartment This is done by clicking the button Processes of the dialog box shown in Fig 3 41 This action opens the dialog box shown in Fig 3 43 The two list boxes in this dialog box show the active processes and the available processes respectively The button Activate is used to activate available pr
300. thin the water column eighth term The fourth equation describes the behaviour of dissipation Oe 10 442 st 1 dA n de 1 5B 3 aS re 3 88 t Adz In order to derive this equation from the equations 3 74 to 3 77 the gradient of the density p was neglected Dissipation spreads diffusively first term it is eliminted if diffusive vertial downward transport ends at the sediment second term it follows the advective motion of the water column third term and it is produced by a source term fourth term It is usual to use equation 3 83 in order to parameterize this source term of the equation The fifth equation describes the behaviour of dissolved substances in the water column aCr 10 Cri 18 1dA Dih a 3i 54 Dz 2 00s aS Bas ae he H ror HED LCa 22 LOr 3 89 Dissolved substances spread diffusively first term they follow the advective motion of the water column second term they are exchanged with the pore water of the first sediment layer third term they can be converted by transformation processes fourth term and they are influenced by inflows and outflows fifth and sixth terms respectively The sixth equation describes the behaviour of particles in the water column OX 1 1 O OX 1 1 O thee A TOR at CA Oz Oz A Oz 2 L 0 sign w dA 1 dA E wseae Xr seai g wsediX Li t g g reksi 7x SSE g Xati e 4 xy 3 90 Particles sp
301. tion 35 equations 34 inflow 34 initial conditions 35 36 input 35 37 name 34 outflow 34 overview 34 reactor type 35 state variable 34 38 dynamic 34 38 equilibrium 34 surface 34 volume 34 38 user definitions 34 40 variable volume 34 35 volume 34 35 volumetric inflow 34 volumetric outflow 34 mobile zone saturated soil column compartment 70 molecular diffusion coefficient lake compartment 103 120 multidimensional interpolation 21 name advective link 127 bifurcation 128 205 advective diffusive reactor compart ment 61 biofilm reactor compartment 49 calculation parameter estimation 155 sensitivity analysis 140 141 simulation 140 141 constant variable 17 diffusive link 130 dynamic process 29 equilibrium process 30 formula variable 23 lake compartment 108 mixed reactor compartment 34 plot 163 probe variable 26 program variable 15 real list variable 20 river section compartment 88 saturated soil column compartment 75 immobile region 81 state variable 14 variable list variable 21 new file menu 7 normal water level river section compartment 91 number of codiagonals of the jacobian ma trix 133 number of grid points advective diffusive reactor compart ment 62 biofilm reactor compartment 51 lake compartment 110 river section compartment 91 saturated soil column compartment 76 number of steps calculation sensitivity analysis 142 simulation 142 nume
302. tional area of the compartment A as a function of the longitudinal spatial coordinate x which is accessible by the program variable Space Coordinate X It is not allowed to use a time dependence or a dependence on state variables for the specifiction of the cross sectional area The edit field Mob Vol Fract is used to specify the porosity of the mobile zone mob Of the soil column Similarly to the cross sectional area A mob can be a function of the space coordinate x and it is not allowed to use a time dependence in this variable As a next option Dispersion in the dialog box shown in Fig 3 53 the user can select how to model dispersion If the user selects the radio button without dispersion a purely advective equation with D 0 is solved note however that due to the spatial discretization numerical diffusion can occur If the user selects the radio button with dispersion a positive dispersion coefficient D must be specified This coefficient can be made dependent on time discharge or cross sectional area by using the program variables Time Discharge or Cross Sectional Area The list box Immobile Reg contains the names of all immobile regions index j in the equations above already defined The set of regions can be edited using the buttons Add Edit and Delete This editing of immobile regions is described later in this subsection As last options Num Grid Pts Resolut
303. to be compared with the data has to be evaluated This field is inactive if there exists only one zone in the compartment selected above In the last field Time Space the time must be specified at which the comparison of the spatial profile data with the calculated variable or the spatial location at which the comparison with the time series data must take place Note that the value entered here is interpreted as a spatial location if the argument of the real list variable selected in the field Data is the program variable Time and as a point of time if the argument of the real list variable selected in the field Data is the program variable corresponding to the spatial location of the compartment selected in the field Compartment If the check box relative space is ticked spatial locations must be given in relative coordinates otherwise in absolute coordinates this check box has no influence for time specifications which are always absolute In the case of a comparison with time series data the value entered in the field Time Space must be within the legal coordinate range of the compartment For absolute spatial locations the legal range is defined in the definition of the compartment selected in the field Compartment Relative locations must be between 0 and 1 If the compartment is a mixed reactor compartment which has no spatial coordinate the value entered in the field Time Space is ignored During execution of the parameter estimati
304. ton Input as described below In this case the change in reactor volume is given by the difference in in and outflow as given by equation 3 3 The check box active for calculation can be used to activate or inactivate the compartment from the calculations This check box has the same functionality as the buttons Activate and Inactivate in the dialog box shown in Fig 3 19 The button Acc is used to specify the numerical accuracy of program variables as described later in this subsection As for each compartment the user has to select which state variables are active This is done by clicking the button Variables of the dialog box shown in Fig 3 21 This action opens the dialog box shown in Fig 3 22 The two list boxes of this dialog box show the active variables and the available variables respectively The button Activate is used to activate available variables selected in the right list box and the button Inactivate is used to inactivate active variables selected in the left list box If an active variable is selected while activating another variable the new active variable is inserted in the list of active variables immediately before the selected variable otherwise it is appended to the 36 CHAPTER 3 MODEL FORMULATION Select Active State Variables x Active Variables Available Variables OSEE PIIP PpP Th NM zo 9 m pa z a s Inactivate 5 ZI vVozzzT XXxXXxXX
305. ty of the sub stance mass flows entering the column and by a transmission boundary condition Shamir and Harleman 1967 at the outlet OC mobi Q s Cmob i z Amor E 2E Ling 3 55a 8 Cmob i p2 7 0 3 55b where Tin is the total given mass input of substance i per unit of time The second of these boundary conditions 3 55b is omitted for dispersion free transport 3 3 COMPARTMENTS 75 User Definitions Within a saturated soil compartment a mobile zone and a user defined number of immobile zones are distinguished Variables and process rates can be made dependent on the zone by using the program variable Zone Index which takes the value 0 in the mobile zone and a user defined positive integer value in each of the immobile zones Figure 3 53 shows the dialog box used for defining or editing a soil column compart ment The edit field Name is used to specify the name of the compartment Each Edit Saturated Soil Column Compartment Ea Name column Comp Index jo Description Options Variables Processes Init Cond Input Start Coord jo End Coord fi 2 21 Cross Sect J MobVolFract thetathetaim Dispersion without dispersion with dispersion D Immobile Reg pores PX Add Edit he Delete Num Grid Pts jis Resolution low high Acc IV active for calculation Cancel Figure 3 53 Dialog box for editing a soil column compartment compartment needs a unique nam
306. ulated as follows Fischer et al 1979 z2 w E x 0 011 A 3 70 where u amp gdS 3 71 is the shear velocity and d 3 72 3 3 COMPARTMENTS 91 is the mean river depth The next option of the dialog box shown in Fig 3 67 is to select the method used for calculating river hydraulics The user has the choice between the the radio buttons kinematic and diffusive which refer to the kinematic wave approximation according to equation 3 59a and the diffusive wave approximation to the St Venant equations according to equation 3 59b In the case of the diffusive approximation an end water level must be specified as a downstream boundary condition The user can select between the radio buttons normal critical and given which refer to a normal end water level according to equation 3 65a a critical end water level according to equation 3 65b or an end water level specified by the user in the edit field below the radio buttons as a function of time and discharge As last options Num Grid Pts Resolution and Acc in the dialog box used for the definition of a river section compartment Fig 3 67 the user can select the number of grid points the discretization order of the numerical algorithm and the accuracies of program variables The number of grid points is used to specify by how many discrete points the continuous z axis is approximated If the number of grid
307. ulated states of the user defined model Clicking the button Initialize deletes the calculated states for the calculation 4 1 SIMULATION 141 Simulation Ed Calculation Definitions active available calc2 z nw Zi Inactivate Initialize Start Continue Figure 4 4 Dialog box for editing calculation definitions and executing simulations numbers of all active calculations and generates newly calculated initial states Clicking this button is only necessary before a simulation for which there exist already calculated states is to be redone The button Start Continue is used to continue the active calculations from the last calculated states if there are no calculated states the simula tion is automatically initialized before the dynamic simulation is started The buttons Initialize and Start Continue are inactive as long as there is no active calculation Clicking the Close button results in closing this dialog box It can be reopened by choosing the Simulation command in the Calc menu shown in Fig 4 1 As mentioned above the buttons New Edit and Duplicate of the dialog box shown in Fig 4 4 are used to define calculations for the user defined model Figure 4 5 shows the dialog box used for defining and editing a single calculation The edit field Name is used to specify the name of the calculation Each calculation needs a unique name as an identifier A name of a calculation consists of a sequence of
308. ume fractions of particulate species in the biofilm Good behaviour of the numerical algorithmsis usually achieved if the absolute accuracy and the product of the relative accuracy times a typical value of the variable both are 4 to 6 orders of magnitude smaller than typical values of the variable In Table 3 5 the program variables available in a biofilm reactor compartment are sum marized for a complete overview of all program variables see Table 3 1 on page 17 58 Edit Accuracies of Program Variables Ea 0 007 Abs Accuracy joon 0 0 Abs Accuracy 0 00 O fo o01 Abs Accuracy feor i o 001 Abs Accuracy foo Discharge Rel Accuracy Volume Rel Accuracy Biofilm Thickn Rel Accuracy Water Fract Rel Accuracy CHAPTER 3 MODEL FORMULATION Cancel Figure 3 40 Dialog box for editing the accuracies of program variables of a biofilm reactor compartment Calculation Number Time Compartment Index Zone Index Discharge Water Fraction Space Coordinate Z Reactor Volume Bulk Volume Biofilm Thickness Growth Velocity of Biofilm Interface Velocity of Biofilm Identifier for calculations value set in the dialog box shown in Figs 4 5 and 4 17 Simulation time Identifier for compartments value set in the dialog box shown in Fig 3 29 Identifier for zones within compartments returns a value of 0 in the bulk volume zone a value of 1 in the biofilm matrix and a value of 2 i
309. variable 100 123 124 program variable 17 dissolved substances biofilm reactor compartment 41 dissolved variables biofilm reactor compartment 49 56 lake compartment 108 120 dynamic process 10 27 30 description 29 name 29 rate 29 stoichiometric coefficient 29 INDEX dynamic state variable 14 edit advective link 126 129 advective diffusive reactor compart ment 59 69 biofilm reactor compartment 41 58 calculation parameter estimation 155 156 sensitivity analysis 141 143 simulation 141 143 compartments 11 32 124 constant variable 17 delete states 135 136 diffusive link 129 131 dynamic process 28 30 equilibrium process 30 31 formula variable 23 25 lake compartment 98 124 links 11 125 131 mixed reactor compartment 34 40 numerical parameters 11 132 134 probe variable 26 processes 11 27 31 program variable 15 17 40 real list variable 18 21 river section compartment 85 97 saturated soil column compartment 70 84 state variable 14 15 system 11 variable list variable 21 22 variables 11 26 edit menu 5 9 10 12 13 27 28 136 electronic mail 8 end coordinate advective diffusive reactor compart ment 62 river section compartment 89 saturated soil column compartment 75 end row real list variable 21 energy of seiche oscillation lake compartment program variable 112 123 124 program variable 17 equation 201 equilibrium process 31 equilibrium process 10 27 3
310. ve reactor compart ment 69 biofilm reactor compartment 49 58 lake compartment 108 124 mixed reactor compartment 39 river section compartment 97 saturated soil column compartment 75 82 84 rad formula variable 24 rate 28 29 dynamic process 29 reactor confined biofilm reactor compartment 48 50 unconfined biofilm reactor compartment 48 50 reactor type biofilm reactor compartment 50 mixed reactor compartment 35 reactor volume biofilm reactor compartment 48 50 program variable 57 58 mixed reactor compartment 34 program variable 35 37 39 program variable 16 read data pairs real list variable 21 real list variable 10 12 18 21 151 active for sensitivity analysis 21 add data pairs 21 argument 18 20 column number of argument 21 INDEX column number of standard deviations 21 column number of values 21 data pairs 18 delete data pairs 21 description 20 end row 21 interpolation 21 interpolation method 18 19 linear 18 smoothing 19 spline 18 19 maximum 20 minimum 20 name 20 read data pairs 21 replace data pairs 21 standard deviation 18 20 21 absolute 18 20 global 20 individual 20 21 relative 18 20 start row 21 unit 20 write data pairs 21 reference program variable 15 relative accuracy program variable advective diffusive reactor compart ment 67 biofilm reactor compartment 57 lake compartment 123 mixed reactor compartment 38 river section compartme
311. ver section compartment 86 saturated soil column compartment 71 type 14 unit 14 volume 14 advective link 126 128 129 advective diffusive reactor compart ment 59 65 67 biofilm reactor compartment 42 49 54 diffusive link 131 lake compartment 100 108 114 116 118 120 mixed reactor compartment 34 38 river section compartment 86 95 saturated soil column compartment 71 79 83 step size calculation sensitivity analysis 142 simulation 142 stiff 139 stiffly stable 139 140 stoichiometric coefficient 28 29 stoichiometric matrix 29 substance flow advective link 126 bifurcation 126 128 substratum biofilm reactor compartment 41 supported platforms 4 8 surface attachment coefficient biofilm reactor compartment 56 surface detachment coefficient biofilm reactor compartment 56 INDEX surface input lake compartment 113 surface shear lake compartment 122 surface state variable 14 surface widt river section compartmenth program variable 97 surface width program variable 16 suspended solids biofilm reactor compartment 41 50 system edit menu 11 tan formula variable 25 tanh formula variable 25 tasks of AQUASIM 2 3 temperature lake compartment 109 thickness sediment layer lake compartment 99 121 time advective link program variable 128 advective diffusive reactor compart ment program variable 62 69 biofilm reactor compartment program variable 58 lake compartme
312. x can be specified The sediment input fluxes can be edited using the buttons Add Edit and Delete If a sediment input flux is selected while adding a new sediment input flux the new input flux is inserted in the list 118 CHAPTER 3 MODEL FORMULATION Edit Sediment Input Fluxes Ed Input Fluxes Variable Input Flux C_O2 flux_02 Add Edit Delete Cancel Figure 3 91 Dialog box for editing sediment inputs to a lake compartment immediately before the selected input flux otherwise it is appended to the end of the list of sediment input fluxes This gives the user the possibility to influence the order of the sediment input fluxes the order is irrelevant for the program but it may be convenient for the user to have a certain order Figure 3 92 shows the dialog box used to specify a single sediment input flux of a dynamic volume state variable In this dialog box the Edit Sediment Input Flux x aie z Input Conc fiflux_PO4 Cancel Figure 3 92 Dialog box for editing a single sediment input to a lake compartment fields Variable and Input Flux allow the user to select a variable and to specify a surface input flux ised C OF tsed x Note that this input flux represents a mass flux per unit sediment area and per unit of time A positive value of a sediment flux represents a flux into the sediment a negative value a flux out of the sediment A sediment input flux of a lake compartmen
313. xXOAaAnNnNnnnNM KEPEPI 22a roo zl Cancel Figure 3 22 Dialog box for activating and inactivating state variables in a compartment end of the list of active variables This gives the user the possibility to influence the order of active variables the order is irrelevant for the program but it may be convenient for the user to have a certain order The list of active variables may contain variables of any type but activation has only an effect to state variables Inactive state variables return a value of zero The reason for allowing other types of variables in the list of active state variables is to facilitate switching between different models that do not contain the same state variables A user can change a state variable to a variable of another type without the requirement of editing the lists of active variables of the compartments Similarly to the activation of state variables the user has to select which processes are active in a compartment This is done by clicking the button Processes of the dialog box shown in Fig 3 21 This action opens the dialog box shown in Fig 3 23 The two list boxes in this dialog box show the active processes and the available processes respectively The button Activate is used to activate available processes selected in the right list box and the button Inactivate is used to inactivate an active processes selected in the left list box If an active process is selected whil
314. y be constructed with the aid of the tangent to the function y p in p The larger the values of sensitivity functions and the more pronounced the differences in shape of the sensitivity functions within the range of available data the more accurately are the parameters identifiable Figure 4 8 shows an example of the time dependence of the sensitivity functions of F Parest_b Sensitivity Functions ol x Sensitivity Functions E A Figure 4 8 Example of a plot of sensitivity functions of a calculated concentration with respect to three model parameters a calculated concentration with respect to three model parameters K rma and Cini look at the tutorial for a complete description of this example It is evident that the parameter Cini is identifiable from measured concentrations because for small values of the time t the calculated concentration is only sensitive to this parameter The sensitivity functions of the parameters K and rma have a similar shape the signs indicate that the calculated concentrations increase with increasing values of K but they decrease 146 CHAPTER 4 SIMULATION AND DATA ANALYSIS with increasing values of rmaz This leads to a correlation between the estimates of these parameters changes in calculated concentrations caused by a change in K can approximately be compensated by an appropriate change in raz Furthermore the much smaller sensitivity of the calculated concentration to the param
315. ynamic surface state variable and rg is the transformation rate of the substance described by S This transformation rate is calculated analogously to the trans formation rate rc described above The dimension of S can be chosen by the program user who is responsible to make consistent process definitions If a substance is converted from dissolved C to attached S e g by an adsorption process the stoichiometric coefficients must be chosen in order to convert the units of C correctly to those of Sj For equilibrium state variables algebraic equations specified as equilibrium processes are solved in the compartment User Definitions Figure 3 21 shows the dialog box used for defining or editing a mixed reactor compartment The edit field Name is used to specify the name of the compartment Each compartment needs a unique name as an identifier A name of a compartment consists of a sequence of letters A Z a z digits 0 9 and underline characters _ The first character may not be a digit In the edit field Comp Index a nonnegative integer number can be specified as a compartment index This value can be accessed with the aid of the program variable Compartment Index to make variables or process rates dependent on the compartment 3 3 COMPARTMENTS 35 Edit Mixed Reactor Compartment Ea Comp Index jo Description Options Variables Processes Init Cond Input Reactor Type constant volume Volume 2000 C

Download Pdf Manuals

image

Related Search

Related Contents

Phonix IP4SDSN mobile phone case  Craftsman 917.377991 Owner`s manual  REV COUNTER RCX User`s Manual  Event Bar Q4  LABPS3020  AEROSTAT AS21  RSS Writer User Manual  Quick Guide  03 model SUPPLEMENTARY SERVICE MANUAL  Multifunction granite quartz stone marble cutting and polishing  

Copyright © All rights reserved.
Failed to retrieve file