Computational fluid dynamics is a method for simulating fluid flows that has been widely used in engineering for decades, and which also has applications for studying function and ecology in fossil taxa. However, despite the possible benefits of this approach, computational fluid dynamics has been used only rarely in palaeontology to date. The theoretical basis underlying the technique is outlined and the main steps involved in carrying out computer simulations of fluid flows are detailed. I also describe previous studies that have applied the method to fossils and discuss their potential for informing future research directions in palaeontology. Computational fluid dynamics can enable large-scale comparative analyses, as well as exacting tests of hypotheses related to the function and ecology of ancient organisms. In this way, it could transform our understanding of many extinct fossil groups.