指定済み粒子 flux・重み・残差から今バッチのマクロ粒子数を決める。
| Type | Intent | Optional | 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 |
今バッチで生成するマクロ粒子数。 |
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