Computational fluid dynamics (CFD) models have been developed based upon field data collected from a longwall mine in New South Wales, Australia to study the behaviour of goaf gas flow in both active and sealed goaf areas. A base CFD model was built to represent the goaf situations when the active longwall retreats near the finish-offline. Results from the base model were calibrated and compared against field goaf gas monitoring data. The base model was then used to carry out parametric studies to investigate a number of operational scenarios and their impact on goaf gas behaviour. CFD modelling results indicate that the overall goaf gas flow pattern changes as the operating longwall retreats towards finish-offline. In all cases, oxygen penetration into the active goaf remains high, reaching 15 per cent or higher, even at some 800 m behind the longwall face. The modelling results also indicated that it would be difficult for early detection of an active goaf heating (on the maingate side) based upon CO readings in the return airflow, as the main stream of the gaseous product will be flowing into the sealed deep goafs in adjacent longwall (LW) panels. Monitoring points (such as tube bundles and bag sampling points) should be selected at deep seated seals along the active goaf so that abnormal CO or C2H6 readings can be picked up for early detection and location of potential heating spots; goaf inertisation can be better achieved by injecting inert gas such as nitrogen at deeper points (>200 m) behind the operating longwall; the injection of in-seam drainage methane into the goaf areas will only have a limited impact on goaf inertisation as much of the injected methane will migrate towards deep and higher parts of the goaf due to its buoyancy effect.