Skip to content

Commit 19c7d87

Browse files
committed
Fixes for massive mergers and small update double_star::dump
Extended range of inversion of Hertzsprung gap core masses to relative masses > 100 to find solutions for massive mergers. Copied "dirty fix" for mergers in which super_giants switch from TAGB to EAGB from the similar case in which they switch from EAGB to TAGB double_star::dump now prints n_elements = 2 at start of dump, even if one of the stars is disintegrated
1 parent bed0844 commit 19c7d87

4 files changed

Lines changed: 58 additions & 57 deletions

File tree

dstar/starclass/double_star.C

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,8 @@ void double_star::dump(ostream & s, bool brief) {
375375

376376
if(bin_type!=Merged) {
377377

378-
int n_elements = no_of_elements();
378+
//int n_elements = no_of_elements(); // Gijs March26: 2 stars are printed in this dump so better to make that clear at the start of the dump
379+
int n_elements = 2
379380

380381
s << n_elements
381382
<< "\n " << identity

sstar/starclass/hertzsprung_gap.C

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,18 +206,18 @@ real hertzsprung_gap::add_mass_to_accretor(real mdot, bool hydrogen, const real
206206
real t_bgb = base_giant_branch_time(relative_mass, metalicity);
207207
relative_age = t_ms + tau * (t_bgb - t_ms);
208208
last_update_age = t_ms;
209-
209+
210210
if (tau < 0.){
211211
real (single_star::*fptr)(const real, real) = &single_star::initial_hertzsprung_gap_core_mass;
212-
real m_rel = linear_function_inversion(fptr, relative_mass, core_mass, metalicity);
212+
real m_rel = linear_function_inversion(fptr, relative_mass, core_mass, metalicity, cnsts.parameters(minimum_main_sequence), 300);
213213
update_relative_mass(m_rel);
214214
last_update_age = main_sequence_time(relative_mass, metalicity);
215215
relative_age = last_update_age;
216216
evolve_core_mass();
217217
}
218218
if (tau > 1.){
219219
real (single_star::*fptr)(const real, real) = &single_star::terminal_hertzsprung_gap_core_mass;
220-
real m_rel = linear_function_inversion(fptr, relative_mass, core_mass, metalicity);
220+
real m_rel = linear_function_inversion(fptr, relative_mass, core_mass, metalicity, cnsts.parameters(minimum_main_sequence), 300);
221221
update_relative_mass(m_rel);
222222
last_update_age = main_sequence_time(relative_mass, metalicity);
223223
relative_age = next_update_age;

sstar/starclass/single_star.C

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,6 @@ star* single_star::merge_elements(star* str) {
877877

878878
real m_conserved = get_total_mass() + str->get_total_mass();
879879

880-
881880
if (str->get_element_type()!=Main_Sequence) {
882881
// adding two cores of giants together should not result in
883882
// rejuvenation.

sstar/starclass/super_giant.C

Lines changed: 53 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -118,68 +118,69 @@ real super_giant::add_mass_to_accretor(real mdot, bool hydrogen, const real dt)
118118

119119
if (relative_age < t_du_old){
120120

121-
//EAGB
122-
//part to adjust age using the co_core_mass
123-
real A_He = AGB_A_He_estimator();
124-
real l_bagb = base_AGB_luminosity(relative_mass, metalicity);
125-
real t_bagb = base_AGB_time(relative_mass, metalicity);
126-
relative_age = determine_age(COcore_mass, relative_mass, metalicity, A_He, t_bagb, l_bagb);
127-
last_update_age = t_bagb;
128-
real t_du = dredge_up_time(relative_mass, metalicity);
121+
//EAGB
122+
//part to adjust age using the co_core_mass
123+
real A_He = AGB_A_He_estimator();
124+
real l_bagb = base_AGB_luminosity(relative_mass, metalicity);
125+
real t_bagb = base_AGB_time(relative_mass, metalicity);
126+
relative_age = determine_age(COcore_mass, relative_mass, metalicity, A_He, t_bagb, l_bagb);
127+
last_update_age = t_bagb;
128+
real t_du = dredge_up_time(relative_mass, metalicity);
129129

130-
if(relative_age < last_update_age){
131-
relative_age = last_update_age;
132-
real mco = determine_core_mass(relative_age, relative_mass, metalicity,
130+
if(relative_age < last_update_age){
131+
relative_age = last_update_age;
132+
real mco = determine_core_mass(relative_age, relative_mass, metalicity,
133133
A_He, t_bagb, l_bagb);
134-
if(mco >= COcore_mass && mco <= core_mass) {
135-
McL_core_mass = mco;
136-
if(!update_COcore_mass(mco)) {
137-
cerr << "Update COcore mass failed in super_giant()"<<endl;
138-
}
139-
}
140-
}
141-
if(relative_age > t_du){
142-
//this should not be possible
143-
cerr<<"EAGB helium accretion add_mass_to_accretor mc_co > mc_du ?"<<endl;
144-
exit(-1);
145-
}
134+
if(mco >= COcore_mass && mco <= core_mass) {
135+
McL_core_mass = mco;
136+
if(!update_COcore_mass(mco)) {
137+
cerr << "Update COcore mass failed in super_giant()"<<endl;
138+
}
139+
}
140+
}
141+
if(relative_age > t_du){
142+
//this should not be possible
143+
cerr<<"EAGB helium accretion add_mass_to_accretor mc_co > mc_du ?"<<endl;
144+
//exit(-1);
145+
//very dirty fix for mergers
146+
relative_age = t_du;
147+
}
146148
}
147149
else{
148150

149-
//TPAGB
150-
//part to adjust age using the co_core_mass
151-
real mc_du = dredge_up_core_mass(relative_mass, metalicity);
152-
real lambda = min(0.9, 0.3+0.001*pow(relative_mass, 5)); // Eq.73
153-
McL_core_mass = (core_mass - mc_du) / (1 - lambda) + mc_du;
151+
//TPAGB
152+
//part to adjust age using the co_core_mass
153+
real mc_du = dredge_up_core_mass(relative_mass, metalicity);
154+
real lambda = min(0.9, 0.3+0.001*pow(relative_mass, 5)); // Eq.73
155+
McL_core_mass = (core_mass - mc_du) / (1 - lambda) + mc_du;
154156

155-
real L_du = dredge_up_luminosity(relative_mass, metalicity);
156-
real L_x = FGB_x_luminosity(relative_mass, metalicity);
157-
real AH_He = TPAGB_AH_He_estimator();
158-
real t_bagb = base_AGB_time(relative_mass, metalicity);
159-
real t_du = dredge_up_time(relative_mass, metalicity);
157+
real L_du = dredge_up_luminosity(relative_mass, metalicity);
158+
real L_x = FGB_x_luminosity(relative_mass, metalicity);
159+
real AH_He = TPAGB_AH_He_estimator();
160+
real t_bagb = base_AGB_time(relative_mass, metalicity);
161+
real t_du = dredge_up_time(relative_mass, metalicity);
160162

161-
if (L_du <= L_x){
162-
relative_age = determine_age(McL_core_mass, relative_mass, metalicity, AH_He, t_du, L_du);
163-
last_update_age = t_bagb;
164-
}
165-
else{
163+
if (L_du <= L_x){
164+
relative_age = determine_age(McL_core_mass, relative_mass, metalicity, AH_He, t_du, L_du);
165+
last_update_age = t_bagb;
166+
}
167+
else{
166168

167-
real q = sub_giant_q_parameter(relative_mass, metalicity);
168-
real B = sub_giant_B_factor(relative_mass);
169-
real t_inf2 = specific_time_limit(AH_He, t_du,
169+
real q = sub_giant_q_parameter(relative_mass, metalicity);
170+
real B = sub_giant_B_factor(relative_mass);
171+
real t_inf2 = specific_time_limit(AH_He, t_du,
170172
B, L_du, q);
171-
relative_age = t_inf2 - pow(McL_core_mass, 1.-q)/AH_He/B/(q-1.);
172-
last_update_age = t_bagb;
173-
174-
}
173+
relative_age = t_inf2 - pow(McL_core_mass, 1.-q)/AH_He/B/(q-1.);
174+
last_update_age = t_bagb;
175+
}
175176

176-
if(relative_age < t_du){
177-
//this should not be possible
178-
cerr<<"TPAGB helium accretion add_mass_to_accretor mc_co < mc_du ?"<<endl;
179-
//exit(-1);
180-
//very dirty fix for mergers
181-
relative_age = t_du;
182-
}
177+
if(relative_age < t_du){
178+
//this should not be possible
179+
cerr<<"TPAGB helium accretion add_mass_to_accretor mc_co < mc_du ?"<<endl;
180+
//exit(-1);
181+
//very dirty fix for mergers
182+
relative_age = t_du;
183+
}
183184
// // for now nothing, the next time evolve_element is entered, star makes the transition to the next phase
184185
// if(relative_age > next_update_age){
185186
// }

0 commit comments

Comments
 (0)