@@ -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