Skip to content

Commit

Permalink
Fix stellar type for low mass ms stars (#972)
Browse files Browse the repository at this point in the history
Low Z, 0.1Msun stars can have radii < 0.1Rsun so would be counted as a WD
  • Loading branch information
rjfarmer committed Jul 25, 2023
1 parent ddab37f commit bcffa3d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/amuse/community/mesa_r15140/interface.f90
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ integer function get_stellar_type(AMUSE_id, AMUSE_value)
integer, intent(out) :: AMUSE_value
integer :: ierr
double precision :: lgR, mass, ch1, che3, che4, cc12, cne20
double precision :: lgL, lgLH, ah1, ahe3, ahe4, lgLHe
double precision :: lgL, lgLH, ah1, ahe3, ahe4, lgLHe, logg
AMUSE_value = -99
get_stellar_type = -1

Expand Down Expand Up @@ -618,9 +618,12 @@ integer function get_stellar_type(AMUSE_id, AMUSE_value)
call get_history_value(AMUSE_id,'average he4',ahe4, ierr)
if(ierr/=MESA_SUCESS) return

call get_history_value(AMUSE_id,'photosphere_logg',logg, ierr)
if(ierr/=MESA_SUCESS) return



if (lgR > -1.0) then
if (logg < 6.0) then
if(ch1 > 1d-4) then ! MS
if(lgLH-lgL < -1 ) then ! Pre-main-sequence star
AMUSE_value = 17
Expand Down

0 comments on commit bcffa3d

Please sign in to comment.