## 3 Numerical Model
### The Shallow Water Equations  
The Shallow Water Equations (SWEs) were derived from the depth-averaged 3D incompressible Navier-Stokes equations, neglecting vertical acceleration and assuming hydrostatic pressure distribution.  
The software FLOW-3D permits solving the non-conservative form of the two-dimensional (2D) SWEs (i.e., the depth-averaged continuity and momentum equations), respectively:  
\[\frac{\partial(V_{F}F)}{\partial t}+\frac{\partial(uA_{x}F)}{\partial x}+\frac {\partial(vA_{y}F)}{\partial y}=0 \tag{6}\]  
\[\frac{\partial u}{\partial t}+\frac{1}{V_{F}}\bigg{(}uA_{x}\frac{\partial u}{ \partial x}+vA_{y}\frac{\partial u}{\partial y}\bigg{)} =-\frac{1}{\rho}\frac{\partial p}{\partial x}+G_{x}+\frac{\tau_{ b,x}}{\rho d} \tag{7}\]  
\[\frac{\partial v}{\partial t}+\frac{1}{V_{F}}\bigg{(}uA_{x}\frac{\partial v}{ \partial x}+vA_{y}\frac{\partial v}{\partial y}\bigg{)} =-\frac{1}{\rho}\frac{\partial p}{\partial y}+G_{y}+\frac{\tau_{ b,y}}{\rho d} \tag{8}\]  
where \(u\) and \(v\) are the depth-averaged velocities along the horizontal \(x\) and vertical \(y\) directions, respectively, \(A_{x}\) and \(A_{y}\) are the fractional areas open to flow, \(F\) is the fluid fraction, \(G_{x}\) and \(G_{y}\) are the body acceleration components, \(d\) is the water depth, and \(\tau_{b,x}\) and \(\tau_{b,y}\)[64] represent the bottom shear stress components.  
The FAVOR and the VOF methods were used in the SWEs model of FLOW-3D for the geometry description and fluid interface tracking, respectively. The volume fraction variable \(V_{F}\) and the water fraction variable \(F\) were used to define a variable bottom contour and the fluid depth, respectively [46]. Equations (6)-(8) are expressed in terms of volume, area, and water fractions for flow in a single layer of control volumes used to apply VOF and FAVOR methods.  
The pressure was calculated as:  
\[p=p_{0}+\rho gH \tag{9}\]  
where \(p_{0}\) is the atmospheric pressure on the water-free surface and \(H\) is the elevation of the free surface above the grid bottom (i.e., the sum of the obstacle and water depths):  
\[H=(1-V_{F})\cdot\delta z+F\cdot V_{F}\cdot\delta z. \tag{10}\]  
In the SWEs model, the vertical \(z\)-direction is assumed as shallow direction, along which two real cells are considered in each mesh block. The lower cell size \(\delta z\) in the \(z\)-direction is defined as being large enough to contain any fluid depth occurring throughout the simulation. For turbulent flow, in the SWE model, the bottom shear stress is evaluated through a quadratic law as follows:  
\[\tau_{b,x}=-\rho C_{D}u\sqrt{u^{2}+v^{2}},\ \tau_{b,y}=-\rho C_{D}v\sqrt{u^{2}+v ^{2}} \tag{11}\]  
where \(C_{D}\) represents the drag coefficient. This coefficient can be defined manually or calculated using the following equation based on the surface roughness height:  
\[C_{D}=\bigg{[}\frac{\kappa}{B+(\ z_{0}/d)}\bigg{]}^{2}, \tag{12}\]  
in which \(\kappa=0.4\) is the Von Karman constant, \(B=0.71\) and \(z_{0}=k_{s}/30\), with \(k_{s}\) the surface roughness. Many depth-averaged flow models use Manning coefficient \(n\) to calculate the bed shear stress in SWEs except for the FLOW-3D SWE model which uses drag coefficient \(C_{D}\) instead. Manning's \(n\) was not available in the version of the FLOW-3D SWE model used in the present study. When needed, the relationship between drag coefficient and Manning coefficient \(C_{D}=(n^{2}g)/d^{1/3}\) can be utilized to switch between these two coefficients.  
In numerical simulations, Equations (6)-(8) can be solved explicitly and implicitly.