Speeding up the computation of wave impact
Many technical challenges cannot be solved through programming alone. Whenever flows, forces, optimization, or forecasts come into play, mathematical modelling can play a crucial role. In this blog series, we demonstrate how a combination of mathematics and software leads to solutions for real-world engineering problems.
These blog posts are based on interviews with colleagues who recently worked on projects in which mathematics played a decisive role.
In this instalment, we speak with Sjoerd, who contributes to ComFLOWโa simulation software package developed at the University of Groningen and managed at MARIN.
Could you briefly explain what ComFLOW is?
ComFLOW is software that predicts, with high precision, how water behaves around ships, platforms, dikes, and breakwaters. The package is particularly well-suited for scenarios where water strikes a structure with great force. This enables designers and operators to better assess risks before a structure is actually built or modified.
Why is calculating these water flows so difficult?
When waves collide, water splashes, and surfaces move, the flow is in a constant state of flux. To predict the forces exerted on a ship or structure, ComFLOW calculates the evolution of the flow step by step. This requires smart mathematical methods that are sufficiently accurate without making the computation time impractically long.
And what is your contribution to this?
Our contribution primarily lies in making the software faster and more efficient. This allows for larger and more complex simulations to be performed within the same amount of computation time, or for results to become available more quickly. To achieve this, we examine both the mathematical calculation methods and the way they are implemented in the software.
And what does this combination of mathematics and software yield in practice?
The interaction between water and moving objects, such as ships, is quite complex. While the computations for this worked, we hadnโt yet managed to parallelize them. A naive approach requires a massive amount of data exchange between different CPUs, which leads to a significant loss of speed. By gaining a deep understanding of the mathematics behind the water-ship interaction, we were able to introduce auxiliary variables that made the calculation effectively parallelizable. As a result, this code now runs in parallel.
Furthermore, we recently achieved a roughly twofold speedup in calculating the pressure field. This is one of the most computationally intensive and error-prone parts of the simulation, involving the solution of a large system of linear equations. This acceleration was realized through a combination of clever memory reuse, consolidating calculations that use the same data, compressing specific data, and skipping certain convergence checks. Restructuring memory usage and calculations requires a thorough understanding of how the algorithm functions. Meanwhile, compressing data and adjusting convergence checks requires a solid grasp of the underlying mathematics to ensure that the process still converges toward the correct solution.
Ultimately, these improvements allow users to evaluate designs more quickly and explore a wider range of scenarios.
And what are the next steps?
ComFLOW is always evolving. There is still a great deal to be accomplished in terms of testing, documentation, code quality, and delivery. These are topics we frequently encounter when modernizing and refactoring existing software. We hope to make significant improvements in this area over the coming months, so that we can then dive back into the technical depths!
Mathematical Details
From Water to Mathematics
To predict how water flows, ComFLOW uses mathematical equations that describe physical laws, such as the conservation of mass and momentum. ComFLOW employs the so-called Navier-Stokes equations for this purpose; these form the foundation of the simulation.
From Equations to Calculations
For complex flows of this nature, the equations cannot be solved directly. Consequently, ComFLOW divides the area surrounding an objectโsuch as a ship or a platformโinto small cells and calculates the behaviour of the water within each cell using the Finite Volume method. Additional techniques are required to accurately track the shape of a structure and the moving water surface; these include “cut cells,” adaptive grid refinement, and the Volume-of-Fluid method. Greater computational precision requires a higher volume of calculations, making it essential to strike a balance between accuracy and computation time.
Reaching a Solution Faster
During a simulation, ComFLOW must repeatedly calculate the pressure within the water. This requires solving a very large system of equations, which is computationally intensive. Specialized mathematical solution methods can make this process more efficient. ComFLOW utilizes techniques such as the iterative solver BiCGSTAB and ILU preconditioning to achieve this.