Liquid metal on a speaker (Slow Mo Guys), but as simulation @ProjectPhysX
Liquid metal on a speaker (Slow Mo Guys), but as simulation  @ProjectPhysX
Uploaded March 2022 | Updated September 2026, 1 week ago
The Slow Mo Guys did a video about liquid gallium on a vibrating speaker membrane, wondering what it would look like in simulation: youtu.be/A9J1gkw9BI0?t=135

Well, I can now simulate liquid metal with my FluidX3D software, and it even runs in real time.
Note that I couldn't do the simulation with 1:1 the physical parameters of liquid gallium, as it just wouldn't be stable. The parameters that I used are (in lattice units): box size 128x128x96, density rho=1, kinematic shear viscosity nu=0.01, force per volume f=0.0005, surface tension sigma=0.005, peak velocity of speaker membrane u=0.09, frequency of speaker freq=0.01.

The raytracer here does reflections only at a depth of 2, so 1-3 rays per pixel.

The simulation software used is FluidX3D, an OpenCL implementation of the lattice Boltzmann method. FluidX3D runs at peak hardware efficiency on the worlds fastest data-center GPUs, on gaming GPUs and CPUs and it even runs my smartphone.

The fluid simulation is done with the lattice Boltzmann method (LBM) with the Volume-of-Fluid (VoF) extension and piecewise linear interface construction (PLIC) for surface tension.

VoF-LBM provides a 3D grid with fluid fill levels, used as isovalues for marching-cubes, which generates a contiguous triangle mesh representing the water surface.
Marching-cubes: paulbourke.net/geometry/polygonise

Raindrop simulations: doi.org/10.1186/s43591-021-00018-8
Volume-of-Fluid: doi.org/10.3390/computation10020021
Esoteric-Pull: doi.org/10.3390/computation10060092
FP32/FP16 mixed precision: researchgate.net/publication/362275548_Accuracy_and_performance_of_the_lattice_Boltzmann_method_with_64-bit_32-bit_and_customized_16-bit_number_formats
FluidX3D: doi.org/10.15495/EPub_UBT_00005400

With raytracing I shoot light rays from the camera through the 3D isogrid. For each grid cell that a ray traverses, I run marching-cubes to generate the triangles on-the-fly, then check for ray-triangle intersections with any of these triangles. If the ray intersects, I don't use the flat-face-surface nromal of the triangle, as this would lead to visual artifacts on the reflected/refracted rays. Instead, I interpolate the surface normal at the intersection point in order to have a smoothly appearing surface. How does surface normal interpolation work with marching-cubes? I get the normals directly at the lattice points with gradient (central derivative) on the isogrid, then do trilinear interpolation to the intersection point. This is only computed once, after the intersection point has been found.

The 3D lattice that the LBM provides already is one of the ideal acceleration structures for raytracing. Any ray only has to check for possible intersections with isosurface triangles contained within the traversed grid cells. This makes it - when the lattice is not too large - even run in real time on any OpenCL 1.2 capable GPU with enough memory. No RTX or "professional" GPU required.

Also see the most realistic raindrop simulation ever done: youtu.be/9Rfu9ZqW894

Timestamps:
0:00 intro
0:03 simulation start
0:29 almost melts the GPU
1:15 pressure waves from speaker membrane
1:32 isosurface mesh generation
2:15 outro

#FluidX3D #OpenCL #Raytracing #GPU #LBM
Liquid metal on a speaker (Slow Mo Guys), but as simulationReal Time Ray Tracing... in the Command Prompt in 16 ColorsReal Time Ray Tracing... in the Command Prompt in 616 dithered ColorsPhysX3D [GRAVITY SIMULATION] 5k body galaxy simulated in real timePhysX3D [GRAVITY SIMULATION] Euler vs. RK4 / Sonnensystem im Jahr 3016SoundFFT [AUDIO SPECTRUM ANALYZER] Music DemoInterstellar Ranger 10 billion voxel CFD on 8x 64GB GPUsFluidX3D [FLUID SIMULATION] Some Real Time DemonstrationsDroneEngine [QUADCOPTER SIMULATION] June Update: control modesFluidX3D - Simulating Rayleigh-Bénard Convection in Real Time and 3D on a GPUPhysX3D [GRAVITY SIMULATION] Planetary Movement through SpacePortraits of the Planets Supercut
Dr. Moritz Lehmann |

Liquid metal on a speaker (Slow Mo Guys), but as simulation

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER