From 845757456706601e8c55c39380a821dbcc65d56c Mon Sep 17 00:00:00 2001 From: Grzegorz Kowal Date: Sun, 27 Dec 2020 20:56:48 -0300 Subject: [PATCH] INTEGRALS: Fix sign of diffusion terms in reconnection rate measure. Signed-off-by: Grzegorz Kowal --- sources/integrals.F90 | 44 +++++++++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 16 deletions(-) diff --git a/sources/integrals.F90 b/sources/integrals.F90 index 8635c2e..a0bc451 100644 --- a/sources/integrals.F90 +++ b/sources/integrals.F90 @@ -744,7 +744,7 @@ module integrals ! diffusion of magnetic energy through the lower X boundary ! inarr(26) = inarr(26) & - + sum(tmp(1,:,:) * pdata%q(ibz,nb,nb:ne,nb:ne) & + - sum(tmp(1,:,:) * pdata%q(ibz,nb,nb:ne,nb:ne) & - tmp(2,:,:) * pdata%q(iby,nb,nb:ne,nb:ne)) * dyz #else /* NDIMS == 3 */ ! the Y component of current density @@ -762,7 +762,7 @@ module integrals ! diffusion of magnetic energy through the lower X boundary ! inarr(26) = inarr(26) & - + sum(tmp(1,:,:) * pdata%q(ibz,nb,nb:ne, : ) & + - sum(tmp(1,:,:) * pdata%q(ibz,nb,nb:ne, : ) & - tmp(2,:,:) * pdata%q(iby,nb,nb:ne, : )) * dyz #endif /* NDIMS == 3 */ @@ -816,7 +816,7 @@ module integrals ! diffusion of magnetic energy through the upper X boundary ! inarr(26) = inarr(26) & - - sum(tmp(1,:,:) * pdata%q(ibz,ne,nb:ne,nb:ne) & + + sum(tmp(1,:,:) * pdata%q(ibz,ne,nb:ne,nb:ne) & - tmp(2,:,:) * pdata%q(iby,ne,nb:ne,nb:ne)) * dyz #else /* NDIMS == 3 */ ! the Y component of current density @@ -834,7 +834,7 @@ module integrals ! diffusion of magnetic energy through the upper X boundary ! inarr(26) = inarr(26) & - - sum(tmp(1,:,:) * pdata%q(ibz,ne,nb:ne, : ) & + + sum(tmp(1,:,:) * pdata%q(ibz,ne,nb:ne, : ) & - tmp(2,:,:) * pdata%q(iby,ne,nb:ne, : )) * dyz #endif /* NDIMS == 3 */ @@ -929,13 +929,15 @@ module integrals - 0.5d+00 * (pdata%q(iby,nb:ne,nb ,nbu:neu) & - pdata%q(iby,nb:ne,nb ,nbl:nel)) / dh(3) - inarr(15) = inarr(15) - sum(sign(tmp(:,1,:), & +! diffusion of Bx through the lower Y boundary +! + inarr(15) = inarr(15) + sum(sign(tmp(:,1,:), & pdata%q(ibx,nb:ne,nb,nb:ne))) * dxz ! diffusion of magnetic energy through the lower Y boundary ! inarr(27) = inarr(27) & - + sum(tmp(:,1,:) * pdata%q(ibx,nb:ne,nb,nb:ne) & + - sum(tmp(:,1,:) * pdata%q(ibx,nb:ne,nb,nb:ne) & - tmp(:,2,:) * pdata%q(ibz,nb:ne,nb,nb:ne)) * dxz #else /* NDIMS == 3 */ ! the Z component of current density @@ -950,13 +952,15 @@ module integrals tmp(:,2,:) = (pdata%q(ibz,nb:ne,nb , : ) & - pdata%q(ibz,nb:ne,nbl, : )) / dh(2) - inarr(15) = inarr(15) - sum(sign(tmp(:,1,:), & +! diffusion of Bx through the lower Y boundary +! + inarr(15) = inarr(15) + sum(sign(tmp(:,1,:), & pdata%q(ibx,nb:ne,nb , : ))) * dxz ! diffusion of magnetic energy through the lower Y boundary ! inarr(27) = inarr(27) & - + sum(tmp(:,1,:) * pdata%q(ibx,nb:ne,nb, : ) & + - sum(tmp(:,1,:) * pdata%q(ibx,nb:ne,nb, : ) & - tmp(:,2,:) * pdata%q(ibz,nb:ne,nb, : )) * dxz #endif /* NDIMS == 3 */ @@ -1047,13 +1051,15 @@ module integrals - 0.5d+00 * (pdata%q(ibz,nbu:neu,ne,nb :ne ) & - pdata%q(ibz,nbl:nel,ne,nb :ne )) / dh(1) - inarr(15) = inarr(15) + sum(sign(tmp(:,1,:), & +! diffusion of Bx through the upper Y boundary +! + inarr(15) = inarr(15) - sum(sign(tmp(:,1,:), & pdata%q(ibx,nb:ne,ne,nb:ne))) * dxz ! diffusion of magnetic energy through the upper Y boundary ! inarr(27) = inarr(27) & - - sum(tmp(:,1,:) * pdata%q(ibx,nb:ne,ne,nb:ne) & + + sum(tmp(:,1,:) * pdata%q(ibx,nb:ne,ne,nb:ne) & - tmp(:,2,:) * pdata%q(ibz,nb:ne,ne,nb:ne)) * dxz #else /* NDIMS == 3 */ ! the Z component of current density @@ -1068,13 +1074,15 @@ module integrals tmp(:,2,:) = 0.5d+00 * (pdata%q(ibz,nbl:nel,ne, : ) & - pdata%q(ibz,nbu:neu,ne, : )) / dh(1) - inarr(15) = inarr(15) + sum(sign(tmp(:,1,:), & +! diffusion of Bx through the upper Y boundary +! + inarr(15) = inarr(15) - sum(sign(tmp(:,1,:), & pdata%q(ibx,nb:ne,ne, : ))) * dxz ! diffusion of magnetic energy through the upper Y boundary ! inarr(27) = inarr(27) & - - sum(tmp(:,1,:) * pdata%q(ibx,nb:ne,ne, : ) & + + sum(tmp(:,1,:) * pdata%q(ibx,nb:ne,ne, : ) & - tmp(:,2,:) * pdata%q(ibz,nb:ne,ne, : )) * dxz #endif /* NDIMS == 3 */ @@ -1129,13 +1137,15 @@ module integrals - 0.5d+00 * (pdata%q(ibz,nbu:neu,nb:ne,nb ) & - pdata%q(ibz,nbl:nel,nb:ne,nb )) / dh(1) - inarr(18) = inarr(18) - sum(sign(tmp(:,:,2), & +! diffusion of Bx through the lower Z boundary +! + inarr(18) = inarr(18) + sum(sign(tmp(:,:,2), & pdata%q(ibx,nb:ne,nb:ne,nb))) * dxy ! diffusion of magnetic energy through the lower Z boundary ! inarr(28) = inarr(28) & - + sum(tmp(:,:,1) * pdata%q(iby,nb:ne,nb:ne,nb) & + - sum(tmp(:,:,1) * pdata%q(iby,nb:ne,nb:ne,nb) & - tmp(:,:,2) * pdata%q(ibx,nb:ne,nb:ne,nb)) * dxy end if ! resistivity @@ -1184,13 +1194,15 @@ module integrals - 0.5d+00 * (pdata%q(ibz,nbu:neu,nb:ne,ne ) & - pdata%q(ibz,nbl:nel,nb:ne,ne )) / dh(1) - inarr(18) = inarr(18) + sum(sign(tmp(:,:,1), & +! diffusion of Bx through the upper Z boundary +! + inarr(18) = inarr(18) - sum(sign(tmp(:,:,2), & pdata%q(ibx,nb:ne,nb:ne,ne))) * dxy ! diffusion of magnetic energy through the upper Z boundary ! inarr(28) = inarr(28) & - - sum(tmp(:,:,1) * pdata%q(iby,nb:ne,nb:ne,ne) & + + sum(tmp(:,:,1) * pdata%q(iby,nb:ne,nb:ne,ne) & - tmp(:,:,2) * pdata%q(ibx,nb:ne,nb:ne,ne)) * dxy end if ! resistivity