From 4aa6e5aab2e60bffa1c6548869b6e2abf20feb63 Mon Sep 17 00:00:00 2001 From: JGonzalez Date: Wed, 4 Feb 2026 11:23:26 +0100 Subject: [PATCH] Try to impose a reflection with drag --- src/modules/mesh/moduleMeshBoundary.f90 | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/modules/mesh/moduleMeshBoundary.f90 b/src/modules/mesh/moduleMeshBoundary.f90 index eaa2d52..7fc7798 100644 --- a/src/modules/mesh/moduleMeshBoundary.f90 +++ b/src/modules/mesh/moduleMeshBoundary.f90 @@ -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 (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) + ! print *,part%v(1) + ! print * - ! if (random() < 0.844d0) then - call reflection(edge, part) - part%v = part%v + 40e3/v_ref - if (dot_product(part%v, edge%normal) <= 0.d0) then + else call transparent(edge, part) end if - ! else - ! call transparent(edge, part) - - ! end if - end select end subroutine outflowAdaptive