To suppress knock in gasoline engines, the coolant flow of a single-cylinder engine was improved by using two methods: a multi-dimensional knock calculation and a method for predicting combustion chamber wall temperature based on a thermo-fluid calculation. Through these calculations, the head gasket geometry was modified to change the coolant flow and thereby improve the distribution of wall temperatures on the head side. By decreasing the wall temperature on the exhaust side by about 10K while maintaining the wall temperature on the intake side, it was possible to advance the spark timing by about 1°CA and improve the thermal efficiency by 0.4% over the whole speed range.