A two-dimensional model based on OpenTidalFarm is applied to simulate tidal stream flow around turbines. The model is governed by shallow water equations and is able to optimize the layout of the deployed turbine array in terms of maximizing the energy outputs. Three turbine array layouts including two structured layouts (regular and staggered) and one unstructured layout (optimized) are simulated to investigate the effect of turbine layouts on energy extraction. The present study shows that more energy could be extracted when lateral spacing decreases and longitudinal spacing increases within the same domain, namely the effective turbine layout is to deploy more turbines in the first row to extract energy from undisturbed tidal stream, while larger longitudinal spacing will make it possible for tidal stream to recover more before reaching the next turbines row. Taking the tidal stream turbines array around Zhoushan Islands as a case study, results show that the optimized layout can extract 106.8% energy of that extracted by the regular and staggered layout for a full tide in the same marine area. Additionally, the turbine array has a great influence on tidal stream velocities immediately behind the array and has little effect on far-field wake flow.