Skip to content

Commit 7365b23

Browse files
committed
[ci optional] Merge branch 'main' into abundance_timestep_controls
2 parents d553177 + a7c411b commit 7365b23

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+4510
-181
lines changed

.gitattributes

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,13 @@
1010
*.mp4 filter=lfs diff=lfs merge=lfs -text
1111

1212
# Try to get github to better understand what our filetypes are
13-
*.inc linguist-langauge=Fortran
14-
*inlist* linguist-langauge=Fortran
13+
*.inc linguist-language=Fortran
14+
*inlist* linguist-language=Fortran
1515
*.mod linguist-generated
16+
*reaclib_results* -linguist-detectable
17+
*.ph -linguist-detectable
18+
*.[1-9] -linguist-detectable
19+
*.in -linguist-detectable
1620

1721
# Things to ignore from the release
1822
star/dev_cases_compare_pulses export-ignore

.github/workflows/build_compile.yml

Lines changed: 0 additions & 81 deletions
This file was deleted.

CITATIONS.bib

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -94,19 +94,22 @@ @ARTICLE{Paxton2019
9494
adsnote = {Provided by the SAO/NASA Astrophysics Data System}
9595
}
9696

97-
@ARTICLE{Jermyn2022,
98-
author = {{Jermyn}, Adam S. and {Bauer}, Evan B. and {Schwab}, Josiah and {Farmer}, R. and {Ball}, Warrick H. and {Bellinger}, Earl P. and {Dotter}, Aaron and {Joyce}, Meridith and {Marchant}, Pablo and {Mombarg}, Joey S.~G. and {Wolf}, William M. and {Wong}, Tin Long Sunny and {Cinquegrana}, Giulia C. and {Farrell}, Eoin and {Smolec}, R. and {Thoul}, Anne and {Cantiello}, Matteo and {Herwig}, Falk and {Toloza}, Odette and {Bildsten}, Lars and {Townsend}, Richard H.~D. and {Timmes}, F.~X.},
99-
title = "{Modules for Experiments in Stellar Astrophysics (MESA): Time-Dependent Convection, Energy Conservation, Automatic Differentiation, and Infrastructure}",
100-
journal = {arXiv e-prints},
101-
keywords = {Astrophysics - Solar and Stellar Astrophysics, Astrophysics - Earth and Planetary Astrophysics, Astrophysics - High Energy Astrophysical Phenomena, Astrophysics - Instrumentation and Methods for Astrophysics},
102-
year = 2022,
103-
month = {dec},
104-
eid = {arXiv:2208.03651},
105-
pages = {arXiv:2208.03651},
97+
@ARTICLE{Jermyn2023,
98+
author = {{Jermyn}, Adam S. and {Bauer}, Evan B. and {Schwab}, Josiah and {Farmer}, R. and {Ball}, Warrick H. and {Bellinger}, Earl P. and {Dotter}, Aaron and {Joyce}, Meridith and {Marchant}, Pablo and {Mombarg}, Joey S.~G. and {Wolf}, William M. and {Sunny Wong}, Tin Long and {Cinquegrana}, Giulia C. and {Farrell}, Eoin and {Smolec}, R. and {Thoul}, Anne and {Cantiello}, Matteo and {Herwig}, Falk and {Toloza}, Odette and {Bildsten}, Lars and {Townsend}, Richard H.~D. and {Timmes}, F.~X.},
99+
title = "{Modules for Experiments in Stellar Astrophysics (MESA): Time-dependent Convection, Energy Conservation, Automatic Differentiation, and Infrastructure}",
100+
journal = {\apjs},
101+
keywords = {Stellar physics, Stellar evolution, Stellar evolutionary models, Computational methods, 1621, 1599, 2046, 1965, Astrophysics - Solar and Stellar Astrophysics, Astrophysics - Earth and Planetary Astrophysics, Astrophysics - High Energy Astrophysical Phenomena, Astrophysics - Instrumentation and Methods for Astrophysics},
102+
year = 2023,
103+
month = mar,
104+
volume = {265},
105+
number = {1},
106+
eid = {15},
107+
pages = {15},
108+
doi = {10.3847/1538-4365/acae8d},
106109
archivePrefix = {arXiv},
107110
eprint = {2208.03651},
108111
primaryClass = {astro-ph.SR},
109-
adsurl = {https://ui.adsabs.harvard.edu/abs/2022arXiv220803651J},
112+
adsurl = {https://ui.adsabs.harvard.edu/abs/2023ApJS..265...15J},
110113
adsnote = {Provided by the SAO/NASA Astrophysics Data System}
111114
}
112115

binary/defaults/binary_controls.defaults

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -813,15 +813,19 @@
813813
! wind_BH_alpha_*
814814
! ~~~~~~~~~~~~~~~
815815

816-
! Bondi-Hoyle accretion parameter for each star. The default is 3/2 taken
817-
! from Hurley et al. 2002, MNRAS, 329, 897, in agreement with
818-
! Boffin & Jorissen 1988, A&A, 205, 155
816+
! Bondi-Hoyle accretion parameter for each star. The default for alpha is 3/2
817+
! taken from Hurley et al. 2002, MNRAS, 329, 897, in agreement with
818+
! Boffin & Jorissen 1988, A&A, 205, 155.
819+
! The default for beta is 1/8=0.125 in accordance for results of cool
820+
! supergiants from Kucinskas A., 1999, Ap&SS, 262, 127
819821
! "\_1" refers to first star, "\_2" to the second one.
820822

821823
! ::
822824

823825
wind_BH_alpha_1 = 1.5d0
824826
wind_BH_alpha_2 = 1.5d0
827+
wind_BH_beta_1 = 1.25d-1
828+
wind_BH_beta_2 = 1.25d-1
825829

826830

827831
! max_wind_transfer_fraction_*

binary/private/binary_ctrls_io.f90

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ module binary_ctrls_io
125125
do_wind_mass_transfer_2, &
126126
wind_BH_alpha_1, &
127127
wind_BH_alpha_2, &
128+
wind_BH_beta_1, &
129+
wind_BH_beta_2, &
128130
max_wind_transfer_fraction_1, &
129131
max_wind_transfer_fraction_2, &
130132

@@ -428,6 +430,8 @@ subroutine store_binary_controls(b, ierr)
428430
b% do_wind_mass_transfer_2 = do_wind_mass_transfer_2
429431
b% wind_BH_alpha_1 = wind_BH_alpha_1
430432
b% wind_BH_alpha_2 = wind_BH_alpha_2
433+
b% wind_BH_beta_1 = wind_BH_beta_1
434+
b% wind_BH_beta_2 = wind_BH_beta_2
431435
b% max_wind_transfer_fraction_1 = max_wind_transfer_fraction_1
432436
b% max_wind_transfer_fraction_2 = max_wind_transfer_fraction_2
433437

@@ -618,6 +622,8 @@ subroutine set_binary_controls_for_writing(b, ierr)
618622
do_wind_mass_transfer_2 = b% do_wind_mass_transfer_2
619623
wind_BH_alpha_1 = b% wind_BH_alpha_1
620624
wind_BH_alpha_2 = b% wind_BH_alpha_2
625+
wind_BH_beta_1 = b% wind_BH_beta_1
626+
wind_BH_beta_2 = b% wind_BH_beta_2
621627
max_wind_transfer_fraction_1 = b% max_wind_transfer_fraction_1
622628
max_wind_transfer_fraction_2 = b% max_wind_transfer_fraction_2
623629

binary/private/binary_evolve.f90

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ subroutine binarydata_init(b, doing_restart)
188188
b% CE_lambda2 = 0d0
189189
b% CE_Ebind1 = 0d0
190190
b% CE_Ebind2 = 0d0
191+
b% mtransfer_rate = 0
191192

192193
b% num_tries = 0
193194

@@ -337,6 +338,11 @@ integer function binary_evolve_step(b)
337338
b% eccentricity = b% eccentricity + get_edot(b) *b% time_step*secyer
338339
if (b% eccentricity < b% min_eccentricity) b% eccentricity = b% min_eccentricity
339340
if (b% eccentricity > b% max_eccentricity) b% eccentricity = b% max_eccentricity
341+
else
342+
b% edot_tidal = 0d0
343+
b% edot_enhance = 0d0
344+
b% extra_edot = 0d0
345+
b% edot = 0d0
340346
end if
341347

342348
!use new eccentricity to calculate new time coordinate
@@ -504,17 +510,19 @@ integer function binary_finish_step(b)
504510

505511
binary_finish_step = keep_going
506512
! update change factor in case mtransfer_rate has changed
507-
if(b% mtransfer_rate_old /= b% mtransfer_rate .and. &
508-
b% mtransfer_rate /= 0 .and. b% mtransfer_rate_old /= 0) then
509-
if(b% mtransfer_rate < b% mtransfer_rate_old) then
510-
b% change_factor = b% change_factor*(1d0-b% implicit_lambda) + b% implicit_lambda* &
511-
(1+b% change_factor_fraction*(b% mtransfer_rate/b% mtransfer_rate_old-1))
512-
else
513-
b% change_factor = b% change_factor*(1d0-b% implicit_lambda) + b% implicit_lambda* &
514-
(1+b% change_factor_fraction*(b% mtransfer_rate_old/b% mtransfer_rate-1))
513+
if(.not. b% doing_first_model_of_run) then
514+
if(b% mtransfer_rate_old /= b% mtransfer_rate .and. &
515+
b% mtransfer_rate /= 0 .and. b% mtransfer_rate_old /= 0) then
516+
if(b% mtransfer_rate < b% mtransfer_rate_old) then
517+
b% change_factor = b% change_factor*(1d0-b% implicit_lambda) + b% implicit_lambda* &
518+
(1+b% change_factor_fraction*(b% mtransfer_rate/b% mtransfer_rate_old-1))
519+
else
520+
b% change_factor = b% change_factor*(1d0-b% implicit_lambda) + b% implicit_lambda* &
521+
(1+b% change_factor_fraction*(b% mtransfer_rate_old/b% mtransfer_rate-1))
522+
end if
523+
if(b% change_factor > b% max_change_factor) b% change_factor = b% max_change_factor
524+
if(b% change_factor < b% min_change_factor) b% change_factor = b% min_change_factor
515525
end if
516-
if(b% change_factor > b% max_change_factor) b% change_factor = b% max_change_factor
517-
if(b% change_factor < b% min_change_factor) b% change_factor = b% min_change_factor
518526
end if
519527

520528
! store all variables into "old"

binary/private/binary_timestep.f90

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -126,39 +126,46 @@ integer function binary_pick_next_timestep(b)
126126

127127
if (b% max_timestep < 0) b% max_timestep = b% s_donor% dt
128128

129-
130129
b% env(b% d_i) = s% star_mass - s% he_core_mass
131130
if (b% point_mass_i == 0) then
132131
b% env(b% a_i) = b% s_accretor% star_mass - b% s_accretor% he_core_mass
133132
end if
134133

135-
if (b% env_old(b% d_i) /= 0) then
136-
env_change = b% env(b% d_i) - b% env_old(b% d_i)
134+
if(.not. b% doing_first_model_of_run) then
135+
if (b% env_old(b% d_i) /= 0) then
136+
env_change = b% env(b% d_i) - b% env_old(b% d_i)
137+
else
138+
env_change = 0
139+
end if
140+
141+
if (b% rl_relative_gap_old(b% d_i) /= 0) then
142+
rel_gap_change = b% rl_relative_gap_old(b% d_i) - b% rl_relative_gap(b% d_i)
143+
else
144+
rel_gap_change = 0
145+
end if
146+
147+
if (b% angular_momentum_j_old /= 0) then
148+
j_change = b% angular_momentum_j - b% angular_momentum_j_old
149+
else
150+
j_change = 0
151+
end if
152+
153+
if (b% separation_old /= 0) then
154+
sep_change = b% separation - b% separation_old
155+
else
156+
sep_change = 0
157+
end if
158+
if (b% eccentricity_old /= 0) then
159+
e_change = b% eccentricity - b% eccentricity_old
160+
else
161+
e_change = 0
162+
end if
137163
else
138164
env_change = 0
139-
end if
140-
141-
if (b% rl_relative_gap_old(b% d_i) /= 0) then
142-
rel_gap_change = b% rl_relative_gap_old(b% d_i) - b% rl_relative_gap(b% d_i)
143-
else
144165
rel_gap_change = 0
145-
end if
146-
147-
if (b% angular_momentum_j_old /= 0) then
148-
j_change = b% angular_momentum_j - b% angular_momentum_j_old
149-
else
150166
j_change = 0
151-
end if
152-
153-
if (b% separation_old /= 0) then
154-
sep_change = b% separation - b% separation_old
155-
else
156167
sep_change = 0
157-
end if
158-
if (b% eccentricity_old /= 0) then
159-
e_change = b% eccentricity - b% eccentricity_old
160-
else
161-
e_change = 0
168+
e_change = 0
162169
end if
163170

164171
! get limits for dt based on relative changes

binary/private/binary_wind.f90

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ subroutine Bondi_Hoyle_wind_transfer(binary_id, s_i, ierr)
9494

9595
type(binary_info), pointer :: b
9696
type (star_info), pointer :: s
97-
real(dp) :: v_orb, v_wind, b_BH
98-
real(dp) :: alpha ! Bondi-Hoyle alpha for that star
97+
real(dp) :: v_orb, v_wind
98+
real(dp) :: alpha, beta ! Bondi-Hoyle alpha, beta for that star
9999
real(dp) :: max_xfer ! Maximum transfer fraction
100100

101101
call binary_ptr(binary_id, b, ierr)
@@ -107,18 +107,20 @@ subroutine Bondi_Hoyle_wind_transfer(binary_id, s_i, ierr)
107107
if (s_i == 1) then
108108
s => b% s1
109109
alpha = b% wind_BH_alpha_1
110+
beta = b% wind_BH_beta_1
110111
max_xfer = b% max_wind_transfer_fraction_1
111112
else
112113
s => b% s2
113114
alpha = b% wind_BH_alpha_2
115+
beta = b% wind_BH_beta_2
114116
max_xfer = b% max_wind_transfer_fraction_2
115117
end if
116118

117119
! orbital speed Hurley et al 2002 eq. 8
118-
v_orb = sqrt(standard_cgrav * b% m(s_i) / b% separation) !cm/s
120+
v_orb = sqrt(standard_cgrav * (b% m(1) + b% m(2)) / b% separation) !cm/s
119121

120122
! windspeed from Hurley et al 2002 eq. 9
121-
v_wind = sqrt( 2d0 / 8d0 * standard_cgrav * b% m(s_i) / b% r(s_i) )
123+
v_wind = sqrt(2d0 * beta * standard_cgrav * b% m(s_i) / b% r(s_i))
122124

123125
! Bondi-Hoyle transfer fraction Hurley et al. 2002 eq. 6
124126
b% wind_xfer_fraction(s_i) = alpha / pow2(b% separation) /&

binary/public/binary_controls.inc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ logical :: do_enhance_wind_1, do_enhance_wind_2
8484
real(dp) :: tout_B_wind_1, tout_B_wind_2
8585
logical :: do_wind_mass_transfer_1, do_wind_mass_transfer_2
8686
real(dp) :: wind_BH_alpha_1, wind_BH_alpha_2
87+
real(dp) :: wind_BH_beta_1, wind_BH_beta_2
8788
real(dp) :: max_wind_transfer_fraction_1, max_wind_transfer_fraction_2
8889

8990
! orbital jdot controls

binary/test_suite/wind_fed_bhhmxb/inlist_project

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222

2323
limit_retention_by_mdot_edd = .true.
2424
do_wind_mass_transfer_1 = .true.
25+
wind_BH_beta_1 = 1.25d-1 ! wind_BH_beta_1 = 7d0 ! 7 since donor is O star, using this value would make more sense, but we keep the default of 1/8
26+
! which results in wind accretion below and above the Eddington limit (which we want to test).
2527
do_jdot_mb = .false.
2628

2729
report_rlo_solver_progress = .true.

0 commit comments

Comments
 (0)