compute_macro_particles_from_flux Subroutine

public subroutine compute_macro_particles_from_flux(particle_flux_m2_s, inject_face, pos_low, pos_high, batch_duration, w_particle, residual, n_macro)

指定済み粒子 flux・重み・残差から今バッチのマクロ粒子数を決める。

Arguments

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

粒子数 flux [1/m^2/s]。

character(len=*), intent(in) :: inject_face

注入面識別子。

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

1バッチの物理時間長 [s]。 マクロ粒子重み。

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

前バッチから繰り越すマクロ粒子端数。

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

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


Calls

proc~~compute_macro_particles_from_flux~~CallsGraph proc~compute_macro_particles_from_flux compute_macro_particles_from_flux proc~compute_face_area_from_bounds compute_face_area_from_bounds proc~compute_macro_particles_from_flux->proc~compute_face_area_from_bounds proc~resolve_face_axes resolve_face_axes proc~compute_face_area_from_bounds->proc~resolve_face_axes

Called by

proc~~compute_macro_particles_from_flux~~CalledByGraph proc~compute_macro_particles_from_flux compute_macro_particles_from_flux proc~compute_macro_particles_for_species compute_macro_particles_for_species proc~compute_macro_particles_for_species->proc~compute_macro_particles_from_flux

Source Code

  subroutine compute_macro_particles_from_flux( &
    particle_flux_m2_s, inject_face, pos_low, pos_high, batch_duration, w_particle, residual, n_macro &
    )
    real(dp), intent(in) :: particle_flux_m2_s
    character(len=*), intent(in) :: inject_face
    real(dp), intent(in) :: pos_low(3), pos_high(3)
    real(dp), intent(in) :: batch_duration, w_particle
    real(dp), intent(inout) :: residual
    integer(i32), intent(out) :: n_macro

    if (.not. ieee_is_finite(particle_flux_m2_s) .or. particle_flux_m2_s < 0.0_dp) then
      error stop "particle_flux_m2_s must be finite and >= 0"
    end if
    if (w_particle <= 0.0_dp) error stop "macro-particle weight must be > 0"

    call carry_macro_particle_budget( &
      particle_flux_m2_s, compute_face_area_from_bounds(inject_face, pos_low, pos_high), batch_duration, w_particle, &
      residual, n_macro &
      )
  end subroutine compute_macro_particles_from_flux