Shallow water wave simulation method based on finite difference, storage medium and equipment
By optimizing shallow water wave simulation using the finite difference method and the Lax-Wendroff method, the problems of high computational complexity and poor numerical stability are solved, achieving efficient simulation of seawater motion, which is suitable for seawater motion simulation in oceanography.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-14
- Publication Date
- 2026-03-13
AI Technical Summary
Existing shallow water wave simulation techniques face challenges in terms of high computational complexity, poor numerical stability, and complex boundary condition handling, making it difficult to meet the requirements of rapid response and accuracy in practical applications.
The shallow water wave equation is discretized using the finite difference method, and numerical approximation is performed using the Lax-Wendroff method. Furthermore, the boundary treatment strategy is optimized through efficient spatial discretization and time integration methods, which reduces computational complexity and improves numerical stability and accuracy.
It achieves efficient computation under regular grid conditions, improves simulation accuracy and stability, and is suitable for real-time simulation of seawater motion, including the excitation of objects falling into the sea, tidal motion, and flood disaster simulation.
Smart Images

Figure CN121659629A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of seawater motion simulation technology, and in particular to a shallow water wave simulation method, storage medium, and device based on finite difference. Background Technology
[0002] Shallow water wave simulation has wide applications in oceanography, its core being the numerical solution of shallow water wave equations describing fluid dynamics. These equations are simplified from the continuity and momentum equations in fluid mechanics, and are primarily used to describe scenarios where the water depth is shallow and the lateral scale of the fluid is much larger than its longitudinal scale, playing a crucial role in oceanography. However, existing simulation techniques still face several challenges in practical applications, including computational complexity, numerical stability, and accuracy issues.
[0003] First, a significant challenge in shallow water wave simulation is its high computational complexity. Shallow water wave equations typically contain highly nonlinear terms, requiring high-resolution meshes to capture detailed flow patterns under complex terrain conditions, leading to a substantial computational burden. In practical applications, such as real-time flood warning systems or large-scale ocean tidal simulations, rapid response is crucial; therefore, reducing computational load while ensuring simulation accuracy becomes a critical issue. Second, balancing numerical accuracy and stability is also challenging. Shallow water wave simulations often involve phenomena with significant discontinuities, such as shock waves and swells. Finally, the complexity of boundary condition handling also limits the widespread application of shallow water wave simulation. In practical applications, boundary conditions often exhibit complex and diverse characteristics, such as open boundaries, solid boundaries, or variable terrain conditions. Accurately handling these boundary conditions to ensure the stability and reliability of the simulation is another major challenge facing existing methods. Summary of the Invention
[0004] In view of the above-mentioned problems in the prior art, the present invention provides a shallow water wave simulation method, storage medium and device based on finite difference, so as to solve the technical problems in the prior art that still face high computational complexity, poor numerical stability and difficulty in guaranteeing computational accuracy in practical applications.
[0005] This invention provides a shallow water wave simulation method based on finite difference, comprising the following steps:
[0006] Step S1: Determine the shallow water wave equation;
[0007] Step S2: Numerical discretization and solution of the shallow water wave equation;
[0008] Step S3: Determine the simulation parameters;
[0009] Step S4: Set the intensity of the vibration source on the calm water surface;
[0010] Step S5: Set boundary conditions;
[0011] Step S6: Initialize time and variables;
[0012] Step S7: Perform time-iterative loop solution.
[0013] In one embodiment, it also includes,
[0014] Step S8: Visualize the solution results.
[0015] In one embodiment, it also includes,
[0016] Step S9: Set the termination condition.
[0017] In one embodiment, the shallow water wave equation is expressed as follows:
[0018]
[0019] In the formula,
[0020] Where h represents the liquid height or depth of seawater, u represents the velocity component of the two-dimensional liquid velocity field along the x-direction, v represents the velocity component of the two-dimensional liquid velocity field along the y-direction, and g represents gravitational acceleration.
[0021] In one embodiment, step S2 uses the Lax-Wendroff method to calculate the numerical approximation result of the solution to the shallow water wave equation.
[0022] In one embodiment, the simulation parameters in step S3 include the physical size of the simulation region, the mesh resolution, the time step, and physical constants.
[0023] In one embodiment, step S8 includes,
[0024] Create snapshots and draw two-dimensional surface plots of sleep height at regular time intervals;
[0025] Generate animations by saving frame-by-frame snapshots as GIFs to dynamically display the entire process of seawater movement.
[0026] In one embodiment, the termination condition is determined by setting a termination time point. When the termination time point is reached, the iterative calculation is terminated and the final calculation simulation result is output.
[0027] In addition, embodiments of the present invention also provide a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the shallow water wave simulation method based on finite difference as described in any embodiment of the present invention.
[0028] In addition, embodiments of the present invention also provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the shallow water wave simulation method based on finite difference as described in any embodiment of the present invention.
[0029] Compared with the prior art, the beneficial effects of the shallow water wave simulation method, storage medium and device based on finite difference provided by the embodiments of the present invention are as follows: The embodiments of the present invention realize shallow water wave simulation through the finite difference method, which can directly discretize the shallow water wave equation on the grid points, which is easy to implement. Especially in the case of regular grid, its calculation implementation is relatively direct and has good operability. Furthermore, by introducing efficient spatial discretization, time integration methods and boundary processing strategies, the computational complexity is effectively reduced, the numerical stability and computational accuracy are improved, and it can be used for the simulation of seawater motion patterns in scenarios such as seawater motion triggered by objects falling into the sea, seawater tidal motion, and the scope of flood disasters. Attached Figure Description
[0030] Figure 1 This is a schematic diagram illustrating the simulation effect of seawater motion in a shallow water wave simulation method based on finite difference provided in an embodiment of the present invention. Detailed Implementation
[0031] To enable those skilled in the art to better understand the technical solution of the present invention, the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments.
[0032] Various embodiments and features of this application are described herein with reference to the accompanying drawings.
[0033] These and other features of this application will become apparent from the following description of preferred forms of embodiments given as non-limiting examples, with reference to the accompanying drawings.
[0034] It should also be understood that although this application has been described with reference to some specific examples, those skilled in the art can certainly implement many other equivalent forms of this application, which have the features described in the claims and are therefore all within the scope of protection defined herein.
[0035] The above and other aspects, features and advantages of this application will become more apparent when taken in conjunction with the accompanying drawings and in view of the following detailed description.
[0036] Specific embodiments of this application are described below with reference to the accompanying drawings; however, it should be understood that the claimed embodiments are merely examples of this application, which can be implemented in various ways. Well-known and / or repeated functions and structures are not described in detail to ascertain the true intent based on the user's historical operations, and to avoid unnecessary or redundant details that would obscure this application. Therefore, the specific structural and functional details claimed herein are not intended to be limiting, but merely serve as the basis and representative basis for the claims to teach those skilled in the art to use this application in various ways with substantially any suitable detailed structure.
[0037] This specification may use the phrases “in one embodiment,” “in another embodiment,” “in yet another embodiment,” or “in other embodiments,” all of which may refer to one or more of the same or different embodiments according to this application.
[0038] The principles and features of the present invention are described below with reference to the accompanying drawings. The embodiments described are for illustrative purposes only and are not intended to limit the scope of the invention. The following description, in conjunction with... Figure 1 The preferred embodiments of the present invention will be described in further detail below:
[0039] like Figure 1 As shown, this embodiment of the invention provides a shallow water wave simulation method based on finite difference, comprising the following steps:
[0040] Step S1: Determine the shallow water wave equation;
[0041] The shallow water wave equations are a set of hyperbolic partial differential equations (or parabolic if viscous shear is considered) describing the flow of a fluid (sometimes, but not always, at a free surface) below the pressure surface. When the horizontal length scale is much larger than the vertical length scale, integrating the Navier-Stokes equations over depth yields the shallow water wave equations. In this case, mass conservation indicates that the vertical velocity scale of the liquid is much smaller than the horizontal scale. From the momentum equation, we can deduce that the vertical pressure gradient is almost equal to the hydrostatic pressure, while the horizontal pressure gradient is due to the displacement of the pressure surface, meaning that the horizontal velocity field of the fluid is constant throughout the depth. Integrating over the vertical direction eliminates the vertical velocity from the equations. Thus, the shallow water equations are derived. Assume the variables are the liquid height or depth h of the seawater, and the two-dimensional liquid velocity fields u and v. The following equations exist:
[0042]
[0043] To make the equation more compact, let:
[0044]
[0045] Therefore, equation (1) can be expressed as:
[0046]
[0047] Where h represents the liquid height or depth of seawater, u represents the velocity component of the two-dimensional liquid velocity field along the x-direction, v represents the velocity component of the two-dimensional liquid velocity field along the y-direction, and g represents gravitational acceleration.
[0048] Step S2: Numerical discretization and solution of the shallow water wave equation;
[0049] The Lax-Wendroff method is used to compute a numerical approximation of the solution. Definition: represents a time step of n on grid (i, j). The time step consists of two phases:
[0050] First, at half the step size...
[0051]
[0052] Second, regarding the entire step length...
[0053]
[0054] Where Δt represents the time step, Δx represents the spatial step in the x direction, and Δy represents the spatial step in the y direction.
[0055] Step S3: Determine the simulation parameters;
[0056] Specifically, this includes setting the physical dimensions of the simulation region, mesh resolution, time step, and physical constants. Example parameters are as follows:
[0057] (1) Simulation area: a square area with dimensions of 100m in both the X and Y directions;
[0058] (2) Mesh generation: Spatial step size dx = 1.0m, dy = 1.0m, number of grids n = 100 (total number of grid points is n+2×n+2, including the boundary);
[0059] (3) Time parameters: time step dt = 0.1s, total simulation duration tn = 40s, initial time t0 = 0;
[0060] (4) Physical constants: gravitational acceleration g = 9.8 m / s² 2 .
[0061] Step S4: Set the intensity of the vibration source on the calm water surface;
[0062] Taking water droplet perturbation as an example, it is simplified into a Gaussian pulse type to simulate water droplet falling. The parameters can be set as follows:
[0063] (1) Pulse height: 0.6m;
[0064] (2) Pulse width: 10 grid points (approximately 10m);
[0065] (3) Impulse form: Two-dimensional Gaussian function D(x,y)=0.6exp[-5(x 2 +y 2 )];
[0066] (4) Pulse position: placed at the southeast corner of the grid index at 30%.
[0067] Step S5: Set boundary conditions;
[0068] For the boundary conditions, to simplify, we assume the study area is square and the boundary is a simple elastic boundary. We set the displacements in the x, y, and z directions to U, V, and H, respectively, and use the reflection boundary conditions as follows:
[0069] (1) Left boundary (x=0): H(:,1)=H(:,2), U(:,1)=U(:,2), V(:,1)=-V(:,2);
[0070] (2) Right boundary (x=L_x): H(:,n+2)=H(:,n+1), U(:,n+2)=U(:,n+1), V(:,n+2)=-V(:,n+1);
[0071] (3) Lower boundary (y=0): H(1,:)=H(2,:), U(1,:)=-U(2,:), V(1,:)=V(2,:);
[0072] (4) Upper boundary (y=L_y): H(n+2,:)=H(n+1,:), (n+2,:)=-U(n+1,:), V(n+2,:)=V(n+1,:).
[0073] Step S6: Initialize time and variables;
[0074] (1) Set the current time to t0 = 0;
[0075] (2) Initialize the water depth field H to 1m and the momentum fields U and V to zero;
[0076] (3) Pre-allocate intermediate variable arrays Hx, Ux, Vx, Hy, Uy, Vy.
[0077] Step S7: Perform time-iterative loop solution.
[0078] From t=0 to t=tn, perform the following operations in a loop with step size dt:
[0079] (1) Apply boundary conditions: Update the boundary point values at the beginning of each step.
[0080] (2) Difference the x and y directions at half the step size.
[0081] (3) Perform difference calculations throughout the entire step length.
[0082] In one embodiment, it also includes,
[0083] Step S8: Visualize the solution results.
[0084] (1) Snapshot plotting: Plot a two-dimensional surface plot of the water surface height H every 2 time steps;
[0085] (2) Generate animation: Save frame-by-frame images as GIF format (e.g., waterwave.gif) to dynamically display the entire process of seawater movement.
[0086] In one embodiment, it also includes,
[0087] Step S9, set the termination condition.
[0088] When the time reaches tn = 40s, the iteration terminates and the final calculation simulation result is output.
[0089] In addition, embodiments of the present invention also provide a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the shallow water wave simulation method based on finite difference as described in any embodiment of the present invention.
[0090] In addition, embodiments of the present invention also provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the shallow water wave simulation method based on finite difference as described in any embodiment of the present invention.
[0091] like Figure 1 The diagram shows a simulation of seawater movement under a water droplet disturbance scenario. The sub-graphs represent snapshots of seawater movement at different times (0s, 5s, 10s, 15s, 20s, and 25s).
[0092] The above embodiments are merely exemplary embodiments of the present invention and are not intended to limit the present invention. The scope of protection of the present invention is defined by the claims. Those skilled in the art can make various modifications or equivalent substitutions to the present invention within its spirit and scope of protection, and such modifications or equivalent substitutions should also be considered to fall within the scope of protection of the present invention.
Claims
1. A shallow water wave simulation method based on finite difference, characterized in that, Includes the following steps: Step S1: Determine the shallow water wave equation; Step S2: Numerical discretization and solution of the shallow water wave equation; Step S3: Determine the simulation parameters; Step S4: Set the intensity of the vibration source on the calm water surface; Step S5: Set boundary conditions; Step S6: Initialize time and variables; Step S7: Perform time-iterative loop solution.
2. The shallow water wave simulation method based on finite difference according to claim 1, characterized in that: It also includes, Step S8: Visualize the solution results.
3. The shallow water wave simulation method based on finite difference according to claim 2, characterized in that: It also includes, Step S9: Set the termination condition.
4. The shallow water wave simulation method based on finite difference according to claim 1, characterized in that: The shallow water wave equation is expressed as follows: In the formula, Where h represents the liquid height or depth of seawater, u represents the velocity component of the two-dimensional liquid velocity field along the x-direction, v represents the velocity component of the two-dimensional liquid velocity field along the y-direction, and g represents gravitational acceleration.
5. The shallow water wave simulation method based on finite difference according to claim 4, characterized in that: In step S2, the Lax-Wendroff method is used to calculate the numerical approximation result of the solution to the shallow water wave equation.
6. The shallow water wave simulation method based on finite difference according to claim 1, characterized in that: The simulation parameters mentioned in step S3 include the physical size of the simulation region, the mesh resolution, the time step, and physical constants.
7. The shallow water wave simulation method based on finite difference according to claim 2, characterized in that: Step S8 includes, Create snapshots and draw two-dimensional surface plots of sleep height at regular time intervals; Generate animations by saving frame-by-frame snapshots as GIFs to dynamically display the entire process of seawater movement.
8. The shallow water wave simulation method based on finite difference according to claim 3, characterized in that: The termination condition is determined by setting a termination time point. When the termination time point is reached, the iterative calculation is terminated and the final calculation simulation result is output.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by the processor, it implements the shallow water wave simulation method based on finite difference as described in any one of claims 1-8.
10. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the shallow water wave simulation method based on finite difference as described in any one of claims 1-8.