Skip to content

Commit c2f5da7

Browse files
author
Silvia Toonen
committed
preparations for implementing outer mass transfer
1 parent c44c776 commit c2f5da7

File tree

2 files changed

+36
-26
lines changed

2 files changed

+36
-26
lines changed

interactions.py

+18-8
Original file line numberDiff line numberDiff line change
@@ -869,6 +869,18 @@ def triple_stable_mass_transfer(bs, donor, accretor, self):
869869
bs.bin_type = bin_type['stable_mass_transfer']
870870

871871
#implementation is missing
872+
873+
def triple_common_envelope_phase(bs, donor, accretor, self):
874+
# mass transfer of both inner and outer orbit is not yet considered here
875+
876+
# orbital evolution is being taken into account in secular_code
877+
if REPORT_FUNCTION_NAMES:
878+
print('Triple common envelope')
879+
880+
bs.bin_type = bin_type['common_envelope']
881+
self.save_snapshot()
882+
883+
#implementation is missing
872884

873885
#when the tertiary star transfers mass to the inner binary
874886
def outer_mass_transfer(bs, donor, accretor, self):
@@ -884,13 +896,11 @@ def outer_mass_transfer(bs, donor, accretor, self):
884896
# possible the outer binary needs part_dt_mt as well.
885897
#adjusting triple is done in secular evolution code
886898
else:
887-
if REPORT_FUNCTION_NAMES:
888-
print('outer_mass_transfer: unstable mass transfer in outer binary')
889-
bs.bin_type = bin_type['common_envelope_energy_balance']
890-
self.save_snapshot()
891-
892-
#implementation is missing
893-
#snapshot
899+
triple_common_envelope_phase(bs, donor, accretor, self)
900+
901+
902+
#stopping condition 0:False, 1:True, -1: calculate through outer mass transfer - effect on inner & outer orbit is taken care off here.
903+
return -1
894904

895905
#-------------------------
896906

@@ -1044,7 +1054,7 @@ def perform_stellar_interaction(bs, self):
10441054

10451055
if bs.child1.is_donor:
10461056
if bs.child2.child1.is_donor or bs.child2.child2.is_donor:
1047-
outer_mass_transfer(bs, bs.child1, bs.child2, self)
1057+
stopping_condition = outer_mass_transfer(bs, bs.child1, bs.child2, self)
10481058
else:
10491059
detached(bs, self)
10501060

triple_class.py

+18-18
Original file line numberDiff line numberDiff line change
@@ -863,10 +863,6 @@ def check_RLOF(self):
863863
if star.radius >= Rl3 - (1.0 * small_numerical_error|units.RSun):
864864
star.is_donor = True
865865

866-
if star.is_donor and (bin.child1.is_donor or bin.child2.is_donor):
867-
print(Rl1, bin.child1.radius, Rl2, bin.child2.radius)
868-
print(Rl3, star.radius)
869-
sys.exit('RLOF in inner and outer binary')
870866

871867
else:
872868
sys.exit('check_RLOF: structure stellar system unknown')
@@ -1842,29 +1838,33 @@ def resolve_stellar_interaction(self, stellar_system = None):
18421838
return
18431839
elif self.is_binary(stellar_system):
18441840
if REPORT_TRIPLE_EVOLUTION:
1845-
print('\n perform stellar interaction: binary - double star')
1841+
print('\n perform stellar interaction: binary')
18461842
# stellar_system = perform_stellar_interaction(stellar_system, self)
18471843
stopping_condition = perform_stellar_interaction(stellar_system, self)
18481844
return stopping_condition #stellar interaction
18491845
else:
1850-
if not stellar_system.child1.is_star: #child1 is a multiple
1851-
stopping_condition = self.resolve_stellar_interaction(stellar_system.child1)
1852-
if not stopping_condition: #stellar interaction
1853-
return False
1854-
elif not stellar_system.child2.is_star: #child2 is a multiple
1855-
stopping_condition = self.resolve_stellar_interaction(stellar_system.child2)
1856-
if not stopping_condition: #stellar interaction
1857-
return False
1858-
else:
1859-
sys.exit('resolve_stellar_interaction: structure stellar system unknown, both children are binaries')
1860-
18611846
if REPORT_TRIPLE_EVOLUTION:
1862-
print('\n perform stellar interaction: binary')
1863-
# stellar_system = perform_stellar_interaction(stellar_system, self)
1847+
print('\n perform stellar interaction')
1848+
18641849
stopping_condition = perform_stellar_interaction(stellar_system, self)
18651850
if not stopping_condition: #stellar interaction
18661851
return False
1852+
1853+
if stopping_conditions>0:
1854+
#in case of outer mass transfer, skip inner evolution, is taken care of in outer mass transfer
1855+
if not stellar_system.child1.is_star: #child1 is a multiple
1856+
stopping_condition = self.resolve_stellar_interaction(stellar_system.child1)
1857+
if not stopping_condition: #stellar interaction
1858+
return False
1859+
elif not stellar_system.child2.is_star: #child2 is a multiple
1860+
stopping_condition = self.resolve_stellar_interaction(stellar_system.child2)
1861+
if not stopping_condition: #stellar interaction
1862+
return False
1863+
else:
1864+
sys.exit('resolve_stellar_interaction: structure stellar system unknown, both children are binaries')
1865+
18671866
return True
1867+
18681868

18691869
def determine_mass_transfer_timescale(self, stellar_system = None):
18701870

0 commit comments

Comments
 (0)