Aquarium: A Fully Differentiable Fluid-Structure Interaction Solver for Robotics Applications

Jeong Hun Lee, Mike Yan Michelis, Robert K. Katzschmann, Zachary Manchester

Abstract

We present Aquarium, a differentiable fluid-structure interaction (FSI) solver for robotics that offers stable simulation, accurately coupled fluid-robot physics in two dimensions, and full differentiability with respect to fluid and robot states and parameters. Aquarium achieves stable simulation with accurate flow physics by directly integrating over the incompressible Navier-Stokes equations using a fully implicit Crank-Nicolson scheme with a second-order finite-volume spatial discretization. The fluid and robot physics are coupled using the immersed-boundary method by formulating the no-slip condition as an equality constraint applied directly to the Navier-Stokes system. This choice of coupling allows the fluid-structure interaction to be posed and solved as a nonlinear optimization problem. This optimization-based formulation is then exploited using the implicit-function theorem to compute derivatives. Derivatives can then be passed to downstream gradient-based optimization or learning algorithms. We demonstrate Aquarium's ability to accurately simulate coupled fluid-robot physics with numerous 2D examples, including a cylinder in free stream and a soft robotic fish tail with hardware validation. We also demonstrate Aquarium's ability to provide analytical gradients by performing gradient-based shape-and-gait optimization of an oscillating diamond foil to maximize its generated thrust.

Introduction

Designing bio-inspired underwater robots—such as mechanical fish or flapping-wing vehicles—presents a significant engineering challenge. The performance of these systems is inextricably linked to complex interactions between the robot's body and the surrounding fluid. Traditionally, the design process has been bifurcated: engineers design the physical morphology (shape) and the control system (gait) separately. This separation often leads to sub-optimal performance because it ignores the tight coupling between fluid dynamics and structural movement.

Existing Computational Fluid Dynamics (CFD) solvers typically act as "black boxes," providing simulation results without offering information on how small changes in parameters affect the outcome. Without these gradients, optimizing a robot requires computationally expensive gradient-free trial and error. Furthermore, many solvers lack the stability required for the large time steps common in robotics control applications. Aquarium addresses these gaps by providing a stable, physics-based simulator where every component is fully differentiable.

Methodology

Fluid Dynamics and Stability

Aquarium solves the incompressible Navier-Stokes equations using a second-order finite-volume spatial discretization. To ensure stability at the coarser time scales often required for robotics applications, the solver employs a fully implicit Crank-Nicolson scheme. Unlike explicit solvers, which can become unstable if the time step is too large, this implicit approach maintains physical accuracy and numerical stability across varying temporal resolutions.

Fluid-Structure Coupling

To model the interaction between the robot and the fluid, Aquarium utilizes the immersed-boundary method. This approach allows the robot to move through a fixed fluid grid, eliminating the need for the computationally expensive "re-meshing" required by other techniques. The no-slip condition at the robot's surface is formulated as an equality constraint applied directly to the Navier-Stokes system.

Analytical Differentiability

The core innovation of Aquarium is its formulation of the FSI system as a Karush-Kuhn-Tucker (KKT) system. By viewing the simulation as a large-scale constrained optimization problem—where fluid equations represent the objective and the robot's presence represents the constraints—the authors can apply the Implicit Function Theorem (IFT). This allows for the calculation of analytical gradients by reusing the matrix factorizations already performed during the simulation step. This method provides gradients with minimal additional computational overhead compared to traditional backpropagation through time.

Validation and Results

Benchmarking and Hardware Validation

The solver was validated against established CFD benchmarks and real-world hardware:

  • Cylinder in Free Stream: Aquarium's results for drag, lift coefficients, and Strouhal numbers at Reynolds numbers 40 and 100 showed strong agreement with established numerical and empirical studies.
  • Soft Robotic Fish Tail: To test "real-to-sim" viability, the authors modeled a pneumatically actuated soft fish tail. By approximating the soft body as a 10-link rigid chain, Aquarium successfully matched the thrust force patterns and transient flow effects observed in physical hardware actuated at 3Hz.

Shape-and-Gait Co-optimization

To demonstrate the utility of analytical gradients, the authors performed a co-optimization task on an oscillating diamond foil. The goal was to simultaneously optimize the foil's thickness (shape) and its heave/pitch movements (gait) to maximize thrust.

Using the L-BFGS optimization algorithm powered by Aquarium’s gradients, the system achieved a 139% improvement in thrust. The optimization reached a near-optimal solution in just 7 iterations and fully converged in 14, demonstrating the efficiency of gradient-based design compared to gradient-free methods.

Conclusion and Future Work

Aquarium represents a significant step forward in differentiable physics for robotics. By providing stable, accurate, and differentiable 2D FSI simulations, it enables the simultaneous optimization of robot morphology and control. While the current version is limited to 2D environments and rigid-body approximations of soft structures, it captures the essential forcing effects necessary for practical robotics design. Future work will focus on extending the solver to 3D domains, integrating native soft-body dynamics, and improving computational performance through GPU acceleration and specialized sparse linear solvers.

Summary updated

BibTeX
@inproceedings{lee2023aquarium,
  author = {Jeong Hun Lee and Mike Yan Michelis and Robert K. Katzschmann and Zachary Manchester},
  title = {{Aquarium: A Fully Differentiable Fluid-Structure Interaction Solver for Robotics Applications}},
  booktitle = {IEEE International Conference on Robotics and Automation},
  year = {2023},
  url = {https://openreview.net/forum?id=x1HpWwVxhz},
}
Figure