Implementation of average scheme and testing
New input variables to activate the average scheme. Still only computing the mean, no the standard deviation. Output checked with ALPHIE Grid example. Looks good. No impact on CPU time, although testing is still required.
This commit is contained in:
parent
c5c4cbefbf
commit
38d28887ff
3 changed files with 43 additions and 1 deletions
|
|
@ -114,6 +114,8 @@ PROGRAM fpakc
|
||||||
!$OMP SINGLE
|
!$OMP SINGLE
|
||||||
tEMField = omp_get_wtime() - tEMField
|
tEMField = omp_get_wtime() - tEMField
|
||||||
|
|
||||||
|
CALL doAverage(t)
|
||||||
|
|
||||||
tStep = omp_get_wtime() - tStep
|
tStep = omp_get_wtime() - tStep
|
||||||
|
|
||||||
!Output data
|
!Output data
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ MODULE moduleAverage
|
||||||
|
|
||||||
!Generic type for average scheme
|
!Generic type for average scheme
|
||||||
TYPE, PUBLIC:: averageGeneric
|
TYPE, PUBLIC:: averageGeneric
|
||||||
INTEGER:: tStart = 0 !Starting iteartion for average scheme
|
INTEGER:: tStart = 1 !Starting iteartion for average scheme
|
||||||
TYPE(averageData), ALLOCATABLE:: mean(:)
|
TYPE(averageData), ALLOCATABLE:: mean(:)
|
||||||
TYPE(averageData), ALLOCATABLE:: deviation(:)
|
TYPE(averageData), ALLOCATABLE:: deviation(:)
|
||||||
CONTAINS
|
CONTAINS
|
||||||
|
|
@ -47,6 +47,8 @@ MODULE moduleAverage
|
||||||
END DO
|
END DO
|
||||||
|
|
||||||
ELSEIF (tAverage > 1) THEN
|
ELSEIF (tAverage > 1) THEN
|
||||||
|
ALLOCATE(newAverage%output(1:nSpecies))
|
||||||
|
|
||||||
!Normal average step
|
!Normal average step
|
||||||
DO n = 1, mesh%numNodes
|
DO n = 1, mesh%numNodes
|
||||||
DO s = 1, nSpecies
|
DO s = 1, nSpecies
|
||||||
|
|
@ -58,6 +60,8 @@ MODULE moduleAverage
|
||||||
|
|
||||||
END DO
|
END DO
|
||||||
|
|
||||||
|
DEALLOCATE(newAverage%output)
|
||||||
|
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
END SUBROUTINE updateAverage
|
END SUBROUTINE updateAverage
|
||||||
|
|
|
||||||
|
|
@ -75,6 +75,11 @@ MODULE moduleInput
|
||||||
CALL readInject(config)
|
CALL readInject(config)
|
||||||
CALL checkStatus(config, "readInject")
|
CALL checkStatus(config, "readInject")
|
||||||
|
|
||||||
|
!Read average scheme
|
||||||
|
CALL verboseError('Reading average scheme...')
|
||||||
|
CALL readAverage(config)
|
||||||
|
CALL checkStatus(config, "readAverage")
|
||||||
|
|
||||||
!Read parallel parameters
|
!Read parallel parameters
|
||||||
CALL verboseError('Reading Parallel configuration...')
|
CALL verboseError('Reading Parallel configuration...')
|
||||||
CALL readParallel(config)
|
CALL readParallel(config)
|
||||||
|
|
@ -1180,6 +1185,37 @@ MODULE moduleInput
|
||||||
|
|
||||||
END SUBROUTINE readInject
|
END SUBROUTINE readInject
|
||||||
|
|
||||||
|
SUBROUTINE readAverage(config)
|
||||||
|
USE moduleAverage
|
||||||
|
USE moduleCaseParam, ONLY: tauMin
|
||||||
|
USE moduleMesh, ONLY: mesh
|
||||||
|
USE moduleSpecies, ONLY: nSpecies
|
||||||
|
IMPLICIT NONE
|
||||||
|
|
||||||
|
TYPE(json_file), INTENT(inout):: config
|
||||||
|
LOGICAL:: found
|
||||||
|
REAL(8):: tStart
|
||||||
|
INTEGER:: n
|
||||||
|
|
||||||
|
CALL config%info('average', found)
|
||||||
|
IF (found) THEN
|
||||||
|
useAverage = .TRUE.
|
||||||
|
CALL config%get('average.startTime', tStart, found)
|
||||||
|
|
||||||
|
IF (found) THEN
|
||||||
|
averageScheme%tStart = INT(tStart / tauMin)
|
||||||
|
|
||||||
|
END IF
|
||||||
|
ALLOCATE(averageScheme%mean(1:mesh%numNodes))
|
||||||
|
DO n = 1, mesh%numNodes
|
||||||
|
ALLOCATE(averageScheme%mean(n)%output(1:nSpecies))
|
||||||
|
|
||||||
|
END DO
|
||||||
|
|
||||||
|
END IF
|
||||||
|
|
||||||
|
END SUBROUTINE readAverage
|
||||||
|
|
||||||
!Reads the velocity distribution functions for each inject
|
!Reads the velocity distribution functions for each inject
|
||||||
SUBROUTINE readVelDistr(config, inj, object)
|
SUBROUTINE readVelDistr(config, inj, object)
|
||||||
USE moduleErrors
|
USE moduleErrors
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue