A thermal model for the rotary kiln including heat transfer within the bed