Researchers combined X-ray computed micro-tomography (XCT) with percolation-based flow simulations to model how water moves through espresso pucks. Testing Tumba (Rwanda) and Guayacán (Colombia) beans at 11 grind sizes, they mapped pore networks and ran digital brews to derive an equation linking particle size, packing and pore connectivity to water permeability and saturation. The findings can help manufacturers tune machines for more consistent extraction, while individual taste still determines what feels "perfect."
Math Reveals the Recipe for the 'Perfect' Espresso: Grind, Pores, and Flow

People love a great cup of coffee, but what makes an espresso objectively ‘perfect’? An international team of mathematicians and environmental scientists used imaging and physics to quantify how grind size and internal puck structure control extraction—then turned those insights into predictive formulas.
Study Overview
The researchers published their findings in Royal Society Open Science. They tested two coffee varieties—Tumba (Rwanda) and Guayacán (Colombia)—ground into 11 distinct particle sizes ranging from very fine to coarse. Each grind size was packed into glass tubes and imaged with X-ray computed micro-tomography (XCT), producing high-resolution 3D maps of the internal structure and the tiny passageways between grains known as pore spaces.
Digital Brewing and Percolation Theory
Using the XCT maps, the team ran digital flow simulations based on percolation theory, a branch of physics that models how fluids move through connected voids. The simulations tested how readily continuous water pathways form through the puck and how that connectivity influences saturation and extraction—essentially, they brewed many virtual shots on a computer.
Key Findings
The authors derived an equation that relates water permeability and saturation to three main factors: pore-space connectivity, particle (grain) size, and the surface area presented by the packed grounds. They report their formulas are in "excellent agreement" with percolation theory, offering a quantitative bridge between microstructure and macroscopic flow behavior.
Practical takeaway: More connected pore networks and optimal particle sizes increase the fraction of water that actually flows over coffee surface area, which increases contact time and generally produces stronger flavor.
Implications
The work is oriented toward improving commercial espresso equipment rather than changing home barista habits overnight. Machine manufacturers could integrate these formulas to fine-tune grind profiles, pressure and filtration to achieve more consistent extraction across different beans and packing methods.
What This Means For Your Cup
Until machines adopt such data-driven adjustments, personal preference rules: if your espresso tastes perfect to you, that is what matters. Still, this research gives roasters and equipment makers a science-based pathway to make more consistently excellent shots for everyone.
Help us improve.


























