Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Merge branch 'debug'
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Mar 20, 2023
2 parents 3554088 + e5b28e4 commit d84d88f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions examples/solar_impact/sundiver.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
2 changes: 1 addition & 1 deletion src/swiftest/swiftest_util.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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(:)
Expand Down
2 changes: 1 addition & 1 deletion src/symba/symba_discard.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d84d88f

Please sign in to comment.