This is now an iterative process, which makes things better

This commit is contained in:
Jorge Gonzalez 2026-03-09 18:07:06 +01:00
commit e7a47611d9

View file

@ -387,13 +387,15 @@ submodule(moduleMesh) boundaryParticle
end do
! Correction for this time step
alpha = 1.d0 - density_incident/density_rest
! Limit alpha between 0 and 1
alpha = min(alpha, 1.d0)
alpha = max(alpha, 0.d0)
! Apply correction with a factor of 0.1 to avoid fast changes
self%alpha(edge%n) = self%alpha(edge%n) + 0.1d0 * alpha
self%alpha(edge%n) = alpha
! Limit alpha between 0 and 1
self%alpha(edge%n) = min(self%alpha(edge%n), 1.d0)
self%alpha(edge%n) = max(self%alpha(edge%n), 0.d0)
deallocate(density_nodes)