| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(sim_config), | intent(in) | :: | sim | |||
| type(particle_species_spec), | intent(in) | :: | spec_e | |||
| type(sheath_injection_context), | intent(inout) | :: | ctx | |||
| type(zhao_params_type), | intent(in) | :: | p | |||
| character(len=1), | intent(in) | :: | branch | |||
| real(kind=dp), | intent(in) | :: | phi0_v | |||
| real(kind=dp), | intent(in) | :: | phi_m_v | |||
| real(kind=dp), | intent(in) | :: | n_swe_inf_m3 | |||
| type(zhao_local_state_type), | intent(out) | :: | state |
subroutine sample_zhao_reservoir_state(sim, spec_e, ctx, p, branch, phi0_v, phi_m_v, n_swe_inf_m3, state) type(sim_config), intent(in) :: sim type(particle_species_spec), intent(in) :: spec_e type(sheath_injection_context), intent(inout) :: ctx type(zhao_params_type), intent(in) :: p character(len=1), intent(in) :: branch real(dp), intent(in) :: phi0_v, phi_m_v, n_swe_inf_m3 type(zhao_local_state_type), intent(out) :: state integer :: axis real(dp) :: boundary_value, distance_m, axis_sign call resolve_inject_face(sim%box_min, sim%box_max, spec_e%inject_face, axis, boundary_value) axis_sign = -ctx%reference_inward_normal(axis) distance_m = (boundary_value - ctx%reference_coordinate)*axis_sign if (distance_m < -1.0d-12) then error stop 'sheath_reference_coordinate must lie on or inside the shared reservoir_face boundary.' end if ctx%reservoir_plane_distance_m = max(0.0d0, distance_m) call sample_zhao_state_at_z(p, branch, phi0_v, phi_m_v, n_swe_inf_m3, ctx%reservoir_plane_distance_m, state) end subroutine sample_zhao_reservoir_state