Coupled modelling of stress and fluid flow, with applications to gas extraction and disposal of energy residues