Skip to content

Commit bf53dfe

Browse files
committed
BUG: something is wrong with gravity!
1 parent 862b40a commit bf53dfe

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/init_mag_grid.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -492,10 +492,13 @@ bool Grid::init_dipole_grid(Quadtree quadtree_ion, Planets planet) {
492492
gravity_vcgc[2] = - mu * rad_unit_vcgc[2] % radius2i_scgc;
493493
gravity_potential_scgc.set_size(nX, nY, nAlts);
494494
gravity_potential_scgc.zeros();
495-
gravity_mag_scgc = sqrt(
496-
gravity_vcgc[0] % gravity_vcgc[0] +
497-
gravity_vcgc[1] % gravity_vcgc[1] +
498-
gravity_vcgc[2] % gravity_vcgc[2]);
495+
496+
gravity_mag_scgc = mu / pow(radius_scgc, 2);
497+
498+
//gravity_mag_scgc = sqrt(
499+
// gravity_vcgc[0] % gravity_vcgc[0] +
500+
// gravity_vcgc[1] % gravity_vcgc[1] +
501+
// gravity_vcgc[2] % gravity_vcgc[2]);
499502

500503
report.print(4, "Done gravity calculations for the dipole grid.");
501504

0 commit comments

Comments
 (0)