Numerical Investigation of Ocean and Coastal Wave Dynamics: Shallow Water Equation Framework

Abstract

This research focuses on the numerical investigation of ocean and coastal wave dynamics using the shallow water equations (SWEs) framework with the bathtub model as a simplified domain. The study employs a MATLAB-based simulation to analyze wave behavior, including propagation, reflection, and wave interference under idealized conditions. The governing equations consist of the continuity equation and the momentum conservation equations, capturing nonlinear wave propagation and interaction governed by the nonlinear shallow water equations. The bathtub model, with its confined geometry, offers a controlled environment for studying key dynamics such as wave resonance, boundary interactions, and energy dissipation. The numerical implementation uses finite difference schemes to discretize the SWEs, ensuring stability and accuracy. Key findings include insights into the influence of initial wave conditions, the role of geometric constraints in amplifying or dissipating wave energy, and the interplay between hydrodynamic forces and boundaries. These results are relevant for understanding storm surges, tidal behavior, and the impact of coastal infrastructure.

Share and Cite:

Hasan, M. and Roy, S. (2026) Numerical Investigation of Ocean and Coastal Wave Dynamics: Shallow Water Equation Framework. Journal of Applied Mathematics and Physics, 14, 2978-2988. doi: 10.4236/jamp.2026.148146.

1. Introduction

Numerical investigation in oceanography uses computer simulations and mathematical models to understand ocean processes and dynamics. This approach helps scientists predict weather, manage marine resources, assess environmental impacts, and prepare for natural hazards such as tsunamis [1]. While field observations provide valuable data, they are often limited in spatial and temporal coverage; therefore, numerical models provide an effective means of simulating complex ocean processes over extended periods and large geographic regions [2]. In this research, the Shallow Water Equations (SWEs) were applied within a simplified bathtub model to investigate wave propagation in oceanic and coastal environments [3]. The SWEs describe fluid motion in shallow-water systems through the conservation of mass and momentum while accounting for variations in water depth and gravitational forces [4]. The bathtub model simplifies the physical domain, enabling clear observation of wave reflection, interaction, and amplification in a controlled setting that captures key characteristics of coastal tsunami behavior [5] [6]. An intuitive analogy is to consider the ocean as a large bathtub in which a wave is generated by an underwater earthquake. In deep water, tsunami waves travel at very high speeds while maintaining relatively small wave heights, making them difficult to detect. As these waves approach the coast and enter shallower water, their speed decreases, and wave height increases significantly due to wave shoaling effects [7] [8]. This rapid increase in wave height is one of the primary reasons tsunamis pose severe hazards to coastal communities. The model also facilitates the study of wave reflection, which occurs when waves encounter boundaries such as coastlines or engineered structures. Reflected waves may interfere with incoming waves, producing constructive or destructive interference patterns that alter wave energy distribution. Another important aspect of tsunami analysis is wave run-up, defined as the maximum vertical elevation or inland penetration of water after a wave reaches the shore [9]. By applying SWEs within the bathtub framework, wave run-up and potential coastal flooding can be estimated, thereby supporting tsunami hazard assessment and early-warning system development [10]. Shallow water equations are widely used in tsunami modeling because they accurately represent the dominant physics governing long-wave propagation in shallow coastal regions [11]-[15]. Since vertical motion is generally small compared with horizontal flow, the SWE framework provides an efficient and reliable approach for simulating tsunami propagation, coastal inundation, and run-up processes. The bathtub model further contributes to tsunami studies by providing a simplified representation of the ocean as a bounded basin. This approach facilitates the investigation of wave reflection, boundary interactions, resonance effects, and nearshore wave amplification [16]. By simulating wave behavior in a controlled environment, researchers can better understand how real tsunami waves interact with coastlines, bathymetric features, and natural barriers, thereby improving tsunami risk assessment and coastal management strategies.

Previous studies have extensively employed shallow water equations to model tsunami propagation, coastal flooding, and run-up under realistic ocean conditions [17]-[19]. However, these sophisticated models often make it difficult to isolate and understand fundamental wave processes such as reflection, interaction, and nearshore amplification. Although the bathtub model is frequently used as a conceptual tool for explaining tsunami behavior, its application as a simplified numerical framework coupled with the SWEs remains relatively limited. Consequently, there is a lack of simplified numerical studies that use the shallow water equations within a bathtub model to investigate fundamental tsunami-wave processes in a controlled environment [20]. This study addresses this gap by numerically investigating wave propagation, reflection, interaction, and run-up within a simplified bathtub model, thereby providing physical insight that can complement and support more sophisticated tsunami modeling approaches [21].

2. Overview of Shallow Water Equation (SWE)

The Shallow Water Equations (SWEs) are widely used to model wave dynamics in coastal and ocean environments where the water depth is small compared to the characteristic horizontal length scale of motion [22] [23]. When interpreted through a bathtub-model framework, these equations describe how water propagates, redistributes, and interacts with boundaries within a confined shallow-water domain. Such a simplified representation provides a useful framework for examining wave propagation, reflection, and interaction processes under controlled conditions. In the bathtub model, the SWEs describe the evolution of water depth and momentum resulting from fluid motion and boundary interactions. The governing equations consist of a continuity equation and two momentum conservation equations. The equations are:

a) Mass conservation (continuity equation)

h t + ( uh ) x + ( vh ) y =0

The continuity equation describes how water depth (h) changes over time due to the horizontal transport of water in the (x) and (y) directions. It ensures conservation of mass within the computational domain and governs the spatial distribution of water levels during wave propagation [15].

b) Momentum conservation in the x direction

( uh ) t + ( u 2 h+ 1 2 g h 2 ) x + ( uvh ) y =0

This equation describes the conservation of momentum in the horizontal (x) direction and accounts for both advective transport and hydrostatic pressure effects. It is particularly important for simulating wave transformation processes such as shoaling, refraction, and nearshore wave propagation [22].

c) Momentum conservation in the y direction

( vh ) t + ( uvh ) x + ( v 2 h+ 1 2 g h 2 ) y =0

Similarly, the momentum equation in the (y)-direction governs fluid motion perpendicular to the (x)-axis and enables the simulation of multidirectional wave propagation and circulation patterns, including longshore and rip-current dynamics [2].

3. Mathematical Formulation of Shallow Water Equation (SWE)

The following partial differential equations (PDEs) constitute the shallow water equations (SWEs):

h t + ( uh ) x + ( vh ) y =0 (1)

( uh ) t + ( uvh ) y + ( u 2 h+ 1 2 g h 2 ) x =0 (2)

( vh ) t + ( uvh ) x + ( v 2 h+ 1 2 g h 2 ) y =0 (3)

Here, the independent variables x, y, and t represent the spatial dimensions and time, respectively. The dependent variables include the surface height h (hereafter referred to as displacement) and the two-dimensional velocity components u and v. The partial derivatives with respect to the same variable (∂x, ∂y, ∂t) are grouped into vectors and rewritten as a single equation, which is then combined into vectors and reformulated as a single hyperbolic partial differential equation.

The vectors:

H=( h uh vh ) (4)

U( H )=( uh u 2 h+ 1 2 g h 2 uvh ) (5)

V( H )=( vh uvh v 2 h+ 1 2 g h 2 ) (6)

The single hyperbolic PDE:

H t + U x + V y =0 (7)

The matrix H holds displacement in two dimensions and is also used to create the mesh animation. The matrix U stores the x-direction velocity at each point, where positive values indicate motion in the positive x-direction and negative values indicate the opposite. Similarly, the matrix V represents velocities in the y-direction, with positive and negative values indicating movement in the positive and negative y-directions, respectively. We know there is a numerical method for solving hyperbolic partial differential equations known as the Lax-Wendroff method. Unlike the Euler methods, which calculate each step of a function, the Lax-Wendroff method involves first calculating a half step and then using the result from the half step to calculate the full step [24]-[28]. It is formally expressed below:

When a function takes the form:

f( x,t ) t = g( f( x,t ) ) x (8)

The first step is:

f i+1/2 n+1/2 f i n + f i+1 n 2 1 2 Δt = g i+1 n g i n Δx (9)

And the second step is:

f i n+1 f i n Δt = g i+1/2 n+1/2 g i1/2 n+1/2 Δx (10)

To illustrate how this applies to the shallow water equations, replace H with f and U( H ) with g( f ) . Equation (9) can be rewritten as:

H x i+1/2 n+1/2 = H i+1 n + H i n 2 +( 2Δt ) U i+1 n U i n Δx (11)

H y j+1/2 n+1/2 = H j+1 n + H j n 2  +( 2Δt ) V i+1 n V i n Δy (12)

Since H is two-dimensional, the step needs to be computed twice, once for each dimension. The intermediate steps are saved in separate matrices, Hx and Hy, to be used in the following step. Similarly, the intermediate steps for U and V are computed in the same way and stored in Ux, Uy, and Vx, Vy. Equation (10) is rewritten as:

H i,j n+1 = H i,j n +Δt U x i+1/2 n+1/2 U x i1/2 n+1/2 Δx +Δt V y i+1/2 n+1/2 V y i1/2 n+1/2 Δy (13)

4. Computational Setup of Lax-Wendroff Method

The Lax-Wendroff method is a numerical scheme for solving hyperbolic partial differential equations using finite difference approximations. It is second-order accurate in both space and time and represents an explicit time integration technique in which the governing equations are evaluated at the current time level. The Lax-Wendroff scheme was adopted because its second-order accuracy in both space and time makes it well suited for simulating wave propagation in the nonlinear shallow water equations, and numerical stability was verified by ensuring that the Courant-Friedrichs-Lewy (CFL) condition remained satisfied throughout all simulation runs [27]. The Lax-Wendroff method is also applied in the bathtub model formulation of the shallow water equations (SWE) to simulate wave dynamics in confined water bodies such as reservoirs or bays. In this framework, it solves the governing equations describing the evolution of water surface elevation and velocity fields under time-dependent disturbances. The second-order accuracy ensures improved fidelity in wave propagation, while reflective boundary conditions model interactions with basin boundaries. Nevertheless, the method may still produce spurious oscillations near sharp wave fronts, which can lead to instability if not mitigated through numerical smoothing or filtering techniques [29] [30].

From Equations (1), (2), and (3), we also get three vectors here:

U=( h uh vh )

F( U )=( uh u 2 h+ 1 2 uvh g h 2 )

G( U )=( vh uvh v 2 h+ 1 2 g h 2 )

In this notation, the shallow water equations represent a form of hyperbolic conservation law:

U t + F( U ) x + G( U ) y =0

The numerical simulations were performed on a square computational domain using the two-dimensional shallow water equations. The domain was discretized using a uniform Cartesian grid. In the demonstration code, the domain extends from x,y=1to1 , with a grid resolution of 21 × 21 points, corresponding to Δx=Δy=0.1 . The initial water depth was h=1 , and the initial velocity components were u=v=0 . Reflective boundary conditions were imposed on all domain boundaries, with u=0 on vertical walls and v=0 on horizontal walls. The simulation was advanced using the two-step Lax-Wendroff finite-difference scheme. The total simulation time and time step ( Δt ) were selected to satisfy the CFL stability criterion [30].

5. Result and Discussion

Using domain size: 2 m × 2 m, grid resolution: 21 × 21, Δx=Δy=0.1m , Δt=0.01s , total simulation time = 5 s, water depth = 1 m, boundary condition = reflective.

5.1. Initial Disturbance

The initial disturbance (Figure 1) was prescribed as a Gaussian-shaped surface elevation centered at the middle of the computational domain, ( x,y )=( 0,0 ) . The disturbance had a maximum amplitude of 1.0 and was defined by

U=exp[ 5( x 2 + y 2 ) ]

This localized Gaussian elevation served as the source of wave generation. The initial velocity field was assumed to be zero throughout the computational domain, u( x,y,0 )=0 , v( x,y,0 )=0 .

(a) (b)

Figure 1. Initial Gaussian surface elevation used to generate waves in the computational domain, shown as (a) 3D surface plot and (b) 2D contour plot.

5.2. Outward Wave Propagation

After an initial disturbance (Figure 2) in a bathtub model, waves spread across the water surface as energy is transferred between adjacent water particles. The characteristics of this movement depend on factors such as water depth and surface tension, with deeper water generally allowing smoother and faster motion. When waves interact with boundaries or obstacles, they may reflect or change direction. Overall, the bathtub model helps illustrate how energy transfer and environmental conditions influence wave behavior in a fluid system.

(a) (b)

Figure 2. Outward propagation of the generated wave from the initial disturbance location, shown as (a) 3D surface plot and (b) 2D contour plot.

5.3. Reflection at Boundaries

Wave reflection (Figure 3) occurs when waves encounter solid boundaries such as tub walls or obstacles, causing the wave energy to return into the water. The direction of the reflected wave depends on the angle at which it strikes the boundary. Reflection behavior is influenced by boundary characteristics such as wall smoothness and orientation, and can be observed using markers or visual tracking methods. This process highlights how confined boundaries affect wave behavior and energy distribution.

(a) (b)

Figure 3. Reflection of the propagating wave from the solid domain boundaries under reflective boundary conditions, shown as (a) 3D surface plot and (b) 2D contour plot.

5.4. Interference of Reflected Waves

Waves are generated by a disturbance and reflect off the walls or obstacles. When incoming and reflected waves overlap, they interfere, producing constructive interference (increased wave height) or destructive interference (reduced or canceled waves), depending on their phase (Figure 4). Visibility can be improved using dyes or visual tools, while obstacles and timing of disturbances influence the resulting patterns. Both experiments and simulations help analyze these interactions and improve understanding of wave behavior.

(a) (b)

Figure 4. Interference pattern produced by the interaction of outgoing and reflected waves within the computational domain, shown as (a) 3D surface plot and (b) 2D contour plot.

The numerical implementation was verified by comparing the simulated wave propagation with the analytical behavior of linear shallow-water waves over constant depth, showing good agreement and confirming the correctness of the model. The study employs the standard nonlinear shallow water equations, consisting of one continuity equation and two momentum equations, to simulate wave generation, propagation, reflection, and interference in a two-dimensional domain. Only gravitational and nonlinear shallow-water effects are considered; no dispersive, bottom-friction, viscous dissipation, turbulence, Coriolis, or other source terms are included.

6. Conclusion

This study shows that the Shallow Water Equations (SWEs) are effective for modeling tsunami propagation over large ocean distances due to the long wavelengths of tsunami waves, which allow horizontal velocities to dominate. Using a bathtub model, global tsunami propagation can be simulated by treating landmasses as perfect boundaries, though this approach excludes coastal dynamics such as wave shoaling, vertical velocity increases, and interactions with seafloor features. While useful for analyzing ocean-wide wave motion, the model does not capture the impacts of tsunamis near shorelines. Future research should focus on incorporating coastal topography, vertical dynamics, and wave-coast interactions, potentially through hybrid models combining SWEs for long-range propagation with detailed numerical methods for coastal effects.

Author Contributions

First author, Mohammad Tanzil Hasan: Supervision, computational support, manuscript editing, interpretation of results, and visualization. Co-author, Sudipta Roy: Conceptualization, methodology development, original draft writing, manuscript editing, computational analysis, and visualization.

Conflicts of Interest

The authors declare no conflicts of interest regarding the publication of this paper.

References

[1] Kanayama, H. and Dan, H. (2013) A Tsunami Simulation of Hakata Bay Using the Viscous Shallow-Water Equations. Japan Journal of Industrial and Applied Mathematics, 30, 605-624.[CrossRef]
[2] Mao, M. and Xia, M. (2023) Seasonal Dynamics of Water Circulation and Exchange Flows in a Shallow Lagoon-Inlet-Coastal Ocean System. Ocean Modelling, 186, Article 102276.[CrossRef]
[3] Chen, Z., Heller, V. and Briganti, R. (2024) Numerical Modelling of Tsunami Propagation in Idealised Converging Water Body Geometries. Coastal Engineering, 189, Article 104482.[CrossRef]
[4] Kinnmark, I. (1986) The Shallow Water Wave Equations: Formulation, Analysis and Application. Springer-Verlag.[CrossRef]
[5] Ngatcha, A.R.N. (2024) High Order Shallow Water Equations: Application to Dam Break Problems. Journal of Mechanics, 40, 820-842.[CrossRef]
[6] Pugazendi, V. and Ntantis, E.L. (2025) Numerical Modelling of Wave Propagation in Shallow Water. International Journal of Mathematical Modelling and Numerical Optimisation, 15, 1-15.[CrossRef]
[7] Mousa, M.M. and Ma, W.-X. (2020) Efficient Modeling of Shallow Water Equations Using Method of Lines and Artificial Viscosity. Modern Physics Letters B, 34, 2050051.[CrossRef]
[8] Begnudelli, L. and Sanders, B.F. (2006) Unstructured Grid Finite-Volume Algorithm for Shallow-Water Flow and Scalar Transport with Wetting and Drying. Journal of Hydraulic Engineering, 132, 371-384.[CrossRef]
[9] Hu, P., Zhao, Z., Ji, A., Li, W., He, Z., Liu, Q., et al. (2022) A GPU-Accelerated and LTS-Based Finite Volume Shallow Water Model. Water, 14, Article 922.[CrossRef]
[10] Filippini, A.G., Arpaia, L., Perrier, V., Pedreros, R., Bonneton, P., Lannes, D., et al. (2024) An Operational Discontinuous Galerkin Shallow Water Model for Coastal Flood Assessment. Ocean Modelling, 192, Article 102447.[CrossRef]
[11] Suzuki, T. and Altomare, C. (2022) Wave Interactions with Coastal Structures. Journal of Marine Science and Engineering, 9, Article 1331.[CrossRef]
[12] Tinh, N.X., Tanaka, H., Yu, X. and Liu, G. (2021) Numerical Implementation of Wave Friction Factor into the 1D Tsunami Shallow Water Equation Model. Coastal Engineering Journal, 63, 174-186.[CrossRef]
[13] Rijnsdorp, D.P., Smit, P.B. and Guza, R.T. (2021) A Nonlinear, Non-Dispersive Energy Balance for Surfzone Waves: Infragravity Wave Dynamics on a Sloping Beach. Journal of Fluid Mechanics, 944, A45.[CrossRef]
[14] Olabarrieta, M., Medina, R., Gonzalez, M. and Otero, L. (2011) C3: A Finite Volume-Finite Difference Hybrid Model for Tsunami Propagation and Runup. Computers & Geosciences, 37, 1003-1014.[CrossRef]
[15] Mousa, M.M. (2018) Efficient Numerical Scheme Based on the Method of Lines for the Shallow Water Equations. Journal of Ocean Engineering and Science, 3, 303-309.[CrossRef]
[16] Vinita, and Kumar, P. (2025) Mathematical Modeling of Two-Dimensional Depth Integrated Nonlinear Coupled Boussinesq-Type Equations for Shallow-Water Waves with Ship-Born Generation Waves in Coastal Regions. Journal of Marine Science and Engineering, 13, Article 562.[CrossRef]
[17] Garayshin, V.V., Harris, M.W., Nicolsky, D.J., Pelinovsky, E.N. and Rybkin, A.V. (2016) An Analytical and Numerical Study of Long Wave Run-Up in U-Shaped and V-Shaped Bays. Applied Mathematics and Computation, 279, 187-197.[CrossRef]
[18] Kim, S.Y., Yasuda, T. and Mase, H. (2008) Numerical Analysis of Effects of Tidal Variations on Storm Surges and Waves. Applied Ocean Research, 30, 311-322.[CrossRef]
[19] Abdalazeez, A.A., Didenkulova, I. and Dutykh, D. (2019) Nonlinear Deformation and Run-Up of Single Tsunami Waves of Positive Polarity: Numerical Simulations and Analytical Predictions. Natural Hazards and Earth System Sciences, 19, 2905-2913.[CrossRef]
[20] Khan, R.A. and Kevlahan, N.K. (2022) Data Assimilation for the Two-Dimensional Shallow Water Equations: Optimal Initial Conditions for Tsunami Modelling. Ocean Modelling, 174, Article 102009.[CrossRef]
[21] Brecht, R., Cardoso-Bihlo, E. and Bihlo, A. (2025) Physics-Informed Neural Networks for Tsunami Inundation Modeling. Journal of Computational Physics, 536, Article 114066.[CrossRef]
[22] Madsen, P.A. and Fuhrman, D.R. (2010) High-Order Boussinesq-Type Modelling of Nonlinear Wave Phenomena in Deep and Shallow Water. In: Advances in Coastal and Ocean Engineering, World Scientific, 245-285.[CrossRef]
[23] Liu, Z., Ma, Q.W. and Sriram, V. (2016) Numerical Simulation of Wave-Structure Interaction Using a Coupled Potential Flow and Navier-Stokes Model. Ocean Engineering, 113, 1-13.
[24] Htwe, S.H., Shibazaki, B. and Fujii, Y. (2014) Numerical Simulation of Tsunami Propagation and Inundation along the Rakhine Coast Areas in Myanmar. Bulletin of the International Institute of Seismology and Earthquake Engineering, 48, 109-114.
[25] Wang, G., Liang, Q., Shi, F. and Zheng, J. (2021) Analytical and Numerical Investigation of Trapped Ocean Waves along a Submerged Ridge. Journal of Fluid Mechanics, 915, A54.[CrossRef]
[26] Xing, Y. (2017) Numerical Methods for the Nonlinear Shallow Water Equations. In: Abgrall, R. and Shu, C.W., Handbook of Numerical Methods for Hyperbolic Problems Vol. 18, North-Holland, 363-396.
[27] Long Huynh, V., Dodd, N. and Zhu, F. (2017) Coastal Morphodynamical Modelling in Nonlinear Shallow Water Framework Using a Coordinate Transformation Method. Advances in Water Resources, 107, 326-335.[CrossRef]
[28] Rashidi, A., Shomali, Z. and Moradi, A. (2025) Performance Review of Nonlinear Shallow Water Equations in Tsunami Wave Modeling. Iranian Journal of Geophysics, 19, 1-28.
[29] Kalyanaraman, B., Bennetts, L.G., Lamichhane, B. and Meylan, M.H. (2019) On the Shallow-Water Limit for Modelling Ocean-Wave Induced Ice-Shelf Vibrations. Wave Motion, 90, 1-16.[CrossRef]
[30] Zheng, P.B., Zhang, Z.H., Zhang, H.S. and Zhao, X.Y. (2023) Numerical Simulation of Nonlinear Wave Propagation from Deep to Shallow Water. Journal of Marine Science and Engineering, 11, Article 1003.[CrossRef]

Copyright © 2026 by authors and Scientific Research Publishing Inc.

Creative Commons License

This work and the related PDF file are licensed under a Creative Commons Attribution 4.0 International License.