photo_ray_macro_weight Function

public pure function photo_ray_macro_weight(inject_face, pos_low, pos_high, ray_direction, emit_current_density_a_m2, q_particle, batch_duration, total_rays) result(w_hit)

1 本の光線で放出されるマクロ粒子の重み(全 rank 合計 total_rays 本で放出電流を分担する)。

Arguments

Type IntentOptional Attributes Name
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) :: ray_direction(3)
real(kind=dp), intent(in) :: emit_current_density_a_m2
real(kind=dp), intent(in) :: q_particle
real(kind=dp), intent(in) :: batch_duration
integer(kind=i32), intent(in) :: total_rays

Return Value real(kind=dp)


Calls

proc~~photo_ray_macro_weight~~CallsGraph proc~photo_ray_macro_weight photo_ray_macro_weight proc~compute_face_area_from_bounds compute_face_area_from_bounds proc~photo_ray_macro_weight->proc~compute_face_area_from_bounds proc~resolve_face_axes resolve_face_axes proc~photo_ray_macro_weight->proc~resolve_face_axes proc~compute_face_area_from_bounds->proc~resolve_face_axes

Source Code

  pure real(dp) function photo_ray_macro_weight( &
    inject_face, pos_low, pos_high, ray_direction, emit_current_density_a_m2, q_particle, batch_duration, total_rays &
    ) result(w_hit)
    character(len=*), intent(in) :: inject_face
    real(dp), intent(in) :: pos_low(3), pos_high(3), ray_direction(3), emit_current_density_a_m2, q_particle
    real(dp), intent(in) :: batch_duration
    integer(i32), intent(in) :: total_rays
    real(dp) :: launch_dir(3), inward_dot, launch_area, projected_area
    integer :: axis_n, axis_t1, axis_t2

    call resolve_face_axes(inject_face, axis_t1, axis_t2)
    axis_n = 6 - axis_t1 - axis_t2
    launch_dir = ray_direction/sqrt(sum(ray_direction*ray_direction))
    inward_dot = launch_dir(axis_n)
    launch_area = compute_face_area_from_bounds(inject_face, pos_low, pos_high)
    projected_area = launch_area*abs(inward_dot)
    w_hit = emit_current_density_a_m2*projected_area*batch_duration/(abs(q_particle)*real(max(1_i32, total_rays), dp))
  end function photo_ray_macro_weight