Skip to content

TRIPTYCH is a computer program that simulates the collision of two stars, including the orbital trajectories, merger, and evolution of the merger product.

Notifications You must be signed in to change notification settings

pau-amaro-seoane/triptych

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TRIPTYCH

Version 0.4
Aug 20, 2024
https://github.com/pau-amaro-seoane/triptych

BACKGROUND INFORMATION

TRIPTYCH is a computer program that simulates the collision of two stars, including the orbital trajectories, merger, and evolution of the merger product. The code therefore joins three branches of stellar astrophysics: dynamics, hydrodynamics, and evolution. This program is a first step toward realistic dynamical simulations of star clusters that include stellar collisions and stellar evolution.

The primary code developers and contributors for the first releases were Jarrod Hurley (AMNH), Piet Hut (IAS), Vicki Johnson (Pomona), James Lombardi (Vassar), Jun Makino (Tokyo), Steve McMillan (Drexel), Peter Teuben (Maryland), and Jessica Sawyer Warren (Rutgers). Recently, Pau Amaro Seoane has joined and J. Lombardi and he take care of keeping the programme up to date, including making it compatible with input produced by MESA. Once we replace the Numerical Recipe routines, this code will be free software licensed under the GNU GPL.

This program is an outgrowth of the first MODEST workshop. MODEST stands for MOdeling DEnse STellar systems. For more information, see the MODEST homepage and the following summary article:

"MODEST-1: Integrating Stellar Evolution and Stellar Dynamics."
Hut, Shara, Aarseth, Klessen, Lombardi, Makino, McMillan, Pols, Teuben, and Webbink 2002, submitted to New Astronomy; astro-ph/0207318.

FILES

Distributed with TRIPTYCH are the following files in different directories:

RUNS:

  • README
  • clean.sh
  • input
  • run.sh

bin:

  • triptych (executable, you need to produce this)

docs:

  • CHANGES
  • LICENSE
  • README
  • copying

sev1:

  • modest_evolution.f
  • modest_star.h

sev2:

  • modest_evolution0.0.f
  • modest_star.h

src:

  • dynamics.h
  • makemeastar.f
  • modest_dynamics.f
  • mrenv.f
  • star.f
  • zcnsts.f
  • hrdiag.f
  • mlwind.f
  • modest_evolution.f
  • params.h
  • triptych*
  • zdata.h
  • makefile
  • modest_common.h
  • modest_star.h
  • recipes.f
  • triptych.f
  • zfuncs.f

stellar_models:

  • m04.mdl
  • m06.mdl
  • m08.mdl

tools:

  • afvsai_triptych.f
  • sample_input
  • triptych.sm
  • createMESA2triptych.sh
  • run_simulations.sh
  • ThermalTime.sh
  • plot_density.py

Brief Description:

  • triptych.f: The main program that calls the dynamics, merger, and evolution modules.
  • modest_dynamics.f: Contains the subroutines that treat the orbital motion of the parent stars.
  • makemeastar.f: Contains the subroutine makemeastar that determines the profiles of a collision product.
  • modest_evolution.f: Contains the subroutines that treat the stellar evolution of the collision product.
  • makefile: A sample makefile that generates an executable.

sev1:

Contains the original "toy model" stellar evolution routines of Hut and Makino.

sev2:

Contains the default stellar evolution routines: Hurley's SSE wrappers and library (compiled with Intel Fortran compiler).

m0*.mdl:

Sample input data files, generated from data from the Yale Rotational Evolution Code, that model the profiles in Population II main sequence parent stars of 0.4, 0.6, and 0.8 solar masses. Data in these files are in cgs units:

  • Column 1 = Enclosed mass (m)
  • Column 2 = Radius at this (m)
  • Column 3 = Pressure at this (m)
  • Column 4 = Density at this (m)
  • Columns 5 through 18 = The fraction chemical abundances, by mass, for H, metals, He3, C12, C13, N14, N15, O16, O17, O18, H2, Li6, Li7, and Be9, in that order.

afvsai_triptych.f:

This code assumes that TRIPTYCH collided two identical stars and calls the hydro output file product.dat.

The code reads in product.dat line by line. On each line, it:

  1. Reads in the values of (m), (P), and (\rho).
  2. Calculates (A = P/\rho^{5/3}).
  3. Finds the two lines in the .mdl file that have mini values that straddle (m/2), the first of these two lines gives "last" quantities in the code below.
  4. Interpolates between these lines to get Piniuse and ainiuse.
  5. Prints to a file a line of data that contains (\log_{10}(A - A_{\text{ini}})) and (\log_{10}(P_{\text{ini}})) for plotting later.

We expect to find a slope of -1.1 on a log-log plot, since that is what TRIPTYCH/MMAS is using under the hood.

triptych.sm:

A file containing sample Super-Mongo macros for plotting the data generated by TRIPTYCH.

MESA Tools

In the tools directory, there are scripts that facilitate the use of MESA (Modules for Experiments in Stellar Astrophysics) to create initial conditions for TRIPTYCH. The two main shell scripts are:

  1. MESA2triptych.sh:
    This script converts an ASCII output file from MESA (specifically a profile*.data file) into a format compatible with TRIPTYCH. The Triptych format describes the internal structure of a star, with data on enclosed mass, radius, pressure, density, and chemical abundances for each mass shell.

    • Converts the mass from solar masses to grams.
    • Converts the radius from logarithmic solar radii to centimeters.
    • Converts pressure and density from logarithmic values to linear values in cgs units.
    • Reverses the order of the data to start from the center of the star.
    • Removes the first line with zero mass, as it could cause issues.
  2. run_simulation.sh:
    This script is used to run multiple simulations with TRIPTYCH using a variety of initial conditions. The script allows the user to specify ranges for velocity, periastron separation, and initial separation, as well as select which stellar models to use.

    • Allows for automatic handling of stalled simulations by setting a timeout.
    • Provides an estimate of the total number of simulations based on the parameter ranges.
    • Records the core radius and density from the simulations and calculates the thermal timescale.

GETTING STARTED

Once you have downloaded and uncompressed the source code, you can try out TRIPTYCH by following these steps:

  1. Compile the code:

    • For OpenBSD, with egfortran:
    • For Linux, with gfortran:
  2. Run the executable:

    • After compiling, you can run the program by typing:
      ./triptych
    • Follow the on-screen instructions, or for a faster start, you can use:
      ./triptych < sample_input > LOG
  3. Using MESA tools:

    • If you need to generate initial conditions for triptych using MESA, navigate to the tools directory. There, you will find the MESA2triptych.sh script, which converts MESA output files (profile*.data) into a format compatible with triptych. The script will take care of converting units, adjusting the order of the data, and ensuring compatibility with the triptych format.
  4. Running Multiple Simulations:

    • To run multiple simulations with varying initial conditions, use the run_simulation.sh script. This script allows you to specify ranges for velocity, periastron separation, and initial separation. It also provides options for selecting different stellar models and includes safeguards to handle simulations that may get stuck.

    • The script outputs important details, such as core radius and density, and calculates the thermal timescale, making it easier to analyze the results of multiple runs.

If you have any comments or suggestions, please consider emailing the developers at jalombar@allegheny.edu and amaro@riseup.net. Our goal is for this software package to evolve to meet the needs of the dense stellar cluster community.

About

TRIPTYCH is a computer program that simulates the collision of two stars, including the orbital trajectories, merger, and evolution of the merger product.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published