The wave character of atoms can produce Casimir-like size effects in gases confined in a narrow box. A general micro/nano scaled model of the Otto engine cycle working with an ideal gas is used to discuss the Casimir-like size effects. Based on the model, expressions of the work output and efficiency are derived analytically. By means of numerical calculation and illustration, the influence of the surface areaon the performance of the cycle are discussed and evaluated in detail. Furthermore, some optimal operating regions including those for the work output, efficiency and the optimal region of the volume ratio and the surface area ratio are determined and evaluated. The results attained here are useful for designing of a micro/nano scaled heat exchange device.