In many problems of interest to geology and soil mechanics a fluid moves through a solid matrix which is also being deformed. In most cases of interest the effective viscosity of the matrix is many orders of magnitude greater than that of the percolating fluid, and both form interconnected networks in three dimensions. The partial differential equations governing such behaviour can now be obtained and a variety of simple model problems have been investigated. Some of the more surprising solutions contain solitary waves and compaction fronts. Some of the less exotic solutions are presently of more geological interest. The mobility of volatile rich melts at melt fractions as small as 0.1% has important consequences for trace element geochemistry. The geometry of layered intrusives appears to result from differential compaction of the crystal mush, and the rates required can be used to estimate a viscosity of 3 x 1018 Pa s for an olivine matrix. This value agrees excellently with laboratory experiments when proper account is taken of the grain size dependence. Compaction in sedimentary rocks results in overpressure when the porosity becomes sufficiently small, and can also lead to the development of secondary porosity.