@@ -20,9 +20,8 @@ def stellar_remnant(stellar):
2020 return remnant
2121
2222
23- def stellar_core_temperature_and_density (M , z = 0.02 ):
24-
25- filename = f"stellar_M{ M .value_in (units .MSun )} MSun_core_temperature_and_density.pkl"
23+ def stellar_core_temperature_and_density (mass , metallicity = 0.02 ):
24+ filename = f"stellar_M{ mass .value_in (units .MSun )} MSun_core_temperature_and_density.pkl"
2625
2726 time = [] | units .Myr
2827 rho_core = [] | units .g / units .cm ** 3
@@ -32,8 +31,8 @@ def stellar_core_temperature_and_density(M, z=0.02):
3231 ncheck = 100
3332
3433 stellar = Mesa (version = "15140" )
35- stellar .parameters .metallicity = z
36- star = stellar .particles .add_particle (Particle (mass = M ))
34+ stellar .parameters .metallicity = metallicity
35+ star = stellar .particles .add_particle (Particle (mass = mass ))
3736
3837 # #BOOKLISTSTART1# #
3938 while not stellar_remnant (stellar ):
@@ -91,19 +90,19 @@ def new_argument_parser():
9190 )
9291 parser .add_argument (
9392 "-Z" ,
94- "--metalicity " ,
93+ "--metallicity " ,
9594 default = 0.02 ,
96- help = "Stellar metalicity " ,
95+ help = "Stellar metallicity " ,
9796 )
9897 return parser
9998
10099
101- def calculate_core_temperature_density (mass = 1 | units .MSun , Z = 0.02 ):
100+ def calculate_core_temperature_density (mass = 1 | units .MSun , metallicity = 0.02 ):
102101 filename = (
103102 f"stellar_M{ mass .value_in (units .MSun )} MSun_core_temperature_and_density.pkl"
104103 )
105104
106- time , rhoc , Tc , stp = stellar_core_temperature_and_density (mass , Z )
105+ time , rhoc , Tc , stp = stellar_core_temperature_and_density (mass , metallicity )
107106 with open (filename , "wb" ) as file :
108107 pickle .dump ([time , rhoc , Tc , stp ], file )
109108
0 commit comments