Gravity bug
Closed this issue · 3 comments
rbooth200 commented
The enclosed mass calculation is not correct - it does not include contributions from previous cells unless self-gravity is turned on. Also, the mass in a single volume should be computed as density * volume, i.e. density * (r_{i+1}^3 - r_i^3) / 3. Factors of 4 * pi can be ignored entirely in a spherical code. See here:
Line 53 in 7c3ccea
Schulik commented
I fixed that yesterday actually, is that out of date in the spherical branch??
Schulik commented
Updating the mass only in the case of self-gravity is intentional - because in all cases phi = grav(r, m(r)); but I guess we can switch that to an if-clause with grav(r,m(0)) and grav(r,m(r))
rbooth200 commented
Ok - looks like I had an out of date version