mesa icon indicating copy to clipboard operation
mesa copied to clipboard

`star_utils:get_phot_info` should raise non-zero `ierr` if L < 0

Open warrickball opened this issue 3 years ago • 8 comments

The various code paths in star_utils:get_phot_info currently avoid dealing with a negative luminosity (which causes problems in e.g. set_phot_info when trying to evaluate Teff ~ (L/4πR²σ)⁰·²⁵) by limiting the output luminosity to max(1, L). As @adamjermyn suggested in PR 278, we should probably rather have the various routines raise a non-zero ierr rather than make up a value of L and pretend everything is OK.

warrickball avatar Jun 18 '21 15:06 warrickball

I suppose the counterargument would be that maybe the solver learns something by evaluating with a small but non-negative L, and we'd be cutting off that iteration prematurely by raising an error. I don't find that argument terribly convincing but it is at least in principle an empirical case someone could make...

adamjermyn avatar Jun 18 '21 20:06 adamjermyn

Yeah, I figured step one here would be to try raising ierr /= 0 and see what happens.

warrickball avatar Jun 18 '21 20:06 warrickball

Hmmm actually thinking more, can't there be physical setups where L < 0(temporarily) at the surface? I'm thinking of irradiated stars...

adamjermyn avatar Jun 21 '21 14:06 adamjermyn

If so, where's the "photosphere"?

warrickball avatar Jun 21 '21 15:06 warrickball

I don't think photospheres make sense in that case...

adamjermyn avatar Jun 21 '21 15:06 adamjermyn

Like in that case the radiation field doesn't become strictly outward-facing at infinity, and I think you need that to define a photosphere?

adamjermyn avatar Jun 21 '21 15:06 adamjermyn

That's what I'm thinking too. But in that case you might not want to call a subroutine who's name implies you want information at the photosphere.

That said, I'm not sure that isn't what we're doing anyway when using the 'irradiated' atmosphere option. I just had a quick look in atm and it looks like even that assumes a positive luminosity, since it computes some sort of temperature using the Stefan–Boltzman law. So all this possibly deserves a rethink but at a higher level than get_phot_info.

warrickball avatar Jun 21 '21 15:06 warrickball

Agreed. I don't think get_phot_info is the right place for this change.

-Adam

On Mon, Jun 21, 2021 at 11:31 AM, Warrick Ball @.***> wrote:

That's what I'm thinking too. But in that case you might not want to call a subroutine who's name implies you want information at the photosphere.

That said, I'm not sure that isn't what we're doing anyway when using the 'irradiated' atmosphere option. I just had a quick look in atm and it looks like even that assumes a positive luminosity, since it computes some sort of temperature using the Stefan–Boltzman law. So all this possibly deserves a rethink but at a higher level than get_phot_info.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/MESAHub/mesa/issues/280#issuecomment-865128919, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABPR5H7GSDJQ3RKXGRKCI7DTT5LO5ANCNFSM4655CI5Q .

adamjermyn avatar Jun 21 '21 15:06 adamjermyn