The problem on the behavior of a solitary wave passing over different types of underwater barriers is considered. The problem has been solved numerically using the method of the correction of flows. The parameters of the method of solution have been selected. The results are compared with the Korteweg–de Vries theory. The interaction of two solitary waves is simulated and it is shown that they possess the properties of solitons. After the interaction, their shape and velocity remain constant; it is only the phase that undergoes a change. The case of disintegration of the initial perturbation in a cylindrically symmetric problem is considered.