Prediction of in-cylinder flows and fuel-air mixing are two fundamental pre-requisites for a successful simulation of direct-injection engines. Over the years, many efforts were carried out in order to improve available turbulence and spray models. However, enhancements in physical modeling can be drastically affected by how the mesh is structured. Grid quality can negatively influence the prediction of organized charge motion structures, turbulence generation and interaction between in-cylinder flows and injected sprays. This is even more relevant for modern direct injection engines, where multiple injections and control of charge motions are employed in a large portion of the operating map. Currently, two different approaches for mesh generation exist: manual and automatic. The first makes generally possible to generate high-quality meshes but, at the same time, it is very time consuming and not completely free from user errors. Automatic mesh generation is very fast, but does not easily allow to align grid with flow and spray in regions of interest, for instance where fuel is injected or where the air flow is confined between pipe walls and thigh gaps (intake and exhaust head ducts and valve gaps). Within this context, the authors have developed a novel approach for automatic mesh generation, where both mesh quality and flow alignment are taken into account. Such methodology has been incorporated into the Lib-ICE code, which is based on the OpenFOAM technology. On the basis of combustion chamber details and/or user specified parameters (piston bowl points, injector direction, squish height, valve lift diagram,…), body fitted, high quality grids are automatically generated to perform full-cycle or compression/combustion simulations. To assess the proposed approach, two direct-injection engines were simulated. The first is Diesel fueled and only compression and combustion phases are simulated, showing the advantages of a spray-oriented grid, compared to a conventional Cartesian one, in terms of prediction of fuel-air mixing and combustion process. The second one is a gasoline, direct-injection engine. In this case full-cycle simulations were performed and computed flow field data were compared with optical experimental ones.