Merge branch 'issue/volumeNode' into 'feature/average'
Fix for node volume See merge request JorgeGonz/fpakc!28
This commit is contained in:
commit
78763bbd84
3 changed files with 27 additions and 20 deletions
|
|
@ -320,7 +320,18 @@ MODULE moduleMesh2DCyl
|
||||||
fPsi = self%fPsi(xi)
|
fPsi = self%fPsi(xi)
|
||||||
r = DOT_PRODUCT(fPsi,self%r)
|
r = DOT_PRODUCT(fPsi,self%r)
|
||||||
self%volume = r*detJ
|
self%volume = r*detJ
|
||||||
self%arNodes = fPsi*r*detJ
|
xi = (/-5.D-1, -5.D-1, 0.D0/)
|
||||||
|
r = DOT_PRODUCT(self%fPsi(xi),self%r)
|
||||||
|
self%arNodes(1) = fPsi(1)*r*detJ
|
||||||
|
xi = (/ 5.D-1, -5.D-1, 0.D0/)
|
||||||
|
r = DOT_PRODUCT(self%fPsi(xi),self%r)
|
||||||
|
self%arNodes(2) = fPsi(2)*r*detJ
|
||||||
|
xi = (/ 5.D-1, 5.D-1, 0.D0/)
|
||||||
|
r = DOT_PRODUCT(self%fPsi(xi),self%r)
|
||||||
|
self%arNodes(3) = fPsi(3)*r*detJ
|
||||||
|
xi = (/-5.D-1, 5.D-1, 0.D0/)
|
||||||
|
r = DOT_PRODUCT(self%fPsi(xi),self%r)
|
||||||
|
self%arNodes(4) = fPsi(4)*r*detJ
|
||||||
|
|
||||||
END SUBROUTINE areaQuad
|
END SUBROUTINE areaQuad
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -151,8 +151,9 @@ MODULE moduleMeshOutputGmsh2
|
||||||
INTEGER:: n
|
INTEGER:: n
|
||||||
REAL(8):: time
|
REAL(8):: time
|
||||||
CHARACTER(:), ALLOCATABLE:: fileName
|
CHARACTER(:), ALLOCATABLE:: fileName
|
||||||
CHARACTER (LEN=iterationDigits):: tstring
|
CHARACTER (LEN=iterationDigits):: tString
|
||||||
CHARACTER(:), ALLOCATABLE:: title
|
CHARACTER(:), ALLOCATABLE:: title
|
||||||
|
CHARACTER (LEN=2):: cString
|
||||||
|
|
||||||
SELECT TYPE(self)
|
SELECT TYPE(self)
|
||||||
TYPE IS(meshParticles)
|
TYPE IS(meshParticles)
|
||||||
|
|
@ -168,9 +169,9 @@ MODULE moduleMeshOutputGmsh2
|
||||||
|
|
||||||
IF (collOutput) THEN
|
IF (collOutput) THEN
|
||||||
time = DBLE(t)*tauMin*ti_ref
|
time = DBLE(t)*tauMin*ti_ref
|
||||||
WRITE(tstring, iterationFormat) t
|
WRITE(tString, iterationFormat) t
|
||||||
|
|
||||||
fileName='OUTPUT_' // tstring// '_Collisions.msh'
|
fileName='OUTPUT_' // tString// '_Collisions.msh'
|
||||||
WRITE(*, "(6X,A15,A)") "Creating file: ", fileName
|
WRITE(*, "(6X,A15,A)") "Creating file: ", fileName
|
||||||
OPEN (60, file = path // folder // '/' // fileName)
|
OPEN (60, file = path // folder // '/' // fileName)
|
||||||
|
|
||||||
|
|
@ -178,7 +179,8 @@ MODULE moduleMeshOutputGmsh2
|
||||||
|
|
||||||
DO k = 1, nCollPairs
|
DO k = 1, nCollPairs
|
||||||
DO c = 1, interactionMatrix(k)%amount
|
DO c = 1, interactionMatrix(k)%amount
|
||||||
WRITE(title, "(5A,I2)") '"Pair ', interactionMatrix(k)%sp_i%name, '-', interactionMatrix(k)%sp_j%name, ' collision ', c
|
WRITE(cString, "(I2)") c
|
||||||
|
title = '"Pair ' // interactionMatrix(k)%sp_i%name // '-' // interactionMatrix(k)%sp_j%name // ' collision ' // cString
|
||||||
CALL writeGmsh2HeaderElementData(60, title, t, time, 1, self%numVols)
|
CALL writeGmsh2HeaderElementData(60, title, t, time, 1, self%numVols)
|
||||||
DO n=1, self%numVols
|
DO n=1, self%numVols
|
||||||
WRITE(60, "(I6,I10)") n + numEdges, self%vols(n)%obj%tallyColl(k)%tally(c)
|
WRITE(60, "(I6,I10)") n + numEdges, self%vols(n)%obj%tallyColl(k)%tally(c)
|
||||||
|
|
|
||||||
|
|
@ -660,24 +660,18 @@ MODULE moduleSolver
|
||||||
TYPE(particle), INTENT(inout):: part
|
TYPE(particle), INTENT(inout):: part
|
||||||
CLASS(meshVol), POINTER, INTENT(in):: volOld
|
CLASS(meshVol), POINTER, INTENT(in):: volOld
|
||||||
CLASS(meshVol), POINTER, INTENT(inout):: volNew
|
CLASS(meshVol), POINTER, INTENT(inout):: volNew
|
||||||
REAL(8):: fractionVolume, fractionWeight
|
REAL(8):: fractionVolume, pSplit
|
||||||
INTEGER:: nSplit
|
|
||||||
|
|
||||||
!If particle has change cell, call Weighting scheme
|
!If particle changes volume to smaller cell
|
||||||
IF (volOld%n /= volNew%n) THEN
|
IF (volOld%volume > volNew%volume) THEN
|
||||||
fractionVolume = volOld%volume/volNew%volume
|
fractionVolume = volOld%volume/volNew%volume
|
||||||
|
|
||||||
part%weight = part%weight * fractionVolume
|
!Calculate probability of splitting particle
|
||||||
|
pSplit = 1.D0 - DEXP(-fractionVolume)
|
||||||
|
|
||||||
fractionWeight = part%weight / part%species%weight
|
IF (random() < pSplit THEN
|
||||||
|
!Split particle in two
|
||||||
IF (fractionWeight >= 2.D0) THEN
|
CALL splitParticle(part, 2, volNew)
|
||||||
nSplit = FLOOR(fractionWeight)
|
|
||||||
CALL splitParticle(part, nSplit, volNew)
|
|
||||||
|
|
||||||
ELSEIF (part%weight < 1.D0) THEN
|
|
||||||
!Particle has lost statistical meaning and will be terminated
|
|
||||||
part%n_in = .FALSE.
|
|
||||||
|
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue