[Mesa-users] removing mass inside the star

Ebraheem Farag ekfarag at asu.edu
Mon Mar 18 22:31:21 UTC 2024


Hello Natasha,

Without looking too closely, I think it might be possible to implement what
you are looking for by adopting the same mass adjustment scheme done by the
"relax_core" star_job.

You can find the subroutine "do_relax_core" in
$MESA_DIR/star/private/relax.f90 on lines 1979. I think you can just strip
what you need out of the "do1_relax_core" subroutine which adjusts the
internal mass between relaxation steps. It should be simple enough to
implement this into a run_star_extras.f90 and just remove the
"do_internal_evolve" portion of the "do_relax_core" subroutine which
performs the relaxation.

Note that the "do1_relax_core" subroutine also modifies the internal radius
and luminosity by calling the "do1_relax_R_center" and "do1_relax_L_center"
subroutines, so perhaps these are the additional values which need updated
beyond just the updating the mass coordinates.

I hope this is somewhat helpful. If you already have something like this
implemented and are comfortable sharing, I would be glad to help give it a
try.

I do think it would be worth adding some controls MESA to do this during an
evolution run, but we can start with a run_star_extras and then move to a
github pull request if we can make this approach function.

-EbF



On Fri, Mar 15, 2024 at 8:16 AM Natasha Ivanova via Mesa-users <
mesa-users at lists.mesastar.org> wrote:

> Hello all,
>
> I need to smoothly remove the mass inside the star (e.g., imagine an
> accretion during a CE). I used to do it with my old stellar code, which was
> not a problem, but something is incorrect when I try to do it with MESA. I
> am sure it is possible, as there were papers published on that subject with
> MESA; I likely do not do all that is needed.
>
> The mass removal should not affect (at least at the moment of the removal)
> values of P, tho and T, the star has to relax to the new values as a
> reaction to new mass coordinates.
>
> So, assume I have new values of masses at each previous mesh point.
> Is there a subroutine in MESA that updates all necessary values for q and
> other quantities if the mass array is known?
>
> Currently, I do the update (after the array m is updated) as
>
>          s% dm(s% nz) = s% m(s% nz)
>
>          do k = s% nz-1, 1, -1
>             s% dm(k) = s% m(k) - s% m(k+1)
>          end do
>
>          s% mstar = s% m(1)
>          s% xmstar = s% mstar - s% M_center
>
>          do k=1,s% nz
>             s% q(k) = (s% m(k) - s% M_center) / s% xmstar
>          end do
>
>          do k = 1,s% nz-1
>             s% dq(k) = s% q(k) - s% q(k+1)
>          end do
>
>          s% dq(s% nz) = s% q(s% nz)
>
> but it is clearly either wrong, or not enough even for very tiny mass
> corrections.
> Applying the steps above on unchanged mass is OK, so the quantities above
> seem to be found correctly, but perhaps not all quantities that are needed
> are updated.
>
> Does anyone know what to do?
>
> Thanks!!
> Natasha
> _______________________________________________
> mesa-users at lists.mesastar.org
>
> https://urldefense.com/v3/__https://lists.mesastar.org/mailman/listinfo/mesa-users__;!!IKRxdwAv5BmarQ!ZakLGH7eZp8f0VuR9J_AmUMrYUFEibIHG3pfZUIelteTazh6EJLfqCXnG0-RrmIsY6haYiM9d3co53KtJArKqgy21Rj39g$
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.mesastar.org/pipermail/mesa-users/attachments/20240318/82fce913/attachment.htm>


More information about the Mesa-users mailing list