Lab 1

Using the Binary Module - Evolving a donor star

Solving for Mass Transfer in a DWD binary system

Double white dwarf binaries can display a rich variety of outcomes, depending on their mass ratio (e.g.,Marsh+2004). Some will undergo unstable mass transfer and merge/explode, forming either a type Ia supernova or a merger product like an R Coronae Borealis star. However, for this lab we will look into the case of stable mass transfer.

AM CVn binaries are ultracompact binaries with orbital periods between 5 and 69 minutes, where a white dwarf stably accretes from a helium-rich companion (e.g., Ramsay+2018). Their orbital evolution is driven by angular momentum loss due to the emission of gravitational waves, detectable by future space-based gravitational wave detectors like LISA (e.g.,Kupfer+2024). There are three formation channels for AM CVn binaries. The donor can either be a helium white dwarf formed from a common envelope event, a non-degenerate helium-burning star, or an evolved Cataclysmic Variable formed from stable mass transfer. Common to all these scenarios is that the donor eventually becomes a fully to semi-degenerate object. The donor responds to mass loss by expanding, and since it is filling its Roche lobe, the orbit also expands. The component masses and the donor’s mass-radius relation set the rate of orbital angular momentum loss, and in turn the mass transfer rate. In this lab, we will look into the first two scenarios involving a helium white dwarf or a helium star, and in particular the mass transfer rate for different types of donors.

In the helium star channel (e.g.,Yungelson2008, Sarkar+2023), the donor undergoes core helium burning at first. Gravitational waves bring the donor into contact, and the nuclear burning in the donor eventually quenches due to mass loss. In this lab, we will use a few different masses and initial orbital periods at zero-age core helium burning.

A donor in the helium white dwarf channel (e.g.,Deloye+2007, Wong&Bildsten2021) is not necessarilly fully degenerate (zero-temperature). Depending on its post-common envelope orbital period, it could remain semi-degenerate due to a short cooling time. We will explore a range of central specific entropies at contact. A higher entropy value (less degenerate) yields a larger radius.


Lab Instructions

For this lab, we will be running a generic binary system with the accretor as a point mass, assuming fully conservative mass transfer. Each task will have a solution given here. Feel free to visit the solutions as needed, but we encourage you to work through with the hints first.

link to the Google spreadsheet of options

link to the GitHub repo (general link)

link to the MESA documentation

Lab 1 solutions if needed

Task 0. Download Files

The Lab 1 starting directory should contain these files

inlist
inlist1
inlist2
inlist_project
binary_history_columns.list
< type >_< mass >M[_Sc< entropy >].mod
mesa_49_and_fe56.net
src/
make/
mk
clean
re
rn


Task 1. Editing inlist_project

The inlists in this directory are organized by number, 1 being the donor and 2 being the accretor, along with an inlist_project that contains parameters for both stars.

Begin by editing inlist_project in the binary_controls section (all relevant areas are notated by a !!!!! in the inlist):

Hint (click here)

The common format for the three flags is 'do_jdot_X'.


Hint (click here)

The section on timestep controls based on relative changes is here.


Hint (click here)

You are looking to set the parameter fj. If you aren't sure how many threads you are using, run echo $OMP_NUM_THREADS in the terminal.


Don’t forget to save the inlist! Solutions


Task 2. Setting up the donor

We now need to set up our donor star. This work will all be done in the donor inlist, inlist1.

Hint (click here)

Search for load_saved_model, load_model_filename, change_initial_net, new_net_name and pgstar_flag


Hint (click here)

We only need to set change_initial_net here, not change_net.


     okay_to_reduce_gradT_excess = .true.
     gradT_excess_lambda1 = -1
  ! show temperature/density profile
    !!!!!
    TRho_Profile_win_flag = .true.
    TRho_Profile_xmin = -8.1
    TRho_Profile_xmax = 7.2
    TRho_Profile_ymin = 2.6
    TRho_Profile_ymax = 8.5
    !!!!!

  ! add eos regions
    !!!!!
    show_TRho_Profile_eos_regions = .true.
    !!!!!
History_Panels1_win_flag = .true.
History_Panels1_num_panels = 2

History_Panels1_xaxis_name =  ! Period in minutes
History_Panels1_yaxis_name(1) =  ! log10 of donor star abs(mdot)

History_Panels1_yaxis_reversed(1) = .false.
History_Panels1_ymin(1) = -13d0
History_Panels1_ymax(1) = -6d0
History_Panels1_dymin(1) = -1
History_Panels1_other_yaxis_name(1) = ''

Don’t forget to save the inlist! Solutions


Task 3. Setting up the Accretor

Given that we are evolving the accetor as a point mass, is there any remaining setup we need to do for that star?

Hint (click here)

We don't need to set up the accretor, because evolve_both_stars is set to False! This means, the binary module only cares about the primary star, the donor, as described in inlist1. As a matter of fact, MESA won't even read inlist2.


Task 4. Adding history columns

In order for this exercise to be useful for lab 3, we need to save out additional data in our history columns for later use. To do this, uncomment the following values in your binary_history_columns.list:

Hint (click here)

Each of them is marked by a '!!!!!'


Double check that each of the above values is uncommented! (And don’t forget to save) Solutions


Task 5. Run the model

It is finally time! Clean, Make, and Run the model and watch the magic of computers! The runs should take approximately 8 minutes. If the run appears desparately stuck, let us know. Keep in mind that run time will be dependent on which donor model is being used and how many threads are available. If the run is taking too long, you can stop it and use the solution file for Lab 3.

The run should terminate with the code star_mass_min_limit, indicating our stopping condition was successful.

Now compare with your neighbor’s model. Are there any behavior differences?

BONUS. Calculating Timescales

If you choose to do this bonus task, please begin by making a backup of your completed LOGS1 directory, just in case you run out of time and don’t get to complete this second run!

The general behavior of timescales can provide us with insights into the behavior of a system. As a bonus exercise, we will add the global thermal timescale and the mass transfer timescale as history columns. Both of these timescales can be derived from the variables floating around in MESA, generally following:

Global thermal timescale = integral ( cp * T * dm ) / L
Mass transfer timescale ~ M/Mdot

In order to add these values to history columns, we cannot simply add the values to history_columns.list, instead we need to modify run_star_extras.

Open run_star_extras and replace the include statement with the contents of $MESA_DIR/star/job/standard_run_star_extras.inc. Then, find the subroutine and function that would allow us to add data to additional history columns. Take a look through the MESA Documentation if you are not sure.

Hint (click here)

We will be making our changes in the subroutine data_for_extra_history_columns


In this subroutine, declare an additional integer, k. Remember the format for variable initializations is type :: name.

Now, let’s add in the thermal timescale in years. Establish a name and initial value for this column, then write a Do loop for the integral.

! thermal timescale (yr)
names(1) = 't_th'
vals(1) = 0d0
do k = 1, () ! Add end condition for Do loop
    vals(1) = () ! Add calculation step in loop
end do 
vals(1) = ! Finish calculation outside of integral
Hint (click here)

Look through $MESA_DIR/star_data for the available data in the star pointer, s%

Hint (click here)

The variables you'll need to use are:
s% nz
s% cp(k)
s% T(k)
s% dm(k)
s% L_surf

Hint (click here)

The calculation step outside the integral is vals(1) = vals(1) / (s% L_surf * Lsun) / secyer


Next, we can add the timescale for mass change in years. As with the thermal timescale, we will need to establish a name for this column, t_Mdot and an initial value for this column, 1d99. Add a write step that prints the result of the thermal timescale calculation to the terminal. Only set the column to the absolute value of this calculation, if |Mdot| is over 1d-20. Otherwise, leave the column at 1d99. Remember to watch the units!

! timescale for mass change (yr)
names(2) = 't_Mdot'
vals(2) = 1d99
write(*,*) ! Add the calculation here
if () then
   vals(2) = ()
end if
Hint (click here)

The variables you'll need to use are:
s% mstar
s% mstar_dot

Hint (click here)

write(*,*) s% mstar/s% mstar_dot / secyer

Hint (click here)

if (abs(s% mstar_dot/Msun*secyer) > 1d-20) then

Hint (click here)

vals(2) = abs( s% mstar/ s% mstar_dot / secyer )


In order to prep MESA for these extra history columns, update the relevant value in how_many_extra_binary_history_columns.

Finally, add some useful pgstar plots of these values to the donor inlist:

History_Panels1_yaxis_name(2) = 't_th'
History_Panels1_yaxis_reversed(2) = .false.
History_Panels1_ymin(2) = 5d0
History_Panels1_ymax(2) = 12d0
History_Panels1_yaxis_log(2) = .true.
History_Panels1_dymin(2) = -1

History_Panels1_other_yaxis_name(2) = 't_Mdot'
History_Panels1_other_yaxis_reversed(2) = .false.
History_Panels1_other_ymin(2) = 5d0
History_Panels1_other_ymax(2) = 12d0
History_Panels1_other_yaxis_log(2) = .true.
History_Panels1_other_dymin(2) = -1

Rerun the model. Do you notice any features in the new timescale plots? What do these values tell us about the behavior of the donor?


Solutions

If you need any solutions for Lab 1: you can find them here

Back to main page