1 Introduction

Studying and analysing the sediment transport phenomenon and hydrodynamics in different flow regimes (Afzal et al., 2021; Dutta et al., 2022, 2023; Gautam et al., 2021; Kumar & Afzal, 2023a, b, c; Prasad and Kumar, 2014; Pradhan et al., 2022; Priyadarsan and Afzal, 2023; Ranasinghe & Turner, 2006) around a structure plays an important role in several coastal engineering applications which includes bridge pier construction, oil and gas pipeline transmission, low Reynolds number applications and many more. The key point in sediment transport phenomenon in coastal areas is the presence of both waves and current. Earlier several researchers have studied the sediment transport phenomenon in detail using computational fluid dynamics (CFD) which was mainly due to effect of steady current (Chauchat et al. 2017) in OpenFOAM framework. Some of the other researchers have studied hydrodynamics beneath both waves and current in OpenFOAM framework but lacked the presence of sediment transport in the module (https://openfoamwiki.net/index.php/Contrib/sedfoam). Development of a solver (that can take into account presence of both waves and current along with sediment transport) which caters to the need to coastal and ocean engineers is very rare but essential. The development of a new solver is paramount in diving deep into the intriguing physics of the sediment transport phenomenon and hydrodynamics around the bridge piers. An attempt has been made in this paper to develop a new computational solver for studying the sediment transport phenomenon and complex hydrodynamics in coastal engineering applications.

Sukhinov et al. (2014) has developed a mathematical model to study the sediment transport phenomenon for a non-stationary spatial 2D model in the coastal zone of water reservoirs. They have considered the soil porosity, the critical shear stress, turbulent exchange, wind currents and friction on the bottom. Lai and Wu (2019) have developed a new 3D hydrostatic pressure model to study the open channel flows. The proposed model works well for flow and sediment transport phenomenon with flexible meshes. Yoyrurob and Liengcharernsit (2011) has developed a finite element solver to study the sediment transport considering the bedload and suspended load transport. Singh (2005) has developed a two-dimensional sediment transport model to study the sediment transport phenomenon.

Jian and Chen (2019) have numerically simulated sediment transport to study the sediment movement and the evolution law of the estuary bed for studying the estuary sediment deposition, sea water intrusion prevention treatment scheme and solve the problems of engineering. Benkhaldoun et al. (2009) have presented a one- and two-dimensional finite volume method to study the sediment transport. It has been found that the numerical simulations are well able to capture the complex physics sediment transport under flow regimes with high shocks. Kitsikoudis et al. (2015) has used artificial neural networks, symbolic regression based on generic programming and adaptive-network-based fuzzy inference system for the derivation of sediment transport formulae. Chauchat et al. (2017) have developed a two-phase solver for sediment transport application. The developed solver was an extension to the already existing in-built twoPhaseEulerFoam solver. Since the proposed solver by Chauchat et al. (2017) is a two phase solver, the effect of waves can not be studied. The solver OLAFOAM (https://openfoamwiki.net/index.php/Contrib/sedfoam) developed in OpenFOAM environment to study the hydrodynamics in an open channel due to the combined action of waves and current. The hydroFOAM solver developed in this work is different from the OLAFOAM (https://openfoamwiki.net/index.php/Contrib/sedfoam), where the wave module is not completely numerical, rather it is a combination of both analytical and numerical approaches. To work with the sedimentTransportFOAM solver, the output from the hydroFOAM solver needs to be solved and formatted in a particular manner. Thus, the need to create a customized hydrodynamics solver named hydroFOAM is created in this work.

Wu (2004) has proposed a two-dimensional depth averaged model to study the sediment transport in open channel flow using the finite volume method. He has computed the flow and sediment transport formulations in a decoupled manner. Hung et al. (2009) have used an orthogonal curvilinear coordinate system to develop a depth averaged two-dimensional non-equilibrium cohesive and non-cohesive transport model. Jacobsen et al. (2012) have developed a wave generation toolbox in OpenFOAM (https://www.https://openfoam.org/) for solving open channel flows using the Reynolds averaged Navier–Stokes (RANS) equations.

As per the author’s knowledge, there is no computational tool available that integrates the advanced capabilities of OpenFOAM for high-performance finite volume simulation with established and accurate analytical expressions encompassing free surface flows, wave dynamics, and flow current mechanics. This paper signifies a pioneering effort in this direction. What sets this paper apart is its fusion of numerical and analytical methods to forecast scour and flow properties. This tool will find widespread applications in sediment transport, scour prediction, and bridge pier modeling. Conversely, solvers such as IHFOAM and OLAFOAM lack the speed and comprehensive solution provided by analytical methods. In our approach, we’ve harnessed the strengths of both analytical methods and numerical simulation to create hydroFOAM and sedimentTransportFOAM as two distinct modules. The decision to maintain them as separate modules is rooted in software development standards, specifically to maintain modularity in the code. This design choice allows for future expansions without entangling or interlinking with the existing code.

In this paper, the flow dynamics and sediment transport computational models are developed for the open channel coastal engineering applications, this will help the engineers to design the structures more safely leading to environmental sustainability (Abdelzaher, 2022; Abdelzaher & Shehata, 2022; Elkhouly et al., 2021). The numerical modeling has been carried out using the open source C++ framework OpenFOAM (https://www.https://openfoam.org/). The developed semi-coupled code has been validated with the data from literature. To the best of authors’ knowledge, this work is idiosyncratic in its own. The development of solver for the open channel coastal engineering applications in sediment transport has not been done earlier in OpenFOAM framework. With the aid of OpenFOAM parallel computing classes, the developed solver can be used to run in parallel threads. Thus, the proposed module can work in serial as well as parallel computing mode. The paper is structured as follows: A brief introduction has been presented in Sect. 1. The mathematical model has been presented in Sect. 2. The validation of the developed model is presented in Sect. 3. A concluding remark has been presented in Sect. 4.

2 Mathematical modeling

The solver developed in this module to study the sediment transport phenomenon due to the combined action of waves and current is a combination of two solvers, i.e., hydroFOAM and sedimentTransportFOAM. The proposed mathematical model in this article is a semi-coupled solver. The proposed mathematical framework has been implemented using the free and open source OpenFOAM framework. hydroFOAM solver is used to study the hydrodynamic parameters of the flow behaviour in coastal engineering applications without taking consideration of the effect of sediment transport. Later the parameters resulted out from the hydroFOAM solver is used as an input to the sedimentTransportFOAM solver. The sedimentTransportFOAM solver solves the differential equations to calculate the sediment transport parameters. hydroFOAM solver solves the three-dimensional volume averaged Reynolds averaged Navier–Stokes (VARANS) equations for two in-compressible phases using a finite volume discretization and the volume of fluid (VOF) method.

2.1 hydroFOAM solver

The volume averaged Reynolds averaged Navier–Stokes (VARANS) equations include continuity and momentum conservation equations to solver the pressure and velocity field in the flow domain. The continuity equation is as follows:

$$\begin{aligned} \frac{\partial \langle u_i\rangle }{\partial x_i} = 0 \end{aligned}$$
(1)

The momentum equation can be expressed as follows:

$$\begin{aligned} \begin{aligned} \frac{\partial \rho \langle u_i \rangle }{\partial t} + \frac{\partial }{\partial x_j}\bigg [\frac{1}{\phi }\rho \langle u_i \rangle \langle u_j \rangle \bigg ]=&-\phi \frac{\partial \langle p^*\rangle ^f}{\partial x_i} + \phi g_j \mathbf {X_j}\frac{\partial \rho }{\partial x_i}+\frac{\partial }{\partial x_j}\bigg [ \mu _{eff}\frac{\partial \langle u_i \rangle }{\partial x_j}\bigg ]\\&\quad - \bigg [A\langle u_i \rangle + B |\langle u \rangle |\langle u_i\rangle +C\frac{\partial u_i}{\partial t}\bigg ] \end{aligned} \end{aligned}$$
(2)

The friction coefficients are calculated according to the formula proposed by Engelund (1953). The coefficients are calculated as follows:

$$\begin{aligned} A= & {} \alpha \frac{(1-\phi )^3\mu }{\phi ^2 D^2_{50}} \end{aligned}$$
(3)
$$\begin{aligned} B= & {} \beta \left( 1+\frac{7.5}{KC}\right) \frac{\rho (1-\phi )}{\phi ^2 D_{50}} \end{aligned}$$
(4)

To track the fluid movement and interface the following interphase equation is used.

$$\begin{aligned} \frac{\partial \alpha }{\partial t}+\frac{1}{\phi }\frac{\partial (\alpha \langle u_i \rangle ) }{\partial x_i}=0 \end{aligned}$$
(5)

In this solver the two phases are assumed as water and air. In computation these two phases can be substituted by denser media and lighter media respectively. Thus, the two phases presented here can be generalized for any fluids. Here \(\alpha \) is the volume fraction of water (or the denser medium). \(\alpha \) is defined as follows:

$$\begin{aligned} \alpha = \text {volume of water per cell} = \frac{V_{water}}{V_{total}} \end{aligned}$$
(6)

where \(V_{water}\) and \(V_{total}\) are volume of water in cell and total volume of cell respectively.

From Eq. (6), it can be concluded that the value of \(\alpha =1\) corresponds to the cells where the complete cell is filled with water. Similarly, \(\alpha =0\) corresponds to the cell having air only. All other values corresponds to the interface. Any hydrodynamic parameter, Y for any given cell can be calculated from the following formula:

$$\begin{aligned} Y = \alpha Y_{water}+(1-\alpha ) Y_{air} \end{aligned}$$
(7)

For example the density in any particular cell can be calculated using the Eq. (7). This is shown in the following Eq. (8):

$$\begin{aligned} \rho = \alpha \rho _{water}+(1-\alpha )\rho _{air} \end{aligned}$$
(8)

The values of \(\alpha \) for each and every cell in the domain can be calculated using the Eq. (5). But for physical interpretation there should be sharp interface. Thus to maintain the physical continuity and sharp interface, \(\alpha \) must be conservative and lie between 0 and 1. Thus an artificial compression term [\(\nabla \cdot \mathbf {U_c} \alpha (1-\alpha )\)]. This is a standard procedure used in OpenFOAM (Weller et al., 1998). This approach is conservative and takes only non-zero values only at the interface. Thus the Eq. (5) can be written as presented in Eq. (9). The boundedness of the equation is achieved by using the MULES solver (presented in Appendix  A). The MULES solver is an already existing solver in OpenFOAM. A limiter factor on the fluxes of the discretized divergence term is used to ensure the value lies between 0 and 1.

$$\begin{aligned} \frac{\partial \alpha }{\partial t}+\frac{1}{\phi }\frac{\partial (\alpha \langle u_i \rangle ) }{\partial x_i}+\frac{\partial \langle u_{c_i} \rangle \alpha (1-\alpha )}{\phi \partial x_i}=0 \end{aligned}$$
(9)

Freely available wave generation toolbox developed by Jacobsen et al. (2012) is being used in the hydroFOAM solver for the purpose of generation of wave boundary conditions. The module incorporates generation and absorption of waves at inlet and outlet boundaries. The wave generation toolkit (Jacobsen et al., 2012) is being released under the GNU public license through the extended community. Table 1 presents the list of wave theories included in this study. A brief discussion on the turbulence modeling has been presented in Appendix B.

Table 1 List of “wave type” and “wave theory” available in hydroFOAM

2.2 sedimentTransportFOAM

The sediment transport mechanism depends on the shape and size of sediment particles. There are two modes of sediment transport, i.e. suspended load transport and bed load transport. The mode in which sediment transport will occur depends not on the settling velocity of the sediment to the critical bed shear stress (Kraft et al., 2011). There is also a good way to approximate the chance of which mode of sediment transport on the basis of the ratio of settling velocity to the shear velocity. In suspended load transport, sediment particles move without staying in contact with the bed, whereas in bed load transport, the particles maintain continuous contact with the bed as they move. The larger sediment particles move downstream due to the bed load transport mechanism. There is a rough estimation of 5–25% of the suspended load is transported as bed load. The developed solver sedimentTransportFOAM is a semi-analytical solver. The calculation of bed shear stress in the combined action of waves and current is challenging. Earlier several researchers have worked on calculating bed shear stress and developed a couple of equations. The sedimentTransportFOAM has six models to calculate the bed shear stress. The end-user can choose among these equations as per the need. Babaeyan-Koopaei et al. (2002) has developed the following equation to calculate the bed shear stress:

$$\begin{aligned} \tau = \rho gRS_f \end{aligned}$$
(10)

Schlichting and Gersten (1979) has proposed the following equation to calculate bed shear stress:

$$\begin{aligned} \tau = \rho C_D U^2 \end{aligned}$$
(11)

The friction-based approach takes into account the bed friction in calculation of bed shear stress. The following equation is derived by considering the frictional force.

$$\begin{aligned} \tau = \frac{1}{2}\rho fU^2 \end{aligned}$$
(12)

where \(f=0.06/log\Big (\frac{12h_s}{\frac{3.3\nu }{u^*}}\Big )^2\) if \(u^*k_s/\nu <5.0\), otherwise if \(u^*k_s/\nu >70.0\), then \(f=0.06/log\Big (\frac{12h_s}{k_s}\Big )^2\). Here f is the coefficient of friction, \(k_s\) is bed roughness parameter. Rijn (1984) has suggested that the value of \(k_s=3d_{90}\).

Schlichting and Gersten (1979) has used a logarithmic relationship to calculate the bed shear stress.

$$\begin{aligned} &\tau = \rho u^{*2} \\ &\text {where,}\quad u^*=u\left( \frac{1}{k}ln\left( \frac{z}{z_0}\right) \right) ^{-1} \end{aligned}$$
(13)

where \(u^*\) is the shear velocity, z is the height above the bed and \(z_0\) is the characteristic roughness length and is calculated as \(k_s/30\).

Simulations carried with keeping the turbulence models turned on can be used to calculate bed shear stress \(\tau \) using the following definition.

$$\begin{aligned} \tau = -\rho \big (\nu _{t}+\nu \big ) \frac{\partial u}{\partial z} \end{aligned}$$
(14)

Another formulation that can be used whenever a turbulence model is in place for carrying out the simulation, is presented here. The total kinetic energy, k is defined as:

$$\begin{aligned} k = \frac{1}{2}\left( \left\langle \tilde{u}^2 \right\rangle +\left\langle \tilde{v}^2 \right\rangle +\left\langle \tilde{w}^2\right\rangle \right) \end{aligned}$$
(15)

The \(\langle \rangle \) is the averaging operator.Then the bed shear stress can be calculated as follows:

$$\begin{aligned} \tau =k\sqrt{c_\mu } \end{aligned}$$
(16)

Generally, the value of \(c_\mu \) is taken as 0.09.

Table 2 Different formulations available in sedimentTransportFOAM for calculation of bed shear stress

Above section discusses the methodology to calculate the bed shear stress using different mathematical proposed earlier. Table 2 lists down the keywords available in sedimentTransportFOAM for calculating the bed shear stresses. Three different formulations are there in sedimentTransportFOAM to calculate the bed load transport rate. The different models are discussed here. Before that three non-dimensional numbers are formulated below to ease out the discussions. The non-dimensional formula of bed shear stress, critical bed shear stress and bed load transport rate are described below:

$$\begin{aligned} \begin{aligned} \tau ^*=\frac{\tau }{(\rho _s-\rho )gd_i}\\ \tau ^*_{c,i}=\frac{\tau _{c,i}}{(\rho _s-\rho )gd_i}\\ q^*_{b,i}=\frac{q_{b,i}}{\sqrt{\frac{(\rho _s-\rho )g}{\rho }}d_i}\\ \end{aligned} \end{aligned}$$
(17)

The formulation given by Rijn (1984) is presented below:

$$\begin{aligned} \begin{aligned} \frac{q_{b,i}}{d_i^{1.5}\sqrt{\frac{(\rho _s-\rho )g}{\rho _s}}} = 0.053 \frac{\left( \frac{\tau -\tau _{c,i}}{\tau _{c,i}}\right) ^{2.1}}{\left( d_i\left( \frac{\rho _s/(\rho -1)g}{\nu ^2}\right) ^{\frac{1}{3}}\right) ^{0.3}} \end{aligned} \end{aligned}$$
(18)

The critical bed shear stress \(\tau ^*_{c,i}\) is calculated from the Shields diagram (Dustegir et al., 2018). According to Van Rijn (1984) this equation fits well for the small diameter particles in a range of 100–500 μm. When modeling suspended sediment numerically, the computed bed-load movement can be utilized as a boundary condition i.e. reference concentration. Meyer-Peter and Müller (1948) proposed the following formula to calculate the bed load transport rate:

$$ \begin{aligned} q_{{b,i}}^{*} = & 0;\;\;\;\;\;{\text{if}}\;\;\;\;\tau ^{{\text{*}}} < \tau _{{c,i}}^{*} \\ q_{{b,i}}^{*} = & \alpha _{s} \left( {\tau ^{*} - \tau _{{c,i}}^{*} } \right)^{n} ;\;\;\;\;\;{\text{if}}\;\;\;\;\tau ^{{\text{*}}} > \tau _{{c,i}}^{*} \\ \end{aligned} $$
(19)

where

$$\begin{aligned} \alpha _s=1.6ln\tau ^*+9.8 \end{aligned}$$

Engelund and Fredsøe (1976) has given the following model in 1976 to calculate the bed load transport rate:

$$ \begin{aligned} q_{{b,i}}^{*} = & 0:\;\;\;\;{\text{if}}\;\;\;\;\tau ^{{\text{*}}} < \tau _{{c,i}}^{*} \\ q_{{b,i}}^{*} = & 18.74\left( {\tau ^{*} - \tau _{{c,i}}^{*} } \right)\left( {\tau ^{{*0.5}} - 0.7\tau ^{{*0.5}} } \right):\;\;\;\;{\text{if}}\;\;\;\;\tau ^{{\text{*}}} > \tau _{{c,i}}^{*} \\ \end{aligned}$$
(20)

A convection diffusion transport equation is used for predicting the suspended load transport in sedimentTransportFOAM.

$$\begin{aligned} \frac{\partial c}{\partial t}+U_i\frac{\partial c}{\partial x_j}+w_s\frac{\partial c}{\partial z}=\frac{\partial }{\partial x_i}\left( \Gamma \frac{\partial c}{\partial x_i}\right) \end{aligned}$$
(21)

The deposition rate is calculated from the following formulation:

$$\begin{aligned} D = w_sc_b \end{aligned}$$
(22)

The sediment concentration rate is calculated from the following equation:

$$\begin{aligned} \begin{aligned} c_{bed,sus.load,i}=0.015\frac{d_i}{a} \frac{\left( \frac{\tau - \tau _{c,i}}{\tau _{c,i}}\right) ^{1.5}}{\left( d_i\left( \frac{\rho _s/(\rho _w-1)g}{\nu ^2}\right) ^\frac{1}{3}\right) ^{0.3}}\\ \end{aligned} \end{aligned}$$
(23)

The equivalent roughness height of Nikuradse was considered as reference level above bed (a), with a minimum value 0.01d. According to Rijn (1984) the equation is the ”best” agreement between measured and calculated concentration profiles for a flow depth of 0.1–0.25 m, with a flow velocity varied from 0.4 to 1.6 m/s and sediment size in the range of 180–700 μm. The above section discusses the mathematical model used in the sedimentTransportFOAM solver in a concise manner. In the next section some differential equation solving algorithms are presented.

2.3 Algorithm

hydroFOAM solver is coded using the PIMPLE algorithm which is a combination of PISO and SIMPLE algorithm. PISO stands for pressure implicit with splitting of operators, whereas SIMPLE stands for semi-implicit method for pressure linked equation. The non linearity terms in the equations explained in hydroFOAM is handled using an iterative technique. For example the non-linear term in the momentum equation \(\nabla \cdot (\textbf{UU})\) is approximated as \(\nabla \cdot (\textbf{U}^{n}\textbf{U}^{n+1})\). Here, \(\textbf{U}^{n}\) and \(\textbf{U}^{n+1}\) are the solution at present and next step respectively. As there is no pressure equation in the governing Navier–Stokes equation, the continuity equation imposes a constraint on the momentum equation. At low Courant number, the coupling between the pressure and velocity is very strong. Therefore a pressure corrector term is repeated without updating the same in the momentum equation. In in-compressible flows, the momentum equation is discretized as:

$$\begin{aligned} a_P^u\textbf{U}_P+\sum _Na_N^u\textbf{U}_N=r-\nabla p \end{aligned}$$
(24)

Writing a new term \(\mathbf {H(u)}\), which is defined as follows:

$$\begin{aligned} \mathbf {H(U)} = r-\sum _Na_N^u\textbf{U}_N \end{aligned}$$
(25)

Applying Eq. 25 in Eq. 24 gives:

$$\begin{aligned} \begin{aligned} a_P^u+\textbf{U}_P&=\mathbf {H(U)}-\nabla p \\ \textbf{U}_P&= (a_P^u)^{-1}(\mathbf {H(U)}-\nabla p) \end{aligned} \end{aligned}$$
(26)

Substituting the Eq. 26 in continuity equation (\(\nabla \cdot \textbf{U}=0\)) will result in the following equation:

$$\begin{aligned} \nabla \cdot [(a_P^u)^{-1}\nabla p] = \nabla [(a_p^u)^{-1}\mathbf {H(U)}] \end{aligned}$$
(27)

The differential equations used in sedimentTransportFOAM are solved by using the finite volume discretization. All the terms of the equation are solved implicitly.

The variables used in the earlier equations of bed shear stress calculation are presented in Table 3.

Table 3 List of symbols used

3 Validation

The hydroFOAM solver has been validated with the works of Umeyama (2011) for combined wave-current flows without the presence of any structure. The flow condition used are presented in Table 4. The validation plot comprising of z versus velocity at four different time steps are presented in Fig. 1 which shows very good agreement between the simulated velocity profile obtained using the developed code and the experimental results of Umeyama (2011).

Table 4 Flow conditions used for the results presented in Fig. 1
Fig. 1
figure 1

Validation of z versus velocity plot at four different t/T ratio

The numerical model (hydroFOAM and sedimentTransportFOAM solver) has also been validated with the work of Sumer et al. (2003) for steady current condition. The bed load transport rate computed from the numerical model is compared with the work of Sumer et al. (2003) and is presented in Table 6. The flow conditions used in this validation are mentioned below (Table 5). The validations shows excellent agreement between the experimental results and to that obtained using the developed numerical model.

Table 5 Flow conditions used in the validation with the works of Sumer et al. (2003)
Table 6 Comparison of the rate of bed load transported in volume per unit time per unit width, q cm\(^3\)/cm s) with the works of Sumer et al. (2003)

Further, the developed numerical model has been validated with the work of Ribberink and Al-Salem (1994) for oscillatory flow conditions. The domain dimensions are taken as 14 m \(\times \) 0.3 m \(\times \) 1.1 m. Second order Stokes wave formulation has been used here for wave generation. Figure 2 present the plots of the validation showing the variation of suspended sediment concentration at different distances from the bed. The flow conditions used in the simulation are presented in Table 7.

Table 7 Flow conditions used for the results presented in Fig. 2
Fig. 2
figure 2

z versus c plot for two considered cases

Furthermore, the present computational model has been validated with the work of Li and Davies (1996) for combined wave-current flows. The flow conditions used here are presented in Table 8. Figure 3 shows the plots of the validation showing the variation of suspended sediment concentration at different distances from the bed. The Fig. 3 shows that the present computational model is able to satisfactorily predict the experimental results obtained by Li and Davies (1996).

Table 8 Flow conditions for the plots presented in Fig. 3
Fig. 3
figure 3

Validation of z versus c plot with the work of Li and Davies (1996)

4 Conclusion

The continuity, momentum and interphase equations are solved using the finite volume method.The volume of fluid method is being employed to track the interface. The solver is developed with the aid of the PIMPLE algorithm. The simulation data computed from the hydroFOAM solver is used for the simulation of the sedimentTransportFOAM solver. The resulted data from the sedimentTransportFOAM is used to analyze the sediment transport phenomenon.

4.1 Key lessons learnt

The hydroFOAM solver successfully captures the wave-current phenomenon, the code has been validated with the works of Umeyama (2011) for combined wave-current flows without the presence of any structure. The sediment transport cases are successfully validated with the works of Sumer et al. (2003) for steady current condition, Ribberink and Al-Salem (1994) for wave only flow conditions and Li and Davies (1996) for combined wave-current flows. The developed model predicts very well the hydrodynamics and sediment transport phenomenon in river and coastal engineering applications.

4.2 Future work

The code will be further employed to investigate hydrodynamic scour and design bridge piers resistant to flow-induced vibrations, instabilities, and erosion. In the future, there are plans to incorporate smoothed particle hydrodynamics (SPH) into the current framework for analyzing particle-level scour predictions and also develop a coupled three-phase sediment transport module.