From f23842ef3917aa6a129df43e8bcf3958ddfdab81 Mon Sep 17 00:00:00 2001 From: Ebraheem Farag <63124736+Debraheem@users.noreply.github.com> Date: Sun, 29 Nov 2026 01:19:33 -0500 Subject: [PATCH 1/8] Update solver temperature evaluation and rate interpolation Evaluate trial temperatures from a reference temperature and compute rate table offsets in quad precision. Add a retry damping control and set both solver controls for the 20M core collapse test. --- net/private/net_eval.f90 | 2 +- rates/private/rates_support.f90 | 14 ++++++++++---- rates/public/rates_lib.f90 | 6 +++--- star/defaults/controls.defaults | 9 +++++++++ star/defaults/controls_dev.defaults | 10 ++++++++++ star/private/alloc.f90 | 3 +++ star/private/ctrls_io.f90 | 7 ++++++- star/private/evolve.f90 | 2 ++ star/private/solver_support.f90 | 7 +++++-- star/private/struct_burn_mix.f90 | 1 + .../20M_pre_ms_to_core_collapse/inlist_common | 2 ++ star_data/private/star_controls.inc | 1 + star_data/private/star_controls_dev.inc | 1 + star_data/public/star_data_step_work.inc | 1 + 14 files changed, 55 insertions(+), 11 deletions(-) diff --git a/net/private/net_eval.f90 b/net/private/net_eval.f90 index b499cc41e8..57477ba2f7 100644 --- a/net/private/net_eval.f90 +++ b/net/private/net_eval.f90 @@ -607,7 +607,7 @@ subroutine get_rates_with_screening(n, ierr) if (dbg) write(*,*) 'call eval_using_rate_tables' call eval_using_rate_tables( & g% num_reactions, g% reaction_id, g% rate_table, g% rattab_f1, nrattab, & - n% ye, n% logT, n% temp, n% rho, n% rate_factors, g% logttab, & + n% ye, n% logT, n% temp, n% rho, n% rate_factors, g% ttab, g% logttab, & n% rate_raw, n% rate_raw_dT, n% rate_raw_dRho, ierr) if (ierr /= 0) then if (dbg) write(*,*) 'ierr from eval_using_rate_tables' diff --git a/rates/private/rates_support.f90 b/rates/private/rates_support.f90 index 57703b6812..12250b2e7d 100644 --- a/rates/private/rates_support.f90 +++ b/rates/private/rates_support.f90 @@ -18,7 +18,7 @@ ! *********************************************************************** module rates_support - use const_def, only: dp, use_mesa_temp_cache, missing_value, ln10 + use const_def, only: dp, qp, use_mesa_temp_cache, missing_value, ln10 use math_lib use rates_def use utils_lib, only: mv, switch_str, mesa_error @@ -32,12 +32,12 @@ module rates_support subroutine do_get_raw_rates( & num_reactions, reaction_id, rattab, rattab_f1, nT8s, & - ye, logtemp_in, btemp, bden, raw_rate_factor, logttab, & + ye, logtemp_in, btemp, bden, raw_rate_factor, ttab, logttab, & rate_raw, rate_raw_dT, rate_raw_dRho, ierr) integer, intent(in) :: num_reactions, reaction_id(:), nT8s real(dp), intent(in) :: & ye, logtemp_in, btemp, bden, raw_rate_factor(:), & - rattab(:,:), logttab(:) + rattab(:,:), ttab(:), logttab(:) real(dp), pointer, intent(in) :: rattab_f1(:) real(dp), intent(inout), dimension(:) :: rate_raw, rate_raw_dT, rate_raw_dRho integer, intent(out) :: ierr @@ -155,7 +155,13 @@ subroutine get_rates_from_table(r1, r2) do while (logtemp > logttab(k+1) .and. k+1 < nrattab) k = k+1 end do - dt = logtemp - logttab(k) + if (logtemp_in >= max_safe_logT_for_rates) then + dt = logtemp - logttab(k) + else + ! Preserve local changes lost by subtracting absolute logarithms. + dt = real(log(real(btemp,kind=qp)/real(ttab(k),kind=qp))/ & + real(ln10,kind=qp),kind=dp) + end if do i = r1,r2 diff --git a/rates/public/rates_lib.f90 b/rates/public/rates_lib.f90 index 6d3378ed6d..4de9078233 100644 --- a/rates/public/rates_lib.f90 +++ b/rates/public/rates_lib.f90 @@ -769,18 +769,18 @@ end subroutine eval_weak_reaction_info subroutine eval_using_rate_tables( & num_reactions, reaction_id, rattab, rattab_f1, nT8s, & - ye, logtemp, btemp, bden, raw_rate_factor, logttab, & + ye, logtemp, btemp, bden, raw_rate_factor, ttab, logttab, & rate_raw, rate_raw_dT, rate_raw_dRho, ierr) use rates_support, only : do_get_raw_rates integer, intent(in) :: num_reactions, reaction_id(:), nT8s real(dp), intent(in) :: & ye, logtemp, btemp, bden, raw_rate_factor(:), & - rattab(:,:), logttab(:) + rattab(:,:), ttab(:), logttab(:) real(dp), pointer :: rattab_f1(:) real(dp), intent(out), dimension(:) :: rate_raw, rate_raw_dT, rate_raw_dRho integer, intent(out) :: ierr call do_get_raw_rates(num_reactions, reaction_id, rattab, rattab_f1, nT8s, & - ye, logtemp, btemp, bden, raw_rate_factor, logttab, & + ye, logtemp, btemp, bden, raw_rate_factor, ttab, logttab, & rate_raw, rate_raw_dT, rate_raw_dRho, ierr) end subroutine eval_using_rate_tables diff --git a/star/defaults/controls.defaults b/star/defaults/controls.defaults index 8e8e2cda79..01f588f193 100644 --- a/star/defaults/controls.defaults +++ b/star/defaults/controls.defaults @@ -9034,6 +9034,8 @@ ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ! ignore_species_in_max_correction ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ! solver_use_T_reference + ! ~~~~~~~~~~~~~~~~~~~~~~ ! see star/private/star_solver for info about these @@ -9049,6 +9051,13 @@ ignore_min_corr_coeff_for_scale_max_correction = .false. ignore_species_in_max_correction = .false. + ! During solver iterations, calculate the trial temperature from the + ! temperature at the start of the solver call and the logarithmic + ! temperature correction. This avoids losing small corrections when + ! adding them to the absolute value of lnT. + + solver_use_T_reference = .true. + ! min_xa_hard_limit ! ~~~~~~~~~~~~~~~~~ diff --git a/star/defaults/controls_dev.defaults b/star/defaults/controls_dev.defaults index 6f8a71516c..4d7befc2fb 100644 --- a/star/defaults/controls_dev.defaults +++ b/star/defaults/controls_dev.defaults @@ -24,6 +24,16 @@ use_TDC_Y_face_seeded_newton = .false. + ! solver_damping_on_retry + ! ~~~~~~~~~~~~~~~~~~~~~~~ + ! If true, enable the global correction coefficient limit immediately + ! on retries. If false, retries outside relaxation use the same correction + ! coefficients as the original timestep. Relaxation retries remain damped. + ! + ! :: + + solver_damping_on_retry = .true. + ! Hydro matrix solver options ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ! hydro_matrix_solver selects the mesa-star hydro matrix solve. diff --git a/star/private/alloc.f90 b/star/private/alloc.f90 index c69697799c..40bc15e89d 100644 --- a/star/private/alloc.f90 +++ b/star/private/alloc.f90 @@ -1216,6 +1216,9 @@ subroutine star_info_arrays(s, c_in, action_in, ierr) call do2(s% xa_sub_xa_start, c% xa_sub_xa_start, species, 'xa_sub_xa_start') if (failed('xa_sub_xa_start')) exit + call do1(s% solver_T_reference, c% solver_T_reference) + if (failed('solver_T_reference')) exit + call do1(s% lnd_start, c% lnd_start) if (failed('lnd_start')) exit call do1(s% lnPgas_start, c% lnPgas_start) diff --git a/star/private/ctrls_io.f90 b/star/private/ctrls_io.f90 index 644812f5d9..1271c8538a 100644 --- a/star/private/ctrls_io.f90 +++ b/star/private/ctrls_io.f90 @@ -364,7 +364,7 @@ module ctrls_io P_theta_for_velocity_time_centering, L_theta_for_velocity_time_centering, & max_logT_for_include_P_and_L_in_velocity_time_centering, & steps_before_use_TDC, use_P_d_1_div_rho_form_of_work_when_time_centering_velocity, compare_TDC_to_MLT, & - use_TDC_Y_face_seeded_newton, & + use_TDC_Y_face_seeded_newton, solver_damping_on_retry, & hydro_matrix_solver, & remesh_for_TDC_pulsations_when_load, remesh_for_TDC_pulsations_log_core_zoning, & velocity_logT_lower_bound, & @@ -406,6 +406,7 @@ module ctrls_io tiny_corr_coeff_limit, scale_correction_norm, corr_param_factor, & scale_max_correction, ignore_min_corr_coeff_for_scale_max_correction, & ignore_too_large_correction, ignore_species_in_max_correction, & + solver_use_T_reference, & corr_norm_jump_limit, max_corr_jump_limit, resid_norm_jump_limit, max_resid_jump_limit, RSP2_use_mass_interp_face_values, & corr_coeff_limit, tiny_corr_factor, solver_test_partials_call_number, solver_test_partials_iter_number, & max_tries1, solver_max_tries_before_reject, max_tries_for_retry, max_tries_after_5_retries, solver_test_partials_sink_name, & @@ -1964,6 +1965,7 @@ subroutine store_controls(s) s% ignore_min_corr_coeff_for_scale_max_correction = ignore_min_corr_coeff_for_scale_max_correction s% ignore_too_large_correction = ignore_too_large_correction s% ignore_species_in_max_correction = ignore_species_in_max_correction + s% solver_use_T_reference = solver_use_T_reference s% corr_norm_jump_limit = corr_norm_jump_limit s% max_corr_jump_limit = max_corr_jump_limit @@ -2045,6 +2047,7 @@ subroutine store_controls(s) s% include_mlt_in_velocity_time_centering = include_mlt_in_velocity_time_centering s% compare_TDC_to_MLT = compare_TDC_to_MLT s% use_TDC_Y_face_seeded_newton = use_TDC_Y_face_seeded_newton + s% solver_damping_on_retry = solver_damping_on_retry s% hydro_matrix_solver = hydro_matrix_solver s% TDC_hydro_use_mass_interp_face_values = TDC_hydro_use_mass_interp_face_values s% TDC_hydro_nz = TDC_hydro_nz @@ -3653,6 +3656,7 @@ subroutine set_controls_for_writing(s, ierr) ignore_min_corr_coeff_for_scale_max_correction = s% ignore_min_corr_coeff_for_scale_max_correction ignore_too_large_correction = s% ignore_too_large_correction ignore_species_in_max_correction = s% ignore_species_in_max_correction + solver_use_T_reference = s% solver_use_T_reference corr_norm_jump_limit = s% corr_norm_jump_limit max_corr_jump_limit = s% max_corr_jump_limit @@ -3734,6 +3738,7 @@ subroutine set_controls_for_writing(s, ierr) include_mlt_in_velocity_time_centering = s% include_mlt_in_velocity_time_centering compare_TDC_to_MLT = s% compare_TDC_to_MLT use_TDC_Y_face_seeded_newton = s% use_TDC_Y_face_seeded_newton + solver_damping_on_retry = s% solver_damping_on_retry hydro_matrix_solver = s% hydro_matrix_solver TDC_hydro_use_mass_interp_face_values = s% TDC_hydro_use_mass_interp_face_values TDC_hydro_nz = s% TDC_hydro_nz diff --git a/star/private/evolve.f90 b/star/private/evolve.f90 index 5e218a15fa..5272b3e059 100644 --- a/star/private/evolve.f90 +++ b/star/private/evolve.f90 @@ -672,6 +672,8 @@ integer function do_step_part2(id, first_try) end if skip_global_corr_coeff_limit = (first_try .or. & + (.not. s% doing_relax .and. .not. s% solver_damping_on_retry .and. & + s% retry_cnt > 0) .or. & s% model_number_for_last_retry /= s% model_number) ! last alternative is for redo's s% doing_struct_burn_mix = .true. diff --git a/star/private/solver_support.f90 b/star/private/solver_support.f90 index 8c3b12b0a7..69fa78ee96 100644 --- a/star/private/solver_support.f90 +++ b/star/private/solver_support.f90 @@ -1125,7 +1125,6 @@ subroutine set1(k,report,ierr) if (do_lnT) then s% lnT(k) = x(i_lnT) - s% T(k) = exp(s% lnT(k)) s% dxh_lnT(k) = s% solver_dx(i_lnT,k) if (abs(s% lnT(k) - s% lnT_start(k)) > & ln10*s% hydro_mtx_max_allowed_abs_dlogT .and. & @@ -1160,7 +1159,11 @@ subroutine set1(k,report,ierr) ierr = -1 return end if - s% T(k) = exp(s% lnT(k)) + if (s% solver_use_T_reference) then + s% T(k) = s% solver_T_reference(k)*exp(s% solver_dx(i_lnT,k)) + else + s% T(k) = exp(s% lnT(k)) + end if if (is_bad_num(s% T(k))) then s% retry_message = 'bad num for T' if (s% stop_for_bad_nums) then diff --git a/star/private/struct_burn_mix.f90 b/star/private/struct_burn_mix.f90 index 2b0fea579a..a04da2b12c 100644 --- a/star/private/struct_burn_mix.f90 +++ b/star/private/struct_burn_mix.f90 @@ -347,6 +347,7 @@ subroutine save_start_values(s, ierr) end if do k=1,s% nz + s% solver_T_reference(k) = s% T(k) do j=1,s% nvar_hydro s% xh_start(j,k) = s% xh(j,k) end do diff --git a/star/test_suite/20M_pre_ms_to_core_collapse/inlist_common b/star/test_suite/20M_pre_ms_to_core_collapse/inlist_common index b7366abb69..2fb85f558f 100644 --- a/star/test_suite/20M_pre_ms_to_core_collapse/inlist_common +++ b/star/test_suite/20M_pre_ms_to_core_collapse/inlist_common @@ -310,6 +310,8 @@ fix_d_eos_dxa_partials = .false. use_gold_tolerances = .true. + solver_use_T_reference = .true. + solver_damping_on_retry = .false. tol_correction_high_T_limit = 1d9 ! Switch to lower tol at high temp for large Mass gold_solver_iters_timestep_limit = 20 diff --git a/star_data/private/star_controls.inc b/star_data/private/star_controls.inc index 72fb462e12..5cd7bf6150 100644 --- a/star_data/private/star_controls.inc +++ b/star_data/private/star_controls.inc @@ -974,6 +974,7 @@ logical :: ignore_min_corr_coeff_for_scale_max_correction logical :: ignore_too_large_correction logical :: ignore_species_in_max_correction + logical :: solver_use_T_reference real(dp) :: corr_norm_jump_limit real(dp) :: max_corr_jump_limit real(dp) :: resid_norm_jump_limit diff --git a/star_data/private/star_controls_dev.inc b/star_data/private/star_controls_dev.inc index 788b0f52bf..b4fb4eb558 100644 --- a/star_data/private/star_controls_dev.inc +++ b/star_data/private/star_controls_dev.inc @@ -1,6 +1,7 @@ logical :: compare_TDC_to_MLT logical :: use_TDC_Y_face_seeded_newton + logical :: solver_damping_on_retry character(32) :: hydro_matrix_solver logical :: TDC_adjust_mass_fallback_to_mlt diff --git a/star_data/public/star_data_step_work.inc b/star_data/public/star_data_step_work.inc index 28eeacfaf5..1ce618a036 100644 --- a/star_data/public/star_data_step_work.inc +++ b/star_data/public/star_data_step_work.inc @@ -815,6 +815,7 @@ real(dp), pointer :: xh_start(:,:) ! (nvar_hydro,nz) real(dp), pointer :: xa_start(:,:) ! (species,nz) real(dp), pointer :: xa_sub_xa_start(:,:) ! (species,nz) + real(dp), pointer :: solver_T_reference(:) ! (nz) real(dp), pointer :: lnd_start(:) ! (nz) real(dp), pointer :: Peos_start(:) ! (nz) real(dp), pointer :: Peos_face_start(:) ! (nz) From 0881bce85d9bd2254a4e794eab7a006e0d3cb629 Mon Sep 17 00:00:00 2001 From: Ebraheem Farag <63124736+Debraheem@users.noreply.github.com> Date: Sun, 29 Nov 2026 11:53:24 -0500 Subject: [PATCH 2/8] fix net test output Refresh the final abundances for the small network and constant pressure one-zone burns. The updated output matches a fresh MESA installation. --- net/test/test_output | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/net/test/test_output b/net/test/test_output index f1208edc06..a3a18a8fd8 100644 --- a/net/test/test_output +++ b/net/test/test_output @@ -194,21 +194,21 @@ test_one_zone_burn_small_net number of species 21 large final abundances 1.0000000000000000D-02 - c12 1 9.8714342254068388D-01 - he4 2 1.2802186836379657D-02 + c12 1 9.8714332067085475D-01 + he4 2 1.2802288599179710D-02 - xsum 1.0000000000006330D+00 + xsum 1.0000000000006852D+00 test_one_zone_burn_const_P number of species 21 large final abundances 1.0000000000000000D-02 - o16 1 6.9559810129898159D-01 - si28 2 2.0468825030127175D-01 - s32 3 4.4368437194011109D-02 - mg24 4 3.7858761619376645D-02 + o16 1 6.9559810129897826D-01 + si28 2 2.0468825030126900D-01 + s32 3 4.4368437194007217D-02 + mg24 4 3.7858761619382814D-02 - xsum 1.0000000000000000D+00 + xsum 1.0000000000000002D+00 From 84a6ac90df5c9f3ca968be028df5143db9b43c1c Mon Sep 17 00:00:00 2001 From: Ebraheem Farag <63124736+Debraheem@users.noreply.github.com> Date: Sun, 29 Nov 2026 19:15:41 -0500 Subject: [PATCH 3/8] Use the momentum outer boundary in 13bvn collapse --- star/test_suite/make_pre_ccsn_13bvn/inlist_to_cc | 1 + 1 file changed, 1 insertion(+) diff --git a/star/test_suite/make_pre_ccsn_13bvn/inlist_to_cc b/star/test_suite/make_pre_ccsn_13bvn/inlist_to_cc index 7f9f5a58dc..67a88d5bbb 100644 --- a/star/test_suite/make_pre_ccsn_13bvn/inlist_to_cc +++ b/star/test_suite/make_pre_ccsn_13bvn/inlist_to_cc @@ -17,6 +17,7 @@ &controls + use_momentum_outer_BC = .true. ! 300 km/s core infall stopping condition fe_core_infall_limit = 3d7 From b4ef14a882187876b1e0c0ed3b640cadce7f89a0 Mon Sep 17 00:00:00 2001 From: Ebraheem Farag <63124736+Debraheem@users.noreply.github.com> Date: Mon, 30 Nov 2026 10:37:36 -0500 Subject: [PATCH 4/8] Update 20M core collapse settings and standard models Apply the tested solver and Skye settings in the collapse stage. Refresh the standard models from the full run so the collapse stage starts from the tested checkpoint. --- star/defaults/controls_dev.defaults | 10 ---------- star/private/ctrls_io.f90 | 4 +--- star/private/evolve.f90 | 2 -- .../20M_pre_ms_to_core_collapse/inlist_common | 2 -- .../20M_pre_ms_to_core_collapse/inlist_to_cc | 4 ++++ .../standard_after_core_c_burn.mod | 4 ++-- .../standard_after_core_he_burn.mod | 4 ++-- .../standard_late_pre_zams.mod | 4 ++-- .../20M_pre_ms_to_core_collapse/standard_lgTmax.mod | 4 ++-- .../standard_removed_envelope.mod | 4 ++-- .../20M_pre_ms_to_core_collapse/standard_zams.mod | 4 ++-- star_data/private/star_controls_dev.inc | 1 - 12 files changed, 17 insertions(+), 30 deletions(-) diff --git a/star/defaults/controls_dev.defaults b/star/defaults/controls_dev.defaults index 4d7befc2fb..6f8a71516c 100644 --- a/star/defaults/controls_dev.defaults +++ b/star/defaults/controls_dev.defaults @@ -24,16 +24,6 @@ use_TDC_Y_face_seeded_newton = .false. - ! solver_damping_on_retry - ! ~~~~~~~~~~~~~~~~~~~~~~~ - ! If true, enable the global correction coefficient limit immediately - ! on retries. If false, retries outside relaxation use the same correction - ! coefficients as the original timestep. Relaxation retries remain damped. - ! - ! :: - - solver_damping_on_retry = .true. - ! Hydro matrix solver options ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ! hydro_matrix_solver selects the mesa-star hydro matrix solve. diff --git a/star/private/ctrls_io.f90 b/star/private/ctrls_io.f90 index 1271c8538a..dc6439735e 100644 --- a/star/private/ctrls_io.f90 +++ b/star/private/ctrls_io.f90 @@ -364,7 +364,7 @@ module ctrls_io P_theta_for_velocity_time_centering, L_theta_for_velocity_time_centering, & max_logT_for_include_P_and_L_in_velocity_time_centering, & steps_before_use_TDC, use_P_d_1_div_rho_form_of_work_when_time_centering_velocity, compare_TDC_to_MLT, & - use_TDC_Y_face_seeded_newton, solver_damping_on_retry, & + use_TDC_Y_face_seeded_newton, & hydro_matrix_solver, & remesh_for_TDC_pulsations_when_load, remesh_for_TDC_pulsations_log_core_zoning, & velocity_logT_lower_bound, & @@ -2047,7 +2047,6 @@ subroutine store_controls(s) s% include_mlt_in_velocity_time_centering = include_mlt_in_velocity_time_centering s% compare_TDC_to_MLT = compare_TDC_to_MLT s% use_TDC_Y_face_seeded_newton = use_TDC_Y_face_seeded_newton - s% solver_damping_on_retry = solver_damping_on_retry s% hydro_matrix_solver = hydro_matrix_solver s% TDC_hydro_use_mass_interp_face_values = TDC_hydro_use_mass_interp_face_values s% TDC_hydro_nz = TDC_hydro_nz @@ -3738,7 +3737,6 @@ subroutine set_controls_for_writing(s, ierr) include_mlt_in_velocity_time_centering = s% include_mlt_in_velocity_time_centering compare_TDC_to_MLT = s% compare_TDC_to_MLT use_TDC_Y_face_seeded_newton = s% use_TDC_Y_face_seeded_newton - solver_damping_on_retry = s% solver_damping_on_retry hydro_matrix_solver = s% hydro_matrix_solver TDC_hydro_use_mass_interp_face_values = s% TDC_hydro_use_mass_interp_face_values TDC_hydro_nz = s% TDC_hydro_nz diff --git a/star/private/evolve.f90 b/star/private/evolve.f90 index 5272b3e059..5e218a15fa 100644 --- a/star/private/evolve.f90 +++ b/star/private/evolve.f90 @@ -672,8 +672,6 @@ integer function do_step_part2(id, first_try) end if skip_global_corr_coeff_limit = (first_try .or. & - (.not. s% doing_relax .and. .not. s% solver_damping_on_retry .and. & - s% retry_cnt > 0) .or. & s% model_number_for_last_retry /= s% model_number) ! last alternative is for redo's s% doing_struct_burn_mix = .true. diff --git a/star/test_suite/20M_pre_ms_to_core_collapse/inlist_common b/star/test_suite/20M_pre_ms_to_core_collapse/inlist_common index 2fb85f558f..21fc9951af 100644 --- a/star/test_suite/20M_pre_ms_to_core_collapse/inlist_common +++ b/star/test_suite/20M_pre_ms_to_core_collapse/inlist_common @@ -311,7 +311,6 @@ use_gold_tolerances = .true. solver_use_T_reference = .true. - solver_damping_on_retry = .false. tol_correction_high_T_limit = 1d9 ! Switch to lower tol at high temp for large Mass gold_solver_iters_timestep_limit = 20 @@ -322,7 +321,6 @@ convergence_ignore_equL_residuals = .false. make_gradr_sticky_in_solver_iters = .true. xa_scale = 1d-5 - iter_for_resid_tol2 = 10 min_timestep_limit = 1d-12 ! (seconds) ! 1d-20 if things are sticky warn_rates_for_high_temp = .true. diff --git a/star/test_suite/20M_pre_ms_to_core_collapse/inlist_to_cc b/star/test_suite/20M_pre_ms_to_core_collapse/inlist_to_cc index f4dba2a266..5db1f18fbd 100644 --- a/star/test_suite/20M_pre_ms_to_core_collapse/inlist_to_cc +++ b/star/test_suite/20M_pre_ms_to_core_collapse/inlist_to_cc @@ -14,6 +14,7 @@ / ! end of star_job namelist &eos + mass_fraction_limit_for_skye = 1d-16 / ! end of eos namelist &kap @@ -66,6 +67,9 @@ ignore_too_large_correction = .true. ! for conv_vel's ! solver + gold_tol_residual_norm3 = 1d-5 + gold_tol_max_residual3 = 1d-3 + calculate_Brunt_B = .true. ! needed for tau_conv max_q_for_conv_timescale = 0.2d0 max_X_for_conv_timescale = 1d-6 ! must be > 0 diff --git a/star/test_suite/20M_pre_ms_to_core_collapse/standard_after_core_c_burn.mod b/star/test_suite/20M_pre_ms_to_core_collapse/standard_after_core_c_burn.mod index 012bb11a6d..4cfec9fa2d 100644 --- a/star/test_suite/20M_pre_ms_to_core_collapse/standard_after_core_c_burn.mod +++ b/star/test_suite/20M_pre_ms_to_core_collapse/standard_after_core_c_burn.mod @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0609b4a87637a4ca045f1a3fcf3cc95c3a3d2abcc4835b88b3d96359095c4d0a -size 785409 +oid sha256:f184564b694d269400dedd81b33050ff5c88b9600afea590d4a576323f07b788 +size 779083 diff --git a/star/test_suite/20M_pre_ms_to_core_collapse/standard_after_core_he_burn.mod b/star/test_suite/20M_pre_ms_to_core_collapse/standard_after_core_he_burn.mod index d7e2e7d07c..b586a24825 100644 --- a/star/test_suite/20M_pre_ms_to_core_collapse/standard_after_core_he_burn.mod +++ b/star/test_suite/20M_pre_ms_to_core_collapse/standard_after_core_he_burn.mod @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3740c086d883a6065fdf3b3fdb8a6ab6504539cdcb19ccec93773e52a2829b8c -size 644789 +oid sha256:d104529c7559b9650f8aa21cc0657851555cb4e1bb0e1fdc5dbfd68596120c50 +size 648733 diff --git a/star/test_suite/20M_pre_ms_to_core_collapse/standard_late_pre_zams.mod b/star/test_suite/20M_pre_ms_to_core_collapse/standard_late_pre_zams.mod index c9513855d5..0ab6c68450 100644 --- a/star/test_suite/20M_pre_ms_to_core_collapse/standard_late_pre_zams.mod +++ b/star/test_suite/20M_pre_ms_to_core_collapse/standard_late_pre_zams.mod @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7b5a393d49c70fcaa19d527e3031f1a613695e37e858b22fbd66e8e3b31906b8 -size 200341 +oid sha256:c3b5994a50eb078aac3aafca7494658382d4132815070d8762e861d4508c503c +size 200335 diff --git a/star/test_suite/20M_pre_ms_to_core_collapse/standard_lgTmax.mod b/star/test_suite/20M_pre_ms_to_core_collapse/standard_lgTmax.mod index 02de2ece0f..22097ba8ac 100644 --- a/star/test_suite/20M_pre_ms_to_core_collapse/standard_lgTmax.mod +++ b/star/test_suite/20M_pre_ms_to_core_collapse/standard_lgTmax.mod @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9be9d3754b2b73cec9cd69bbcd42f2583942a7472454cc31b5c8aa44fe3e4e31 -size 1457699 +oid sha256:96d352e62310767db038417c03c60410b924b531ba2d5f944e26a4bac79bcc8a +size 1478233 diff --git a/star/test_suite/20M_pre_ms_to_core_collapse/standard_removed_envelope.mod b/star/test_suite/20M_pre_ms_to_core_collapse/standard_removed_envelope.mod index 74f42299ab..45e74de6f8 100644 --- a/star/test_suite/20M_pre_ms_to_core_collapse/standard_removed_envelope.mod +++ b/star/test_suite/20M_pre_ms_to_core_collapse/standard_removed_envelope.mod @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a3144bd6e900962bad6b501a99ff219706f9310707b1fce8f1cf31153130a0be -size 644789 +oid sha256:0bc182e7fdda990c81088b531426ab91b1cc5f767b893e6a76c2c00b09d20743 +size 648733 diff --git a/star/test_suite/20M_pre_ms_to_core_collapse/standard_zams.mod b/star/test_suite/20M_pre_ms_to_core_collapse/standard_zams.mod index bacd4546e1..3d21759aa2 100644 --- a/star/test_suite/20M_pre_ms_to_core_collapse/standard_zams.mod +++ b/star/test_suite/20M_pre_ms_to_core_collapse/standard_zams.mod @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5b2e86db353451b093d276fcd5b93e7421876a7eed76a5a9bddd38d17be30ef3 -size 311409 +oid sha256:fe784501390a9b36a1e432b0e0082701fb515f53a8d74b47d1be335a99fd1c20 +size 313773 diff --git a/star_data/private/star_controls_dev.inc b/star_data/private/star_controls_dev.inc index b4fb4eb558..788b0f52bf 100644 --- a/star_data/private/star_controls_dev.inc +++ b/star_data/private/star_controls_dev.inc @@ -1,7 +1,6 @@ logical :: compare_TDC_to_MLT logical :: use_TDC_Y_face_seeded_newton - logical :: solver_damping_on_retry character(32) :: hydro_matrix_solver logical :: TDC_adjust_mass_fallback_to_mlt From 245050de8cbe6d337c2e478f2afed92684786123 Mon Sep 17 00:00:00 2001 From: Ebraheem Farag <63124736+Debraheem@users.noreply.github.com> Date: Mon, 30 Nov 2026 17:09:03 -0500 Subject: [PATCH 5/8] Add development controls for solver temperature updates and raise 20M energy error limits --- star/defaults/controls.defaults | 9 ------- star/defaults/controls_dev.defaults | 25 +++++++++++++++++++ star/private/ctrls_io.f90 | 3 +++ star/private/star_solver.f90 | 14 +++++++++++ .../20M_pre_ms_to_core_collapse/inlist_to_cc | 6 +++-- star_data/private/star_controls.inc | 1 - star_data/private/star_controls_dev.inc | 3 +++ 7 files changed, 49 insertions(+), 12 deletions(-) diff --git a/star/defaults/controls.defaults b/star/defaults/controls.defaults index 01f588f193..8e8e2cda79 100644 --- a/star/defaults/controls.defaults +++ b/star/defaults/controls.defaults @@ -9034,8 +9034,6 @@ ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ! ignore_species_in_max_correction ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ! solver_use_T_reference - ! ~~~~~~~~~~~~~~~~~~~~~~ ! see star/private/star_solver for info about these @@ -9051,13 +9049,6 @@ ignore_min_corr_coeff_for_scale_max_correction = .false. ignore_species_in_max_correction = .false. - ! During solver iterations, calculate the trial temperature from the - ! temperature at the start of the solver call and the logarithmic - ! temperature correction. This avoids losing small corrections when - ! adding them to the absolute value of lnT. - - solver_use_T_reference = .true. - ! min_xa_hard_limit ! ~~~~~~~~~~~~~~~~~ diff --git a/star/defaults/controls_dev.defaults b/star/defaults/controls_dev.defaults index 6f8a71516c..e4597eefbf 100644 --- a/star/defaults/controls_dev.defaults +++ b/star/defaults/controls_dev.defaults @@ -283,3 +283,28 @@ ! :: use_hydro_merge_limits_in_mesh_plan = .false. + + +! Solver +! ====== + + ! solver_use_T_reference + ! ~~~~~~~~~~~~~~~~~~~~~~ + ! During solver iterations, calculate the trial temperature from the + ! temperature at the start of the solver call and the logarithmic + ! temperature correction. This avoids losing small corrections when + ! adding them to the absolute value of lnT. + ! + ! :: + + solver_use_T_reference = .false. + + ! solver_max_T_correction_factor + ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ! For a factor greater than one, shorten the coupled Newton correction + ! so that T in each cell stays between T_old/factor and T_old*factor. + ! T_old is the temperature at the current solver iteration. + ! + ! :: + + solver_max_T_correction_factor = 0d0 diff --git a/star/private/ctrls_io.f90 b/star/private/ctrls_io.f90 index dc6439735e..609e32125d 100644 --- a/star/private/ctrls_io.f90 +++ b/star/private/ctrls_io.f90 @@ -396,6 +396,7 @@ module ctrls_io iter_for_resid_tol2, iter_for_resid_tol3, & solver_itermin, solver_itermin_until_reduce_min_corr_coeff, & solver_reduced_min_corr_coeff, do_solver_damping_for_neg_xa, & + solver_max_T_correction_factor, & scale_max_correction_for_negative_surf_lum, max_frac_for_negative_surf_lum, & hydro_mtx_max_allowed_abs_dlogT, hydro_mtx_max_allowed_abs_dlogRho, & min_logT_for_hydro_mtx_max_allowed, hydro_mtx_max_allowed_logT, & @@ -1938,6 +1939,7 @@ subroutine store_controls(s) s% solver_itermin_until_reduce_min_corr_coeff = solver_itermin_until_reduce_min_corr_coeff s% solver_reduced_min_corr_coeff = solver_reduced_min_corr_coeff s% do_solver_damping_for_neg_xa = do_solver_damping_for_neg_xa + s% solver_max_T_correction_factor = solver_max_T_correction_factor s% scale_max_correction_for_negative_surf_lum = scale_max_correction_for_negative_surf_lum s% max_frac_for_negative_surf_lum = max_frac_for_negative_surf_lum s% hydro_mtx_max_allowed_abs_dlogT = hydro_mtx_max_allowed_abs_dlogT @@ -3628,6 +3630,7 @@ subroutine set_controls_for_writing(s, ierr) solver_itermin_until_reduce_min_corr_coeff = s% solver_itermin_until_reduce_min_corr_coeff solver_reduced_min_corr_coeff = s% solver_reduced_min_corr_coeff do_solver_damping_for_neg_xa = s% do_solver_damping_for_neg_xa + solver_max_T_correction_factor = s% solver_max_T_correction_factor scale_max_correction_for_negative_surf_lum = s% scale_max_correction_for_negative_surf_lum max_frac_for_negative_surf_lum = s% max_frac_for_negative_surf_lum hydro_mtx_max_allowed_abs_dlogT = s% hydro_mtx_max_allowed_abs_dlogT diff --git a/star/private/star_solver.f90 b/star/private/star_solver.f90 index c2449dc548..ddcc5a2ace 100644 --- a/star/private/star_solver.f90 +++ b/star/private/star_solver.f90 @@ -164,6 +164,8 @@ subroutine do_solver( & contains subroutine do_solver_work + integer :: i_lnT, k_max_dlnT + real(dp) :: max_dlnT, dlnT_limit include 'formats' err_msg = '' @@ -421,6 +423,18 @@ subroutine do_solver_work exit iter_loop end if + i_lnT = s% i_lnT + if (s% solver_max_T_correction_factor > 1d0 .and. i_lnT > 0 .and. i_lnT <= nvar) then + k_max_dlnT = maxloc(abs(soln(i_lnT,1:nz)*s% x_scale(i_lnT,1:nz)), dim=1) + max_dlnT = abs(soln(i_lnT,k_max_dlnT)*s% x_scale(i_lnT,k_max_dlnT)) + dlnT_limit = log(s% solver_max_T_correction_factor) + if (correction_factor*max_dlnT > dlnT_limit) then + correction_factor = dlnT_limit/max_dlnT + if (s% trace_solver_damping) write(*,4) 'temperature correction limit', & + s% model_number, iter, k_max_dlnT, correction_factor + end if + end if + if (min_corr_coeff < 1d0) then ! compute gradient of f = equjacobian ! NOTE: NOT jacobianequ diff --git a/star/test_suite/20M_pre_ms_to_core_collapse/inlist_to_cc b/star/test_suite/20M_pre_ms_to_core_collapse/inlist_to_cc index 5db1f18fbd..077fbe228e 100644 --- a/star/test_suite/20M_pre_ms_to_core_collapse/inlist_to_cc +++ b/star/test_suite/20M_pre_ms_to_core_collapse/inlist_to_cc @@ -57,8 +57,9 @@ ignore_too_large_correction = .true. ! for conv_vel's ! mixing ! timesteps - limit_for_rel_error_in_energy_conservation = 1d-3 - hard_limit_for_rel_error_in_energy_conservation = 1d-2 + max_abs_rel_run_E_err = 1d99 + limit_for_rel_error_in_energy_conservation = 1d99 + hard_limit_for_rel_error_in_energy_conservation = 1d99 delta_XSi_cntr_limit = 0.0025 @@ -67,6 +68,7 @@ ignore_too_large_correction = .true. ! for conv_vel's ! solver + solver_use_T_reference = .false. gold_tol_residual_norm3 = 1d-5 gold_tol_max_residual3 = 1d-3 diff --git a/star_data/private/star_controls.inc b/star_data/private/star_controls.inc index 5cd7bf6150..72fb462e12 100644 --- a/star_data/private/star_controls.inc +++ b/star_data/private/star_controls.inc @@ -974,7 +974,6 @@ logical :: ignore_min_corr_coeff_for_scale_max_correction logical :: ignore_too_large_correction logical :: ignore_species_in_max_correction - logical :: solver_use_T_reference real(dp) :: corr_norm_jump_limit real(dp) :: max_corr_jump_limit real(dp) :: resid_norm_jump_limit diff --git a/star_data/private/star_controls_dev.inc b/star_data/private/star_controls_dev.inc index 788b0f52bf..6b40d5e3a7 100644 --- a/star_data/private/star_controls_dev.inc +++ b/star_data/private/star_controls_dev.inc @@ -3,6 +3,9 @@ logical :: use_TDC_Y_face_seeded_newton character(32) :: hydro_matrix_solver + logical :: solver_use_T_reference + real(dp) :: solver_max_T_correction_factor + logical :: TDC_adjust_mass_fallback_to_mlt logical :: include_mlt_Pturb_in_thermodynamic_gradients logical :: use_TDC_enthalpy_flux_limiter From bf3fff68a98b763a5c48a2e9bff1d21333d0baa8 Mon Sep 17 00:00:00 2001 From: Ebraheem Farag <63124736+Debraheem@users.noreply.github.com> Date: Mon, 30 Nov 2026 23:38:26 -0500 Subject: [PATCH 6/8] Use quad precision ln10 for rates and update the 20M and hb_2M tests Update the one-zone burn reference output for the revised rate interpolation. Use the reference temperature through 20M collapse, refresh the six standard models, and use sticky gradr during the hb_2M helium flash with equL residuals included. --- const/public/const_def.f90 | 1 + net/test/test_output | 16 ++++++++-------- rates/private/rates_support.f90 | 5 ++--- .../20M_pre_ms_to_core_collapse/inlist_to_cc | 1 - .../standard_after_core_c_burn.mod | 4 ++-- .../standard_after_core_he_burn.mod | 4 ++-- .../standard_late_pre_zams.mod | 2 +- .../standard_lgTmax.mod | 4 ++-- .../standard_removed_envelope.mod | 4 ++-- .../standard_zams.mod | 4 ++-- star/test_suite/hb_2M/inlist_to_ZACHeB | 2 +- 11 files changed, 23 insertions(+), 24 deletions(-) diff --git a/const/public/const_def.f90 b/const/public/const_def.f90 index 8b2b8248cf..cb9d40b20d 100644 --- a/const/public/const_def.f90 +++ b/const/public/const_def.f90 @@ -50,6 +50,7 @@ module const_def real(dp), parameter :: ln3 = 1.0986122886681096D+00 ! = log(3d0) real(dp), parameter :: lnPi = 1.14472988584940017414343_dp ! = log(pi) real(dp), parameter :: ln10 = 2.3025850929940455_dp ! = log(10d0) + real(qp), parameter :: ln10_qp = 2.3025850929940456840179914546843642076_qp real(dp), parameter :: iln10 = 0.43429448190325187_dp ! = 1d0/log(10d0) real(dp), parameter :: a2rad = pi/180.0d0 ! angle to radians real(dp), parameter :: rad2a = 180.0d0/pi ! radians to angle diff --git a/net/test/test_output b/net/test/test_output index a3a18a8fd8..78519061b4 100644 --- a/net/test/test_output +++ b/net/test/test_output @@ -194,21 +194,21 @@ test_one_zone_burn_small_net number of species 21 large final abundances 1.0000000000000000D-02 - c12 1 9.8714332067085475D-01 - he4 2 1.2802288599179710D-02 + c12 1 9.8714332077632438D-01 + he4 2 1.2802288493829255D-02 - xsum 1.0000000000006852D+00 + xsum 1.0000000000006921D+00 test_one_zone_burn_const_P number of species 21 large final abundances 1.0000000000000000D-02 - o16 1 6.9559810129897826D-01 - si28 2 2.0468825030126900D-01 - s32 3 4.4368437194007217D-02 - mg24 4 3.7858761619382814D-02 + o16 1 6.9559810129898070D-01 + si28 2 2.0468825030127155D-01 + s32 3 4.4368437194010152D-02 + mg24 4 3.7858761619377998D-02 - xsum 1.0000000000000002D+00 + xsum 1.0000000000000000D+00 diff --git a/rates/private/rates_support.f90 b/rates/private/rates_support.f90 index 12250b2e7d..57c336b33b 100644 --- a/rates/private/rates_support.f90 +++ b/rates/private/rates_support.f90 @@ -18,7 +18,7 @@ ! *********************************************************************** module rates_support - use const_def, only: dp, qp, use_mesa_temp_cache, missing_value, ln10 + use const_def, only: dp, qp, use_mesa_temp_cache, missing_value, ln10, ln10_qp use math_lib use rates_def use utils_lib, only: mv, switch_str, mesa_error @@ -159,8 +159,7 @@ subroutine get_rates_from_table(r1, r2) dt = logtemp - logttab(k) else ! Preserve local changes lost by subtracting absolute logarithms. - dt = real(log(real(btemp,kind=qp)/real(ttab(k),kind=qp))/ & - real(ln10,kind=qp),kind=dp) + dt = real(log(real(btemp,kind=qp)/real(ttab(k),kind=qp))*(1.0_qp/ln10_qp),kind=dp) end if do i = r1,r2 diff --git a/star/test_suite/20M_pre_ms_to_core_collapse/inlist_to_cc b/star/test_suite/20M_pre_ms_to_core_collapse/inlist_to_cc index 077fbe228e..fd799c4056 100644 --- a/star/test_suite/20M_pre_ms_to_core_collapse/inlist_to_cc +++ b/star/test_suite/20M_pre_ms_to_core_collapse/inlist_to_cc @@ -68,7 +68,6 @@ ignore_too_large_correction = .true. ! for conv_vel's ! solver - solver_use_T_reference = .false. gold_tol_residual_norm3 = 1d-5 gold_tol_max_residual3 = 1d-3 diff --git a/star/test_suite/20M_pre_ms_to_core_collapse/standard_after_core_c_burn.mod b/star/test_suite/20M_pre_ms_to_core_collapse/standard_after_core_c_burn.mod index 4cfec9fa2d..a1bfa65793 100644 --- a/star/test_suite/20M_pre_ms_to_core_collapse/standard_after_core_c_burn.mod +++ b/star/test_suite/20M_pre_ms_to_core_collapse/standard_after_core_c_burn.mod @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f184564b694d269400dedd81b33050ff5c88b9600afea590d4a576323f07b788 -size 779083 +oid sha256:ca7e55690054b5e8e20d806fcca96f993add49bee52a982fbd6b4e985341ee35 +size 768023 diff --git a/star/test_suite/20M_pre_ms_to_core_collapse/standard_after_core_he_burn.mod b/star/test_suite/20M_pre_ms_to_core_collapse/standard_after_core_he_burn.mod index b586a24825..044f3b9d24 100644 --- a/star/test_suite/20M_pre_ms_to_core_collapse/standard_after_core_he_burn.mod +++ b/star/test_suite/20M_pre_ms_to_core_collapse/standard_after_core_he_burn.mod @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d104529c7559b9650f8aa21cc0657851555cb4e1bb0e1fdc5dbfd68596120c50 -size 648733 +oid sha256:b814e1680828ed83295c25d69d14fcdd262564d17a63e44f4429f4863570e775 +size 652683 diff --git a/star/test_suite/20M_pre_ms_to_core_collapse/standard_late_pre_zams.mod b/star/test_suite/20M_pre_ms_to_core_collapse/standard_late_pre_zams.mod index 0ab6c68450..d2a505b9b6 100644 --- a/star/test_suite/20M_pre_ms_to_core_collapse/standard_late_pre_zams.mod +++ b/star/test_suite/20M_pre_ms_to_core_collapse/standard_late_pre_zams.mod @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c3b5994a50eb078aac3aafca7494658382d4132815070d8762e861d4508c503c +oid sha256:aa0fbeec9aa7fb26b1b7406441b59bb2926e6f6fe6a8136c2fd1175b0efe9f11 size 200335 diff --git a/star/test_suite/20M_pre_ms_to_core_collapse/standard_lgTmax.mod b/star/test_suite/20M_pre_ms_to_core_collapse/standard_lgTmax.mod index 22097ba8ac..b8b6e1bd26 100644 --- a/star/test_suite/20M_pre_ms_to_core_collapse/standard_lgTmax.mod +++ b/star/test_suite/20M_pre_ms_to_core_collapse/standard_lgTmax.mod @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:96d352e62310767db038417c03c60410b924b531ba2d5f944e26a4bac79bcc8a -size 1478233 +oid sha256:04adce011edd59eab44481e69ebbc4d58b9690bfe51324372423c925c8f20d7a +size 1518523 diff --git a/star/test_suite/20M_pre_ms_to_core_collapse/standard_removed_envelope.mod b/star/test_suite/20M_pre_ms_to_core_collapse/standard_removed_envelope.mod index 45e74de6f8..cc69bced3f 100644 --- a/star/test_suite/20M_pre_ms_to_core_collapse/standard_removed_envelope.mod +++ b/star/test_suite/20M_pre_ms_to_core_collapse/standard_removed_envelope.mod @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0bc182e7fdda990c81088b531426ab91b1cc5f767b893e6a76c2c00b09d20743 -size 648733 +oid sha256:4b987b2e81b2afd978e93fb24ffdd3cada25118d19e31e3245932eea5f618aa8 +size 652683 diff --git a/star/test_suite/20M_pre_ms_to_core_collapse/standard_zams.mod b/star/test_suite/20M_pre_ms_to_core_collapse/standard_zams.mod index 3d21759aa2..1a27ea22e3 100644 --- a/star/test_suite/20M_pre_ms_to_core_collapse/standard_zams.mod +++ b/star/test_suite/20M_pre_ms_to_core_collapse/standard_zams.mod @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:fe784501390a9b36a1e432b0e0082701fb515f53a8d74b47d1be335a99fd1c20 -size 313773 +oid sha256:d0eda20ecaa393146c4cf35490d40ecfdf5232653953e91ba8335978a9d5132e +size 311403 diff --git a/star/test_suite/hb_2M/inlist_to_ZACHeB b/star/test_suite/hb_2M/inlist_to_ZACHeB index 739a4dad84..460e666873 100644 --- a/star/test_suite/hb_2M/inlist_to_ZACHeB +++ b/star/test_suite/hb_2M/inlist_to_ZACHeB @@ -37,7 +37,7 @@ use_gold2_tolerances = .true. energy_eqn_option = 'dedt' - convergence_ignore_equL_residuals = .true. ! needed during flash + make_gradr_sticky_in_solver_iters = .true. set_rho_to_dm_div_dV = .false. initial_mass = 2 From e98f7bf5ddc5f8df6c98d40d73ca4fe631862f04 Mon Sep 17 00:00:00 2001 From: Ebraheem Farag <63124736+Debraheem@users.noreply.github.com> Date: Tue, 1 Dec 2026 15:34:39 -0500 Subject: [PATCH 7/8] Restore the hb_2M flash settings from main --- star/test_suite/hb_2M/inlist_to_ZACHeB | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/star/test_suite/hb_2M/inlist_to_ZACHeB b/star/test_suite/hb_2M/inlist_to_ZACHeB index 460e666873..739a4dad84 100644 --- a/star/test_suite/hb_2M/inlist_to_ZACHeB +++ b/star/test_suite/hb_2M/inlist_to_ZACHeB @@ -37,7 +37,7 @@ use_gold2_tolerances = .true. energy_eqn_option = 'dedt' - make_gradr_sticky_in_solver_iters = .true. + convergence_ignore_equL_residuals = .true. ! needed during flash set_rho_to_dm_div_dV = .false. initial_mass = 2 From ff77f8ad1748af082b05b844fc63dd400e7ea883 Mon Sep 17 00:00:00 2001 From: Ebraheem Farag <63124736+Debraheem@users.noreply.github.com> Date: Tue, 1 Dec 2026 16:17:40 -0500 Subject: [PATCH 8/8] [ci skip] add docs for energy error limits in core collapse inlist --- .../20M_pre_ms_to_core_collapse/inlist_to_cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/star/test_suite/20M_pre_ms_to_core_collapse/inlist_to_cc b/star/test_suite/20M_pre_ms_to_core_collapse/inlist_to_cc index fd799c4056..fb4588b603 100644 --- a/star/test_suite/20M_pre_ms_to_core_collapse/inlist_to_cc +++ b/star/test_suite/20M_pre_ms_to_core_collapse/inlist_to_cc @@ -57,9 +57,15 @@ ignore_too_large_correction = .true. ! for conv_vel's ! mixing ! timesteps - max_abs_rel_run_E_err = 1d99 - limit_for_rel_error_in_energy_conservation = 1d99 - hard_limit_for_rel_error_in_energy_conservation = 1d99 + + ! Relax the energy error limits on timesteps for core collapse. + ! If one is concerned about energy conservation, tighten these limits + ! and the solver residual tolerances (see inlist_common). + ! Be careful, some timesteps can be difficult or impossible to converge + ! with tight energy constraints. + max_abs_rel_run_E_err = 1d99 ! this is the MESA default (same as -1) + limit_for_rel_error_in_energy_conservation = 1d99 ! default is 1d-3 + hard_limit_for_rel_error_in_energy_conservation = 1d99 ! default is 1d-4 delta_XSi_cntr_limit = 0.0025