Theory
$f_n = \dfrac{1}{2\pi}\sqrt{g \cdot k_n \cdot \tanh(k_n h)}$
$k_n = \dfrac{n\pi}{a}$, equiv. pendulum:
$l_{eq}= \dfrac{h\tanh(k_1 h)}{k_1 h}$
Analytically compute sloshing natural frequencies for rectangular tanks. Adjust tank width, fluid depth, and density to view 5 sloshing modes and the equivalent pendulum length in real time.
$f_n = \dfrac{1}{2\pi}\sqrt{g \cdot k_n \cdot \tanh(k_n h)}$
$k_n = \dfrac{n\pi}{a}$, equiv. pendulum:
$l_{eq}= \dfrac{h\tanh(k_1 h)}{k_1 h}$
The core of the analysis is finding the natural frequencies of standing surface waves in a rectangular tank. The frequency for each sloshing mode 'n' is governed by gravity, the wave number, and the fluid depth.
$$f_n = \dfrac{1}{2\pi}\sqrt{g \cdot k_n \cdot \tanh(k_n h)}$$$f_n$: Natural frequency of mode n (Hz)
$g$: Acceleration due to gravity (9.81 m/s²)
$k_n$: Wave number for mode n = $n\pi / a$
$a$: Tank width (m)
$h$: Fluid depth (m)
The $\tanh(k_n h)$ function captures the effect of finite fluid depth—it transitions from shallow to deep water behavior.
For engineering design, the fundamental (n=1) sloshing mode is often modeled as a simple pendulum. This equivalent pendulum length allows the complex fluid dynamics to be represented as a simple oscillating mass in structural calculations.
$$l_{eq}= \dfrac{a}{\pi}\cdot \tanh\left(\frac{\pi h}{a}\right) \quad \text{or}\quad l_{eq}= h \cdot \dfrac{\tanh(k_1 h)}{k_1 h}$$$l_{eq}$: Equivalent pendulum length (m).
This length tells you how "long" the pendulum would be to swing at the same frequency as the liquid's first sloshing mode. A shorter $l_{eq}$ means a faster, more violent slosh for a given tank geometry.
Seismic Design of Storage Tanks: This is the most critical application. During an earthquake, sloshing can generate enormous forces on tank walls and roofs. Standards like API 650 use the equivalent pendulum method to calculate these "convective" forces and ensure tanks in refineries or water treatment plants don't fail.
Aerospace Propellant Management: In rockets, sloshing of liquid fuel can destabilize the vehicle's flight. Engineers must calculate sloshing frequencies to avoid matching the rocket's control system frequencies, which could lead to a destructive feedback loop. The analysis informs baffle design inside the tank.
Marine Cargo & Ballast Tanks: On ships, sloshing in partially filled cargo holds (for LNG, oil, or ballast water) creates dynamic loads that can fatigue the structure. Analyzing these modes helps determine safe filling levels and routing to avoid wave conditions that excite sloshing.
Automotive Fuel Tanks: In cars, sudden stops or turns can cause fuel slosh, which affects vehicle handling and can lead to fuel pump starvation. Baffles are designed using sloshing frequency analysis to dampen these motions and ensure consistent fuel delivery.
When you start using this tool, there are several points, especially for CAE beginners, that are easy to stumble on. A major misconception is thinking that the calculation results are the actual design values. This simulator provides the theoretical solution for an ideal rectangular tank assuming "small amplitude". Actual tanks are often cylindrical, and when liquid surface motion becomes large, nonlinear phenomena can no longer be ignored. For example, even if the calculated natural frequency is 1.0 Hz, you should anticipate a variation of about 0.8 Hz to 1.2 Hz in the real machine.
Next, there's a pitfall in parameter input. The liquid depth "h" is the depth at rest, right? But when the tank is accelerating, the liquid surface tilts, changing the effective depth. Consider a car's fuel tank. During hard braking, if the liquid surges forward, the pressure on the rear wall becomes smaller than the calculated value. Conversely, during a turn, one side wall might experience a load greater than anticipated. You should treat simulation results as "one reference state"; in practice, it's essential to examine multiple cases assuming the most severe liquid surface orientations.
Finally, the assumption that you only need to look at the first mode. While the fundamental mode indeed has the most energy, higher-order modes cannot be ignored in some situations. For instance, small internal structures (like mounting struts for measurement equipment) might be located at the nodes (points of minimal motion) or antinodes (points of large motion) of the 3rd or 5th mode waves locally. Understand the purpose of visualizing up to 5 modes with this tool, and get into the habit of considering which modes affect your specific design object.
The liquid sloshing calculation formula might seem specialized, but its roots are actually the same as various engineering fields dealing with wave phenomena. The first that comes to mind is Naval Architecture. The sloshing of water in a moving container like a ship's hull (bulkling) is mathematically a very similar problem to sloshing. Furthermore, the dispersion relation for surface waves in the tank $$ \omega_n^2 = g k_n \tanh(k_n h) $$ is essentially identical to the equation used in Coastal Engineering to describe wave transformation from offshore waves approaching the shore. The property where wave speed decreases as liquid depth "h" becomes shallower (the behavior of tanh) is common to both.
Another major connection is with Structural Mechanics, particularly Fluid-Structure Interaction (FSI) Analysis. The dynamic pressure generated by sloshing deforms the tank wall, and that deformation further changes the liquid's sloshing behavior... this interaction occurs. The natural frequency obtained with this tool assumes "rigid walls"; when FSI is considered, the frequency often becomes slightly lower. Also, the concept of equivalent pendulum length relates to the idea in Earthquake Engineering of modeling rooftop tanks on buildings as "pendulum-type dampers". Treating the liquid slosh as a simplified mass model makes the overall seismic response analysis significantly easier.
If you become interested in the theory behind this tool, try taking the next step. To deepen your understanding of the mathematical background, it's recommended to start by learning the governing "Laplace Equation" and how to set up the boundary conditions (free surface, bottom, side wall conditions). This should help you grasp why the solution takes the form of a combination of trigonometric and hyperbolic functions $$ \phi(x,z) \propto \cos(k_n x) \frac{\cosh(k_n z)}{\cosh(k_n h)} $$.
The next practical step is to investigate sloshing in "cylindrical tanks". Unlike rectangular tanks, the solution involves Bessel functions. Many design standards (e.g., API 650) target cylindrical tanks, so mastering this brings you much closer to practical application. A good learning flow is: 1) Use this tool to get a feel for rectangular tanks, 2) Understand that for cylinders, the radius plays the role of width, and modes separate into axisymmetric and asymmetric, 3) Think qualitatively about the effect of baffles (blocking/reflecting waves).
Ultimately, challenge yourself with the world of nonlinear sloshing and damping. When the liquid surface moves with large amplitude, energy dissipates at the wave crests, and viscous effects also become non-negligible. These phenomena go beyond the linear theory underlying this tool and are areas of active research today. First, thoroughly internalizing how "width", "depth", and "density" affect the frequency using this simple tool will become your strongest foundation for understanding these more complex phenomena.