-
Notifications
You must be signed in to change notification settings - Fork 70
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
CHE Logic Fix for Issue #1303 #1321
Conversation
… orbital frequency, and then set the stellar spin if required
…ars to be synchronized while conserving total angular momentum
Also made the CHE treatment conserve angular momentum by moving all the spin-related code to |
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.
I had clearly made a mistake. I should have updated the angular frequency of the stars when setting them up (see around lines 190-198 of BaseBinaryStar.cpp) and I did not. Thank you for catching that.
I think it's important to realise and clearly state (I'd even add it to the changelog comments and to whatsnew, so we don't forget) that you are now making the assumption that all stars in binaries with sufficiently rapid initial angular frequencies are going to be set as CHE, whatever the tides option, and that this initialisation does not conserve total angular momentum. I am generally OK with that (presumably, tides were efficient pre-ZAMS, a part of the stellar evolution we don't consider), but I'd ask for two changes:
-
Don't do this if the initial rotational frequency of stars is explicitly specified. Presumably, if the user actively chooses a value, they have a reason for doing so. In that case, we should only evolve those angular frequencies under the action of tides, and not by fiat.
-
Update the comment on lines 302--310, it's no longer accurate.
Oh, and you'll need to merge in dev and update the changelog accordingly.
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.
P.S. One small possible update to tidal synchronisation of CHE stars (again, I like your general approach!):
// no (real) root found, synchronize CHE stars ignoring angular momentum conservation
if (m_Star1->StellarType() == STELLAR_TYPE::CHEMICALLY_HOMOGENEOUS){m_Star1->SetOmega(omega);}
if (m_Star2->StellarType() == STELLAR_TYPE::CHEMICALLY_HOMOGENEOUS){m_Star2->SetOmega(omega);}
In this case, you probably want the stars to be forced to have the orbital angular frequency. Right now, you are giving them a negative omega, which was just meant as an indication that no root was found.
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 good to me. Thanks @veome22
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.
Fantastic -- thank you, @veome22 ! I'll now pull this into dev.
Amended the CHE logic so that the determination of CHE uses the
OrbitalAngularVelocity()
rather thanm_Star->Omega()
. This allows stars to change into CHE even if they don't have any spin, as can happen whenTIDES_PRESCRIPTION
isNONE
.For the binary shown in Issue #1303 ,
the output becomes: