First version with possibility for charged particles to be included.
Now, the solver needs to be an input parameter of the case, to select if it is for charged or neutral particles. Resolution of Poisson equation with Dirichlet boundary conditions is possible. The source vector is the charge density. This resolution is done in two steps to save computational time: 1. When reading the mesh, the PLU factorization of the K matrix is computed. 2. In each iteration, the system K*u = f is solved, in which f is the source vector (charge density) and u is the solution (potential) in each node. No case has been added to the repository. This will be done in next commit. The 'non-analog' scheme has been commented. It still needs to split the particle to avoid 'overweight' particles.
This commit is contained in:
parent
73fc9f69c1
commit
c82279f5c5
20 changed files with 859 additions and 227 deletions
|
|
@ -1,83 +0,0 @@
|
|||
! PPartiC neutral DSMC main program.
|
||||
PROGRAM DSMC_Neutrals
|
||||
USE moduleInput
|
||||
USE moduleErrors
|
||||
USE OMP_LIB
|
||||
USE moduleInject
|
||||
USE moduleSolver
|
||||
USE moduleOutput
|
||||
USE moduleCompTime
|
||||
USE moduleMesh
|
||||
IMPLICIT NONE
|
||||
|
||||
! t = time step; n = number of particle; e = number of element; i = number of inject
|
||||
INTEGER:: t = 0
|
||||
CHARACTER(200):: arg1
|
||||
CHARACTER(:), ALLOCATABLE:: inputFile
|
||||
|
||||
|
||||
tStep = omp_get_wtime()
|
||||
!Gets the input file
|
||||
CALL getarg(1, arg1)
|
||||
inputFile = TRIM(arg1)
|
||||
!If no input file is declared, a critical error is called
|
||||
IF (inputFile == "") CALL criticalError("No input file provided", "DSMC_Neutrals")
|
||||
|
||||
!Reads the json configuration file
|
||||
CALL readConfig(inputFile)
|
||||
|
||||
tStep = omp_get_wtime() - tStep
|
||||
|
||||
!Output initial state
|
||||
CALL doOutput(t)
|
||||
CALL verboseError('Starting main loop...')
|
||||
!$OMP PARALLEL PRIVATE(t) DEFAULT(SHARED)
|
||||
DO t = 1, tmax
|
||||
!Insert new particles and push them
|
||||
!$OMP SINGLE
|
||||
tStep = omp_get_wtime()
|
||||
tPush = omp_get_wtime()
|
||||
!$OMP END SINGLE
|
||||
|
||||
CALL doInjects()
|
||||
|
||||
!Push old particles
|
||||
CALL doPushes()
|
||||
|
||||
!$OMP SINGLE
|
||||
tPush = omp_get_wtime() - tPush
|
||||
tColl = omp_get_wtime()
|
||||
!$OMP END SINGLE
|
||||
|
||||
!Collisions
|
||||
CALL doCollisions()
|
||||
|
||||
!$OMP SINGLE
|
||||
tColl = omp_get_wtime() - tColl
|
||||
tReset = omp_get_wtime()
|
||||
!$OMP END SINGLE
|
||||
|
||||
!Reset particles
|
||||
CALL doReset()
|
||||
|
||||
!$OMP SINGLE
|
||||
tReset = omp_get_wtime() - tReset
|
||||
|
||||
!Weight
|
||||
tWeight = omp_get_wtime()
|
||||
!$OMP END SINGLE
|
||||
|
||||
CALL doScatter()
|
||||
|
||||
!$OMP SINGLE
|
||||
tWeight = omp_get_wtime() - tWeight
|
||||
tStep = omp_get_wtime() - tStep
|
||||
!Output data
|
||||
CALL doOutput(t)
|
||||
!$OMP END SINGLE
|
||||
|
||||
END DO
|
||||
!$OMP END PARALLEL
|
||||
|
||||
END PROGRAM DSMC_Neutrals
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue