Method to divide collisions from a collisional iteration into multiple
pushing iterations.
This commit is contained in:
parent
a45df9de22
commit
4ba08e74af
7 changed files with 110 additions and 64 deletions
|
|
@ -379,7 +379,7 @@ MODULE moduleMesh
|
|||
END SUBROUTINE findCell
|
||||
|
||||
!Computes collisions in element
|
||||
SUBROUTINE collision(self)
|
||||
SUBROUTINE collision(self, t)
|
||||
USE moduleCollisions
|
||||
USE moduleSpecies
|
||||
USE moduleList
|
||||
|
|
@ -388,8 +388,12 @@ MODULE moduleMesh
|
|||
IMPLICIT NONE
|
||||
|
||||
CLASS(meshVol), INTENT(inout):: self
|
||||
INTEGER, INTENT(in):: t
|
||||
INTEGER:: modCollisions !Remain of current iteration and everyCollisions
|
||||
INTEGER:: iterToCollisions !Number of iterations from current to next collision
|
||||
INTEGER:: nPart !Number of particles inside the cell
|
||||
REAL(8):: pMax !Maximum probability of collision
|
||||
INTEGER:: nCollIter !Number of collisions to be computed in this iteration
|
||||
INTEGER:: rnd !random index
|
||||
TYPE(particle), POINTER:: part_i, part_j
|
||||
INTEGER:: n !collision
|
||||
|
|
@ -397,19 +401,36 @@ MODULE moduleMesh
|
|||
REAL(8):: sigmaVrelMaxNew
|
||||
TYPE(pointerArray), ALLOCATABLE:: partTemp(:)
|
||||
|
||||
self%nColl = 0
|
||||
modCollisions = MOD(t, everyCollisions)
|
||||
iterToCollisions = everyCollisions - modCollisions
|
||||
|
||||
nPart = self%listPart_in%amount
|
||||
IF (nPart > 1) THEN
|
||||
pMax = self%totalWeight*self%sigmaVrelMax*tauCollisions/self%volume
|
||||
self%nColl = INT(REAL(nPart)*pMax*0.5D0)
|
||||
|
||||
!Converts the list of particles to an array for easy access
|
||||
IF (self%nColl > 0) THEN
|
||||
partTemp = self%listPart_in%convert2Array()
|
||||
IF (modCollisions == 0) THEN
|
||||
!Collisional iteration, computes the number of iterations
|
||||
pMax = self%totalWeight*self%sigmaVrelMax*tauCollisions/self%volume
|
||||
self%nColl = INT(REAL(nPart)*pMax*0.5D0)
|
||||
|
||||
END IF
|
||||
|
||||
DO n = 1, self%nColl
|
||||
IF (self%nColl > iterToCollisions) THEN
|
||||
nCollIter = self%nColl / iterToCollisions
|
||||
|
||||
ELSE
|
||||
nCollIter = self%nColl
|
||||
|
||||
END IF
|
||||
|
||||
IF (nCollIter > 0) THEN
|
||||
!Converts the list of particles to an array for easy access
|
||||
partTemp = self%listPart_in%convert2Array()
|
||||
|
||||
!Removes collisions from this iteration form the total in the cell
|
||||
self%nColl = self%nColl - nCollIter
|
||||
|
||||
END IF
|
||||
|
||||
DO n = 1, nCollIter
|
||||
!Select random numbers
|
||||
rnd = random(1, nPart)
|
||||
part_i => partTemp(rnd)%part
|
||||
|
|
@ -429,11 +450,8 @@ MODULE moduleMesh
|
|||
END IF
|
||||
|
||||
END DO
|
||||
|
||||
END IF
|
||||
|
||||
self%totalWeight = 0.D0
|
||||
|
||||
END SUBROUTINE collision
|
||||
|
||||
SUBROUTINE printOutputGmsh(self, t)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue