The need to reduce development time whilst simultaneously improving engine performance has motivated this application of optimal control to product development processes for engines and powertrains. The optimisation of the fuel consumption is formulated as a constrained Optimal Control Problem (OCP) and solved using pseudospectral methods, giving the optimum heat release and injection profiles in the presence of cylinder pressure rate and cylinder pressure constraints. The technique is applied to an engine design problem and used to reduce fuel consumption by optimising compression ratio within a cylinder pressure limit, also providing new insights into the combustion processes.