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
|
|
@ -9,7 +9,7 @@ MODULE moduleAverage
|
|||
|
||||
!Generic type for average scheme
|
||||
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:: deviation(:)
|
||||
CONTAINS
|
||||
|
|
@ -47,6 +47,8 @@ MODULE moduleAverage
|
|||
END DO
|
||||
|
||||
ELSEIF (tAverage > 1) THEN
|
||||
ALLOCATE(newAverage%output(1:nSpecies))
|
||||
|
||||
!Normal average step
|
||||
DO n = 1, mesh%numNodes
|
||||
DO s = 1, nSpecies
|
||||
|
|
@ -58,6 +60,8 @@ MODULE moduleAverage
|
|||
|
||||
END DO
|
||||
|
||||
DEALLOCATE(newAverage%output)
|
||||
|
||||
END IF
|
||||
|
||||
END SUBROUTINE updateAverage
|
||||
|
|
|
|||
|
|
@ -75,6 +75,11 @@ MODULE moduleInput
|
|||
CALL readInject(config)
|
||||
CALL checkStatus(config, "readInject")
|
||||
|
||||
!Read average scheme
|
||||
CALL verboseError('Reading average scheme...')
|
||||
CALL readAverage(config)
|
||||
CALL checkStatus(config, "readAverage")
|
||||
|
||||
!Read parallel parameters
|
||||
CALL verboseError('Reading Parallel configuration...')
|
||||
CALL readParallel(config)
|
||||
|
|
@ -1180,6 +1185,37 @@ MODULE moduleInput
|
|||
|
||||
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
|
||||
SUBROUTINE readVelDistr(config, inj, object)
|
||||
USE moduleErrors
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue