[Mesa-users] theta_co and time_co not reinitialised upon restarting
Pablo Marchant
pamarca at gmail.com
Mon Aug 19 16:58:05 EDT 2019
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> 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
> 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/20190819/cae99932/attachment-0001.html>
More information about the Mesa-users
mailing list