The present work details a study of the heat flux through the walls of an internal combustion engine. The determination of this heat flux is an important aspect in engine optimization, as it influences the power, efficiency and the emissions of the engine. Therefore, a set of simulation tools in the OpenFOAM® software has been developed, that allows the calculation of the heat transfer through engine walls for ICEs. Normal practice in these types of engine simulations is to apply a wall function model to calculate the heat flux, rather than resolving the complete thermo-viscous boundary layer, and perform simulations of the closed engine cycle. When dealing with a complex engine, this methodology will reduce the overall computational cost. It however increases the need to rely on assumptions on both the initial flow field and the behavior in the near-wall region. As the engine studied in the present work, a Cooperative Fuel Research (CFR) engine, is a simple single cylinder pancake engine, it was possible to implement more complex and numerically demanding methodologies, while still maintaining an acceptable computation time. Both closed and full cycle simulations were therefore performed, for which the heat flux was calculated by both implementing various wall function models and by resolving the complete thermo-viscous boundary layer. The results obtained from the different kind of simulations were then compared to experimental heat flux data, which was measured using a thermopile type heat flux sensor in different locations in the CFR engine. By comparing the results from the different types of simulations, a performance evaluation of the used methodology could be carried out. It was found that the heat flux obtained by resolving the thermo-viscous layer was accurate compared to experiments, while the wall functions were not able to correctly capture the heat flux. Full cycle simulations resulted in a slightly improved result, especially when resolving the boundary layer, but due to the increased computational cost, this method does not seem beneficial.