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

Commit

Permalink
Merge branch 'OOPTides' into debug
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Aug 23, 2021
2 parents aca12ac + 67ba5a6 commit c1f440d
Show file tree
Hide file tree
Showing 9 changed files with 215 additions and 989 deletions.
3 changes: 3 additions & 0 deletions examples/symba_chambers_2013/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 56 additions & 0 deletions examples/symba_chambers_2013/init_cond.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/usr/bin/env python3
import swiftest
import numpy as np
import os

# Initialize simulation object
sim = swiftest.Simulation()

# Set unit conversion factors
MU2KG = swiftest.MSun
TU2S = swiftest.YR2S
DU2M = swiftest.AU2M
sim.param['MU2KG'] = MU2KG
sim.param['TU2S'] = TU2S
sim.param['DU2M'] = DU2M

# Simulation time parameters
sim.param['T0'] = 0.0
sim.param['TSTOP'] = 300e6
sim.param['DT'] = 6 * swiftest.JD2S / sim.param['TU2S']
t_print = 1000.0
iout = int(np.ceil(t_print / sim.param['DT']))
sim.param['ISTEP_OUT'] = iout
sim.param['ISTEP_DUMP'] = iout

# Optional output file names
sim.param['PARTICLE_OUT'] = "particle.dat"
sim.param['ENERGY'] = "YES"
sim.param['ENERGY_OUT'] = "energy.dat"
sim.param['PL_IN'] = "pl_chambers_2013.in"
sim.param['CB_IN'] = "sun_MsunAUYR.in"

# Simulation parameters
sim.param['FRAGMENTATION'] = "YES"
sim.param['ROTATION'] = "YES"
sim.param['CHK_RMAX'] = 1000.0
sim.param['CHK_EJECT'] = 1000.0

# Add central body
sim.add("Sun")
sim.add("Earth")

# Add bodies described in Chambers (2013) Sec. 2.1, with the uniform spatial distribution and two bodies sizes (big and small)
Nb = 14
Ns = 140
Mb = 2.8e-7
Ms = 2.8e-8
dens = 3000.0 / (MU2KG / DU2M**3)
Rb = (3 * Mb / (4 * np.pi * dens) )**(1.0 / 3.0)
Rs = (3 * Ms / (4 * np.pi * dens) )**(1.0 / 3.0)


sim.save("param.in")



69 changes: 37 additions & 32 deletions examples/symba_chambers_2013/param.in
Original file line number Diff line number Diff line change
@@ -1,32 +1,37 @@
!
! Parameter file for Chambers 2013 in units of Msun, AU, year
!
T0 0.0e0
TSTOP 1e8 ! simulation length in years
DT 0.016 ! stepsize in years
CB_IN sun_MsunAUYR.in
PL_IN pl_chambers_2013.in
TP_IN tp.in
IN_TYPE ASCII
ISTEP_OUT 6250 ! output cadence
ISTEP_DUMP 6250 ! system dump cadence
BIN_OUT bin.dat
PARTICLE_OUT particle.dat
OUT_TYPE REAL8 ! double precision real output
OUT_FORM EL ! osculating element output
OUT_STAT REPLACE
CHK_CLOSE yes ! check for planetary close encounters
CHK_RMAX 100000.0 ! discard outside of
EXTRA_FORCE no ! no extra user-defined forces
BIG_DISCARD no ! output all planets if anything discarded
RHILL_PRESENT yes ! Hill's sphere radii in input file
MU2KG 1.98847e30 ! (M_sun-> kg)
DU2M 1.495979e11 ! distance unit to meters (AU --> m)
TU2S 3.15569259747e7 ! time unit to seconds (years --> seconds)
GMTINY 1e-10
ENERGY yes
ENERGY_OUT energy.dat
ROTATION yes
FRAGMENTATION yes
DISCARD_OUT discard.out
SEED 8 12261555 871132 92734722 21132443 36344777 4334443 219291656 3848566
! VERSION Swiftest parameter input
T0 0.0
TSTOP 300000000.0
DT 0.01642710472279261
ISTEP_OUT 60876
ISTEP_DUMP 60876
OUT_FORM EL
OUT_TYPE REAL8
OUT_STAT REPLACE
IN_TYPE ASCII
PL_IN pl_chambers_2013.in
TP_IN tp.in
CB_IN sun_MsunAUYR.in
BIN_OUT bin.dat
CHK_QMIN -1.0
CHK_RMIN -1.0
CHK_RMAX 1000.0
CHK_EJECT 1000.0
CHK_QMIN_COORD HELIO
CHK_QMIN_RANGE -1.0 -1.0
MU2KG 1.988409870698051e+30
TU2S 31557600.0
DU2M 149597870700.0
IN_FORM XV
ENC_OUT enc.dat
EXTRA_FORCE NO
DISCARD_OUT discard.out
PARTICLE_OUT particle.dat
BIG_DISCARD NO
CHK_CLOSE YES
RHILL_PRESENT YES
FRAGMENTATION YES
ROTATION YES
TIDES NO
ENERGY YES
GR NO
ENERGY_OUT energy.dat
Loading

0 comments on commit c1f440d

Please sign in to comment.