Shifting towards constant number of particles per edge
So now each edge has the same number of particles and the weight of each particle is calculated based on the surface of each edge compared to the total one. Only in 2DCyl, still to extend to other geometries. Not perfect constant density, but the issue might be the node volume.
This commit is contained in:
parent
fa23f9481a
commit
b36f9c2615
5 changed files with 36 additions and 49 deletions
|
|
@ -144,6 +144,7 @@ MODULE moduleMesh2DCyl
|
|||
USE moduleSpecies
|
||||
USE moduleBoundary
|
||||
USE moduleErrors
|
||||
USE moduleConstParam, ONLY: PI
|
||||
IMPLICIT NONE
|
||||
|
||||
CLASS(meshEdge2DCyl), INTENT(out):: self
|
||||
|
|
@ -163,7 +164,15 @@ MODULE moduleMesh2DCyl
|
|||
r2 = self%n2%getCoordinates()
|
||||
self%z = (/r1(1), r2(1)/)
|
||||
self%r = (/r1(2), r2(2)/)
|
||||
self%weight = DABS(self%r(2)**2 - self%r(1)**2)
|
||||
!Edge surface
|
||||
IF (self%z(2) /= self%z(1)) THEN
|
||||
self%surface = ABS(self%r(2) + self%r(1))*ABS(self%z(2) - self%z(1))
|
||||
|
||||
ELSE
|
||||
self%surface = ABS(self%r(2)**2 - self%r(1)**2)
|
||||
|
||||
END IF
|
||||
self%surface = self%surface * PI
|
||||
!Normal vector
|
||||
self%normal = (/ -(self%r(2)-self%r(1)), &
|
||||
self%z(2)-self%z(1) , &
|
||||
|
|
@ -586,18 +595,10 @@ MODULE moduleMesh2DCyl
|
|||
!Computes total volume of the cell
|
||||
self%volume = r*detJ*PI8 !4*2*pi
|
||||
!Computes volume per node
|
||||
Xi = (/-5.D-1, -5.D-1, 0.D0/)
|
||||
r = self%gatherF(Xi, 4, self%r)
|
||||
self%n1%v = self%n1%v + fPsi(1)*r*detJ*PI8
|
||||
Xi = (/ 5.D-1, -5.D-1, 0.D0/)
|
||||
r = self%gatherF(Xi, 4, self%r)
|
||||
self%n2%v = self%n2%v + fPsi(2)*r*detJ*PI8
|
||||
Xi = (/ 5.D-1, 5.D-1, 0.D0/)
|
||||
r = self%gatherF(Xi, 4, self%r)
|
||||
self%n3%v = self%n3%v + fPsi(3)*r*detJ*PI8
|
||||
Xi = (/-5.D-1, 5.D-1, 0.D0/)
|
||||
r = self%gatherF(Xi, 4, self%r)
|
||||
self%n4%v = self%n4%v + fPsi(4)*r*detJ*PI8
|
||||
self%n1%v = self%n1%v + fPsi(1)*self%volume
|
||||
self%n2%v = self%n2%v + fPsi(2)*self%volume
|
||||
self%n3%v = self%n3%v + fPsi(3)*self%volume
|
||||
self%n4%v = self%n4%v + fPsi(4)*self%volume
|
||||
|
||||
END SUBROUTINE volumeQuad
|
||||
|
||||
|
|
|
|||
|
|
@ -296,20 +296,6 @@ MODULE moduleMeshInputGmsh2
|
|||
|
||||
CLOSE(10)
|
||||
|
||||
! Adjust node volume at axis
|
||||
SELECT CASE(self%geometry)
|
||||
CASE("Cyl")
|
||||
DO n = 1, self%numNodes
|
||||
r = self%nodes(n)%obj%getCoordinates()
|
||||
IF (r(2) == 0.D0) THEN
|
||||
self%nodes(n)%obj%v = self%nodes(n)%obj%v * 2.0D0!2.0D0/3.0D0
|
||||
|
||||
END IF
|
||||
|
||||
END DO
|
||||
|
||||
END SELECT
|
||||
|
||||
!Call mesh connectivity
|
||||
CALL self%connectMesh
|
||||
|
||||
|
|
|
|||
|
|
@ -496,19 +496,19 @@ MODULE moduleMeshInputVTU
|
|||
|
||||
END DO
|
||||
|
||||
! Adjust node volume at axis
|
||||
SELECT CASE(self%geometry)
|
||||
CASE("Cyl")
|
||||
DO n = 1, numNodes
|
||||
r = self%nodes(n)%obj%getCoordinates()
|
||||
IF (r(2) == 0.D0) THEN
|
||||
self%nodes(n)%obj%v = self%nodes(n)%obj%v * 2.0D0!2.0D0/3.0D0
|
||||
|
||||
END IF
|
||||
|
||||
END DO
|
||||
|
||||
END SELECT
|
||||
! ! Adjust node volume at axis
|
||||
! SELECT CASE(self%geometry)
|
||||
! CASE("Cyl")
|
||||
! DO n = 1, numNodes
|
||||
! r = self%nodes(n)%obj%getCoordinates()
|
||||
! IF (r(2) == 0.D0) THEN
|
||||
! self%nodes(n)%obj%v = self%nodes(n)%obj%v * 2.0D0!2.0D0/3.0D0
|
||||
!
|
||||
! END IF
|
||||
!
|
||||
! END DO
|
||||
!
|
||||
! END SELECT
|
||||
|
||||
!Call mesh connectivity
|
||||
CALL self%connectMesh
|
||||
|
|
|
|||
|
|
@ -78,6 +78,8 @@ MODULE moduleMesh
|
|||
REAL(8):: normal(1:3)
|
||||
!Weight for random injection of particles
|
||||
REAL(8):: weight = 1.D0
|
||||
! Surface of edge
|
||||
REAL(8):: surface = 0.D0
|
||||
!Pointer to boundary type
|
||||
TYPE(boundaryCont), POINTER:: boundary
|
||||
!Array of functions for boundary conditions
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue