Skip to content

Commit

Permalink
Fix missing Na (#930)
Browse files Browse the repository at this point in the history
  • Loading branch information
rjfarmer committed Feb 28, 2023
1 parent 030ed85 commit 6e8136b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/amuse/community/mesa_r15140/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -1090,10 +1090,10 @@ def set_accrete_composition_metals_identifier(self, index_of_the_star, zfracs):

def get_accrete_composition_metals(self, index_of_the_star):
result = {}
for element in ['li','be','b','c','n','o','f','ne','mg','al','si','p',
for element in ['li','be','b','c','n','o','f','ne','na','mg','al','si','p',
's','cl','ar','k','ca','sc','ti','v','cr','mn','fe',
'co','ni','cu','zn']:
r = self.get_control(index_of_the_star,'z_fraction_'+element)
r = self.get_control(index_of_the_star,f'z_fraction_{element}')
result[element] = r['value']

return result
Expand All @@ -1102,25 +1102,25 @@ def set_accrete_composition_metals(self, index_of_the_star, **kwargs):
'''
Sets the accretion composition based on the following elements:
'li','be','b','c','n','o','f','ne','mg','al','si','p'
'li','be','b','c','n','o','f','ne','na','mg','al','si','p'
's','cl','ar','k','ca','sc','ti','v','cr','mn','fe',
'co','ni','cu','zn'
Thus to set the li accretion fraction to 1/2 then pass li=0.5
If an element is not set then its left with its currernt value
If an element is not set then its left with its current value
These must sum to 1.0 (the total z fraction is set by setting the non_metals to the 1-Z value)
'''

result = {}
for element,value in kwargs.items():
if element not in ['li','be','b','c','n','o','f','ne','mg','al','si','p',
if element not in ['li','be','b','c','n','o','f','ne','na','mg','al','si','p',
's','cl','ar','k','ca','sc','ti','v','cr','mn','fe',
'co','ni','cu','zn']:
raise ValueError("Bad element "+str(element))
r = self.set_control(index_of_the_star,'z_fraction_'+element,value)
raise ValueError(f"Bad element {element}")
r = self.set_control(index_of_the_star,f'z_fraction_{element}',value)
return r


Expand Down

0 comments on commit 6e8136b

Please sign in to comment.