From 7848dedfbea5096ca2ea2a32785aa6e9c7d5a37f Mon Sep 17 00:00:00 2001 From: Miikka Vaisala Date: Fri, 11 Sep 2020 11:58:09 +0800 Subject: [PATCH] Gauge correction to the induction equation for the sake of numerical stability. Used in my dynamo work, but apparantly was not done to the main repo. --- acc/mhd_solver/stencil_kernel.ac | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/acc/mhd_solver/stencil_kernel.ac b/acc/mhd_solver/stencil_kernel.ac index 0f37ea5..3aec600 100644 --- a/acc/mhd_solver/stencil_kernel.ac +++ b/acc/mhd_solver/stencil_kernel.ac @@ -449,11 +449,14 @@ induction(in VectorField uu, in VectorField aa) // yes this actually works. See pg.28 in arXiv:astro-ph/0109497) // u cross B - AC_eta * AC_mu0 * (AC_mu0^-1 * [- laplace A + grad div A ]) const Vector B = curl(aa); - const Vector grad_div = gradient_of_divergence(aa); + //MV: Due to gauge freedom we can reduce the gradient of scalar (divergence) from the equation + //const Vector grad_div = gradient_of_divergence(aa); const Vector lap = laplace_vec(aa); // Note, AC_mu0 is cancelled out - const Vector ind = cross(value(uu), B) - AC_eta * (grad_div - lap); + //MV: Due to gauge freedom we can reduce the gradient of scalar (divergence) from the equation + //const Vector ind = cross(value(uu), B) - AC_eta * (grad_div - lap); + const Vector ind = cross(value(uu), B) + AC_eta * lap; return ind; }