-
Notifications
You must be signed in to change notification settings - Fork 75
Updates to WD accretion to address issue #1384 #1386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Running a population test with this PR v dev to test the numbers of SN_Type(SN) == 32 (AIC) and 64 (SN1A):
AIC: SN1a: |
@SimonStevenson I have tweaked the documentation a bit and also added the |
Thanks for the additions Nicolas! Does your fix to qCrit resolve #1385 ? I do have a comment in the documentation for
I think that should be sufficient for now. |
Whoops, I saw the same text as in And no, the change does not address the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @SimonStevenson and @nrsegovia !
Comments:
WhiteDwarfs.cpp:
double preSecondFactor = 1 + 3.5 * MP_Mass_two_thirds + MP_Mass;
Change 1 to 1.0
Remnants.h
double CalculateCriticalMassRatioHurleyHjellmingWebbink() const { return 1.59; }
Please add reference for the 1.59 value as a comment.
Is this meant to apply to all Remnants (including NS and BH), or just WhiteDwarfs?
If ONeWD.cpp uses the same code as COWD.cpp, we should just call COWD::CaclulateMassAcceptanceRate() from ONeWD.h -- no need to repeat code.
Just a comment. We have this code in
Why are those parameters in the reverse order in those functions? I know it doesn't affect the functionality, but I think consistency results in fewer mistakes. Just saying... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cheeky request :-) As long as we're making changes to the WD files, can we also do issue #1351 ?
Done, also moved renamed
I have moved all these qCrits to
I will try to address Jeff's comments during the week |
Indeed, I don't think it makes sense to model mass transfer from NS or BH in COMPAS, so we should always label such systems as mergers, regardless of the mass ratio. I'll wait until you are done with all of the changes you wanted to make before signing off on the review. |
Making ONeWD::CalculateMassAccretionRate call COWD::CalculateMassAccretionRate seems trickier than it may seem. I tried makingCOWD::CalculateMassAccretionRate public and static, but COWD::CalculateMassAccretionRate calls several functions in WhiteDwarfs and I get lots of non-static errors:
I didn't figure out how to resolve this yet. Those functions call member variables so can't be made static. |
…AccretionRegime parameters and properly placed some qCrits in WhiteDwarfs.h
I have moved the qCrits to
I decided to flip
I found constants in some files and moved them. Let me know if you think I missed any.
Perhaps we could move |
Thanks, that seems to work! |
I've merged in dev and updated the changelog and what's new pages. I think this should be ready to go now? |
I don't think so, because NeutronStars inherit from Remnants which inherit from He stars. You probably want to explicitly include something like On identical CalculateMassAcceptanceRate(const double p_DonorMassRate, const bool p_IsHeRich) for ONeWD and COWD: this is declared as a virtual function in WhiteDwarfs.h, so there's absolutely nothing to do for ONeWD -- don't even mention it in ONeWD.h or ONeWD.cpp, it will automatically inherit the COWD version. I don't understand what you've done with DetermineAccretionRegime(). HeWD inherit from WhiteDwarfs and over-writes it, then COWD inherits from HeWD and doesn't over-write it? I don't think that's the intended behaviour, and I think you do want separate DetermineAccretionRegime() code in COWD if it's different from the HeWD version. The HeWD version, meanwhile, can sit either there or in WhiteDwarfs. Looks good otherwise, so will approve once these three changes are implemented. |
Right, I missed the inheritance from HeGB.
What I had in mind was to define DetermineAccretionRegime() in WhiteDwarfs, which would then be used by both CO and ONe WDs. As for HeWDs, they have a different behavior so the function would be overloaded. Isn't this what has been implemented? I do not see the inheritance from HeWDs, though I'm no C++ expert. I have the same question for the COWD-ONeWD inheritance in the other comment, particularly since Fig. 1 in the first methods paper does not seem to imply such relation. |
Hi Ilya, thanks for taking a look.
Honestly I'm not sure I know what I did either, but I don't think it was what I intended to do. I have now edited the code to what I originally intended to do (whether it is correct or not remains to be seen).
ONeWD does not inherit from COWD, it inherits from WhiteDwarfs
COWD does not inherit from HeWD, it inherits from WhiteDwarfs The inheritance is not: WhiteDwarfs -> HeWD -> COWD -> ONeWD it is: WhiteDwarfs -> HeWD Therefore, the logic is the following: DetermineAccretionRegime, CalculateMassAcceptanceRate, CalculateEtaH and CalculateEtaHe are defined in WhiteDwarfs.h and implemented in WhiteDwarfs.cpp. They are used directly (via inheritance) for COWD and ONeWD. DetermineAccretionRegime and CalculateMassAcceptanceRate are redefined/overloaded in HeWD which uses a different prescription. Whilst it may seem counterintuitive that the default implementation is for COWD/ONeWD and not HeWD, this is equally valid given our inheritance order, and avoids the need for duplicate code. Given the significant changes, I have rerun my tests. The test binary evolves the same as in my plots in #1384 The population statistics for AIC and SN1A are the same as reported above. |
Dear @SimonStevenson , @nrsegovia : you are both correct that COWDs and ONeWDs inherit from WhiteDwarfs, not from HeWDs. I was wrong, of course. :( My sincere apologies. Let me check again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks very good!
Just one question. WhiteDwarfs.h now includes the following comment next to the declaration of DetermineAccretionRegime():
"Can also change flags related to SN events"
Does this refer only to m_HeShellDetonation, or some other flags as well? Might be useful to spell this out.
Other than my optional suggestion above, this is an approval -- happy to see this merged in once @jeffriley OKs it.
Oh, one more thing: What happens if a binary with a WD donor does not satisfy the HjellmingWebbink q-crit threshold? It goes into a CE, right? Do we actually have a meaningful CE implementation for WD donors? |
Good point, I would argue that instead of going into a CE we could assume a merger (from Marsh+ 2004 "Mass transfer is dynamically unstable and will lead to a merger, regardless of synchronization torques, if ... q >2/3"). |
I agree, @nrsegovia , but is that what would happen now in the code? |
…_WEBBING qCrit prescription is enabled
@ilyamandel I have now added a couple of lines that should deal with this, though I'm not entirely sure whether this is the best location in the code to do so, and I also wonder how this approach interacts with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @nrsegovia ! But I think your point above, which I agree with, is more general than this particular prescription: any CE initiated by a white dwarf donor should lead to a merger. So I propose the following instead, in the BaseBinaryStar::ResolveCommonEnvelopeEvent() function:
change from
if (isDonorMS || (!envelopeFlag1 && !envelopeFlag2)) { // stellar merger
m_MassTransferTrackerHistory = MT_TRACKING::MERGER;
m_Flags.stellarMerger = true;
}
to
if (isDonorMS || (!envelopeFlag1 && !envelopeFlag2) || (m_Star1->IsRLOF() && m_Star1->IsOneOf(WHITE_DWARFS)) || (m_Star2->IsRLOF() && m_Star2->IsOneOf(WHITE_DWARFS)) { // stellar merger
m_MassTransferTrackerHistory = MT_TRACKING::MERGER;
m_Flags.stellarMerger = true;
}
…t conditions with any qCrit prescription
@ilyamandel right, makes sense. I'm not familiar with how the other qCrit prescriptions deal with WDs, but I agree that it is better to have a "standardized" behavior. I have added the code you suggested and removed the couple of lines I added before. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @nrsegovia !
I'll approve, but you need to merge the current version of dev into this (it's currently at 03.19.00) and change the version number to 03.19.01. Check out / pull dev, then go to your branch and run git merge dev.
Also, a quick reminder on one optional point to consider while you are doing this:
Just one question. WhiteDwarfs.h now includes the following comment next to the declaration of DetermineAccretionRegime():
"Can also change flags related to SN events"
Does this refer only to m_HeShellDetonation, or some other flags as well? Might be useful to spell this out.
@jeffriley , I think you'll need to approve this as well since you requested changes earlier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @nrsegovia and @SimonStevenson
With the constants added to constants.h
, under the comment
// Constants for WD evolution
Can you just ensure that it is clear where the constants come from? I know the constants are named, but is it always clear what paper the constants came from? Maybe, if necessary, just put a comment prior to each group of constants indicating the paper they were taken from?
Modulo that, I approve. I'll mark the PR as approved, and if you can add papers to constants.h
(if necessary) before merging, that'd be great.
Also see @ilyamandel's most recent comments. Wrt merging in dev and changing the version number, there is also a conflict with what's new
since it was modified in v03.19.00
Thanks for signing off Jeff. I have merged in dev and fixed the conflicts in the changelog and What's New page. I also added the references for the WD constants. Does that all look ok @nrsegovia ? Also can you respond to Ilya's query above:
Once this is addressed I think this is ready to go. |
Thank you, @SimonStevenson , looks perfect -- and ready for a merge once @nrsegovia gives it a final check. |
Apologies for the delay. @SimonStevenson the references in |
Indeed it does seem that ResolveHeSD is never called. |
m_HeShellDetonation is used in COWD::IsSupernova() while m_OffCenterIgnition is used in COWD::EvolveOnPhase() [see COWD.h for both]. But my point here was just that we could explicitly list the flags that are changed. This function doesn't need to describe how they may be used elsewhere. The fact that we have a function that's not used at all -- ResolveHeSD() -- is a separate issue that I hadn't appreciated. If we don't use it, we should remove it. |
I updated the comment. Will merge now, since ResolveHeSD() is a separate issue. @nrsegovia , would appreciate your thoughts on whether that can be safely removed. |
Updates to WD accretion to address issue #1384
This enables AIC for ONeWD
Test binary:
@nrsegovia did you want to add anything else to this PR?