Amazing 3D Maze Solved by CFD

If you were amazed at the 2D maze solving ability of Computational Fluid Dynamics (CFD) then you had better sit down and prepare to be even more amazed at CFD's 3D maze solving.

CFD 3D Maze SimulationCFD 3D Maze SimulationVelocity vectors

An ongoing joke in CFD is that you will often come across a 2D algorithm with the comment "extension to 3D is straightforward..." and of course it never is! However, in the case of the script for the original 2D maze generation it was relatively straightforward to extend to 3D...

I modified the depth first traversal algorithm to keep track of maze points in a 3D matrix and added the conditions to branch in the third direction. Instead of using [row, column] notation, as in 2D, I used [i, j, k] to keep track of the logical 3D maze points. I used the same geometry of spheres for maze points and cylinders for interconnects from the 2D maze in the 3D maze, with the addition of a third dimension orientation option for the cylinders.

3D Maze Geometry3D Maze Geometry

The configuration of the CFD simulation for air flow was identical to that for the 2D maze.

3D Maze Surface Mesh3D Maze Surface Mesh

As in the 2D maze, the fluid traces the shortest path through the 3D maze connecting the inlet to the outlet.

Iso-Surfaces of Velocity MagnitudeIso-Surfaces of Velocity MagnitudeCFD 3D Maze Simulation

It is a little trickier to see the path in 3D, but I can testify that the fluid took the shortest path.

Velocity VectorsVelocity VectorsCFD 3D Maze Simulation