Try to impose a reflection with drag

This commit is contained in:
Jorge Gonzalez 2026-02-04 11:23:26 +01:00
commit 4aa6e5aab2

View file

@ -225,23 +225,26 @@ MODULE moduleMeshBoundary
class(meshEdge), intent(inout):: edge
class(particle), intent(inout):: part
real(8):: v_cut
v_cut = 2.d0 * 40.d3/v_ref !This will be the drag velocity of the ions in the future
select type(bound => edge%boundary%bTypes(part%species%n)%obj)
type is(boundaryOutflowAdaptive)
! if (random() < 0.844d0) then
if (dot_product(part%v,-edge%normal) > v_cut) then
! print *,part%v(1), v_cut
! part%v = part%v + v_cut*edge%normal
part%v(1) = part%v(1) - v_cut
! print *,part%v(1)
call reflection(edge, part)
part%v = part%v + 40e3/v_ref
if (dot_product(part%v, edge%normal) <= 0.d0) then
! print *,part%v(1)
! print *
else
call transparent(edge, part)
end if
! else
! call transparent(edge, part)
! end if
end select
end subroutine outflowAdaptive