ETHZ, Fall 017 Numerical Hydraulics Assignment 4 Numerical solution of 1D solute transport using Matlab http://www.bafg.de/ http://warholian.com
Numerical Hydraulics Assignment 4 ETH 017 1 Introduction The assessment of solute transport is important in order to determine the distribution of pollutants in a river or to interpret tracer experiments. In general, the theory of solute transport can be used to model the water quality of rivers. The flux of a solute in a river is determined by four processes: Advection: Molecular diffusion: Turbulent diffusion: Dispersion: J A = u c (1) J m = D m c () J T = u time c = ε c (3) J D = u space c = D c (4) Usually the advection and the dispersion are the driving forces for the solute flux. Therefore we will focus only on these two processes. For 1D simulations, the dispersion coefficient K can be described as followed: Dispersion coefficient: K x = 0.011 u b hu with u = τ 0 ρ = ghi 0 (5) u* is the shear velocity, h is the water depth, u is the cross-section averaged flow velocity, b is the channel width and I0 is the channel slope. Using the integral view over an infinitesimal slice of the river, we can write the solute mass (Advection-Dispersion equation) and the water volume balance in 1D as: Solute mass balance: (Ac) + (Qc) (AD ) = q x x x inc in q out c (6) Water balance: (A) + (Q) x = q in q out (7) If we substitute equation (7) into equation (6) we obtain the transport equation for the solute mass, where we can also include the degradation of the solute assuming a first order kinetic: Transport equation: + u 1 x A x (AD x ) λc = q in A (c in c) (8) 1
Numerical Hydraulics Assignment 4 ETH 017 There are different possibilities how to solve this transport equation. We can use the integral form of (8) with fluxes expressed at the old time (explicit scheme): c new i = c old i + Δt (f old Δx i 1 f old 1 i+ ) λc old i Δt Where the fluxes f contain contributions from advection and dispersion. For the dispersion we first have to decide how to define the concentration gradients at the cell interfaces i ± ½. We can use the difference quotient: = c i+1 c i x i+1/ Δx (9) and (f old 1 i+ ) dispersion = D c i+1 c i. For the advection we must define which concentration is decisive Δx at the cell interfaces i ± ½. During the lecture you learnt that there are the three different options upwind, downwind and central differences. The central difference scheme is not suitable since it produces a tail of oscillations. We can prevent these oscillations by using an upwind scheme, but at the cost of significant numerical dispersion. Upwind means we take (f old 1 i+ ) advection = uc old i when the flow is from left to right. To prevent numerical diffusion it is necessary to discretize fine enough and given that we use an explicit upwind scheme we also must limit the time step for the advection using the Courant Friedrich-Levy criterion (CFL): CFL: Cr = uδt Δx 1 (10) If we set the CFL-criterion equal to one, we obtain an exact forward integration without numerical dispersion for pure advection. This is very similar to the method of characteristics and works very well for a constant flow velocity producing the advection. It requires non-uniform grid spacing when the flow is not uniform. In the assignment we will use this approach and given that the flow velocity is constant we can use a uniform grid. We will use an explicit time integration (with upwind differences) named Explicit Euler-method, meaning that the concentration at the new timestep is depending only on the concentrations at the previous one. Explicit schemes ask for a second limitation of the timestep due to the dispersion term: Neumann criterion: Ne = DΔt (Δx) 1 3 (11) For this assignment we will use a two/three-step method, where in a first step only advection is considered. In addition there will not be any lateral tributaries. In a first step, we consider only advection: Advection step: c new,1 i = c old i + Δt (uc Δx i 1 old uc old i ) (1) In a second step the dispersion is added to the advection and equation (8) reads to: Dispersion step: c new, i = c new,1 i + Δt ((f old Δx i 1 ) dispersion (f old 1 i+ ) dispersion ) (1)
Numerical Hydraulics Assignment 4 ETH 017 Finally, it is possible to add degradation of the solute as a third step: Degradation step: c i new = c i new, λc i new, Δt (13) Boundary conditions Since equation (8) is a second order PDE, two boundary conditions are required. The first boundary condition we will use is the prescribed concentration of the solute on the inflow boundary: Inflow BC: c 1 j+1 = c in (14) It is possible to add a certain mass of a solute only at the first timestep (instantaneous injection) or to insert continuously mass into the river (continuous injection). The second boundary condition we use is the transmission BC, which implies a constant concentration gradient along the boundaries: Transmission BC: c x = 0 (15) Objective The goal of this assignment is to implement the numerical solution for the solute transport under uniform flow conditions in a rectangular channel using an explicit time integration fulfilling the CFLand the Neumann-stability criterion. We will use a two/three-step method where the advection is considered in a first step and afterwards dispersion is taking place. Degradation can be considered as the third step. 3
Numerical Hydraulics Assignment 4 ETH 017 3 Tasks Complete the Matlab template NHY_Assignment_4_IncompleteMatlabCode.m to solve the solute transport equation with the explicit Euler-Discretization considering the CFL-and the Neumanncriterion and using the two/three-step method. The parameterization of the rectangular channel as well as the uniform flow properties are given in Tab. 1. Tab. 1: Channel and flow properties Parameter Value Discharge 40 m 3 /s Velocity Width Length 1 m/s 0 m 10 km Slope 1 Simulation time 4 hrs The initial mass M of the tracer is 1 kg and is injected instantaneously at t = 0 s into the first cell. To determine the initial concentration, dissolve M in the first cell volume and set all other cells to a concentration of 0 g/m 3. Perform a simulation with and one without considering degradation of the tracer. You can use a degradation constant λ = 10 86 400 1/s. Questions 1. Show the spatial concentration distribution after 0.5, 1.5 and.5 hours with and without degradation.. Show the temporal concentration distribution at the outlet with and without degradation. 3. What is the maximum concentration at the outflow section with and without degradation? 4. Verify that the tracer is transported conservatively for the case without degradation. (Check if the total mass of tracer leaving the river reach equals the initial tracer mass). Which amount of the tracer leaves the river reach if degradation is considered? 5. How do the spatial concentration distributions with and without degradation look if the initial concentration is maintained at the inflow cell (continuous injection)? Show the results after the same times as in the first question. 4