Corrections and some basic printing

This commit is contained in:
Jorge Gonzalez 2026-03-10 18:26:47 +01:00
commit a48e5111e7
4 changed files with 42 additions and 3 deletions

View file

@ -1306,6 +1306,9 @@ MODULE moduleInput
end do end do
allocate(bound%alpha(1:mesh%numEdges)) ! TODO: Change this so only the edges associated to the boundary are here
bound%alpha = 0.d0
end select end select
end do end do

View file

@ -651,6 +651,7 @@ MODULE moduleMesh
integer:: n integer:: n
character(:), allocatable:: name character(:), allocatable:: name
procedure(updateParticle_interface), pointer, pass:: update => null() procedure(updateParticle_interface), pointer, pass:: update => null()
procedure(printParticle_interface), pointer, pass:: print => null()
contains contains
procedure(applyParticle_interface), deferred, pass:: apply procedure(applyParticle_interface), deferred, pass:: apply
@ -708,6 +709,14 @@ MODULE moduleMesh
end subroutine updateParticle_interface end subroutine updateParticle_interface
! Update the values of the particle boundary model
subroutine printParticle_interface(self)
import boundaryParticleGeneric
class(boundaryParticleGeneric), intent(inout):: self
end subroutine printParticle_interface
end interface end interface
!Reflecting boundary !Reflecting boundary

View file

@ -109,10 +109,9 @@ submodule(moduleMesh) boundaryParticle
boundary%s_incident = s_incident boundary%s_incident = s_incident
allocate(boundary%alpha(1:mesh%numEdges)) ! TODO: Change this so only the edges associated to the boundary are here
boundary%alpha = 0.d0
boundary%update => quasiNeutrality_update boundary%update => quasiNeutrality_update
boundary%print => quasiNeutrality_print
end select end select
@ -391,7 +390,7 @@ submodule(moduleMesh) boundaryParticle
alpha = 1.d0 - density_incident/density_rest alpha = 1.d0 - density_incident/density_rest
! Apply correction with a factor of 0.1 to avoid fast changes ! 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) = self%alpha(edge%n) + 1.0d-2 * alpha
! Limit alpha between 0 and 1 ! Limit alpha between 0 and 1
self%alpha(edge%n) = min(self%alpha(edge%n), 1.d0) self%alpha(edge%n) = min(self%alpha(edge%n), 1.d0)
@ -405,6 +404,21 @@ submodule(moduleMesh) boundaryParticle
end subroutine quasiNeutrality_update end subroutine quasiNeutrality_update
subroutine quasiNeutrality_print(self)
implicit none
class(boundaryParticleGeneric), intent(inout):: self
print *, 'test'
select type(self)
type is(boundaryQuasiNeutrality)
print*, self%alpha
end select
end subroutine quasiNeutrality_print
! Generic boundary conditions for internal use ! Generic boundary conditions for internal use
module subroutine genericReflection(edge, part) module subroutine genericReflection(edge, part)
use moduleCaseParam use moduleCaseParam

View file

@ -523,6 +523,8 @@ MODULE moduleSolver
USE moduleCaseParam, ONLY: timeStep USE moduleCaseParam, ONLY: timeStep
IMPLICIT NONE IMPLICIT NONE
integer:: b ! TEMPORARY
CALL outputProbes() CALL outputProbes()
counterOutput = counterOutput + 1 counterOutput = counterOutput + 1
@ -551,6 +553,17 @@ MODULE moduleSolver
END IF END IF
WRITE(*,*) WRITE(*,*)
! TEMPORARY
! Output of boundaries. TODO: Move this to mesh module
do b = 1, nBoundariesParticle
if (associated(boundariesParticle(b)%obj%print)) then
print *, b
call boundariesParticle(b)%obj%print()
end if
end do
END IF END IF
counterCPUTime = counterCPUTime + 1 counterCPUTime = counterCPUTime + 1