From 11831a973d86aacc0d8e44b01fd6ecc203300b1a Mon Sep 17 00:00:00 2001 From: JGonzalez Date: Tue, 9 Jul 2024 21:25:30 +0200 Subject: [PATCH] Still not working Trying to have a very simple volume per node assuming a rectangle and the density at the axis it higher than it should (kinda like when using the more accurate volume calculation). This is still weird. I also suspect that the size of the first cell in the axis will also affect this... --- src/modules/mesh/2DCyl/moduleMesh2DCyl.f90 | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/modules/mesh/2DCyl/moduleMesh2DCyl.f90 b/src/modules/mesh/2DCyl/moduleMesh2DCyl.f90 index 3f88902..bac265c 100644 --- a/src/modules/mesh/2DCyl/moduleMesh2DCyl.f90 +++ b/src/modules/mesh/2DCyl/moduleMesh2DCyl.f90 @@ -582,6 +582,8 @@ MODULE moduleMesh2DCyl REAL(8):: detJ REAL(8):: fPsi(1:4) REAL(8):: dPsi(1:3, 1:4), pDer(1:3, 1:3) + REAL(8):: corrUp, corrDown + REAL(8):: dZ, r2, r1 self%volume = 0.D0 @@ -593,12 +595,20 @@ MODULE moduleMesh2DCyl fPsi = self%fPsi(Xi, 4) r = DOT_PRODUCT(fPsi,self%r) !Computes total volume of the cell - self%volume = r*detJ*PI8 !4*2*pi + self%volume = r*detJ*PI8 !2*pi * 4 (weight of 1 point 2D-Gaussian integral) !Computes volume per node - 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 + ! 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 + dZ = MAXVAL(self%z) - MIN(self%z) + r2 = MAXVAL(self%r) + r1 = MINVAL(self%r) + + self%n1%v = self%n1%v + dZ/2.D0 * PI * ( r2**2 - 3.0D0*r1**2 + 2.0D0*r2*r1)*0.25D0 + self%n2%v = self%n2%v + dZ/2.D0 * PI * ( r2**2 - 3.0D0*r1**2 + 2.0D0*r2*r1)*0.25D0 + self%n3%v = self%n3%v + dZ/2.D0 * PI * (3.0D0*r2**2 - r1**2 - 2.0D0*r2*r1)*0.25D0 + self%n4%v = self%n4%v + dZ/2.D0 * PI * (3.0D0*r2**2 - r1**2 - 2.0D0*r2*r1)*0.25D0 END SUBROUTINE volumeQuad