reservoir_face 開口面の平均電位を N x N 格子平均で評価する。
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(mesh_type), | intent(in) | :: | mesh |
現在バッチ開始時点の電荷分布メッシュ。 |
||
| type(sim_config), | intent(in) | :: | sim |
シミュレーション設定。 |
||
| type(particle_species_spec), | intent(in) | :: | spec |
reservoir_face 粒子種設定。 |
||
| real(kind=dp), | intent(out) | :: | phi_face |
注入開口面の平均電位 [V]。 |
subroutine compute_face_average_potential(mesh, sim, spec, phi_face) type(mesh_type), intent(in) :: mesh type(sim_config), intent(in) :: sim type(particle_species_spec), intent(in) :: spec real(dp), intent(out) :: phi_face integer(i32) :: ngrid, i, j integer :: axis_n, axis_t1, axis_t2 real(dp) :: boundary_value, inward_normal(3), pos(3), t1, t2, phi real(dp) :: phi_sum call resolve_face_sampling_geometry( & sim%box_min, sim%box_max, spec%inject_face, axis_n, axis_t1, axis_t2, boundary_value, inward_normal & ) ngrid = sim%injection_face_phi_grid_n phi_sum = 0.0d0 do i = 1_i32, ngrid t1 = (real(i, dp) - 0.5d0)/real(ngrid, dp) do j = 1_i32, ngrid t2 = (real(j, dp) - 0.5d0)/real(ngrid, dp) pos = 0.0d0 pos(axis_n) = boundary_value pos(axis_t1) = spec%pos_low(axis_t1) + (spec%pos_high(axis_t1) - spec%pos_low(axis_t1))*t1 pos(axis_t2) = spec%pos_low(axis_t2) + (spec%pos_high(axis_t2) - spec%pos_low(axis_t2))*t2 pos = pos + inward_normal*1.0d-12 call electric_potential_at(mesh, pos, sim%softening, phi) phi_sum = phi_sum + phi end do end do phi_face = phi_sum/real(ngrid*ngrid, dp) end subroutine compute_face_average_potential