A global procedure for flow and heat transfer simulation with complex obstacles on curvilinear grids