COCONUTLAB bali

Open-source engineering lab

The $0 engineering stack

Everything you need to go from this browser toy to a real CFD run of a coconut behind a boulder. Every tool here is free, and each one is battle-tested in research and industry.

$30,000 → $0

  1. 1Geometry
  2. 2Mesh
  3. 3Solve
  4. 4Post-process
  5. 5Script & prototype
  6. →The full recipe
Step 1

Geometry

Model the river bed, the boulders and the coconut, then export STL for meshing.

FreeCAD

replaces SolidWorks / CATIA

Parametric 3-D CAD: sketch, constrain, extrude, and change any dimension later.

For the coconut: boulders and bed as solids, the coconut as a 17.5 cm sphere, exported as bed+boulders.stl and coconut.stl.

Onshape

free for students and hobbyists

Browser-based professional CAD with free education and hobby plans. It works on a laptop in a Bali café.

For the coconut: the same geometry without installing anything, plus easy sharing.
Step 2

Mesh

Chop the water and air into cells, fine where things happen and coarse elsewhere.

Gmsh

replaces ANSYS Meshing / ICEM

A scriptable mesh generator with a Python API. Great for 2-D river reaches and quick 3-D tetrahedral meshes.

For the coconut: a scripted 2-D plan-view mesh to test the eddy before going 3-D.

Salome

replaces commercial pre-processors

A geometry, meshing and study platform from CEA/EDF. It pairs with Code_Saturne and exports to OpenFOAM.

For the coconut: clean, named boundary patches (inlet, outlet, bed, coconut) for the solver.
Step 3

Solve

Run the actual physics: free surface, turbulence, and a floating body that moves with the flow.

OpenFOAM

replaces Fluent / CFX

A finite-volume CFD toolbox, the workhorse of open-source CFD.

For the coconut: interFoam (VOF free surface) plus sixDoFRigidBodyMotion for the floating body.

DualSPHysics

replaces commercial SPH / free-surface codes

GPU smoothed-particle hydrodynamics with native floating bodies. No mesh needed.

For the coconut: the quickest way to throw a coconut into a plunge pool, on a gaming GPU.

More free solvers

bonus

SU2 (compressible and aero, with adjoint), Basilisk (adaptive free-surface), FEniCS (finite elements), Code_Saturne (EDF), PyVista (3-D plotting in Python).

Step 4

Post-process

Turn gigabytes of numbers into pictures you can reason about.

ParaView

replaces CFD-Post / Tecplot

Post-processing for huge datasets: streamlines, iso-surfaces, animations, Python scripting.

For the coconut: the water surface (alpha.water = 0.5), streamlines, and the coconut's track from VTK.
Step 5

Script & prototype

Before any big run, prototype the physics in a few hundred lines.

Python + NumPy / SciPy / Matplotlib

replaces MATLAB

The offline version of this lab, a D2Q9 lattice-Boltzmann eddy plus a side-view roller model, is a few hundred lines of NumPy.

For the coconut: estimates like T = W/(kU) and the rise speed, parameter sweeps, and figures.
The full recipe

From this website to a "real" simulation of the coconut

  1. 1

    Geometry

    FreeCAD or Onshape → bed+boulders.stl and coconut.stl (sphere, D ≈ 0.175 m).

  2. 2

    Mesh

    blockMesh box about 12 × 4 × 2 m, plus snappyHexMesh refined to level 3–4 at the coconut and the shear line (or Gmsh / Salome).

  3. 3

    Solve

    OpenFOAM interFoam (or foamRun -solver incompressibleVoF) with k-ω SST and sixDoFRigidBodyMotion. Recalibrate the mass first: the lab's 2.67 kg is probably too heavy. Expect 5–20 M cells and hours to days on a workstation for ~60 s of physical time.

  4. 4

    Quick alternative

    DualSPHysics on a gaming GPU with <floatings>, particle spacing dp ≈ 2 cm.

  5. 5

    Post-process

    ParaView: the alpha.water = 0.5 iso-surface, streamlines, and the coconut's centre-of-mass track. Escape = it crosses the reattachment line. Compare the residence time with T = W/(kU).

Licence notePrices of commercial tools vary by contract, and many vendors offer free student editions. The point isn't that commercial tools are bad. It's that you can learn, and do serious work, without paying for them.