float_object_type Derived Type

type, public :: float_object_type

浮体刚体粒子集数据结构


Contents

Source Code


Components

Type Visibility Attributes Name Initial
integer, public :: istart

浮体粒子集的索引

integer, public :: iend

浮体粒子集的索引

real(kind=rk), public :: mass(2)

浮体质量、转动惯量Izz

real(kind=rk), public :: loc(2)

浮体质心

real(kind=rk), public :: vel(2)

浮体速度

real(kind=rk), public :: acc(2)

浮体加速度

real(kind=rk), public :: ang_vel

浮体角速度

real(kind=rk), public :: ang_acc

浮体角加速度


Type-Bound Procedures

procedure, public, :: update_particle_step

  • private pure subroutine update_particle_step(self, particles, dt)

    更新粒子, 速度比位移、加速度快半步长

    Arguments

    Type IntentOptional Attributes Name
    class(float_object_type), intent(inout) :: self

    浮体粒子集

    type(particle_type), intent(inout) :: particles

    区域

    real(kind=rk), intent(in) :: dt

    时间步长

procedure, public, :: update_particle_init

  • private pure subroutine update_particle_init(self, particles, dt)

    初始化leapfrog算法,基于加速度,推进速度半步长

    Arguments

    Type IntentOptional Attributes Name
    class(float_object_type), intent(inout) :: self

    浮体粒子集

    type(particle_type), intent(inout) :: particles

    区域

    real(kind=rk), intent(in) :: dt

    时间步长

procedure, public, :: get_acc

  • private pure subroutine get_acc(self, particles)

    获取浮体受力,更新浮体的加速度

    Arguments

    Type IntentOptional Attributes Name
    class(float_object_type), intent(inout) :: self

    浮体粒子集

    type(particle_type), intent(in) :: particles

    区域

procedure, public, :: init

  • private pure subroutine init(self, particle, istart, iend)

    初始化浮体的质量、质心、转动惯量、速度、角速度

    Arguments

    Type IntentOptional Attributes Name
    class(float_object_type), intent(inout) :: self

    浮体粒子集

    type(particle_type), intent(in) :: particle

    区域

    integer, intent(in) :: istart

    浮体粒子集的索引

    integer, intent(in) :: iend

    浮体粒子集的索引

Source Code

    type float_object_type
        integer :: istart, iend !! 浮体粒子集的索引
        real(rk) :: mass(2)     !! 浮体质量、转动惯量Izz
        real(rk) :: loc(2)      !! 浮体质心
        real(rk) :: vel(2)      !! 浮体速度
        real(rk) :: acc(2)      !! 浮体加速度
        real(rk) :: ang_vel     !! 浮体角速度
        real(rk) :: ang_acc     !! 浮体角加速度
    contains
        procedure :: init, get_acc, update_particle_init, update_particle_step
    end type float_object_type