[Mesa-users] difficulty with custom mass loss

Francis Timmes fxt44 at mac.com
Tue Jul 16 01:08:41 EDT 2019


> I say that after being burned in just such a way during a summer school lab.


spreading bill's superb lab:

https://billwolf.space/projects/leiden_2019/


fxt








> On Jul 15, 2019, at 7:51 PM, Bill Wolf via Mesa-users <mesa-users at lists.mesastar.org> wrote:
> 
> Careful, there. In other_adjust_mdot, you want to change s% mstar_dot. But in other_wind, you only need to set w.
> 
> Why the difference? When in doubt about how an "other" hook works, go to $MESA_DIR/star/private and grep for something like "call s% other_blah_blah_blah". In this case,
> 
> cd $MESA_DIR/star/private
> grep "call s% other_adjust_mdot" *.f90
> 
> You'll see that it's in evolve.f90. The call happens right after a call to set_mdot, which sounds promising. That subroutine is located in winds.f90. It's a pretty long subroutine, but you'll see its ultimate effect is to change the value of s% mstar_dot, so that's a strong indication that you'll want to do the same in your other_adjust_mdot routine.
> 
> HOWEVER, you'll note that in set_mdot, the actual wind calculation is done by eval_wind_for_scheme. In that subroutine, we finally call s% other_wind. So what? Well, if you set s% mstar_dot in other_wind, it will ultimately be overwritten by the end of set_mdot (probably the value of w, whatever that ends up being in your wind routine, if anything). In short, setting s% mstar_dot in the wind routine will have no effect.
> 
> Figuring out when these hooks are actually called is very useful (read: necessary), because it helps you know which variables have already been set and which ones you should leave alone, because they'll just be overwritten later. The other_* hooks are extremely powerful, but you can be burned by them quite easily if you don't know the context in which they are called. I say that after being burned in just such a way during a summer school lab.
> 
> Regards,
> 
> Bill
> 
> 
> 
> From: TUCHOW, NOAH WOLFE <nxt5109 at psu.edu>
> Reply: TUCHOW, NOAH WOLFE <nxt5109 at psu.edu>
> Date: July 15, 2019 at 7:38:44 PM
> To: Bill Wolf <wmwolf at asu.edu>
> Cc: Aaron Dotter <aaron.dotter at gmail.com>, mesa-users at lists.mesastar.org <mesa-users at lists.mesastar.org>
> Subject:  Re: [Mesa-users] difficulty with custom mass loss 
> 
>> I suppose that makes sense. I was wondering why there were potentially two variables for mdot. I'll try using s% mstar_dot and use other_wind instead.
>> 
>> Thanks,
>> Noah
>> 
>> Noah Tuchow
>> Penn State University
>> Department of Astronomy and Astrophysics
>> 532C Davey Lab
>> University Park, PA 16802
>> 
>> 
>> On Mon, Jul 15, 2019 at 10:28 PM Bill Wolf <wmwolf at asu.edu> wrote:
>> Try setting s% mstar_dot instead of s% star_mdot. I've made this mistake before, and it took me a bit to figure out what was going wrong.
>> 
>> To reduce the surprise factor, other_wind is probably what you want to use, but in most cases that I can think of, other_adjust_mdot should work.
>> 
>> Bill
>> 
>> 
>> From: TUCHOW, NOAH WOLFE <nxt5109 at psu.edu>
>> Reply: TUCHOW, NOAH WOLFE <nxt5109 at psu.edu>
>> Date: July 15, 2019 at 7:18:47 PM
>> To: Aaron Dotter <aaron.dotter at gmail.com>
>> Cc: mesa-users at lists.mesastar.org <mesa-users at lists.mesastar.org>
>> Subject:  Re: [Mesa-users] difficulty with custom mass loss
>> 
>>> The main reason why I wasn't using other_wind is that the mass loss which I wanted to model wasn't exclusively due to wind. If I were to use an other_wind hook, would it matter if the mass loss isn't actually wind? Would I still modify s% star_mdot to set the mass loss rate, or is there another variable I should change? If I wanted to set a custom wind for main sequence evolution would that be setting hot_wind_scheme= 'other' in the inlist?
>>> 
>>> Thanks,
>>> Noah Tuchow
>>> 
>>> 
>>> Noah Tuchow
>>> Penn State University
>>> Department of Astronomy and Astrophysics
>>> 532C Davey Lab
>>> University Park, PA 16802
>>> 
>>> 
>>> On Mon, Jul 15, 2019 at 9:47 PM Aaron Dotter <aaron.dotter at gmail.com> wrote:
>>> Hi Noah,
>>> 
>>> Just a suggestion: Have you tried using other_wind?  I've used that successfully a number of times over the years.  It might be what you're looking for rather than other_adjust_mdot.
>>> 
>>> Aaron
>>> 
>>> On Mon, Jul 15, 2019 at 9:34 PM TUCHOW, NOAH WOLFE <nxt5109 at psu.edu> wrote:
>>> Hello everyone,
>>> 
>>> I've been having a bit of difficulty trying to implement a custom mass loss rate for a main sequence star. I've started off simple, just slightly modifying the default work folder's inlists to make a 1 solar mass star losing mass with a mass loss rate given as a function of time. Since I want to specify a function for a custom mass loss mechanism, I have been trying to use the "other" hooks in run_star_extras to do so. However, I can't seem to get even the simplest example, a constant mass loss rate, working via run star extras. I made a simple subroutine called const_mdot, and I direct MESA to use it in extras_controls as an other_adjust_mdot. I am trying to set  s% star_mdot to be a value that I specify in the inlist, but, when I run MESA, I find that the mass of the star doesn't change at all.  I noticed that setting mass_change in the inlist controls does what I thought this would be doing, but I would eventually like to implement more complicated mass loss rates.
>>> 
>>> Am I not implementing mass loss in the correct manner? Should I not put my mass loss subroutine as an other_adjust_mdot, or is s% star_mdot not the right quantity to be modifying? I know there is an other_wind option, but I'm dealing with mass loss from other sources such as CMEs not only wind. I've attached my inlists and run_star_extras.f  which I've been using in MESA r10398.  How does one specify a custom mass loss rate in MESA?
>>> 
>>> Thanks,
>>> Noah Tuchow
>>> 
>>> Noah Tuchow
>>> Penn State University
>>> Department of Astronomy and Astrophysics
>>> 532C Davey Lab
>>> University Park, PA 16802
>>> 
>>> _______________________________________________
>>> mesa-users at lists.mesastar.org
>>> https://lists.mesastar.org/mailman/listinfo/mesa-users
>>> 
>>> _______________________________________________
>>> mesa-users at lists.mesastar.org
>>> https://lists.mesastar.org/mailman/listinfo/mesa-users
>>> 
> _______________________________________________
> mesa-users at lists.mesastar.org
> https://lists.mesastar.org/mailman/listinfo/mesa-users



More information about the Mesa-users mailing list