Comparison between a non-hydrostatic numerical model and analytic theory for the two-layer exchange flows