3 Modelling concepts Everywhere in this chapter we will use a term “modelling” in the sense of “numerical modelling”. Physical modelling and conceptual modelling as well as numerical modelling itself will be mentioned directly in relevant cases. 3.1 Introduction In chapter 3 the concept of transport equation was introduced, starting from the concepts of control volume and of accumulation rate of a property inside that control volume. Diffusive and advective fluxes were also defined to account for exchanges between the control volume and neighbourhood and the concept of evolution equation was introduced adding sources and sinks to the transport equation. A model is built on the same concepts. Its implementation needs the definition of at least a control volume, the calculation of the fluxes across its boundary and the calculation of the source and sinks using values of the state variables inside the volume. The number of dimensions of the model depends on the importance of relevant property gradients. The simpler model is the "zero-dimensional" model. In this case, there is no spatial variability and only one control volume needs to be considered. On the other extreme of complexity is the three-dimensional (3D) model, required when properties vary along the 3 space dimensions. Whatever is the number of dimensions of a model, it must include the following elements: Equations, Numerical algorithm, Computer code. The order of the items in this list can also be seen as their chronological development order. Hydrodynamic equations are based on mass, momentum and energy conservation principles, which were presented in chapter 3 and are known for longer than one century. Numerical algorithms to solve hydrodynamic models have been attempted even before the existence of computers. The analytical equations and the numerical algorithms produced before the existence of computers allowed the fast development of modelling since the sixties, when computers were made available to a small scientific community. Since that time models and the modelling community has evolved exponentially. Modern integrated computer codes have done more for interdisciplinarity than one century of pure field and laboratory work. After a period of validation of model's assumptions (equations and algorithms) the development of user-friendly graphical interfaces becomes a priority, easing the use of models by non-specialists. They reduce the number of errors on input files, and make easy the checking of those files. Along this chapter concepts and methodologies to build models and to understanding their functioning are being presented. 3.2 Numerical discretisation techniques Computers can only solve algebraic equations. Analytic equations - integral or differential - must be discretised into an algebraic form. The procedure to follow depends on the form of the analytical equation to be solved. The control volume approach is the most adequate to the integral form of evolution equations, while Taylor series are the most adequate for differential equations. 3.2.1 Computation grid The calculation of fluxes across control volume surface is also simpler if the scalar product of the velocity by the normal to each elementary area (face) composing that surface remains constant along the domain. The control volume that makes that calculation simpler must have faces perpendicular to the reference axis. If rectangular coordinates are used, the control volume generating the simpler discretisation is a parallelepiped. In case large oceanic/atmospheric models a suitable control volume must have faces laying on meridians and parallels (geographic coordinates). In depth-integrated models the upper face of the control volume is the free surface and the lower face is the bottom. In 3D models a control volume occupies only part of the water column and its shape depends on the vertical coordinate used. In coastal lagoons Cartesian and sigma type coordinates (or a combination of both) are the most common. The ensemble of control volumes forms the computation grid. In finite-difference type grids control volumes are organized along spatial axis and a structured grid is obtained. On the contrary, typical finite-element grids are non-structured. The latter are more difficult to define, but more flexible, allowing easy variability of spatial resolution. Figure 3.5-1 shows an example of a very general finite-difference type grid using several discretisations on vertical direction. Figure 3.5-1: Example of a grid for a 3D computation. Two vertical domains are used. In the upper domain, a sigma coordinate is used while lower one uses a Cartesian. Figure 3.5-2: Typical 1D spatial grid. 3.2.2 The 1D model case Figure 3.5-3: Generic control volume in a 1D discretisation. A system can be considered as one-dimensional if properties do change along a physical dimension mostly. In this case control volumes can be aligned along the line of variation and one spatial coordinate is enough to describe their locations. Properties are considered as being constant across control volume faces perpendicular to that axis. Fluxes across faces not perpendicular to that axis are null or negligeable. Vi Vi-1 Vi+1 Figure 3.5-1: Example of a grid for a 3D computation. Two vertical domains are used. In the upper domain, a sigma coordinate is used while lower one uses a Cartesian. 3.2.2.1 Control volume approach Control volumes Figure 3.5-2: derivation of the Figure 3.5-3: generates simple used by1D numerical models have the same meaning as in the Typical spatial grid. evolution equation in chapter 3. A discretisation is adequate if it Generic control volume in a 1D discretisation. calculation algorithm, still keeping results accuracy. The simpler calculation is obtained if properties can be considered as being uniform inside the control volume and along parts of its surface (each face). To make this possible Q i-½ Ci-1 Ci i-½ Q i+½ i-½ Vi Vi-1 Vi+1 Δxi Δxi-1 Ai-½ Figure 3.5-3: Generic Ci+1 Δxi+1 Ai+½ control volume in a 1D discretisation. without compromising accuracy, the control volume must be as small as possible: a fine grid is needed. In a 1D model properties can be stored into 1D arrays (vectors). Neighbours of a generic element "i" is "i-1", on the left side and "i+1" on the right (Figure 3.5-3). The length of a control volume must be small enough to allow properties in its interior to be represented by the value in its centre. In that case equations deduced in paragraph 3.2 apply and the rate of accumulation in volume “i” will be given by: AccumulationRate Vi Ci t t Vi Ci t t Δt is the time step of the model. This equation simplifies if the volume remains constant in time. This is not the case in most coastal systems and is not certainly the case in tidal systems. Exchanges between "i" volume and neighbours are accounted by advective and diffusive fluxes. Their calculation needs some hypotheses. Let us detail Figure 3.5-2, indicating the distances between faces (spatial step) and the location points where others auxiliary variables are defined. Advection fluxes at volume “i” contribute with: Q C i i 12 Qi 1Ci 12 t t * where Qi=uiAi-½ and diffusive flux contributes with: i 12 C Ci 1 Ai 12 i 1 2 xi xi 1 t t * i 12 C Ci Ai 12 i 1 1 2 xi xi 1 t t * In these equation t* is a time instant between t and t+t, to be defined according to criteria defined in the next paragraph. Adding the 3 contributions described above one gets: Vi Ci t t Vi Ci t t Qi Ci 12 Qi 1Ci 12 Ci Ci 1 Ai 12 1 x x 2 i i 1 i 12 t t * t t * i 12 Ci 1 Ci Ai 12 1 x x 2 i i 1 t t * (Equation 3.5-1) In the particular case of a channel with uniform and permanent geometry (cross section (A), volume (V) constant) and with constant discharge and diffusivity Equation 3.5-1 becomes: Ci t Ci 1 2 Ci 1 2 Ci U t x t t t t * C 2Ci Ci 1 i 1 x 2 t t * Where U is the cross-section average velocity and x is the ration between the volume and the average cross section (i.e. is the length of the control volume). This is a most popular form of the transport equation, but as shown above, it is applicable only into particular conditions. Additional approaches are required to calculate the advective flux, since concentration is defined at the centre of the control volumes and not at the faces. Those approaches ant their numerical consequences are described in the next sections. 3.2.2.2 Numerical calculation of advection Three common approaches to estimate concentration values at control volume faces are: Linear Approach, Upstream stepwise approach, Quadratic Upwind Approach (QUICK). Linear Approach In the linear approach it is assumed that: Ci 1 2 Ci xi 1 Ci 1xi xi 1 xi Assuming a discretisation where the grid size is uniform, it is easily seen that this approach generates central differences as obtained using Taylor series (see next paragraph). Upstream stepwise approach In this case it is assumed that the concentration at left face is: Q 0 C Qi 0 Ci 1 Ci 1 i 2 i 12 Ci This discretisation respects the transportivity property of advection. This property states that advection can transport properties only downstream and never upstream. The linear approach doesn’t respect this property because volume “i” will get information of downstream concentration through the average process. The violation of this property can generate instabilities and will create conditions to obtain negative values of the concentration. The upstream discretisation avoids that limitation but as shown into next paragraphs can introduce unrealistic numerical diffusion. Quadratic Upwind Approach (QUICK) The quadratic upwind scheme aims to compromise the respect of the transportivity of advection and numerical diffusion (explained further down). In this case it is assumed that concentration distribution around a point follows a quadratic distribution centred on the upstream side of the face being calculated. For the left face one would get: Q 0 C Qi 0 Ci 1 6 8 Ci 1 3 8 Ci 18 Ci 2 i 2 i 12 6 8 Ci 1 3 8 Ci 18 Ci 1 Using the Taylor series discretisation described in the next paragraph, it can be seen that advection calculated using this approach is 3rd order accurate (Leonard, 1976), while pure upstream discretisation is 1st order accurate and the linear approach (central differences) is 2nd order accurate. The inconvenience of QUICK discretisation is that it requires additional approaches close to the boundaries. This is not a very much limiting factor in 1D calculation, but it is in 2D or 3D calculations, especially when geometry is irregular. 3.2.2.2.1 Temporal approach In previous paragraphs spatial discretisation was analysed. A solution was described for diffusion term and three discretisation methods were suggested for advection, but Property value 140 C 0 1 t Time Figure 3.5-4: Visualization of the consequences of temporal discretisation. Property evolves within a time step, but not values used for flux calculation. nothing was said about the instant of time of the variables used to calculate advection or diffusion. Figure 3.5-4 shows an example of a time evolution of a property in a space point. The curve line shows the continuous evolution and dots show values at each time step. Figure shows values at the beginning and end of a particular time step. The flux in that time step is proportional to the dark area shown on the figure. Values at the beginning and end of a time step are shown, as well as concentration variation during that time step. The rate of accumulation at this point is proportional to the slope of this line. The slope of this line also gives an idea of the errors associated to the choice of t*. Explicit models use t*=t, while implicit models consider t*=t+t. From that figure it can be seen that when the slope of the curve is positive explicit models underestimate the advective fluxes1, while when the slope is negative they overestimate them, introducing a phase error. On the contrary, implicit methods overestimated the fluxes by a value of the same order and also introduce a phase error (but with opposite sign). The consideration of an intermediate value between t and 1 In explicit methods the flux during a time step is proportional to the are of the rectangle with sides lengths t an Ct, while in implicit methods is proportional to t an Ct+t. t+∆t generates more accurate fluxes. In the next paragraph it will be shown that t*= t+½ t (semi-implicit method) gives the maximum accuracy. Values at t*= t+½ t can be obtained averaging the values of the properties calculated at time t and time t+t. The price to pay for this accuracy improvement is the increasing of the number of calculations to perform. In next paragraph it will be shown that implicit methods have better stability properties than explicit methods, and it can be shown that semi-implicit method’s stability properties are similar to those of implicit methods. For their stability and accuracy properties, semi-implicit methods are the most efficient numerical methods. 3.2.2.3 Taylor series approach Traditionally discretised equations are obtained from partial differential equations replacing derivatives by finite-differences obtained using Taylor series. Taylor series provide information on the truncation errors done when replacing derivatives by finite-differences. On the contrary the control volume introduced in previous paragraph gives information about physical approaches done during discretisation. Done correctly both methodologies must produce the same discretised equations. To introduce the Taylor series discretisation methods and to analyse stability and accuracy concepts, let us consider the differential equation corresponding to Equation 3.5-1: C C 2C U 2 t x x (Equation 3.5-2) This equation describes advection-diffusion transport in a channel with uniform velocity, permanent geometry and diffusivity. 3.2.2.3.1 Time discretisation (g) Taylor series relate the value of a property in a point (or time instant) with the values of the property in another point and the derivatives in the same point: C t t t 2 2 3 3 t n n C C t C t C 0t n 1 C t 2 3 n t i 2 t i 3! t i n! t i t t t i t i Truncating this series at the first derivative, one gets: t t C Ci Ci t t t i t t Equation 10 This equation states that the resolution all the terms of the equation at time t allows the calculation of the variable at time t t with precision of first order, since the first missing term in the series is multiplied by t . Similarly one could relate the concentration at time t with the concentration at time t t : t t t t t t t t t 2 2 C t 3 3C t n n C C C C t 2 3 n 2 3 ! n ! t t t t i i i i Truncating this series after the first derivative as before, one gets: t t i t i t t C t i Cit t Cit 0t t 0t Equation 11 This equation shows that in implicit methods the truncation error is also of the first order, as in explicit methods, although processes are computed at time t t . Below it will be shown that difference between implicit and explicit methods are their stability properties. From paragraph 3.2.2.2.1 it was expected that explicit and implicit should have the same truncation error and it is also expected that the calculation of the derivatives (or fluxes) at the centre of time step must have a smaller truncation error. To demonstrate it, let us use Taylor series to relate properties at time t and t t with variables at t t / 2 . t t / 2 C C it t C it t / 2 t 2 t i t t / 2 C C t i t t / 2 i C t 2 t i t 2 2 t 2 2 2 2 t t / 2 C t 2 i 2 2 0 t 3 Equation 12 t t / 2 2C t 2 i 2 0 t 3 Subtracting the second equation from the first equation, one gets: t t / 2 C t i Cit t Cit 0 t 2 t 2 Equation 13 n 1 This equation shows that semi-implict methods are second order accurate, and consequently they allow for the use of larger values of time step. The implementation of these methods requires the computation of all derivatives and fluxes centred in time. The values to be used in the calculations can be computed also with second order accuracy, as the average between values at time t and t t , as can be demonstrated using expansions from Equation 12: Cit t / 2 Cit Cit t 2 0t 2 This temporal semi-implicit discretization is known as a the Crank-Nicholson discretization. In this discretization one would get: t t Cit t Cit 1 C 2C U 2 t 2 x x i t 1 C 2C U 2 0(t ) 2 2 x x i To solve this equation, spatial derivatives must be discretised. 3.2.2.3.2 Spatial discretisation Spatial discretization using Taylor follows an approach similar to temporal discretisation. Let’s consider Taylor series developments for points on the left and on the right of point i, at a distance x : * * C * i 1 2 2 3 3 C x C x C 0x 3 C x 2 3 x i 2 x i 3! x i C * i 1 2 2 3 3 C x C x C 0x 3 C x 2 3 x i 2 x i 3! x i * t i * * t i Equation 14 * Equation 15 Subtracting Equation 15 from Equation 14, one gets the so called central difference for first order spatial derivative of C: Cit1 Ci*1 C 2 0x 2x x i * Equation 16 From Equation 14, one would get an expression for a non-centred derivative (right side derivative), and from Equation 15 a left side derivative, both with a truncation error of first order: Cit1 Ci* C 0x x x i Equation 17 C t Ci*1 C 0x i x x i Equation 18 * * If Equation 17 is used when the velocity is negative and Equation 18 is used when the velocity is positive, the first derivative is computed using an “upstream method”, since in both case no downstream information is used. Adding Equation 14 and Equation 15, one gets: * 2C C * 2Cit Ci*1 2 2 i 1 0x 2 x x i Equation 19 Which is the finite-difference form of the second spatial derivative, discretised with a second order truncation order. In next paragraph stability criteria is analysed for some of these discretizations. It will be shown that central differences for first order derivative generate unstable algorithms and it will be shown that truncation error is not the unique aspect to take into account for estimating the accuracy of a numerical algorithm. 3.2.2.4 Stability and accuracy For simplicity let us consider Equation 3.5-2 to illustrate stability and accuracy associated to different options for temporal and spatial discretisation. Let us consider central explicit differences in the particular case of no diffusion. In that case Equation 3.5-2 becomes: t t Ci C C i 1 U i 1 t x Ut Ut t t t t t Ci 1 C Ci 1 C 2 x i 1 2 x i 1 Ci Where t t (Equation 3.5-6) Ut C r is the Courant number, representing the ratio between the path x length of a particle during a time step and the grid size. This is a critical parameter for explicit discretisation methods. Let us consider the case of a channel where initial concentrations are zero everywhere except in a generic point “i”. Table 3.5-1 shows the temporal evolution along 11 time steps (0 to 11) for the case of unitary Courant number and central explicit differences Table 3.5-1: Example of a time evolution in a 1D channel computed using explicit central differences, a unitary courant number, and no diffusion. Time step i-3 0 1 2 3 4 5 6 7 8 9 10 11 i-2 0 0 0 0 0 0 0 0 0 0 0 0 i-1 0 0.00 0.25 0.75 1.31 1.56 1.08 -0.33 -2.29 -3.76 -3.26 0.31 Grid point number i i+1 0 1 -0.50 1.00 -1.00 0.50 -1.13 -0.50 -0.50 -1.63 0.97 -2.13 2.81 -1.16 3.93 1.66 2.94 5.59 -1.00 8.52 -7.14 7.52 -12.54 0.38 i+2 0 0.50 1.00 1.13 0.50 -0.97 -2.81 -3.93 -2.94 1.00 7.14 12.54 Total amount i+3 0 0.00 0.25 0.75 1.31 1.56 1.08 -0.33 -2.29 -3.76 -3.26 0.31 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 for advection and Table 3.5-2 shows the corresponding solution for the case of a Cr=2. In both tables column “i-3” and “i+3” represent the boundary conditions (zero outside of the modelling area) and total amount stands for the total amount of matter inside the channel. Both solutions are unrealistic. In such conditions one would expect the contaminated water to move forward and after a certain time whole the channel should have a concentration equal to zero because the water entering in the model area has null concentration. The value of the total amount of matter inside the channel should remain constant. Stability A model is said unstable if errors generated inside the modelling area are amplified. This is what happened in both calculations. As time evolved the errors have grown. Error growth rate has been higher at higher Courant number. To understand the reasons for instability one can use the following principle: “The influence of a point on its neighbours through advection or diffusion can’t be negative”. This means that the consequence of increasing the concentration in one point can never be a reduction in any of its neighbours. Increasing the concentration in none point will result on an increase in the neighbours ot it will have no effect on them n(if advection and/or diffusion have no capacity to transport material to there. To guarantee the respect of this principle, no coefficient multiplying grid point values in Equation 3.5-6 can be negative. If a coefficient is null there is no influence from that point on point “i”. In Equation 3.5-6 the coefficient of Ci+1 is negative whatever is the Courant number. As a consequence the higher is the concentration in that point, smaller becomes the concentration in point “i”. Adding diffusion this method can be stabilised. Considering diffusion, Equation 3.5-6 would become: t t t t Ci C C i 1 C 2C i C i 1 U i 1 i 1 t x x 2 Equation 3.5-7 t t 1 Ut t t 1 Ut t t t t Ci 2 C i 1 1 2 2 C i C 2 x x 2 i 1 x 2 x x Ci In t t x 2 d is called the diffusion number. In this case positiveness of the Table 3.5-2: Example of a time evolution in a 1D channel computed using explicit central differences, Cr=2, and no diffusion. Time step i-3 0 1 2 3 4 5 6 7 8 9 10 11 i-2 0 0 0 0 0 0 0 0 0 0 0 0 Grid point number i i+1 i+2 i+3 0 1 0 0 -1.00 1.00 1.00 0.00 -2.00 -1.00 2.00 1.00 0.00 -5.00 0.00 3.00 8.00 -5.00 -8.00 3.00 16.00 11.00 -16.00 -5.00 0.00 43.00 0.00 -21.00 -64.00 43.00 64.00 -21.00 -128.00 -85.00 128.00 43.00 0.00 -341.00 0.00 171.00 512.00 -341.00 -512.00 171.00 1024.00 683.00 -1024.00 -341.00 Total amount i-1 0 0.00 1.00 3.00 3.00 -5.00 -21.00 -21.00 43.00 171.00 171.00 -341.00 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 coefficients is assured if: Re g Ux 2 Ut Cr 1 x (Equation 3.5-8) Reg use to be designated by “Grid Reynolds number” The consideration of advection alone is equivalent to the consideration of an infinity Reynolds number and consequently, whatever is the time step (or Cr), central-differences are always instable. The consideration of diffusion doesn’t always increase the stability properties of numerical models. Why did it in this case? Central differences do not respect the transportive property of advection. Physically, advection can only propagate information on the sense of the velocity. The analysis of Table 3.5-1 and Table 3.5-2 shows that information has been also propagated backward. This was a consequence of the use of a downstream value (Ci+1) to calculate the spatial derivative. Physically diffusion propagates the information in any direction (according to the local gradients). In case of Table 3.5-1 and Table 3.5-2 diffusion transports matter upstream, making it available to be transported subsequently by advection and thus it increases stability. When the advective flux is calculated using downstream information, one can remove matter from a control volume that is not there to be removed. This is the mechanism that generates negative concentrations. The method is unstable because those errors are amplified in time. The consideration of (enough) diffusion makes the method stable, but do not avoid the generation of negative concentrations. The upstream discretisation was proposed first to avoid this problem. Let us consider now upstream explicit differences and again the particular case of no diffusion. In that case Equation 3.5-2 becomes: Ci t t Ut Ut t t Ci 1 1. Ci ( forU 0) x x (Equation 3.5-6) In this case it is easy to verify that the method is stable if the Courant number is not greater than 1. Table 3.5-3shows results for Cr=1 and Table 3.5-4 for Cr=0.5. Cr>1 Table 3.5-3: Example of a time evolution in a 1D channel computed using explicit upstream differences, Cr=1.0, and no diffusion. Time step i-3 0 1 2 3 4 i-2 0 0 0 0 0 i-1 0 0.00 0.00 0.00 0.00 Grid point number i i+1 0 1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 i+2 0 1.00 0.00 0.00 0.00 Total amount i+3 0 0.00 1.00 0.00 0.00 0 0 0 0 0 1 1 1 0 0 Table 3.5-4: Example of a time evolution in a 1D channel computed using explicit upstream differences, Cr=0.5, and no diffusion. Time step i-3 0 1 2 3 4 5 6 7 8 9 10 i-2 0 0 0 0 0 0 0 0 0 0 0 i-1 0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 Grid point number i i+1 0 1 0.00 0.50 0.00 0.25 0.00 0.13 0.00 0.06 0.00 0.03 0.00 0.02 0.00 0.01 0.00 0.00 0.00 0.00 0.00 0.00 i+2 0 0.50 0.50 0.38 0.25 0.16 0.09 0.05 0.03 0.02 0.01 i+3 0 0.00 0.25 0.38 0.38 0.31 0.23 0.16 0.11 0.07 0.04 0 0 0 0 0 0 0 0 0 0 0 Total amount 1.00 1.00 1.00 0.88 0.69 0.50 0.34 0.23 0.14 0.09 0.05 would generate an instable model, which could not be solved adding diffusion. In fact if diffusion was considered, the stability criteria would be (Cr+2d)1. In Table 3.5-3 one can that explicit upstream differeces give the exact result. The concentration reamins constant and travel at the exact speed (1 cell per iteration). When the Courant number is reduced to 0.5 (Table 3.5-4) the solution is however degradated through the introduction of numerical diffusion. The method remains stable since the errors are reduced in time. The results obtained in the 4 examples presented show that small truncation errors as given by the Taylor series are not enough to guarantee accurate results. The upstream results show that the reduction of the time step do not guarantee either an improvement of the results. The need for a fine resolution grid The reason why the upstream scheme with a Cr=0.5 gives so poor results is the coarse discretisation used. In this case the matter travels only half of the grid size and consequently the material contained in cell “i” at t=0 is dritibuted by two computing cells at time t=1. Because the concentration is computed as the mass devided by the volume, its values is reduced to ½. This resulot is obtained because we are violating an initial hypothesis “the grid cell is small enough to allow the concentration to be uniform in its interior”. This is not happening when half of the cell has matter and not the other half. If the plume was contained into many cells the problem would still exist but only on the plume limits and would not deteriorate the solution. 3.3 Model implementation (r+f) As described in chapter 3, the implementation of a numerical model in a specific lagoon requires the specification of the boundary conditions specific of the site and the specification of model parameters suitable for the site and for the conditions envisaged for the simulations. The bathymetry and the tidal harmonics at the inlet(s) are boundary conditions that can be considered as time independent in most sites. On the contrary river discharge, water column structure at the sea boundary (in case of 3D simulations) and the atmospheric conditions, are time dependent boundary conditions. Implementation of a model requires data to specify boundary conditions, but also data to specify initial conditions and parameters for process simulation. Additional data is required to evaluate of model results quality. 3.3.1 Bathymetry and modelling grid Bathymetry describes lagoon’s geometry and is the basis of the whole modelling procedure. Bathymetry is generally is measured by Hydrographic Authorities using a fine resolution to provide data for navigation charts and to support coastal engineering works. In terms of bathymetry and grid definition laterally integrated models constitute a particular case, requiring much less information. 3.3.1.1 1D models In the beginning of this chapter it was shown how to build a 1D model and the parameters characterizing the respective grid: cross section and cell length. In that case the volume of each cell was calculated as the product of the cross section by the cell length. As a general rule the free surface level varies in time and the model has to calculate the value of the cross section as a function of that level. In these conditions, the information to supply is the width of the cross section as a function of the level. This information has to be supplied at both tops of each cell or at its centre. Intermediate values can be calculated interpolating. 3.3.1.2 Horizontally resolving models Horizontal resolution models are 2D depth integrated or 3D resolving models. In these models the modelling area is described by a grid usually formed by rectangular cells in finite-difference methods and by triangles in finite-element methods. The depth is specified in the centre of the grid or at the corners and obtained by interpolation in other points. In this type of models horizontal resolution is much higher that in laterally integrated models and more detailed bathymetric information is required. In general “grid-generating programs” create the grids. Those programs require the supply of a detailed coastline and obtain the depth of each cell averaging/interpolating a digitised bathymetry. When the information is scarce, special care has to be taken verifying the depth generated for each model cell. In case of 3D models, after the generation of the horizontal grid and of the corresponding depth distribution, a vertical discretisation has to be defined. Two discretisations are easily defined: Sigma-type coordinates and Cartesian coordinates. In Cartesian coordinates layers are horizontal and maintain the same thickness in time, apart from the surface layer, which thickness depends on the free surface position. In case of sigma coordinates the water column is divided into layers of variable thickness (in space and time) in such a way that the ratio between the thickness of a layer and the local depth remains constant in space and time. In sigma type models vertical resolution is independent of the local depth. This is convenient in systems where density effects play a secondary role compared with topographic effects. Special care has however to be taken in intertidal areas, where the thickness of each layer approaches zero during the drying procedure. The consideration of two sigma domains in the water column can be a solution. 3.3.2 Initial conditions Initial conditions must be supplied for each state variable (velocity and levels, temperature, salinity, nutrients, etc.). This information should be obtained from field data measured synoptically. Unfortunately for most variables information is unknown or available in just a few points and assumptions must be done. For that purpose properties have to be grouped into rapidly dissipative and slowly (or non) dissipative properties. Dissipative properties rapidly forget the information related to the initial conditions becoming dependent only on the boundary conditions. Hydrodynamics is driven by mechanical energy and is highly dissipative. In fact errors on the hydrodynamical initial conditions result into artificial initial energy supply, which will be transformed into kinetic energy before being dissipated. Stability properties of the model are limited by the values of the velocity. Very unrealistic initial conditions can generate very high velocities and create conditions for numerical instability. For these reasons the most efficient way to initialise a hydrodynamic model is to start from null velocity and a horizontal free surface equal to the average level at the open boundaries. Properties associated to the ecology of the system have to be initialised with realistic values. In fact ecological systems are resilient and after a strong perturbation do not necessarily recover to the state before that perturbation. Initialising and ecological model with unrealistic values is equivalent to state that the system has been highly disturbed. In fine resolution models a lot of information must be supplied interpolating from point information available. Specific initialisation software tools can simplify the initialisation procedure. Sediment transport models are also very much independent on the initial conditions. If initial suspended matter concentration is specified in excess, settling will remove it. On the contrary if initial suspended matter is underestimated erosion will supply the missing matter (if deposited matter is available). In this case the difficulty is not the initialisation of the water column concentration, but the initialisation of the erodible amount of sediments lying on the bottom. The user must use a procedure compatible with the information available and with the objectives of the simulation. If the information is scarce and the aim of the simulation is to obtain realistic values of the concentration in the water column, then a convenient procedure is to assume that there is no net erosion in any point of the lagoon. In this case the model is initialised assuming that there is a thin erodible layer everywhere in the lagoon and is run until an equilibrium solution is obtained. After this period erosion and deposition areas are identified and the model is initialised assuming that there is no erodible sediment in the areas where erosion was identified. If the aim of the model is to simulate erosion processes in the lagoon (e.g. due to anthropogenic modifications of its morphology), a consolidation/desagregation module of the bottom must be considered. In fact, after deposition, sediments are submitted to a consolidation process resulting into an increase of the critical shear stress for erosion. To simulate the erosion process an initial vertical profile of consolidation has to be specified. 3.3.3 Boundary conditions Boundary conditions can be specified in terms of a specified value, a specified flux or a specified law of property variation at the boundary. The radiation boundary conditions used on ocean hydrodynamic models fit in the latter group. A typical coastal lagoon has one or several sea inlets and receives land discharges through one or several rivers. In general, at sea inlets the most convenient is to specify the values of the properties or to estimate those values as a function of the values inside the modelling area. At the river boundary the flux is the river flow rate times the specific value of the property (concentration in case of a mass). In this case properties in the fresh water are the most convenient boundary condition. When multiplied by the river discharge the condition becomes in fact a flux condition. 3.3.4 Internal coefficients: calibration and validation Internal coefficients are used to parameterise empirical closures of the processes simulated by the model. These parameters have to be fitted using field data. This procedure is called calibration. From literature the range of variation of each parameter is known. When calibration procedure suggests parameter values out of that range, a scientific explanation has to be found. In fact the most common reason for calibration values out of range is the need to include extra processes in the model. After calibration the model must be validated using a data set not used in the calibration process. This validation process will guarantee that the parameters are adequate to a range of conditions representative of those found in the system being studied. The calibration effort increases with in a non-linear way with the number of parameters (e.g. biological models). In case of models with simple spatial grids the running time is small and some automatic procedures can be established to select the best values of the parameters. In practice, in real systems horizontal transport simulation is required and a small number of trials can be done. 3.4 Model analysis (b) 3.4.1 Limits of models (b) 3.4.1.1 Limitations due to the physical approach 3.4.1.2 Limitations due to the numerical scheme 3.4.1.3 Limitations due to boundary conditions 3.4.1.4 Limitations due to internal parameters 3.4.1.5 General approach to minimize model limitations 3.4.2 Sensitivity Analysis 3.4.3 Calibration 3.4.4 Validation 3.5 User interface (r+f) List of Figures Figure 3.5-1: Example of a grid for a 3D computation. Two vertical domains are used. In the upper domain, a sigma coordinate is used while lower one uses a Cartesian. Figure 3.5-2: Typical 1D spatial grid. Figure 3.5-3: Generic control volume in a 1D discretisation. Figure 3.5-4: Visualization of the consequences of temporal discretisation. Property evolves within a time step, but not values used for flux calculation. Figure 3.5-5: List of equations Equation 3.5-1: Difference equation for a generic 1D transport equation. Equation 3.5-2: Difference 1D transport equation for the particular case of uniform and permanent geometry. Equation 3.5-3: Central-difference calculation of advection. Equation 3.5-4: Upstream calculation of advection. Equation 3.5-5: QUICK calculation of advection. Equation 3.5-6: Advection equation discretised using central explicit differences. Equation 3.5-7: Advection-diffusion equation discretised using central explicit differences for advection and for diffusion. Equation 3.5-8: Conditions for numerical stability of 1D explicit advectiondiffusion discretised using central differences. Equation 3.5-9: Advection equation discretised using upstream explicit differences. Equation 10: Finite difference for computing temporal derivative in an explicit method. Equation 11: Finite difference for computing temporal derivative in an implicit method. Equation 12: Taylor expansions for deriving semi-implicit methods. Equation 13: Finite difference for computing temporal derivative in an CrankNicholson (semi-implicit) method. Equation 14: Expansion series for computing C at point “i+1” Equation 15: Expansion series for computing C at point “i-1” Equation 16: Expansion series for computing first spatial derivative using central differences. Equation 17: Expansion series for computing first spatial derivative using left differences. Equation 18: Expansion series for computing first spatial derivative using right differences. Equation 19: Expansion series for computing second spatial derivative using central differences. List of Tables Table 3.5-1: Example of a time evolution in a 1D channel computed using explicit central differences, a unitary courant number, and no diffusion. Table 3.5-2: Example of a time evolution in a 1D channel computed using explicit central differences, Cr=2, and no diffusion. Table 3.5-3: Example of a time evolution in a 1D channel computed using explicit upstream differences, Cr=1.0, and no diffusion. Table 3.5-4: Example of a time evolution in a 1D channel computed using explicit upstream differences, Cr=0.5, and no diffusion.
© Copyright 2026 Paperzz