resolve_reservoir_target_weight Subroutine

public subroutine resolve_reservoir_target_weight(sim, spec, number_density_m3, vmin_normal, temperature_k, drift_velocity, target_macro_particles_per_batch, w_particle)

reservoir_face の target 個数からシース補正込み重みを解決する。

Arguments

Type IntentOptional Attributes Name
type(sim_config), intent(in) :: sim

シミュレーション設定。

type(particle_species_spec), intent(in) :: spec

reservoir_face 粒子種設定。

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

実効数密度 [1/m^3]。

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

実効数密度 [1/m^3]。 法線速度の下限 [m/s]。

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

実効数密度 [1/m^3]。 法線速度の下限 [m/s]。 実効温度 [K]。

real(kind=dp), intent(in) :: drift_velocity(3)

実効数密度 [1/m^3]。 法線速度の下限 [m/s]。 実効温度 [K]。

integer(kind=i32), intent(in) :: target_macro_particles_per_batch

目標マクロ粒子数。

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

解決したマクロ粒子重み。


Calls

proc~~resolve_reservoir_target_weight~~CallsGraph proc~resolve_reservoir_target_weight resolve_reservoir_target_weight proc~compute_face_area_from_bounds compute_face_area_from_bounds proc~resolve_reservoir_target_weight->proc~compute_face_area_from_bounds proc~compute_inflow_flux_from_drifting_maxwellian compute_inflow_flux_from_drifting_maxwellian proc~resolve_reservoir_target_weight->proc~compute_inflow_flux_from_drifting_maxwellian proc~resolve_inward_normal resolve_inward_normal proc~resolve_reservoir_target_weight->proc~resolve_inward_normal proc~lower_ascii lower_ascii proc~resolve_inward_normal->proc~lower_ascii

Called by

proc~~resolve_reservoir_target_weight~~CalledByGraph proc~resolve_reservoir_target_weight resolve_reservoir_target_weight proc~init_particle_batch_from_config init_particle_batch_from_config proc~init_particle_batch_from_config->proc~resolve_reservoir_target_weight

Source Code

  subroutine resolve_reservoir_target_weight( &
    sim, spec, number_density_m3, vmin_normal, temperature_k, drift_velocity, target_macro_particles_per_batch, w_particle &
    )
    type(sim_config), intent(in) :: sim
    type(particle_species_spec), intent(in) :: spec
    real(dp), intent(in) :: number_density_m3, vmin_normal, temperature_k, drift_velocity(3)
    integer(i32), intent(in) :: target_macro_particles_per_batch
    real(dp), intent(out) :: w_particle

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

    if (target_macro_particles_per_batch <= 0_i32) then
      error stop 'resolve_reservoir_target_weight requires target_macro_particles_per_batch > 0.'
    end if
    call resolve_inward_normal(spec%inject_face, inward_normal)
    gamma_in = compute_inflow_flux_from_drifting_maxwellian( &
               number_density_m3, temperature_k, spec%m_particle, drift_velocity, inward_normal, &
               vmin_normal=vmin_normal &
               )
    area = compute_face_area_from_bounds(spec%inject_face, spec%pos_low, spec%pos_high)
    w_particle = gamma_in*area*sim%batch_duration/real(target_macro_particles_per_batch, dp)
    if (.not. ieee_is_finite(w_particle) .or. w_particle <= 0.0d0) then
      error stop 'sheath-adjusted target_macro_particles_per_batch produced invalid w_particle.'
    end if
  end subroutine resolve_reservoir_target_weight