We introduce a mathematical model for the composting process in biocells where several chemical phenomena, like the aerobic biodegradation, the hydrolysis of insoluble substrate and the biomass decay, occur. We investigate the best aeration strategies in presence of inhibition processes due to high concentrations of oxygen. Optimal stategries are obtained as result of a suitable optimal control problem. The dynamics exhibits an enhanced level of the oxygen concentration that guarantees the aerobic feature of the biodegradation process. Then, a nonlinear bioeconomic term is included in the objective functional to take into account of the external operational cost. The role of the economic cost in the control policy is analyzed and discussed.