TeamCOMPAS / COMPAS

COMPAS rapid binary population synthesis code
http://compas.science
MIT License
65 stars 66 forks source link

Massless remnant formed in PISN has finite mass #1051

Closed SimonStevenson closed 6 months ago

SimonStevenson commented 10 months ago

Describe the bug Massless remnant formed in PISN has finite mass

Label the issue Please label the 'severity' and 'urgency' of this issue. You can choose: urgency_moderate - This is a moderately urgent issue severity_moderate - This is a moderately severe bug

To Reproduce Evolve a single star expected to undergo PISN, e.g., ./COMPAS -n 1 --mode SSE --initial-mass 140 --metallicity 0.0001 --logfile-type CSV

Note that Mass is not 0 (in this case around 62.7 Msun)

Expected behavior Mass should be 0

Versioning (please complete the following information):

Additional context Add any other context about the problem here.

jeffriley commented 10 months ago

This is in the SSE_Supernovae file, right? The SSE_Detailed_Output file and the SSE_Systrm_Parameters file look ok.

The problem appears in the SSE_Supernovae file because we store the stellar attributes to be printed to that file mid-timestep, and at that stage the star hasn't switch to a massless remnant - that happens at the end of the timestep. The immediate proble would be solved, as @SimonStevenson suggests, by setting m_Mass = 0.0 in GiantBranch::ResolvePairInstabilitySN() (probably need to set the core masses there as well). A better solution might be to only squirrel away the attributes that can't be retrieved at the end of the timestep (because they may have been updated after the SN event and before the end of the timestep), then get the remainder and print the supernovae file record at the end of the timestep. The immediate fix can be done here, and maybe we can look at the better fix more long-term.

ilyamandel commented 6 months ago

Addressed in #1109