compute_macro_particles_for_batch Subroutine

public subroutine compute_macro_particles_for_batch(number_density_m3, temperature_k, m_particle, drift_velocity, box_min, box_max, inject_face, pos_low, pos_high, batch_duration, w_particle, residual, n_macro, vmin_normal)

物理流量・重み・残差から今バッチのマクロ粒子数を決める。

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: number_density_m3

粒子数密度 [1/m^3]。

real(kind=dp), intent(in) :: temperature_k

温度 [K]。

real(kind=dp), intent(in) :: m_particle

粒子1個あたりの質量 [kg]。

real(kind=dp), intent(in) :: drift_velocity(3)
real(kind=dp), intent(in) :: box_min(3)
real(kind=dp), intent(in) :: box_max(3)
character(len=*), intent(in) :: inject_face

注入面識別子(x_low/x_high/y_low/y_high/z_low/z_high)。

real(kind=dp), intent(in) :: pos_low(3)
real(kind=dp), intent(in) :: pos_high(3)
real(kind=dp), intent(in) :: batch_duration

1バッチの物理時間長 [s]。

real(kind=dp), intent(in) :: w_particle

マクロ粒子重み。

real(kind=dp), intent(inout) :: residual

前バッチから繰り越すマクロ粒子端数(呼び出し後に更新)。

integer(kind=i32), intent(out) :: n_macro

今バッチで生成するマクロ粒子数。

real(kind=dp), intent(in), optional :: vmin_normal

法線速度の下限 [m/s](省略時は 0)。


Calls

proc~~compute_macro_particles_for_batch~~CallsGraph proc~compute_macro_particles_for_batch compute_macro_particles_for_batch proc~compute_face_area_from_bounds compute_face_area_from_bounds proc~compute_macro_particles_for_batch->proc~compute_face_area_from_bounds proc~compute_inflow_flux_from_drifting_maxwellian compute_inflow_flux_from_drifting_maxwellian proc~compute_macro_particles_for_batch->proc~compute_inflow_flux_from_drifting_maxwellian proc~resolve_face_geometry resolve_face_geometry proc~compute_macro_particles_for_batch->proc~resolve_face_geometry proc~resolve_face_axes resolve_face_axes proc~compute_face_area_from_bounds->proc~resolve_face_axes

Called by

proc~~compute_macro_particles_for_batch~~CalledByGraph proc~compute_macro_particles_for_batch compute_macro_particles_for_batch proc~compute_macro_particles_for_species compute_macro_particles_for_species proc~compute_macro_particles_for_species->proc~compute_macro_particles_for_batch

Source Code

  subroutine compute_macro_particles_for_batch( &
    number_density_m3, temperature_k, m_particle, drift_velocity, box_min, box_max, inject_face, pos_low, pos_high, &
    batch_duration, w_particle, residual, n_macro, vmin_normal &
    )
    real(dp), intent(in) :: number_density_m3
    real(dp), intent(in) :: temperature_k
    real(dp), intent(in) :: m_particle
    real(dp), intent(in) :: drift_velocity(3)
    real(dp), intent(in) :: box_min(3), box_max(3)
    character(len=*), intent(in) :: inject_face
    real(dp), intent(in) :: pos_low(3), pos_high(3)
    real(dp), intent(in) :: batch_duration
    real(dp), intent(in) :: w_particle
    real(dp), intent(inout) :: residual
    integer(i32), intent(out) :: n_macro
    real(dp), intent(in), optional :: vmin_normal

    real(dp) :: inward_normal(3), gamma_in

    if (w_particle <= 0.0_dp) error stop "macro-particle weight must be > 0"

    call resolve_face_geometry(box_min, box_max, inject_face, inward_normal=inward_normal)
    gamma_in = compute_inflow_flux_from_drifting_maxwellian( &
               number_density_m3, temperature_k, m_particle, drift_velocity, inward_normal, vmin_normal=vmin_normal &
               )
    call carry_macro_particle_budget( &
      gamma_in, compute_face_area_from_bounds(inject_face, pos_low, pos_high), batch_duration, w_particle, residual, &
      n_macro &
      )
  end subroutine compute_macro_particles_for_batch