First implementation of probing method
The code nows offer the possibility to obtain the distribution function for a specific species in a 3D velocity grid at a determined position. This is a simple method that just scatter the particles in one cell into the velocity grid.
This commit is contained in:
parent
2d3b163700
commit
56967dd6c7
7 changed files with 413 additions and 86 deletions
|
|
@ -60,6 +60,11 @@ MODULE moduleInput
|
|||
CALL readGeometry(config)
|
||||
CALL checkStatus(config, "readGeometry")
|
||||
|
||||
!Read probes
|
||||
CALL verboseError('Reading Probes...')
|
||||
CALL readProbes(config)
|
||||
CALL checkStatus(config, 'readProbes')
|
||||
|
||||
!Read initial state for species
|
||||
CALL verboseError('Reading Initial state...')
|
||||
CALL readInitial(config)
|
||||
|
|
@ -903,6 +908,47 @@ MODULE moduleInput
|
|||
|
||||
END SUBROUTINE readGeometry
|
||||
|
||||
SUBROUTINE readProbes(config)
|
||||
USE moduleProbe
|
||||
USE moduleErrors
|
||||
USE json_module
|
||||
IMPLICIT NONE
|
||||
|
||||
TYPE(json_file), INTENT(inout):: config
|
||||
CHARACTER(:), ALLOCATABLE:: object
|
||||
LOGICAL:: found
|
||||
CHARACTER(2):: istring
|
||||
INTEGER:: i
|
||||
CHARACTER(:), ALLOCATABLE:: speciesName
|
||||
REAL(8), ALLOCATABLE, DIMENSION(:):: r
|
||||
REAL(8), ALLOCATABLE, DIMENSION(:):: v1, v2, v3
|
||||
INTEGER, ALLOCATABLE, DIMENSION(:):: points
|
||||
REAL(8):: timeStep
|
||||
|
||||
CALL config%info('output.probes', found, n_children = nProbes)
|
||||
|
||||
IF (found) ALLOCATE(probe(1:nProbes))
|
||||
|
||||
DO i = 1, nProbes
|
||||
WRITE(iString, '(I2)') i
|
||||
object = 'output.probes(' // trim(istring) // ')'
|
||||
|
||||
CALL config%get(object // '.species', speciesName, found)
|
||||
CALL config%get(object // '.position', r, found)
|
||||
CALL config%get(object // '.velocity_1', v1, found)
|
||||
CALL config%get(object // '.velocity_2', v2, found)
|
||||
CALL config%get(object // '.velocity_3', v3, found)
|
||||
CALL config%get(object // '.points', points, found)
|
||||
CALL config%get(object // '.timeStep', timeStep, found)
|
||||
|
||||
IF (ANY(points < 2)) CALL criticalError("Number of points in probe " // iString // " incorrect", 'readProbes')
|
||||
|
||||
CALL probe(i)%init(i, speciesName, r, v1, v2, v3, points, timeStep)
|
||||
|
||||
END DO
|
||||
|
||||
END SUBROUTINE readProbes
|
||||
|
||||
SUBROUTINE readEMBoundary(config)
|
||||
USE moduleMesh
|
||||
USE moduleOutput
|
||||
|
|
@ -926,7 +972,7 @@ MODULE moduleInput
|
|||
IF (found) ALLOCATE(boundEM(1:nBoundaryEM))
|
||||
|
||||
DO i = 1, nBoundaryEM
|
||||
WRITE(istring, '(i2)') i
|
||||
WRITE(istring, '(I2)') i
|
||||
object = 'boundaryEM(' // trim(istring) // ')'
|
||||
|
||||
CALL config%get(object // '.type', boundEM(i)%typeEM, found)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue