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

Commit

Permalink
Added the solar impact test case
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Jan 10, 2023
1 parent 51ad2db commit 10f6f9e
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
!Fragmentation
!helio_gr_test
!whm_gr_test
!Chambers2013
!Chambers2013
!solar_impact
35 changes: 35 additions & 0 deletions examples/solar_impact/sundiver.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
"""
Copyright 2023 - David Minton, Carlisle Wishard, Jennifer Pouplin, Jake Elliott, & Dana Singh
This file is part of Swiftest.
Swiftest is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License
as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Swiftest is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Swiftest.
If not, see: https://www.gnu.org/licenses.
"""

#!/usr/bin/env python3
import swiftest
import numpy as np

# Initialize the simulation object as a variable. Arguments may be defined here or through the sim.run() method.
sim = swiftest.Simulation(compute_conservation_values=True, rotation=True, integrator="symba")

# Add the modern planets and the Sun using the JPL Horizons Database.
sim.add_solar_system_body(["Sun","Mercury","Venus","Earth","Mars","Jupiter","Saturn","Uranus","Neptune","Pluto"])

density = 3000.0 * sim.KG2MU / sim.M2DU**3

# Make a body with a periapsis inside the Sun's radius
q = 0.9 * swiftest.RSun * sim.M2DU
a = 0.1
e = 1.0 - q / a
M = 1e-4 * swiftest.MEarth * sim.KG2MU
R = (3 * M / (4 * np.pi * density)) ** (1.0 / 3.0)
rot = 2 * 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()

# Run the simulation. Arguments may be defined here or thorugh the swiftest.Simulation() method.
sim.run(tstart=0.0, tstop=2e-2, dt=0.001, istep_out=1, dump_cadence=0)

0 comments on commit 10f6f9e

Please sign in to comment.