bem_app_config_types Module

アプリ設定の型定義と、設定由来の粒子数計算をまとめるモジュール。


Uses

  • module~~bem_app_config_types~~UsesGraph module~bem_app_config_types bem_app_config_types module~bem_external_boundary_contract bem_external_boundary_contract module~bem_app_config_types->module~bem_external_boundary_contract module~bem_filesystem bem_filesystem module~bem_app_config_types->module~bem_filesystem module~bem_kinds bem_kinds module~bem_app_config_types->module~bem_kinds module~bem_physics_config_types bem_physics_config_types module~bem_app_config_types->module~bem_physics_config_types module~bem_types bem_types module~bem_app_config_types->module~bem_types module~bem_external_boundary_contract->module~bem_kinds module~bem_string_utils bem_string_utils module~bem_external_boundary_contract->module~bem_string_utils iso_c_binding iso_c_binding module~bem_filesystem->iso_c_binding iso_fortran_env iso_fortran_env module~bem_kinds->iso_fortran_env module~bem_physics_config_types->module~bem_kinds module~bem_physics_config_types->module~bem_types ieee_arithmetic ieee_arithmetic module~bem_physics_config_types->ieee_arithmetic module~bem_physics_config_types->module~bem_string_utils module~bem_types->module~bem_kinds module~bem_outflow_spectrum bem_outflow_spectrum module~bem_types->module~bem_outflow_spectrum module~bem_outflow_spectrum->module~bem_kinds sheath_model sheath_model module~bem_outflow_spectrum->sheath_model

Used by

  • module~~bem_app_config_types~~UsedByGraph module~bem_app_config_types bem_app_config_types module~bem_app_config bem_app_config module~bem_app_config->module~bem_app_config_types module~bem_app_config_parser bem_app_config_parser 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_authoring bem_app_config_authoring module~bem_app_config_authoring->module~bem_app_config_types module~bem_app_config_authoring_types bem_app_config_authoring_types module~bem_app_config_authoring->module~bem_app_config_authoring_types module~bem_app_config_authoring_types->module~bem_app_config_types module~bem_app_config_mesh_runtime bem_app_config_mesh_runtime module~bem_app_config_mesh_runtime->module~bem_app_config_types module~bem_app_config_parser->module~bem_app_config_types module~bem_app_config_parser->module~bem_app_config_authoring module~bem_config_toml bem_config_toml module~bem_app_config_parser->module~bem_config_toml module~bem_config_layout bem_config_layout module~bem_app_config_parser->module~bem_config_layout module~bem_app_config_parser_preflight_particles bem_app_config_parser_preflight_particles module~bem_app_config_parser_preflight_particles->module~bem_app_config_types module~bem_app_config_parser_preflight_particles->module~bem_app_config_parser module~bem_config_helpers bem_config_helpers module~bem_app_config_parser_preflight_particles->module~bem_config_helpers module~bem_app_config_parser_preflight_surface bem_app_config_parser_preflight_surface module~bem_app_config_parser_preflight_surface->module~bem_app_config_types module~bem_app_config_parser_preflight_surface->module~bem_app_config_parser module~bem_app_config_parser_preflight_surface->module~bem_config_helpers module~bem_app_config_particle_runtime bem_app_config_particle_runtime module~bem_app_config_particle_runtime->module~bem_app_config_types module~bem_app_config_potential_runtime bem_app_config_potential_runtime module~bem_app_config_particle_runtime->module~bem_app_config_potential_runtime module~bem_app_config_particle_runtime->module~bem_config_helpers module~bem_app_config_potential_runtime->module~bem_app_config_types module~bem_app_config_potential_runtime->module~bem_config_helpers module~bem_irradiation_cell_contract bem_irradiation_cell_contract module~bem_app_config_potential_runtime->module~bem_irradiation_cell_contract module~bem_config_helpers->module~bem_app_config_types module~bem_config_toml->module~bem_app_config_types module~bem_irradiation_cell_contract->module~bem_app_config_types module~bem_output_writer bem_output_writer module~bem_output_writer->module~bem_app_config_types module~bem_surface_current_model bem_surface_current_model module~bem_output_writer->module~bem_surface_current_model module~bem_periodic_checkpoint bem_periodic_checkpoint module~bem_periodic_checkpoint->module~bem_app_config_types module~bem_periodic_checkpoint->module~bem_output_writer module~bem_restart bem_restart module~bem_periodic_checkpoint->module~bem_restart module~bem_restart->module~bem_app_config_types module~bem_run_outputs bem_run_outputs module~bem_run_outputs->module~bem_app_config_types module~bem_run_outputs->module~bem_output_writer module~bem_run_outputs->module~bem_periodic_checkpoint module~bem_surface_current_model->module~bem_app_config_types module~bem_surface_current_model->module~bem_config_helpers module~bem_surface_current_model->module~bem_irradiation_cell_contract module~bem_app_config_authoring_domain bem_app_config_authoring_domain module~bem_app_config_authoring_domain->module~bem_app_config_authoring module~bem_app_config_authoring_geometry bem_app_config_authoring_geometry module~bem_app_config_authoring_geometry->module~bem_app_config_authoring module~bem_app_config_authoring_sources bem_app_config_authoring_sources module~bem_app_config_authoring_sources->module~bem_app_config_authoring 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_sim bem_app_config_parser_preflight_sim module~bem_app_config_parser_preflight_sim->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_parser_validate->module~bem_config_helpers 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_particle_runtime_slots bem_app_config_particle_runtime_slots module~bem_app_config_particle_runtime_slots->module~bem_app_config_particle_runtime module~bem_app_config_runtime->module~bem_app_config_mesh_runtime module~bem_app_config_runtime->module~bem_app_config_particle_runtime module~bem_app_config_runtime->module~bem_app_config_potential_runtime module~bem_config_layout->module~bem_config_toml module~bem_output_writer_files bem_output_writer_files module~bem_output_writer_files->module~bem_output_writer module~bem_output_writer_history bem_output_writer_history module~bem_output_writer_history->module~bem_output_writer module~bem_output_writer_summary bem_output_writer_summary module~bem_output_writer_summary->module~bem_irradiation_cell_contract module~bem_output_writer_summary->module~bem_output_writer module~bem_output_writer_summary->module~bem_surface_current_model module~bem_particle_stepper bem_particle_stepper module~bem_particle_stepper->module~bem_irradiation_cell_contract module~bem_restart_contract bem_restart_contract module~bem_restart_contract->module~bem_restart module~bem_restart_injection bem_restart_injection module~bem_restart_injection->module~bem_restart module~bem_restart_records bem_restart_records module~bem_restart_records->module~bem_restart module~bem_simulator bem_simulator module~bem_simulator->module~bem_app_config module~bem_simulator->module~bem_config_helpers module~bem_simulator->module~bem_irradiation_cell_contract module~bem_simulator->module~bem_output_writer module~bem_simulator->module~bem_run_outputs module~bem_simulator->module~bem_surface_current_model module~bem_simulator->module~bem_app_config_runtime module~bem_simulator->module~bem_particle_stepper module~bem_simulator_io bem_simulator_io module~bem_simulator_io->module~bem_output_writer 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_output_writer module~bem_simulator_loop->module~bem_periodic_checkpoint module~bem_simulator_loop->module~bem_run_outputs module~bem_simulator_loop->module~bem_app_config_runtime module~bem_simulator_loop->module~bem_simulator module~bem_zhao_outflow_refresh bem_zhao_outflow_refresh module~bem_simulator_loop->module~bem_zhao_outflow_refresh module~bem_simulator_particles bem_simulator_particles module~bem_simulator_particles->module~bem_config_helpers module~bem_simulator_particles->module~bem_particle_stepper module~bem_simulator_particles->module~bem_simulator module~bem_zhao_outflow_refresh->module~bem_app_config module~bem_zhao_outflow_refresh->module~bem_irradiation_cell_contract module~bem_zhao_outflow_refresh->module~bem_surface_current_model program~main main program~main->module~bem_app_config program~main->module~bem_output_writer program~main->module~bem_periodic_checkpoint program~main->module~bem_restart program~main->module~bem_run_outputs program~main->module~bem_simulator module~bem_simulator_charge bem_simulator_charge module~bem_simulator_charge->module~bem_simulator module~bem_simulator_stats bem_simulator_stats module~bem_simulator_stats->module~bem_simulator

Variables

Type Visibility Attributes Name Initial
integer, public, parameter :: max_templates = 8

設定配列の初期確保サイズ(上限ではない)。

integer, public, parameter :: max_particle_species = 8
integer(kind=i32), public, parameter :: particle_bc_inherit = -1_i32
integer(kind=i32), public, parameter :: particle_inflow_none = 0_i32
integer(kind=i32), public, parameter :: particle_inflow_reservoir = 1_i32

Derived Types

type, public ::  surface_current_model_config

外部シースの零電流根から species 別の表面電流と境界写像を与えるモデルの設定。

Components

Type Visibility Attributes Name Initial
character(len=32), public :: model = 'none'
character(len=16), public :: zhao_branch = 'auto'
character(len=64), public :: electron_species = ''
character(len=64), public :: ion_species = ''
character(len=64), public :: photoelectron_species = ''
character(len=64), public :: secondary_electron_species = ''
real(kind=dp), public :: solar_elevation_deg = 0.0_dp
real(kind=dp), public :: photoelectron_ref_density_m3 = 0.0_dp
real(kind=dp), public :: photoelectron_source_scale = 1.0_dp
real(kind=dp), public :: reference_area_m2 = 0.0_dp
logical, public :: has_reference_area_m2 = .false.
integer(kind=i32), public :: outflow_refresh_batches = 0_i32

zhao_stationary の外部シース源を観測PE流出で解き直す accepted batch 間隔。0 は初期根を固定する。

logical, public :: include_reflected_electrons = .true.

外部根の源に、セル内で反射して z-high を外向きに抜けた上流電子を含める。外部根を更新する (outflow_refresh_batches>0)ときだけ効く。既定は sheath-model の結合ガイドどおり含める。

logical, public :: has_include_reflected_electrons = .false.

include_reflected_electrons を設定ファイルで明示したか。明示した値だけを preflight で検査する。

real(kind=dp), public :: zhao_upstream_band_tolerance = 0.0_dp

電子drift時のA/C根で、上流に接するE^2<0の幅を |phi_m|(A) / |phi_0|(C) の何割まで許すか。0 は厳密判定。

real(kind=dp), public :: zhao_upstream_field_floor_v_m = 0.0_dp

上流境界を「場がこの外部レベル [V/m] まで落ちた点」に置く。電子drift時のA/C根で、帯の内側の場の不足 sqrt(-min E^2) がこれ以下なら受理する。0 はこの判定を使わない。

real(kind=dp), public :: zhao_ion_pressure_factor = 1.0_dp

外部根のイオン流体の圧力係数 (Sana & Mishra 2026, Eq. 17)。1 は等温。イオン温度は ion species の温度を使う。

type, public ::  particle_species_spec

1粒子種の注入設定を表す。

Components

Type Visibility Attributes Name Initial
character(len=64), public :: species_key = ''
logical, public :: enabled = .false.
integer(kind=i32), public :: npcls_per_step = 0_i32
character(len=32), public :: source_mode = 'volume_seed'
logical, public :: secondary_emission_enabled = .false.
character(len=16), public :: secondary_emission_model = 'whipple'
real(kind=dp), public :: secondary_emission_yield_max = 1.5_dp
real(kind=dp), public :: secondary_emission_energy_max_ev = 500.0_dp
real(kind=dp), public :: secondary_emission_const_yield = 0.0_dp
character(len=64), public :: secondary_emission_target_species = ''
integer(kind=i32), public :: secondary_emission_target_idx = 0_i32
logical, public :: has_secondary_forbidden_source_option = .false.
logical, public :: has_surface_charge_closure = .false.
real(kind=dp), public :: number_density_cm3 = 0.0d0
real(kind=dp), public :: number_density_m3 = 0.0d0
logical, public :: has_number_density_cm3 = .false.
logical, public :: has_number_density_m3 = .false.
real(kind=dp), public :: q_particle = -1.602176634d-19
real(kind=dp), public :: m_particle = 9.10938356d-31
real(kind=dp), public :: w_particle = 1.0d0
logical, public :: has_w_particle = .false.
integer(kind=i32), public :: target_macro_particles_per_batch = 0_i32
logical, public :: has_target_macro_particles_per_batch = .false.
real(kind=dp), public :: pos_low(3) = [-0.4d0, -0.4d0, 0.2d0]
real(kind=dp), public :: pos_high(3) = [0.4d0, 0.4d0, 0.5d0]
real(kind=dp), public :: drift_velocity(3) = [0.0d0, 0.0d0, -8.0d5]
real(kind=dp), public :: temperature_k = 2.0d4
real(kind=dp), public :: temperature_ev = -1.0d0
logical, public :: has_temperature_ev = .false.
real(kind=dp), public :: emit_current_density_a_m2 = 0.0d0
integer(kind=i32), public :: rays_per_batch = 0_i32
logical, public :: deposit_opposite_charge_on_emit = .false.
real(kind=dp), public :: normal_drift_speed = 0.0d0
real(kind=dp), public :: ray_direction(3) = [0.0d0, 0.0d0, 0.0d0]
logical, public :: has_ray_direction = .false.
character(len=16), public :: inject_face = ''
integer(kind=i32), public :: boundary_low(3) = [particle_bc_inherit, particle_bc_inherit, particle_bc_inherit]
integer(kind=i32), public :: boundary_high(3) = [particle_bc_inherit, particle_bc_inherit, particle_bc_inherit]
integer(kind=i32), public :: boundary_inflow_low(3) = particle_inflow_none
integer(kind=i32), public :: boundary_inflow_high(3) = particle_inflow_none
character(len=16), public :: surface_charge_closure = 'explicit'
real(kind=dp), public :: target_absorbed_current_a = 0.0_dp
logical, public :: has_target_absorbed_current_a = .false.
real(kind=dp), public :: target_emission_current_a = 0.0_dp
logical, public :: has_target_emission_current_a = .false.

type, public ::  template_spec

OBJ または template 1 要素の表面と幾何パラメータを保持する。

Components

Type Visibility Attributes Name Initial
logical, public :: enabled = .false.
character(len=16), public :: kind = ''
character(len=256), public :: path = ''
real(kind=dp), public :: scale = 1.0_dp
real(kind=dp), public :: rotation(3) = 0.0_dp
real(kind=dp), public :: offset(3) = 0.0_dp
character(len=16), public :: surface_model = 'insulator'
character(len=32), public :: surface_side_policy = 'not_specified'
real(kind=dp), public :: epsilon_r = 1.0d0
real(kind=dp), public :: center(3) = 0.0d0
real(kind=dp), public :: size_x = 1.0d0
real(kind=dp), public :: size_y = 1.0d0
real(kind=dp), public :: size(3) = [1.0d0, 1.0d0, 1.0d0]
integer(kind=i32), public :: nx = 1
integer(kind=i32), public :: ny = 1
integer(kind=i32), public :: nz = 1
real(kind=dp), public :: radius = 0.5d0
real(kind=dp), public :: inner_radius = 0.25d0
real(kind=dp), public :: height = 1.0d0
integer(kind=i32), public :: n_theta = 24
integer(kind=i32), public :: n_r = 4
integer(kind=i32), public :: n_z = 1
logical, public :: cap = .true.
logical, public :: cap_top = .true.
logical, public :: cap_bottom = .true.
logical, public :: has_cap_top = .false.
logical, public :: has_cap_bottom = .false.
integer(kind=i32), public :: n_lon = 24
integer(kind=i32), public :: n_lat = 12
character(len=16), public :: tessellation = ''
integer(kind=i32), public :: subdivisions = 2
logical, public :: has_n_lon_lat = .false.
logical, public :: has_subdivisions = .false.

type, public ::  app_config

実行条件・メッシュ入力・粒子注入・出力設定を一元管理する。

Components

Type Visibility Attributes Name Initial
integer(kind=i32), public :: n_mesh_parts = 0_i32
type(template_spec), public, allocatable :: mesh_parts(:)
integer(kind=i32), public :: n_particle_species = 0_i32
type(particle_species_spec), public, allocatable :: particle_species(:)
integer(kind=i32), public :: secondary_emission_max_generations = 3_i32
integer(kind=i32), public :: particle_boundary_low(3) = [particle_bc_inherit, particle_bc_inherit, particle_bc_inherit]
integer(kind=i32), public :: particle_boundary_high(3) = [particle_bc_inherit, particle_bc_inherit, particle_bc_inherit]
logical, public :: write_output = .true.
logical, public :: write_mesh_potential = .false.
logical, public :: write_potential_history = .false.
character(len=256), public :: output_dir = 'outputs/latest'
character(len=256), public :: output_restart_from = ''
integer(kind=i32), public :: history_stride = 1
integer(kind=i32), public :: checkpoint_stride = 0
logical, public :: resume_output = .false.
type(sim_config), public :: sim
type(external_boundary_contract_type), public :: boundary_contract

preflight で解決する基底契約。種別 kinetic barrier の面別 override は run 側で重ねる。

type(field_physics_config), public :: field
type(periodic2_physics_config), public :: periodic2
type(panel_kernel_config), public :: panel
type(surface_current_model_config), public :: surface_current

Functions

public function mesh_part_config_path(part_idx) result(path)

診断に使う公開 mesh 配列の添字付きパスを返す。

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: part_idx

Return Value character(len=:), allocatable

public function species_config_path(species_idx) result(path)

診断に使う公開 species 配列の添字付きパスを返す。

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: species_idx

Return Value character(len=:), allocatable

public function particles_per_batch_from_config(cfg) result(batch_n)

有効な粒子種の npcls_per_step を合計し、1バッチあたりの粒子数を返す。 1つ以上の粒子種が有効で、かつ合計が正でない場合は停止する。

Arguments

Type IntentOptional Attributes Name
type(app_config), intent(in) :: cfg

粒子種設定を含むアプリ設定。

Return Value integer(kind=i32)

public pure function species_from_defaults() result(spec)

[[particles.species]] の既定値を返す。 現行仕様では、列挙された粒子種は既定で有効とみなす。

Arguments

None

Return Value type(particle_species_spec)


Subroutines

public subroutine default_app_config(cfg)

app_config を既定値で初期化し、TOML 上書き前の状態を作る。

Arguments

Type IntentOptional Attributes Name
type(app_config), intent(out) :: cfg

既定値で初期化したアプリ設定。