Skeleton for new injection type
This commit is contained in:
parent
555ebd6771
commit
d3f1f0808e
3 changed files with 37 additions and 2 deletions
|
|
@ -71,6 +71,9 @@ PROGRAM fpakc
|
|||
! Update EM boundary models
|
||||
call boundariesEM_update()
|
||||
|
||||
! Update injects
|
||||
call updateInjects
|
||||
|
||||
!Checks if a species needs to me moved in this iteration
|
||||
CALL solver%updatePushSpecies()
|
||||
|
||||
|
|
|
|||
|
|
@ -1432,6 +1432,7 @@ MODULE moduleInput
|
|||
REAL(8), ALLOCATABLE:: temperature(:), normal(:)
|
||||
REAL(8):: flow
|
||||
CHARACTER(:), ALLOCATABLE:: units
|
||||
character(:), allocatable:: type
|
||||
INTEGER:: physicalSurface
|
||||
INTEGER:: particlesPerEdge
|
||||
INTEGER:: sp
|
||||
|
|
@ -1457,11 +1458,16 @@ MODULE moduleInput
|
|||
END IF
|
||||
CALL config%get(object // '.flow', flow, found)
|
||||
CALL config%get(object // '.units', units, found)
|
||||
CALL config%get(object // '.type', type, found)
|
||||
if (.not. found) then
|
||||
! If no type is found, assume constant injection of particles
|
||||
type = 'constant'
|
||||
end if
|
||||
CALL config%get(object // '.physicalSurface', physicalSurface, found)
|
||||
particlesPerEdge = 0
|
||||
CALL config%get(object // '.particlesPerEdge', particlesPerEdge, found)
|
||||
|
||||
CALL inject(i)%init(i, v, normal, temperature, flow, units, sp, physicalSurface, particlesPerEdge)
|
||||
CALL inject(i)%init(i, v, normal, temperature, flow, units, type, sp, physicalSurface, particlesPerEdge)
|
||||
|
||||
CALL readVelDistr(config, inject(i), object)
|
||||
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ MODULE moduleInject
|
|||
LOGICAL:: fixDirection !The injection of particles has a fix direction defined by n
|
||||
INTEGER:: nParticles !Number of particles to introduce each time step
|
||||
CLASS(speciesGeneric), POINTER:: species !Species of injection
|
||||
character(:), allocatable:: type
|
||||
INTEGER:: nEdges
|
||||
type(meshEdgePointer), allocatable:: edges(:)
|
||||
INTEGER, ALLOCATABLE:: particlesPerEdge(:) ! Particles per edge
|
||||
|
|
@ -31,7 +32,7 @@ MODULE moduleInject
|
|||
|
||||
CONTAINS
|
||||
!Initialize an injection of particles
|
||||
SUBROUTINE initInject(self, i, v, n, temperature, flow, units, sp, ps, particlesPerEdge)
|
||||
SUBROUTINE initInject(self, i, v, n, temperature, flow, units, type, sp, ps, particlesPerEdge)
|
||||
USE moduleMesh
|
||||
USE moduleRefParam
|
||||
USE moduleConstParam
|
||||
|
|
@ -48,6 +49,7 @@ MODULE moduleInject
|
|||
REAL(8):: tauInject
|
||||
REAL(8), INTENT(in):: flow
|
||||
CHARACTER(:), ALLOCATABLE, INTENT(in):: units
|
||||
character(:), allocatable, intent(in):: type
|
||||
INTEGER:: e
|
||||
REAL(8):: fluxPerStep = 0.D0
|
||||
|
||||
|
|
@ -143,6 +145,14 @@ MODULE moduleInject
|
|||
!Scale particles for different species steps
|
||||
IF (self%nParticles == 0) CALL criticalError("The number of particles for inject is 0.", 'initInject')
|
||||
|
||||
! Assign type to inject
|
||||
select case(type)
|
||||
case ('constant', 'quasiNeutral')
|
||||
self%type = type
|
||||
case default
|
||||
call criticalError('No injection type ' // type // ' defined', 'initInject')
|
||||
end select
|
||||
|
||||
END SUBROUTINE initInject
|
||||
|
||||
!Injection of particles
|
||||
|
|
@ -176,6 +186,22 @@ MODULE moduleInject
|
|||
|
||||
END SUBROUTINE doInjects
|
||||
|
||||
! Update the value of injects
|
||||
subroutine updateInjects()
|
||||
implicit none
|
||||
|
||||
integer:: i
|
||||
|
||||
do i = 1, nInject
|
||||
select case(inject(i)%type)
|
||||
case ('quasiNeutral')
|
||||
print*, "Calculating quasi-neutrality"
|
||||
|
||||
end select
|
||||
end do
|
||||
|
||||
end subroutine updateInjects
|
||||
|
||||
SUBROUTINE initVelDistMaxwellian(velDist, temperature, m)
|
||||
IMPLICIT NONE
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue