diff --git a/examples/solar_impact/sundiver.py b/examples/solar_impact/sundiver.py old mode 100644 new mode 100755 index 02e320f69..c279b4ec4 --- a/examples/solar_impact/sundiver.py +++ b/examples/solar_impact/sundiver.py @@ -46,9 +46,9 @@ q = 0.9 * swiftest.RSun * sim.M2DU a = 0.1 e = 1.0 - q / a -M = 1e-4 * swiftest.MEarth * sim.KG2MU +M = 2e0 * swiftest.MEarth * sim.KG2MU R = (3 * M / (4 * np.pi * density)) ** (1.0 / 3.0) -rot = 2 * sim.init_cond.sel(name="Earth")['rot'] +rot = 4 * sim.init_cond.sel(name="Earth")['rot'] sim.add_body(name="Sundiver", a=a, e=e, inc=0.0, capom=0.0, omega=0.0, capm=180.0, mass=M, radius=R, Ip=[0.4,0.4,0.4], rot=rot) sim.get_parameter() diff --git a/src/swiftest/swiftest_util.f90 b/src/swiftest/swiftest_util.f90 index cc1b9e398..fcf130f83 100644 --- a/src/swiftest/swiftest_util.f90 +++ b/src/swiftest/swiftest_util.f90 @@ -494,7 +494,7 @@ module subroutine swiftest_util_coord_vb2vh_pl(self, cb) associate(pl => self, npl => self%nbody) cb%vb(:) = 0.0_DP do i = npl, 1, -1 - cb%vb(:) = cb%vb(:) - pl%Gmass(i) * pl%vb(:, i) / cb%Gmass + if (pl%status(i) /= INACTIVE) cb%vb(:) = cb%vb(:) - pl%Gmass(i) * pl%vb(:, i) / cb%Gmass end do do concurrent(i = 1:npl) pl%vh(:, i) = pl%vb(:, i) - cb%vb(:) diff --git a/src/symba/symba_discard.f90 b/src/symba/symba_discard.f90 index aa1f52296..a46ce057d 100644 --- a/src/symba/symba_discard.f90 +++ b/src/symba/symba_discard.f90 @@ -186,7 +186,7 @@ subroutine symba_discard_conserve_energy_and_momentum(pl, nbody_system, param, i becb1 = -(3 * cb%Gmass * cb%mass) / (5 * cb%radius) ! Add planet angular momentum to central body accumulator - cb%dL(:) = Lpl(:) + cb%dL(:) + cb%dL(:) = Lpl(:) + cb%dL(:) + Lcb(:) ! Update rotation of central body to by consistent with its angular momentum if (param%lrotation) then drot0(:) = cb%L0(:)/ (cb%Ip(3) * cb%mass * cb%radius**2)