In geotechnical engineering, drilling fluid is a fluid used to drill boreholes into the earth, and are used while drilling oil and natural gas wells and on exploration drilling rigs. Drilling fluid is often called drilling mud. The three main categories of drilling fluids are water-based muds (which can be dispersed and non-dispersed), non-aqueous muds, usually called oil-based mud or invert, and gaseous drilling fluid, in which a wide range of gases can be used.
The main functions of drilling fluids include providing hydrostatic pressure to prevent formation fluids from entering into the well bore, keeping the drill bit cool and clean during drilling, carrying out drill cuttings, and suspending the drill cuttings while drilling is paused and when the drilling assembly is brought in and out of the hole. The drilling fluid used for a particular job is selected to avoid formation damage and to limit corrosion.
On a drilling rig, drilling mud is pumped from the mud pits through the drill string where it sprays out of nozzles on the drill bit, cleaning and cooling the drill bit in the process. The mud then carries the crushed or cut rock ("cuttings") up the annular space ("annulus") between the drill string and the sides of the hole being drilled, up through the surface casing, where it emerges back at the surface.
Cuttings are then filtered out with either a shale shaker, or the newer shale conveyor technology, and the mud returns to the mud pits. The mud pits are designed in such a way as to allow settling of drilled "fines", and where treatment of the fluid is done by adding chemicals and other additives to the fluid.