Skip to content
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

Magnetic field decay of NSs due to mass accretion #1002

Open
astro-sjgao opened this issue Oct 20, 2023 · 7 comments
Open

Magnetic field decay of NSs due to mass accretion #1002

astro-sjgao opened this issue Oct 20, 2023 · 7 comments
Assignees
Labels
bug Something isn't working severity_moderate This is a moderately severe bug urgency_moderate This is a moderately urgent issue

Comments

@astro-sjgao
Copy link

astro-sjgao commented Oct 20, 2023

I am using COMPAS to calculate the pulsar evolution in X-ray binaries. However, I have observed that the magnetic field decay does not seem to be working as expected.

I have identified a potential cause in the file NS.cpp, as shown in the following line:
double newPulsarMagneticField = (initialMagField - magFieldLowerLimit) * exp(-1 * p_MassGainPerTimeStep / 1000.0 / kappa) + magFieldLowerLimit ;

p_MassGainPerTimeStep seems to be in units of kg (as I found in BinaryConstituentStar.h), while kappa is also in units of kg. The term /1000.0 seems to be a typo.

So, the magnetic filed dacay resulting from mass accretion is insignificant.

For example, assuming the massscale is 0.02 solar mass, and a pulsar accreted 0.01 solar mass, the magnetic field B (>>Bmin) should be reduced to
(B-Bmin)*exp(-0.01/0.02)+Bmin~B*exp(-0.5)=0.61*B
rather than
(B-Bmin)*exp(-0.01/1000/0.02)+Bmin~B*exp(-0.5/1000)=0.9995*B.

@ilyamandel
Copy link
Collaborator

ilyamandel commented Oct 20, 2023 via email

@SimonStevenson
Copy link
Collaborator

Hi Shijie,

I believe that you have been in contact with @yuzhesong over email about this issue.

I haven't really looked at this version of NS.cpp, but it does seem to have a few issues. I think that you are right that the factor of 1000 must be a typo (even if it was meant to be a unit conversion, this wouldn't be the right way to do it). It is possible that someone thought that the equation needed to be in cgs units (so masses in grams) in which case there is a factor of 1000 in the conversion (but we should use something like KG_TO_G or MSOL_TO_G to convert). However, in this case, this factor would need to be applied to both the numerator and denominator of this fraction (both have to be in the same units). At present, it appears the numerator is in grams, and the denominator is in kg.

Typically in COMPAS, masses are in solar masses. So it is already a bit weird that p_MassGainPerTimeStep is in kg.

There are a couple of places where we have this rogue factor of 1000:

        double newPulsarMagneticField = (initialMagField - magFieldLowerLimit) * exp(-1 * p_MassGainPerTimeStep / 1000.0 / kappa) + magFieldLowerLimit ;

and later we have

       double mDot          =  p_MassGainPerTimeStep / 1000.0 / p_Stepsize ;

There seems to be a bit of a nasty mix of SI and cgs units throughout NS.cpp. It seems that similar magic factors appear elsewhere in NS.cpp: e.g., a magic factor of 1000000 appears in the line

    constexpr double _3_C_3         = 3.0 * C * C * C * 1000000.0;

in SpinDownIsolatedPulsar (I think this is the conversion from m to cm, cubed). I think we need to go through and clean this file up. I can try to do that, and put together a PR to address some of these changes, but I think a larger overhaul is needed here.

As @yuzhesong mentioned, although accretion should be possible through both mass transfer and common envelope evolution, in Chattopadhyay+2020 (https://arxiv.org/abs/1912.02415) we focused on accretion during the common envelope. Certainly for MSP formation, accretion through stable mass transfer will be more important. We have yet to explore this with COMPAS.

I also find it a bit weird that UpdateMagneticFieldAndSpin takes 5 parameters in NS.cpp but is called with 3 parameters in BaseBinaryStar.cpp. This seems confusing (at best), and possibly wrong (at worst).

TLDR: Yes, I believe the factor of 1000 is a left over/unneeded cgs conversion. This function should be considered experimental/unsupported at present.

@astro-sjgao
Copy link
Author

Dear Ilya and Simon, thanks for your kind replies.

I have two additional comments on the plusar recycling process.

  • super-Eddingtion accretion during CEE

    In chattopadhyay+2020, mass acccretion by an NS is based on the MacLeod's model, which assumes hyper-Eddington accretion to ensure that NS accretes enough material.

    It appears that COMPAS does not model the mass loss process during CEE step by step in detail, but instead directly removes the entire envelope.

    So, the assumed timestep during CEE determinates the average mass accretion rate of NSs, and the calculated mass accretion rate could be super-Eddington in some cases without a doubt. However, the mass accretion rate still seems to be limited to the Eddington accretion rate in Chattopadhyay+2020, (see Equation 16 in their paper), which contradicts the MacLeod's model.

  • Formation of milisecond pulsars via RLOF

    During low-mass X-ray binary stage, the mass donor can be a main-sequence star without a clear or even without a helium core (Case A mass transfer). This recycling process may differ from the recycling process during CEE.

Best wishes,
Shijie, Gao

@astro-sjgao
Copy link
Author

astro-sjgao commented Nov 16, 2023

Dear Ilya, Simon and Yuzhe,

I found a typo in Equation 9 of Chattopadhyay+2020 paper, where the right-hand side is missing a factor of 2. The correct form of the equation should be as follows:

$$\frac{1}{\Omega_{\rm f}^2}-\frac{1}{\Omega_{\rm i}^2}=\frac{P_{\rm f}^2}{4\pi^2}-\frac{P_{\rm i}^2}{{4}\pi^2}=\left[\frac{4\pi}{\mu_0}\right]\frac{\textcolor{red}{4} R^6\sin^2 \alpha}{3c^3I}\left[B_{\rm min}^2(t_{\rm f}-t_{\rm i})-\tau B_{\rm min}(B_{\rm f}-B_{\rm i})-\frac{\tau}{2}(B_{\rm f}^2-B_{\rm i}^2)\right].$$

See also Equation 9 in Sgalletta+2023 (https://doi.org/10.1093/mnras/stad2768). There is another typo in their Equation 9, where the term "P" is unnecessary and can be removed.

Additionally, I checked the corresponding code in NS.cpp (lines 384-389)and found that there is also a missing factor of 2.

Best wishes,
Shijie, Gao

Formula derivation:

截屏2023-11-16 19 52 46

@debatric
Copy link
Collaborator

debatric commented Nov 16, 2023 via email

@jeffriley jeffriley added bug Something isn't working severity_moderate This is a moderately severe bug urgency_moderate This is a moderately urgent issue labels May 22, 2024
@ilyamandel
Copy link
Collaborator

@debatric , @SimonStevenson , @yuzhesong -- is this an issue on its own, separate from the issue described in #1082 ? [I note that Debatri wrote "The typo in the paper was too late to correct, the correct equations were implemented in the code and my thesis which is available online" -- if so, is it just the case of updating the comments in the code to point to the correct equations? I'd like to resolve long-standing issues, especially with bug labels...

@yuzhesong
Copy link
Collaborator

@ilyamandel #1082 contains the solutions to this issue. Just need to get it to the stage of being able to merged back into dev.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working severity_moderate This is a moderately severe bug urgency_moderate This is a moderately urgent issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants