2.1.4. Crank-Nicholson Time Discretization

For non-stationary problem we can improve the temporal accuracy by means of the so called *θ*-method. In order to do that, *un*+<sup>1</sup> and *wn*+<sup>1</sup> in Equation (9) need to be substituted by *un*+*<sup>θ</sup>* and *wn*+*θ*, while *ηn*+<sup>1</sup> in (10), (11) and (14) needs to be substituted by *ηn*+*θ*. (*u*, *v*, *η*)*n*+*<sup>θ</sup>* are defined as:

$$(\left(u,v,\eta\right))^{n+\theta} = \theta \cdot \left(u,v,\eta\right)^{n+1} + \left(1-\theta\right) \cdot \left(u,v,\eta\right)^{n},\tag{20}$$

where *θ* is an implicit factor to be taken in the interval (0.5, 1] (e.g., [42]). The final system for the hydraulic head reads:

$$\frac{\Delta t \, \theta^2}{\Delta x} \left[ \Delta z\_{i + \frac{1}{2}k}^n \left( \eta\_{i+1,k}^{n+1} - \eta\_{i,k}^{n+1} \right) - \Delta z\_{i - \frac{1}{2}k}^n \left( \eta\_{i,k}^{n+1} - \eta\_{i-1,k}^{n+1} \right) \right]$$

$$+ \frac{\Delta t \, \theta^2}{\Delta z} \left[ \Delta x\_{i,k+\frac{1}{2}}^n \left( \eta\_{i,k+1}^{n+1} - \eta\_{i,k}^{n+1} \right) - \Delta x\_{i,k-\frac{1}{2}}^n \left( \eta\_{i,k}^{n+1} - \eta\_{i,k-1}^{n+1} \right) \right] = b\_{i,k}^n \tag{21}$$

where *b<sup>n</sup> <sup>i</sup>*,*<sup>k</sup>* becomes:

$$\begin{split} b^{n}\_{i;k} &= \theta \left( \Delta^{n}\_{i+\frac{1}{2},k} F u^{n}\_{i+\frac{1}{2},k} - \Delta^{n}\_{i-\frac{1}{2},k} F u^{n}\_{i-\frac{1}{2},k} + \Delta^{n}\_{i,k+\frac{1}{2}} F w^{n}\_{i,k+\frac{1}{2}} - \Delta z^{n}\_{i-\frac{1}{2},k} F w^{n}\_{i,k-\frac{1}{2}} \right) \\ &+ \theta \left( 1 - \theta \right) \frac{\Delta t \, g}{\Delta x} \left[ \Delta z^{n}\_{i+\frac{1}{2},k} \left( \eta^{n}\_{i+1,k} - \eta^{n}\_{i,k} \right) - \Delta z^{n}\_{i-\frac{1}{2},k} \left( \eta^{n}\_{i,k} - \eta^{n}\_{i-1,k} \right) \right] \\ &+ \theta \left( 1 - \theta \right) \frac{\Delta t \, g}{\Delta z} \left[ \Delta x^{n}\_{i,k+\frac{1}{2}} \left( \eta^{n}\_{i,k+1} - \eta^{n}\_{i,k} \right) - \Delta x^{n}\_{i,k-\frac{1}{2}} \left( \eta^{n}\_{i,k} - \eta^{n}\_{i,k-1} \right) \right] \\ &- (1 - \theta) \left( \Delta z^{n}\_{i+\frac{1}{2},k} u^{n}\_{i+\frac{1}{2},k} - \Delta z^{n}\_{i-\frac{1}{2},k} u^{n}\_{i-\frac{1}{2},k} + \Delta x^{n}\_{i,k+\frac{1}{2}} w^{n}\_{i,k+\frac{1}{2}} - \Delta z^{n}\_{i,k-\frac{1}{2}} w^{n}\_{i,k-\frac{1}{2}} \right). \end{split}$$

We note that these modifications do not affect the structure of the linear system for the hydraulic head, since they are just rescaling it through a factor *θ*2.
