アプリ設定の型定義と、設定由来の粒子数計算をまとめるモジュール。
| 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 |
外部シース電流またはmatching-plane応答を与えるモデルの共通設定。
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| character(len=32), | public | :: | model | = | 'none' | ||
| character(len=16), | public | :: | response_backend | = | 'table' | ||
| character(len=16), | public | :: | zhao_branch | = | 'auto' | ||
| character(len=16), | public | :: | zhao_root_selection | = | 'require_unique' | ||
| character(len=64), | public | :: | electron_species | = | '' | ||
| character(len=64), | public | :: | ion_species | = | '' | ||
| character(len=64), | public | :: | photoelectron_species | = | '' | ||
| logical, | public | :: | has_photoelectron_species | = | .false. | ||
| 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. | ||
| character(len=256), | public | :: | response_table_path | = | '' | ||
| logical, | public | :: | has_response_table_path | = | .false. | ||
| logical, | public | :: | implicit_zero_mode | = | .false. | ||
| real(kind=dp), | public | :: | coupling_rtol | = | 1.0e-4_dp | ||
| real(kind=dp), | public | :: | coupling_atol(4) | = | 0.0_dp | ||
| integer(kind=i32), | public | :: | coupling_max_iterations | = | 20_i32 | ||
| real(kind=dp), | public | :: | coupling_relaxation | = | 0.5_dp |
1粒子種の注入設定を表す。
| 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=16), | public | :: | source_mode | = | 'volume_seed' | ||
| 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. | ||
| 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] | ||
| character(len=16), | public | :: | velocity_distribution | = | 'maxwellian' | ||
| character(len=256), | public | :: | velocity_grid_path | = | '' | ||
| character(len=16), | public | :: | velocity_grid_pdf_kind | = | 'phase_space' | ||
| character(len=16), | public | :: | velocity_grid_sampling | = | 'auto' | ||
| real(kind=dp), | public | :: | particle_flux_m2_s | = | 0.0d0 | ||
| real(kind=dp), | public | :: | current_density_a_m2 | = | 0.0d0 | ||
| logical, | public | :: | has_current_density_a_m2 | = | .false. | ||
| 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. | ||
| real(kind=dp), | public | :: | source_normal(3) | = | [0.0d0, 0.0d0, -1.0d0] | ||
| 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. |
1つのテンプレート形状の有効化フラグと幾何パラメータを保持する。
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| logical, | public | :: | enabled | = | .false. | ||
| character(len=16), | public | :: | kind | = | 'plane' | ||
| 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 |
実行条件・メッシュ入力・粒子注入・出力設定を一元管理する。
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| character(len=16), | public | :: | mesh_mode | = | 'template' | ||
| character(len=256), | public | :: | obj_path | = | 'examples/simple_plate.obj' | ||
| character(len=16), | public | :: | mesh_surface_model | = | 'insulator' | ||
| character(len=32), | public | :: | mesh_surface_side_policy | = | 'not_specified' | ||
| real(kind=dp), | public | :: | mesh_epsilon_r | = | 1.0d0 | ||
| real(kind=dp), | public | :: | obj_scale | = | 1.0d0 | ||
| real(kind=dp), | public | :: | obj_rotation(3) | = | [0.0d0, 0.0d0, 0.0d0] | ||
| real(kind=dp), | public | :: | obj_offset(3) | = | [0.0d0, 0.0d0, 0.0d0] | ||
| integer(kind=i32), | public | :: | n_templates | = | 0_i32 | ||
| type(template_spec), | public, | allocatable | :: | templates(:) | |||
| integer(kind=i32), | public | :: | n_particle_species | = | 0_i32 | ||
| type(particle_species_spec), | public, | allocatable | :: | particle_species(:) | |||
| 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(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 |
有効な粒子種の npcls_per_step を合計し、1バッチあたりの粒子数を返す。
1つ以上の粒子種が有効で、かつ合計が正でない場合は停止する。
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(app_config), | intent(in) | :: | cfg |
粒子種設定を含むアプリ設定。 |
[[particles.species]] の既定値を返す。
現行仕様では、列挙された粒子種は既定で有効とみなす。
app_config を既定値で初期化し、TOML 上書き前の状態を作る。
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(app_config), | intent(out) | :: | cfg |
既定値で初期化したアプリ設定。 |