更新粒子, 速度比位移、加速度快半步长
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(float_object_type), | intent(inout) | :: | self |
浮体粒子集 |
||
| type(particle_type), | intent(inout) | :: | particles |
区域 |
||
| real(kind=rk), | intent(in) | :: | dt |
时间步长 |
pure subroutine update_particle_step(self, particles, dt)
class(float_object_type), intent(inout) :: self !! 浮体粒子集
type(particle_type), intent(inout) :: particles !! 区域
real(rk), intent(in) :: dt !! 时间步长
integer :: i
! 浮体表面光滑,加速度由位移决定
self%vel = self%vel + self%acc*dt
self%ang_vel = self%ang_vel + self%ang_acc*dt
! 更新粒子
do i = self%istart, self%iend
particles%vel(:, i) = self%vel(:) + cross_product_local2( &
self%ang_vel, &
particles%loc(:, i) - self%loc(:))
particles%loc(:, i) = particles%loc(:, i) + particles%vel(:, i)*dt
end do
self%loc = self%loc + self%vel*dt
end subroutine update_particle_step