Download Open Processes Library User Manual
Transcript
Open Processes Library, User Manual coefficients, they may share the same Fortran routine. The same is true for ten heavy metals or fifteen organic micro-pollutants that mutually react in the same way but only with differences in reaction rates. Furthermore, the name of the subroutine is converted to uppercase (Fortran standard) and is used in uppercase throughout. We could call our subroutine “FIRSTORDER” and use it for all first order decay processes, like coliform bacteria as well. This would be a very generic routine. This has a drawback: We would have to include an additional process that computes the coliform decay rate as a function of temperature, salinity and UV radiation. For BOD we have to include an additional process that computes the BOD decay rate as a function of temperature and of available oxygen. Instead of doing so, we will join these two steps into one subroutine for the decay of BOD, that we will call “BOD_DECAY”. T The above reasoning shows the type of decisions you have to make to keep your library manageable. It is a matter of taste whether you prefer a few, large subroutines or many small subroutines. In general, smaller routines make the system more flexible but, like with everything in life, exaggeration will do no good. DR AF (The two checkboxes act on horizontal/vertical exchanges in the upper right corner are reserved for future use.) We see three empty lists: Input items This is the list of all items that the process needs to do its computation Output Fluxes The list of all ‘arrows-between-substances’ that the process will compute Other output items The list of all output items that the process will produce. Input items We need the decay rate k1 for BOD as input parameter for the simple BOD decay formula: ∂BOD = −k1 · BOD ∂t (4.1) In general however this decay rate is temperature-dependent according to: (T −20) k1 = k20 · Tcoef (4.2) The rate equals the rate at 20 ◦ C multiplied with a temperature coefficient to the power T −20. This means that we now have three input items: temperature, the temperature coefficient and the decay coefficient at 20 ◦ C. We press the Add button besides the Input Items section and the Edit Item window appears (Figure 4.11). Here we insert the ID “BOD_Dr_20” with the name “Decay rate at 20 C for Biochemical Oxygen Demand” (this is 48 characters, so about the maximum for this field). Remark: ID’s are directly used in the computer-generated source code. So they should be valid Fortran names. Use underscores in stead of minus signs. That is also the reason why Oxygen should be preferred as ID rather that DO, because it then would be similar to the Fortran DO-loop instruction. 24 of 56 Deltares