获取浮体受力,更新浮体的加速度
指向文档公式
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(float_object_type), | intent(inout) | :: | self |
浮体粒子集 |
||
| type(particle_type), | intent(in) | :: | particles |
区域 |
pure subroutine get_acc(self, particles)
class(float_object_type), intent(inout) :: self !! 浮体粒子集
type(particle_type), intent(in) :: particles !! 区域
real(rk) :: force(2), torque
integer :: i
force = 0.0_rk
torque = 0.0_rk
do i = self%istart, self%iend
force = force + particles%acc(:, i)*particles%mass(i)
torque = torque + cross_product_local(particles%loc(:, i) - self%loc(:), &
particles%acc(:, i)*particles%mass(i))
end do
self%acc = force/self%mass(1)
self%ang_acc = torque/self%mass(2)
end subroutine get_acc