spx_external_force Module

External forces
外力:1. 重力;2. 边界排斥力。



Contents


Variables

Type Visibility Attributes Name Initial
type(external_force_type), public :: exf_obj
integer, private, parameter :: p1 = 12

p1, p2 are used to calculate the boundary repulsion
p1, p2 用来计算边界排斥力

integer, private, parameter :: p2 = 4

p1, p2 are used to calculate the boundary repulsion
p1, p2 用来计算边界排斥力


Abstract Interfaces

abstract interface

  • private subroutine external_force_fcn(self, particle, pairs, acc, n)

    Solve the external force
    外力求解,涉及重力和边界力

    Arguments

    Type IntentOptional Attributes Name
    class(external_force_type), intent(inout) :: self
    type(particle_type), intent(in) :: particle

    particle
    区域

    type(nnps_pairs_type), intent(in) :: pairs

    Pairs
    粒子对

    real(kind=rk), intent(inout) :: acc(:,:)

    Acceleration
    加速度

    integer, intent(in) :: n

    实粒子数, nreal


Derived Types

type, private ::  external_force_type

外力求解

Components

Type Visibility Attributes Name Initial
procedure(external_force_fcn), public, pointer :: run
real(kind=rk), public :: r0

排斥力半径

real(kind=rk), public :: dd

速度最大值的平方量级

Type-Bound Procedures

procedure , public , :: init Subroutine

Subroutines

private subroutine init(self)

初始化

Arguments

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

private subroutine external_force_with_gravity(self, particle, pairs, acc, n)

含重力、排斥力的外力求解

Arguments

Type IntentOptional Attributes Name
class(external_force_type), intent(inout) :: self
type(particle_type), intent(in) :: particle

区域

type(nnps_pairs_type), intent(in) :: pairs

粒子对

real(kind=rk), intent(inout) :: acc(:,:)

加速度

integer, intent(in) :: n

实粒子数

private pure subroutine external_force_without_gravity(self, particle, pairs, acc, n)

排斥力的外力求解 (无重力)

Arguments

Type IntentOptional Attributes Name
class(external_force_type), intent(inout) :: self
type(particle_type), intent(in) :: particle

区域

type(nnps_pairs_type), intent(in) :: pairs

粒子对

real(kind=rk), intent(inout) :: acc(:,:)

加速度

integer, intent(in) :: n

实粒子数