photo_escape_weight_factor Function

public function photo_escape_weight_factor(mesh, sim, spec, elem_idx) result(factor)

放出元要素の局所障壁からPE escape重み係数を返す。

Arguments

Type IntentOptional Attributes Name
type(mesh_type), intent(in) :: mesh
type(sim_config), intent(in) :: sim
type(particle_species_spec), intent(in) :: spec
integer(kind=i32), intent(in) :: elem_idx

Return Value real(kind=dp)


Calls

proc~~photo_escape_weight_factor~~CallsGraph proc~photo_escape_weight_factor photo_escape_weight_factor proc~element_potential_without_self element_potential_without_self proc~photo_escape_weight_factor->proc~element_potential_without_self proc~lower_ascii lower_ascii proc~photo_escape_weight_factor->proc~lower_ascii proc~species_temperature_k species_temperature_k proc~photo_escape_weight_factor->proc~species_temperature_k

Called by

proc~~photo_escape_weight_factor~~CalledByGraph proc~photo_escape_weight_factor photo_escape_weight_factor proc~init_particle_batch_from_config init_particle_batch_from_config proc~init_particle_batch_from_config->proc~photo_escape_weight_factor

Source Code

  real(dp) function photo_escape_weight_factor(mesh, sim, spec, elem_idx) result(factor)
    type(mesh_type), intent(in) :: mesh
    type(sim_config), intent(in) :: sim
    type(particle_species_spec), intent(in) :: spec
    integer(i32), intent(in) :: elem_idx

    real(dp) :: barrier_v, thermal_energy_j, arg

    select case (trim(lower_ascii(spec%photo_escape_model)))
    case ('none')
      factor = 1.0d0
      return
    case ('boltzmann_cutoff')
      barrier_v = max(element_potential_without_self(mesh, elem_idx, sim%softening) - sim%phi_infty, 0.0d0)
      if (barrier_v <= 0.0d0) then
        factor = 1.0d0
        return
      end if
      thermal_energy_j = k_boltzmann*species_temperature_k(spec)
      if (thermal_energy_j <= 0.0d0) then
        factor = 0.0d0
        return
      end if
      arg = abs(spec%q_particle)*barrier_v/thermal_energy_j
      if (.not. ieee_is_finite(arg)) then
        error stop 'photo_escape_model produced a non-finite Boltzmann argument.'
      end if
      if (arg >= 700.0d0) then
        factor = 0.0d0
      else
        factor = exp(-arg)
      end if
    case default
      error stop 'Unknown photo_escape_model in runtime.'
    end select
  end function photo_escape_weight_factor