The invention belongs to the field of particle distribution optimization, and particularly relates to an SPH particle distribution optimization method based on gradient particle migration, which comprises the following steps: carrying out WCSPH calculation, initializing a fluid domain and a
rigid body motion boundary in a WCSPH
solver, defining a center coordinate according to the structural characteristics of a solved object, delimiting a migration region based on the center coordinate, and carrying out gradient particle migration. Traversing particles in the marked area after the calculation step is finished, and updating the center coordinates in real time when the solving object moves; calculating the
Euclidean distance from the marked particles to the boundary of the migration region, calculating a migration
volume correction coefficient, and calculating a synthetic migration vector by combining the position vector of the marked particles; and updating the position of the marked particle according to the synthesized migration vector, and updating a
density field to complete particle migration. The
simulation feasibility of
engineering problems such as the actual ship inflow surge effect is remarkably improved, and the method has outstanding industrial application value.