7. 2-dimensional unsteady flow with free water surface
This chapter describes a method for calculating 2D unsteady flow with a free water surface. The flow field dealt with here does not take into account the distribution of velocities in the depth direction nor the velocity components in the vertical direction. The depth scale is considerably small relative to the planar scale, i.e., the flow is relatively shallow. It is also called 2D shallow flow. The basic formulas of 2D shallow flow consist of the following equation of continuity…
…and of the following equations of motion.
Where, \(x, y\) are the plane coordinate axes that are perpendicular to each other, \(t\) is time, \(u, v\) are depth-averaged velocity in the \(x, y\) directions, \(h\) is the water depth, \(H\) is the water level, \(g\) is the gravitational acceleration, \(\tau_x, \tau_y\) are the bed shear force in the directions of \(x, y\), \(\rho\) is the density of water and \(\nu_t\) is the turbulent eddy viscosity.
Using the Manning formula for the law of resistance, the bed shear force is expressed as follows.
Where, \(n\) is the Manning’s roughness coefficient. Regarding the deliberation of Equation (7.4), refer to Expressions of riverbed shear force in Appendix. Deploying a zero-equation model, the turbulent eddy viscosity is expressed as follows.
Where, \(u_\ast\) is the friction velocity,
\(I_f\) is the gradient of friction velocity as expressed by the following equation.
7.1. Basic formulas and the application of the split method
For the calculation of 2D unsteady flow with a free-surface, Equation (7.1) is used to calculate the water depth, \(h\), Equation (7.2), the equation of motion in the \(x\) direction, is used to calculate the flow velocity, \(u\), in the \(x\) direction; and Equation (7.2), the equation of motion in the \(y\) direction, is used to calculate the flow velocity, \(v\), in the \(y\) direction. When the riverbed elevation, \(\eta\), is given, the water level, \(H=\eta+h\) is \(H=\eta+h\). \(H=\eta+h\) has a univalent correspondence with \(h\). Then, instead of \(h\), we can treat \(H\) as an unknown value.
As performed for the case of 1D, the split method is applied to Equation (7.2) and Equation (7.3). Because their forms are almost the same, an explanation is given only for Equation (7.2), here. Now, we rewrite Equation (7.2) as follows by applying the relationship of \(H=\eta+h\). For your confirmation, these equations are shown again.
This equation has an advection term. Thus, the equation is split into three equations. Each includes one part related to the advection term, one to the pressure and friction terms, and one to the diffusion term.
Now, \(n\) is a time step. Instead of calculating \(u^n \rightarrow u^{n+1}\) with Equation (7.8), assuming \(\overline{u}\) and \(\widetilde{u}\) are in the middle, let us calculate \(u^n \rightarrow \overline{u}\) with Equation (7.9), \(\overline{u} \rightarrow \widetilde{u}\) with Equation (7.10), and \(\widetilde{u} \rightarrow u^{n+1}\) with Equation (7.11). Because Equation (7.9) includes \(h\), the solutions should also satisfy the equation of continuity, Equation (7.1). Therefore, let us express it as \(h^n \rightarrow \overline{h}\). On the other hand, because Equation (7.10) and Equation (7.11) do not include \(h\), we use \(\overline{h}\) for \(h^{n+1}\) as follows.
For \(v\), we perform exactly the same procedure as above. The equation of motion for \(v\) is also split, as follows.
The above is summarized as follows.
Phase name |
Procedure |
Equations used |
||
---|---|---|---|---|
Non-advection phase I |
\(u^n \rightarrow \overline{u}\) |
\(v^n \rightarrow \overline{v}\) |
\(h^n \rightarrow \overline{h} \rightarrow h^{n+1}\) |
|
Non-advection phase II |
\(\overline{u} \rightarrow \widetilde{u}\) |
\(\overline{v} \rightarrow \widetilde{v}\) |
||
Advection phase |
\(\widetilde{u} \rightarrow u^{n+1}\) |
\(\widetilde{v} \rightarrow v^{n+1}\) |
Now, we are ready to apply the CIP method.
7.2. The non-advection phase I
We calculate \(u^n \rightarrow \overline{u}\) with Equation (7.9), and \(v^n \rightarrow \overline{n}\) with Equation (7.13). Now, let us rewrite equations (7.9) and (7.13) as follows.
Therefore, we have…
Meanwhile, because we obtain \(h^n \rightarrow \overline{h}\) by using Equation (7.1), the following equation should be satisfied.
Therefore, we need to solve the simultaneous equations (7.18) \(\sim\) (7.20) so as to obtain \(\overline{h}\), \(\overline{u}\) and \(\overline{v}\).
In general, when the CIP method is applied to the calculation of a fluid, we use a staggered grid in which calculation points of \(u\), \(v\) and \(h\) are alternately placed. Here, let us deploy the setting of calculation points shown in Figure 7.1.
Taking into account of the arrangement of calculation points in Figure 7.1, the difference expression of Equation (7.18) is as follows.
Where, subscript, \(_{up}\), means it is a value at the calculation point of \(u\). The arrangement of calculation points in Figure 7.1 gives…
Similarly, the difference expression of Equation (7.19) is…
The subscript \(_{vp}\) indicates that it is the value of \(u\) at the calculation point, and we have…
To substitute Equation (7.21) and Equation (7.24) for the second and third terms on the left side of Equation (7.20), we make the following definitions.
In consideration of the arrangement of grid points (the calculation points of \(q_u`n and :math:`q_v\) are assumed to be the same as \(u\) and \(v\), respectively). Now, we have…
Together with the following difference expression of Equation (7.20) that uses \(q_x\) and \(q_y\)…
…we can obtain \(\overline{h}\). However, \(\overline{q_x}\) and \(\overline{q_y}\) on the right side of Equation (7.30) also contain \(\overline{h}\) in implicit form, which require calculation repetitions to solve the equation. This procedure is shown in Figure 7.2.
The calculation repetitions give \(\overline{h}(i)\), \(\overline{u}(i,j)\) and \(\widetilde{v}(i,j)\). They are calculation results for non-advection phase I.
When \(\overline{u}(i,j)\) and \(\overline{u}(i,j)\) in non-advection phase I are obtained, \(\displaystyle{{\partial u}\over{\partial x}}\) , \(\displaystyle{{\partial u}\over{\partial y}}\) , \(\displaystyle{{\partial v}\over{\partial x}}\) and \(\displaystyle{{\partial v}\over{\partial y}}\) i.e., \(\overline{\displaystyle{{\partial u}\over{\partial x}}}\), \(\overline{\displaystyle{{\partial u}\over{\partial y}}}\) , \(\overline{\displaystyle{{\partial v}\over{\partial x}}}\) and \(\overline{\displaystyle{{\partial v}\over{\partial y}}}\) for non-advection phase I need to be calculated. As for the 1D case, they can be calculated by using the following equations.
7.3. The non-advection phase II
Here, we calculate the diffusion term. For the diffusion term, we calculate \(\overline{u} \rightarrow \widetilde{u}\) and \(\overline{v} \rightarrow \widetilde{v}\) using Equation (7.10) and Equation (7.14).
We can simply apply the central difference scheme to the diffusion term. The difference expressions of Equation (7.10) and Equation (7.14) are below.
7.4. The advection phase
In the advection phase, we calculate Equation (7.11) and Equation (7.15). They are in exactly the same form as the 2D advection equation (The 2D advection equation) that was introduced in the previous chapter. Equation (7.11) is obtained by replacing \(f\) with \(u\) in Equation (6.1). Equation (7.15) is obtained by replacing \(f\) with \(v\) in Equation (6.1). Therefore, the procedure introduced in the previous chapter can be applied “as is”. However, there is one difference: The method for arranging the calculation points of \(u\) and \(v\) differs from that of the 2D advection equation. We need to pay attention to this. For example, when applying the CIP method to Equation (6.13), for \(v\) in the third term on the left side, we need to use the value at calculation point \(u\). Therefore, we need to convert the nearby values as was done for Equation (7.22). Similarly, for \(u\) in the second term on the left side of Equation (7.15), we need to use \(u\) at the calculation point \(v\). At the same time, we need a convention such as that used for Equation (7.25). Incorporating these, calculations in the advection phase use the following equations.
7.4.1. u in the advection phase
Where,
For \(a_1 \sim g_1\) in Equation (7.37), use those that replaced \(f\) with \(\widetilde{u}\), \(f_x\) and \(f_y\) with \(u_x\) and \(u_y\), respectively, in the Equation (6.16) introduced in the previous chapter. Where,
7.4.2. v in the advection phase
Where,
For \(a_1 \sim g_1\) in Equation (7.41), we replace \(f\) with \(\widetilde{v}\), and \(f_x\) and \(f_y\) with \(v_x\) and \(v_y\), respectively, in Equation (6.16). Where,
7.4.3. Updating differentiation amounts in the advection phase
Differentiation amounts need to be updated by using Equation (6.21) and Equation (6.22), which were mentioned in the previous chapter. For your confirmation, these equations are shown again.
First, let us discuss about when \(f\) is replaced with \(u\) in Equation \(bibun2_21\). For the left side, the CIP method can be applied by means of the split method. A two-step calculation is performed: The first step is the calculation of the advection part by the CIP method; the second step is the calculation of the remaining part. For example, assuming that we express updating of \(u\) in terms of \(x\) differentiation as…
then, the advection part can be calculated by…
The remaining part can be calculated by…
(Regarding \(a_1, c_1, e_1, d_1, g_1\), please refer to the previous section.) Similarly, the differentiation amount of \(u\) with respect to \(y\) can be updated as follows.
The calculations of \(\displaystyle{\widehat{{\partial u}\over{\partial x}}}\) and \(\displaystyle{\widehat{{\partial u}\over{\partial y}}}\) in the second and third terms of Equation (7.49) and Equation (7.51) are known to be more stable when \(\widetilde{u}\) is used than when the calculation results of Equation (7.48) and Equation (7.50), immediately before them, are used. \(\displaystyle{\widehat{{\partial u}\over{\partial x}}}\) and \(\displaystyle{\widehat{{\partial u}\over{\partial y}}}\) The former method uses the following equations, instead of equations (7.49) and (7.51).
7.4.3.1. Problem (7)
Explain the method for calculating \(\displaystyle{\cfrac{\partial v}{\partial x}}\) and \(\displaystyle{\cfrac{\partial v}{\partial y}}\) in the advection phase. |
7.5. The Python code, and a calculation example
7.5.1. The Python code
The Python code for calculating 2D unsteady flow with a free-surface mentioned above is…
https://github.com/YasuShimizu/2DH_Python
The parameters for the calculation conditions are described at “config.yml”, which is in the repository. Note that the code also takes into account the friction of the channel sidewall (the riverbanks), in addition to the parameters described in this chapter. An explanation of the method for calculating the friction of the channel sidewalls (riverbanks) is given in River bank (sidewall) friction resistance in the Appendix. The code also allows for obstacles in the channel to be taken into account. The number structures and their locations can be described in a text file named “obst.dat” in the same repository.
In the calculation example shown below, the number of obstacles is one. The obstacle is shown in the cells: \(i=\) from the 10th to the 14th cells in the \(x\) direction, and \(j=\) from the 6th to the 14th cells in the \(y\) direction. This creates a rectangular obstruction at the center of the upstream side of the straight channel. The calculation shows that the obstacle breaks up the flow and that an intermittent Karman vortex develops behind the obstacle.
7.6. About NaysMini
NaysMini is a solver that uses the Cartesian coordinate 2D model described in this chapter in conjunction with the iRIC GUI, and all of the source code is available. A NaysMini manual is also available. Please refer to it.