bem_injection_flux Module

Maxwell reservoirの流束、macro粒子数、面速度sampling。


Uses

  • module~~bem_injection_flux~~UsesGraph module~bem_injection_flux bem_injection_flux ieee_arithmetic ieee_arithmetic module~bem_injection_flux->ieee_arithmetic module~bem_constants bem_constants module~bem_injection_flux->module~bem_constants module~bem_counter_rng bem_counter_rng module~bem_injection_flux->module~bem_counter_rng module~bem_injection_geometry bem_injection_geometry module~bem_injection_flux->module~bem_injection_geometry module~bem_injection_random bem_injection_random module~bem_injection_flux->module~bem_injection_random module~bem_kinds bem_kinds module~bem_injection_flux->module~bem_kinds module~bem_constants->module~bem_kinds module~bem_counter_rng->module~bem_kinds iso_c_binding iso_c_binding module~bem_counter_rng->iso_c_binding m_pcg64_bind m_pcg64_bind module~bem_counter_rng->m_pcg64_bind module~bem_injection_geometry->module~bem_kinds module~bem_string_utils bem_string_utils module~bem_injection_geometry->module~bem_string_utils module~bem_injection_random->module~bem_constants module~bem_injection_random->module~bem_counter_rng module~bem_injection_random->module~bem_kinds module~bem_random_stream bem_random_stream module~bem_injection_random->module~bem_random_stream iso_fortran_env iso_fortran_env module~bem_kinds->iso_fortran_env module~bem_random_stream->module~bem_counter_rng module~bem_random_stream->module~bem_kinds module~bem_random_stream->iso_c_binding module~bem_random_stream->m_pcg64_bind

Used by

  • module~~bem_injection_flux~~UsedByGraph module~bem_injection_flux bem_injection_flux module~bem_app_config_parser bem_app_config_parser module~bem_app_config_parser->module~bem_injection_flux module~bem_injection bem_injection module~bem_injection->module~bem_injection_flux module~bem_photoelectron_injection bem_photoelectron_injection module~bem_injection->module~bem_photoelectron_injection module~bem_photoelectron_injection->module~bem_injection_flux module~bem_app_config bem_app_config module~bem_app_config->module~bem_app_config_parser module~bem_app_config_runtime bem_app_config_runtime module~bem_app_config->module~bem_app_config_runtime module~bem_app_config_parser_finalize bem_app_config_parser_finalize module~bem_app_config_parser_finalize->module~bem_app_config_parser module~bem_app_config_parser_preflight_particles bem_app_config_parser_preflight_particles module~bem_app_config_parser_preflight_particles->module~bem_app_config_parser module~bem_app_config_parser_preflight_sim bem_app_config_parser_preflight_sim module~bem_app_config_parser_preflight_sim->module~bem_app_config_parser module~bem_app_config_parser_preflight_surface bem_app_config_parser_preflight_surface module~bem_app_config_parser_preflight_surface->module~bem_app_config_parser module~bem_app_config_parser_read_mesh bem_app_config_parser_read_mesh module~bem_app_config_parser_read_mesh->module~bem_app_config_parser module~bem_app_config_parser_read_particles bem_app_config_parser_read_particles module~bem_app_config_parser_read_particles->module~bem_app_config_parser module~bem_app_config_parser_read_sim bem_app_config_parser_read_sim module~bem_app_config_parser_read_sim->module~bem_app_config_parser module~bem_app_config_parser_read_surface bem_app_config_parser_read_surface module~bem_app_config_parser_read_surface->module~bem_app_config_parser module~bem_app_config_parser_validate bem_app_config_parser_validate module~bem_app_config_parser_validate->module~bem_app_config_parser module~bem_app_config_particle_runtime bem_app_config_particle_runtime module~bem_app_config_particle_runtime->module~bem_injection module~bem_app_config_particle_runtime_slots bem_app_config_particle_runtime_slots module~bem_app_config_particle_runtime_slots->module~bem_injection module~bem_app_config_particle_runtime_slots->module~bem_app_config_particle_runtime module~bem_simulator_particles bem_simulator_particles module~bem_simulator_particles->module~bem_photoelectron_injection module~bem_simulator bem_simulator module~bem_simulator_particles->module~bem_simulator module~bem_app_config_particle_runtime_batch bem_app_config_particle_runtime_batch module~bem_app_config_particle_runtime_batch->module~bem_app_config_particle_runtime module~bem_app_config_particle_runtime_sampling bem_app_config_particle_runtime_sampling module~bem_app_config_particle_runtime_sampling->module~bem_app_config_particle_runtime module~bem_app_config_runtime->module~bem_app_config_particle_runtime module~bem_simulator->module~bem_app_config module~bem_simulator->module~bem_app_config_runtime module~bem_zhao_outflow_refresh bem_zhao_outflow_refresh module~bem_zhao_outflow_refresh->module~bem_app_config program~main main program~main->module~bem_app_config program~main->module~bem_simulator module~bem_simulator_charge bem_simulator_charge module~bem_simulator_charge->module~bem_simulator module~bem_simulator_io bem_simulator_io module~bem_simulator_io->module~bem_app_config_runtime module~bem_simulator_io->module~bem_simulator module~bem_simulator_loop bem_simulator_loop module~bem_simulator_loop->module~bem_app_config_runtime module~bem_simulator_loop->module~bem_simulator module~bem_simulator_loop->module~bem_zhao_outflow_refresh module~bem_simulator_stats bem_simulator_stats module~bem_simulator_stats->module~bem_simulator

Functions

public pure function compute_inflow_flux_from_drifting_maxwellian(number_density_m3, temperature_k, m_particle, drift_velocity, inward_normal, vmin_normal) result(gamma_in)

drifting Maxwellian の片側流入束 [#/m^2/s] を返す。

Arguments

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

粒子数密度 [1/m^3]。

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

温度 [K]。

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

粒子1個あたりの質量 [kg]。

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

法線速度の下限 [m/s](省略時は 0)。

Return Value real(kind=dp)


Subroutines

public subroutine compute_macro_particles_for_batch(number_density_m3, temperature_k, m_particle, drift_velocity, box_min, box_max, inject_face, pos_low, pos_high, batch_duration, w_particle, residual, n_macro, vmin_normal)

物理流量・重み・残差から今バッチのマクロ粒子数を決める。

Arguments

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

粒子数密度 [1/m^3]。

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

温度 [K]。

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

粒子1個あたりの質量 [kg]。

real(kind=dp), intent(in) :: drift_velocity(3)
real(kind=dp), intent(in) :: box_min(3)
real(kind=dp), intent(in) :: box_max(3)
character(len=*), intent(in) :: inject_face

注入面識別子(x_low/x_high/y_low/y_high/z_low/z_high)。

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

マクロ粒子重み。

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

前バッチから繰り越すマクロ粒子端数(呼び出し後に更新)。

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

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

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

法線速度の下限 [m/s](省略時は 0)。

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

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

public subroutine sample_reservoir_face_particle_counter(box_min, box_max, inject_face, pos_low, pos_high, drift_velocity, m_particle, temperature_k, barrier_normal_energy, vmin_normal, rng_seed, rng_counter, x, v)

上流リザーバ境界から流入する粒子を 1 つ、counter-based 乱数で面注入としてサンプルする。 同じ (seed, counter) は常に同じ粒子を返すので、どの rank・thread が生成しても結果は同じ。 速度の法線成分は flux-weighted に draw 1、面内位置は draw 2, 3、熱速度は draw 100 以降を使う。

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: box_min(3)
real(kind=dp), intent(in) :: box_max(3)
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) :: drift_velocity(3)
real(kind=dp), intent(in) :: m_particle
real(kind=dp), intent(in) :: temperature_k
real(kind=dp), intent(in) :: barrier_normal_energy

法線エネルギー障壁 2 q Δφ / m [m^2/s^2](0 なら無し)。

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

法線エネルギー障壁 2 q Δφ / m [m^2/s^2](0 なら無し)。 無限遠法線速度の下限 [m/s]。

integer(kind=i32), intent(in) :: rng_seed
integer(kind=i64), intent(in) :: rng_counter(:)
real(kind=dp), intent(out) :: x(3)
real(kind=dp), intent(out) :: v(3)

public subroutine sample_flux_weighted_normal_component(mu, sigma, vn, vmin_normal, sigma_cutoff, uniform)

flux-weighted half-range 正規分布から法線速度をサンプルする。

Arguments

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

法線速度分布の平均ドリフト成分 [m/s]。

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

法線速度分布の平均ドリフト成分 [m/s]。 法線速度分布の標準偏差 [m/s]。

real(kind=dp), intent(out) :: vn(:)
real(kind=dp), intent(in), optional :: vmin_normal

法線速度の下限 [m/s](省略時は 0)。

real(kind=dp), intent(in), optional :: sigma_cutoff
real(kind=dp), intent(in) :: uniform(:)