A width-averaged hydrodynamic model of two-layer tidal circulation