A comprehensive, one-dimensional mathematical model for the heat and mass transfer within large-scale bagasse stockpiles is presented. The model accounts for a multicomponent gas phase, liquid water and water vapour phases, along with a solid bagasse phase. A description of the numerical scheme used to implement the model is also given as is an extensive estimation of physical and chemical parameters within the model. The model is validated against experimental data obtained from a one dimensional bagasse slab and shows very good correspondence with these measurements. An analysis of the predicted transport dynamics in a large-scale stockpile shows that the bulk of the stockpile becomes anaerobic shortly after stockpile construction, which limits the ability of the core of the stockpile to significantly overheat. However, the model predicts the existence of a 1 to 2m shell at the outer surface of the stockpile in which oxygen penetration can be sufficient to cause overheating, which can lead to stockpile combustion. The model shows that the ground beneath the stockpile acts as a significant heat sink and the time at which the ground starts to have a cooling effect depends on the size (height) of the stockpile with larger (higher) stockpiles being hotter than smaller (lower) ones. Furthermore, the model predicts that more highly compacted stockpiles are cooler than those with lower compaction due to the fact that more compacted stockpiles have lower oxygen levels and a higher effective thermal conductivity. Finally, the model predicts that reducing the transfer of sensible heat at the top surface of the stockpile, whilst maintaining normal mass transfer at this surface, can lead to combustion and that reducing the transfer of oxygen at this surface can lead to stockpile cooling as long as the rate of energy transfer at the surface is sufficiently high.