From 7d011e8f733c9bcb1de8d44c27bf912655d36068 Mon Sep 17 00:00:00 2001 From: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> Date: Thu, 21 Oct 2021 10:01:39 -0700 Subject: Div(B) Cleaning: Change Normalization of G (#2429) * PSATD with div(B) Cleaning: Change Normalization of G * Use New Normalization also in RZ * Use New Normalization also in FDTD * Reset Benchmark of Test divb_cleaning_3d --- .../SpectralSolver/SpectralAlgorithms/PsatdAlgorithm.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithm.cpp') diff --git a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithm.cpp b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithm.cpp index b3a4ec885..4fc2910db 100644 --- a/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithm.cpp +++ b/Source/FieldSolver/SpectralSolver/SpectralAlgorithms/PsatdAlgorithm.cpp @@ -324,11 +324,11 @@ PsatdAlgorithm::pushSpectralFields (SpectralFieldData& f) const { const Complex k_dot_B = kx * Bx_old + ky * By_old + kz * Bz_old; - fields(i,j,k,Idx.Bx) += I * c2 * S_ck * G_old * kx; - fields(i,j,k,Idx.By) += I * c2 * S_ck * G_old * ky; - fields(i,j,k,Idx.Bz) += I * c2 * S_ck * G_old * kz; + fields(i,j,k,Idx.Bx) += I * S_ck * G_old * kx; + fields(i,j,k,Idx.By) += I * S_ck * G_old * ky; + fields(i,j,k,Idx.Bz) += I * S_ck * G_old * kz; - fields(i,j,k,Idx.G) = C * G_old + I * S_ck * k_dot_B; + fields(i,j,k,Idx.G) = C * G_old + I * c2 * S_ck * k_dot_B; } if (time_averaging) @@ -373,9 +373,9 @@ PsatdAlgorithm::pushSpectralFields (SpectralFieldData& f) const if (divb_cleaning) { - fields(i,j,k,Idx.Bx_avg) += I * c2 * ep0 * X1 * G_old * kx; - fields(i,j,k,Idx.By_avg) += I * c2 * ep0 * X1 * G_old * ky; - fields(i,j,k,Idx.Bz_avg) += I * c2 * ep0 * X1 * G_old * kz; + fields(i,j,k,Idx.Bx_avg) += I * ep0 * X1 * G_old * kx; + fields(i,j,k,Idx.By_avg) += I * ep0 * X1 * G_old * ky; + fields(i,j,k,Idx.Bz_avg) += I * ep0 * X1 * G_old * kz; } } } -- cgit v1.2.3