Development of a tidal flow model for optimisation of tidal turbine arrays