From 4cadfe536781bd7b901e7adaf8a361be7ebc9c13 Mon Sep 17 00:00:00 2001 From: JGonzalez Date: Sat, 29 Jun 2024 22:22:10 +0200 Subject: [PATCH] Seems are a bit better There is still less density in the axis. I don't find a reason why. There must be a modification to the weight... --- src/modules/mesh/2DCyl/moduleMesh2DCyl.f90 | 24 ++++------------------ src/modules/moduleInject.f90 | 5 ++--- 2 files changed, 6 insertions(+), 23 deletions(-) diff --git a/src/modules/mesh/2DCyl/moduleMesh2DCyl.f90 b/src/modules/mesh/2DCyl/moduleMesh2DCyl.f90 index dbe182f..4991b7e 100644 --- a/src/modules/mesh/2DCyl/moduleMesh2DCyl.f90 +++ b/src/modules/mesh/2DCyl/moduleMesh2DCyl.f90 @@ -586,32 +586,16 @@ MODULE moduleMesh2DCyl !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 - IF (self%r(1) == 0.D0) THEN - self%n1%v = self%n1%v * PI / 2.D0 - - END IF + self%n1%v = self%n1%v + fPsi(1)*self%volume 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 - IF (self%r(2) == 0.D0) THEN - self%n2%v = self%n2%v * PI / 2.D0 - - END IF + self%n2%v = self%n2%v + fPsi(2)*self%volume 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 - IF (self%r(3) == 0.D0) THEN - self%n3%v = self%n3%v * PI / 2.D0 - - END IF + self%n3%v = self%n3%v + fPsi(3)*self%volume 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 - IF (self%r(4) == 0.D0) THEN - self%n4%v = self%n4%v * PI / 2.D0 - - END IF + self%n4%v = self%n4%v + fPsi(4)*self%volume END SUBROUTINE volumeQuad diff --git a/src/modules/moduleInject.f90 b/src/modules/moduleInject.f90 index b37e021..fb01f75 100644 --- a/src/modules/moduleInject.f90 +++ b/src/modules/moduleInject.f90 @@ -306,8 +306,6 @@ MODULE moduleInject nMin = nMin + 1 nMax = nMin + self%nParticles - 1 - !Assign weight to particle. - partInj(nMin:nMax)%weight = self%species%weight !Particle is considered to be outside the domain partInj(nMin:nMax)%n_in = .FALSE. !$OMP END SINGLE @@ -315,10 +313,11 @@ MODULE moduleInject !$OMP DO DO n = nMin, nMax randomX = randomWeighted(self%cumWeight, self%sumWeight) - randomEdge => mesh%edges(self%edges(randomX))%obj !Random position in edge partInj(n)%r = randomEdge%randPos() + !Assign weight to particle. + partInj(n)%weight = self%species%weight !Volume associated to the edge: IF (ASSOCIATED(randomEdge%e1)) THEN partInj(n)%cell = randomEdge%e1%n