[Mesa-users] theta_co and time_co not reinitialised upon restarting

Glenn-Michael Oomen glennmichael.oomen at kuleuven.be
Thu Aug 22 07:44:46 EDT 2019


Hi Pablo,


I applied your fix to my version of the code (r-11701) and everything seems to work nicely.


As for test cases, I don't really know how to make it or how it should behave at least. Either way, since it appears that not many people work with the eccentric orbits in MESA (perhaps I am even the only one), I will proceed carefully and investigate anything that does not seem normal to me. If there are any other problems, I will share it with you.


Cheers,

Glenn

________________________________
Van: Pablo Marchant <pamarca at gmail.com>
Verzonden: maandag 19 augustus 2019 22:58
Aan: Glenn-Michael Oomen
CC: mesa-users at lists.mesastar.org
Onderwerp: Re: [Mesa-users] theta_co and time_co not reinitialised upon restarting

Hi Glenn-Michael,

thanks a lot for your report. I just committed a fix that should sort this out, could you please try it out?

https://app.assembla.com/spaces/mesa/subversion/commits/12004

a reason why this did not pop out earlier is because we're missing test cases with eccentric systems. If you have any example test case that could be included into the test suite I'd be happy to check it out.

Cheers!

On Fri, Aug 16, 2019 at 5:13 AM Glenn-Michael Oomen <glennmichael.oomen at kuleuven.be<mailto:glennmichael.oomen at kuleuven.be>> wrote:

Hi MESA,


I was having some trouble restarting a binary model from a photo in MESA version r-11701. After some digging, I found out that the problem was in the Tout_enhance_wind function, because theta_co contained completely random values and several NaNs. It turns out that theta_co and time_co are only properly initialised at the start of a binary model in binarydata_init of binary_evolve.f90, but not when restarting a model.


I applied a quick fix in my copy of the code by also reinitialising these arrays after restarting. I did this by adding the following to run_binary_support (just after theta_co and time_co are allocated):


         ! Set all parameters necessary for integration over the binary orbit
         ! 1) true anomaly = polar angle from periastron 0 -> 2pi
         if (doing_restart) then
            do i = 1,b% anomaly_steps
               b% theta_co(i) = (i-1) * (2 * pi) / b% anomaly_steps
            end do
            ! 2) time between periastron and polar angle theta 0 -> 1 (fraction of the
            !    orbital period)
            do i = 1,b% anomaly_steps ! time between periastron and polar angle theta
               b% time_co(i) = ( 2 * atan_cr( sqrt( (1-b% eccentricity)/(1 + b% eccentricity) ) * &
                               tan_cr(b% theta_co(i)/2d0) ) - b% eccentricity * &
                               sqrt(1 - b% eccentricity**2) * sin_cr(b% theta_co(i)) / &
                               (1 + b% eccentricity * cos_cr(b% theta_co(i)) ) ) /2. /pi
               if (i > b% anomaly_steps/2+1) then
                  b% time_co(i) = b% time_co(i) + b% time_co(b% anomaly_steps/2+1) * 2
               end if
            end do
         end if

I basically copied this piece of code from binary_evolve to run_binary_support.

Best regards,
Glenn-Michael Oomen



_______________________________________________
mesa-users at lists.mesastar.org<mailto:mesa-users at lists.mesastar.org>
https://lists.mesastar.org/mailman/listinfo/mesa-users



--
Pablo Marchant Campos
M.Sc on Astrophysics, Universidad Católica de Chile
PhD on Astrophysics, Argelander-Institut für Astronomie, Universität Bonn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.mesastar.org/pipermail/mesa-users/attachments/20190822/410f40b7/attachment.html>


More information about the Mesa-users mailing list