From 2ee6c1764eb5c22896a8ee456bbd98fb58b3fc23 Mon Sep 17 00:00:00 2001 From: Jorge Gonzalez Date: Thu, 23 Feb 2023 08:18:46 +0100 Subject: [PATCH] Probes were not working properly Issue in the output of probes and in the detection of particles inside the velocity grid. --- src/modules/moduleProbe.f90 | 8 +++++--- src/modules/solver/moduleSolver.f90 | 3 ++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/modules/moduleProbe.f90 b/src/modules/moduleProbe.f90 index 2d2295a..83a567a 100644 --- a/src/modules/moduleProbe.f90 +++ b/src/modules/moduleProbe.f90 @@ -95,7 +95,7 @@ MODULE moduleProbe !Maximum radius !TODO: Make this an input parameter - self%maxR = 1.D-1/L_ref + self%maxR = 1.D0 !Init the probe lock CALL OMP_INIT_LOCK(self%lock) @@ -110,6 +110,8 @@ MODULE moduleProbe INTEGER, INTENT(out):: i, j, k LOGICAL, INTENT(out):: inside + inside = .TRUE. + i = FLOOR((vp(1) - self%vi(1))/self%vrange(1)*(REAL(self%nv(1) - 1)) + 1.D0) IF (i >= self%nv(1) .OR. i < 1) inside = .FALSE. j = FLOOR((vp(2) - self%vj(1))/self%vrange(2)*(REAL(self%nv(2) - 1)) + 1.D0) @@ -198,7 +200,7 @@ MODULE moduleProbe WRITE(tstring, iterationFormat) t WRITE(pstring, "(I3.3)") self%id - fileName='OUTPUT_' // tstring// '_f_' // pstring // '.dat' + fileName='Probe_' // tstring// '_f_' // pstring // '.dat' WRITE(*, "(6X,A15,A)") "Creating file: ", fileName OPEN (10, file = path // folder // '/' // fileName) WRITE(10, "(A1, 1X, A)") "# ", self%species%name @@ -268,7 +270,7 @@ MODULE moduleProbe DO i = 1, nProbes probe(i)%f = 0.D0 - probe(i)%update = MOD(t, probe(i)%every) == 0 .OR. t == tFinal + probe(i)%update = MOD(t, probe(i)%every) == 0 .OR. t == tFinal .OR. t == tInitial END DO diff --git a/src/modules/solver/moduleSolver.f90 b/src/modules/solver/moduleSolver.f90 index da2c9c4..69d4055 100644 --- a/src/modules/solver/moduleSolver.f90 +++ b/src/modules/solver/moduleSolver.f90 @@ -523,6 +523,8 @@ MODULE moduleSolver END IF + CALL outputProbes(t) + counterOutput = counterOutput + 1 IF (counterOutput >= triggerOutput .OR. & t == tFinal .OR. t == tInitial) THEN @@ -530,7 +532,6 @@ MODULE moduleSolver !Resets output counter counterOutput=0 - CALL outputProbes(t) CALL mesh%printOutput(t) IF (ASSOCIATED(meshForMCC)) CALL meshForMCC%printColl(t) CALL mesh%printEM(t)