[mesa-users] Accretion: max_star_mass_for_gain and eps_grav
Dean Townsley
Dean.M.Townsley at ua.edu
Fri Aug 14 17:25:26 EDT 2015
Hi Philip,
Just to confirm Josiah's comments...
You have found pretty much the right culprit. This appears to be a hole
in the logic treating the max_star_mass_for_gain parameter in
mesa/star/private/adjust_mass.f90.
The following changes seem to make your inlist_A work as expected for
me. Hopefully the syntax of diff is obvious enough for you to make
these changes easily. Just add the lines with the + to your
adjust_mass.f90 file near the line numbers following the @@, 113 and 130
in this case.
Dean
--- star/private/adjust_mass.f90 (revision 7624)
+++ star/private/adjust_mass.f90 (working copy)
@@ -113,6 +113,8 @@
.or. (delta_m < 0 .and. s% star_mass <= s%
min_star_mass_for_loss) &
.or. (delta_m > 0 .and. s% max_star_mass_for_gain > 0 &
.and. s% star_mass >= s% max_star_mass_for_gain)) then
+ delta_m = 0
+ s% mstar_dot = 0
call save_for_d_dt(s)
if (dbg) write(*,*) 'do_adjust_mass return 2'
return
@@ -130,9 +132,11 @@
.and. new_mstar > Msun*s% max_star_mass_for_gain) then
new_mstar = Msun*s% max_star_mass_for_gain
delta_m = new_mstar - old_mstar
+ s% mstar_dot = delta_m/dt
else if (delta_m < 0 .and. new_mstar < Msun*s%
min_star_mass_for_loss) then
new_mstar = Msun*s% min_star_mass_for_loss
delta_m = new_mstar - old_mstar
+ s% mstar_dot = delta_m/dt
end if
frac = old_xmstar/new_xmstar
On 08/14/2015 04:02 PM, Josiah Schwab wrote:
> Hello Philip,
>
>> I want to use MESA 7624 to model accretion which stops when a chosen
>> mass is exceeded. I find strange behaviour when the
>> max_star_mass_for_gain parameter is used to achieve this. The strange
>> behaviour seems to be because the eps_grav calculation still thinks
>> the star is accreting even after the maximum mass is exceeded.
> Thank you for this excellent report. It looks like you uncovered a bug
> in the `max_star_mass_for_gain' and `min_star_mass_for_loss' controls.
> You may be the first person to use these :)
>
> This will be fixed in the next release. I will follow up with you
> off-list about the specific fix that gets applied.
>
> Until then, if you want to be able to change the accretion rate while
> the run is going, you can do the same thing using run_star_extras.f.
>
> Add the following lines to "extras_finish_step"
>
> ! turn off mass loss when the star grows larger than ? (in Msun)
> if (s% star_mass > s% x_ctrl(1)) s% mass_change = 0
>
> Then, you can specify the meas
>
> &controls
>
> x_ctrl(1) = 0.6
>
> /
>
> Best,
> Josiah
>
> ------------------------------------------------------------------------------
> _______________________________________________
> mesa-users mailing list
> mesa-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mesa-users
>
More information about the Mesa-users
mailing list