Application of the Galerkin method to the formulation of a three-dimensional nonlinear hydrodynamic numerical sea model