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.
This commit is contained in:
Miikka Vaisala
2020-09-11 11:58:09 +08:00
parent b7e7853b10
commit 7848dedfbe

View File

@@ -449,11 +449,14 @@ induction(in VectorField uu, in VectorField aa)
// yes this actually works. See pg.28 in arXiv:astro-ph/0109497) // 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 ]) // u cross B - AC_eta * AC_mu0 * (AC_mu0^-1 * [- laplace A + grad div A ])
const Vector B = curl(aa); 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); const Vector lap = laplace_vec(aa);
// Note, AC_mu0 is cancelled out // 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; return ind;
} }