The paper reports a numerical simulation study of drying of peas and rice grains in a rotary dryer with superheated steam, dry air, and humid air (20%, 40%, 60% and 80% moisture content by volume) at 1 bar as the drying media. The initial water contents in peas and rice grains are 75% and 13% (by weight), respectively. The thermal model includes turbulent convection heat transfer from the gas to the refractory wall and solids, radiation exchange among the gas, refractory wall and the solid surface, conduction in the refractory wall, and mass and energy balances of the gas and the solids. In the absence of experimental data of food drying, the present model has been satisfactorily validated with the experimental and numerical results reported in Sass (1967, Sass, A., “Simulation of Heat-Transfer Phenomena in a Rotary Kiln”, Industrial & Engineering Chemistry Process Design and Development, 6(4), pp. 532–535) for iron ore and cement. It is found that for superheated steam there is an optimum kiln inner diameter at which the predicted kiln length is the highest. For dry air, the predicted kiln length monotonically decreases with a decrease in kiln inner diameter. A detailed parametric study lent a good physical insight into the drying process. An optimization study has been conducted for superheated steam as the drying medium using the Univariate Search method to minimize the length of the kiln with an upper limit on the inlet gas temperature as the constraint.