Rework of injection of particles with a special focus in 2DCyl to ensure an homogeneous distribution. #51
1 changed files with 24 additions and 5 deletions
Added an adhoc factor to correct injection
I think that the volume of the nodes is not being well calculated, maybe we need a better volume calculation for this, using multiple points (as it is done for K)
commit
6b78ae3738
|
|
@ -226,11 +226,11 @@ MODULE moduleMesh2DCyl
|
||||||
REAL(8):: p1(1:2), p2(1:2)
|
REAL(8):: p1(1:2), p2(1:2)
|
||||||
|
|
||||||
rnd = random()
|
rnd = random()
|
||||||
IF (self%r(1) == 0.D0 .OR. &
|
! IF (self%r(1) == 0.D0 .OR. &
|
||||||
self%r(2) == 0.D0) THEN
|
! self%r(2) == 0.D0) THEN
|
||||||
rnd = rnd**(1.D0/3.D0)
|
! rnd = rnd**(1.D0/3.D0)
|
||||||
|
!
|
||||||
END IF
|
! END IF
|
||||||
|
|
||||||
p1 = (/self%z(1), self%r(1) /)
|
p1 = (/self%z(1), self%r(1) /)
|
||||||
p2 = (/self%z(2), self%r(2) /)
|
p2 = (/self%z(2), self%r(2) /)
|
||||||
|
|
@ -578,6 +578,9 @@ MODULE moduleMesh2DCyl
|
||||||
REAL(8):: detJ
|
REAL(8):: detJ
|
||||||
REAL(8):: fPsi(1:4)
|
REAL(8):: fPsi(1:4)
|
||||||
REAL(8):: dPsi(1:3, 1:4), pDer(1:3, 1:3)
|
REAL(8):: dPsi(1:3, 1:4), pDer(1:3, 1:3)
|
||||||
|
REAL(8):: nodeR(1:3)
|
||||||
|
REAL(8), PARAMETER:: correction = 0.81D0 !TODO: No idea why this is needed, this needs more attention. Probably a better
|
||||||
|
! calculation of the volume is needed.
|
||||||
|
|
||||||
self%volume = 0.D0
|
self%volume = 0.D0
|
||||||
|
|
||||||
|
|
@ -592,9 +595,25 @@ MODULE moduleMesh2DCyl
|
||||||
self%volume = r*detJ*PI8 !4*2*pi
|
self%volume = r*detJ*PI8 !4*2*pi
|
||||||
!Computes volume per node
|
!Computes volume per node
|
||||||
self%n1%v = self%n1%v + fPsi(1)*self%volume
|
self%n1%v = self%n1%v + fPsi(1)*self%volume
|
||||||
|
nodeR = self%n1%getCoordinates()
|
||||||
|
if (nodeR(2) == 0.D0) then
|
||||||
|
self%n1%v = self%n1%v * correction
|
||||||
|
end if
|
||||||
self%n2%v = self%n2%v + fPsi(2)*self%volume
|
self%n2%v = self%n2%v + fPsi(2)*self%volume
|
||||||
|
nodeR = self%n2%getCoordinates()
|
||||||
|
if (nodeR(2) == 0.D0) then
|
||||||
|
self%n2%v = self%n2%v * correction
|
||||||
|
end if
|
||||||
self%n3%v = self%n3%v + fPsi(3)*self%volume
|
self%n3%v = self%n3%v + fPsi(3)*self%volume
|
||||||
|
nodeR = self%n3%getCoordinates()
|
||||||
|
if (nodeR(2) == 0.D0) then
|
||||||
|
self%n3%v = self%n3%v * correction
|
||||||
|
end if
|
||||||
self%n4%v = self%n4%v + fPsi(4)*self%volume
|
self%n4%v = self%n4%v + fPsi(4)*self%volume
|
||||||
|
nodeR = self%n4%getCoordinates()
|
||||||
|
if (nodeR(2) == 0.D0) then
|
||||||
|
self%n4%v = self%n4%v * correction
|
||||||
|
end if
|
||||||
|
|
||||||
END SUBROUTINE volumeQuad
|
END SUBROUTINE volumeQuad
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue