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

Commit

Permalink
Working on adding Rhill to initial condition generator
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Jul 27, 2021
1 parent 6d84eeb commit 01413dd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
sim.param['OUT_STAT'] = "UNKNOWN"
sim.param['GR'] = 'NO'
sim.param['CHK_CLOSE'] = 'YES'
sim.param['RHILL_PRESENT'] = 'YES'

sim.param['MU2KG'] = swiftest.MSun
sim.param['TU2S'] = swiftest.JD2S
Expand Down
10 changes: 7 additions & 3 deletions python/swiftest/swiftest/init_cond.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ def solar_system_horizons(plname, idval, param, ephemerides_start_date, ds):
tlab.append('vx')
tlab.append('vy')
tlab.append('vz')
plab.append('Rhill')

dims = ['time', 'id', 'vec']
t = np.array([0.0])
Expand Down Expand Up @@ -193,11 +192,16 @@ def solar_system_horizons(plname, idval, param, ephemerides_start_date, ds):
p11.append(pldata[key].vectors()['vy'][0] * VCONV)
p12.append(pldata[key].vectors()['vz'][0] * VCONV)
if ispl:
Rhill.append(pldata[key].elements()['a'][0] * (3 * MSun_over_Mpl[key]) ** (-THIRDLONG))
Rpl.append(planetradius[key] * DCONV)
GMpl.append(GMcb[0] / MSun_over_Mpl[key])
# Generate planet value vectors
pvec = np.vstack([p1, p2, p3, p4, p5, p6, GMpl, Rpl, p7, p8, p9, p10, p11, p12, Rhill])
if (param['RHILL_PRESENT'] == 'yes'):
print("We are appending the Hill sphere")
Rhill.append(pldata[key].elements()['a'][0] * (3 * MSun_over_Mpl[key]) ** (-THIRDLONG))
pvec = np.vstack([p1, p2, p3, p4, p5, p6, GMpl, Rpl, p7, p8, p9, p10, p11, p12, Rhill])
else:
print("Why aren't we appending the Hill sphere?")
pvec = np.vstack([p1, p2, p3, p4, p5, p6, GMpl, Rpl, p7, p8, p9, p10, p11, p12])
else:
pvec = np.vstack([p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12])
plab = tlab.copy()
Expand Down

0 comments on commit 01413dd

Please sign in to comment.