Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add conv_vel cs limit to mlt/tdc #780

Merged
merged 19 commits into from
Mar 8, 2025
Merged

add conv_vel cs limit to mlt/tdc #780

merged 19 commits into from
Mar 8, 2025

Conversation

Debraheem
Copy link
Member

To make use of deprecated controls max_conv_vel_div_csound and max_conv_vel_div_csound_maxq by request #776 and #373. This pr introduces a cs limiter, initially designed by adam/pablo for tdc. We can also introduce a limit for mlt, similar to the one present in previous releases. At the moment, this pr only includes the cs limiter for conv_vel inside TDC.

This pr has also highlighted some potential issues in the building of the pre_ms_model. We are unable to call s% q(k) inside mlt when building the pre_ms_model because it is not yet set. In fact, I've marked a couple statements inside the pms build routine which could be problematic.

I don't mind removing max_conv_vel_div_csound_maxq , but ideally, we can call q(k) inside the mlt_routine during the pms model creation.

worst case, we don't introduce either of these controls, but in that case we should remove them all together.

@Debraheem Debraheem added documentation Improvements or additions to documentation enhancement New feature or request tdc labels Feb 9, 2025
@Debraheem Debraheem requested a review from pmocz February 9, 2025 04:56
@Debraheem Debraheem self-assigned this Feb 9, 2025
Copy link
Member Author

@Debraheem Debraheem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, q and dq are set before this subroutine which calls mlt/tdc to create the pms model.

       call look_for_brackets(lnd, dlnd, lnd1, lnd3, pre_ms_f, y1, y3, &
               imax, pre_ms_lrpar, rpar, pre_ms_lipar, ipar, ierr)

@Debraheem Debraheem linked an issue Feb 14, 2025 that may be closed by this pull request
@Debraheem
Copy link
Member Author

This pr needs a changelog, and some testing, then it will be ready for a merge.

@Debraheem
Copy link
Member Author

Reconsideration, perhaps we can introduce a convective enthalpy flux limiter as well for TDC, as in Radek's thesis. This might be more appropriate than a strict convective velocity limter for TDC. It might help convergence on the pre-ms for TDC. https://acta.astrouw.edu.pl/Vol58/n3/pap_58_3_4.pdf. This would be useful for RSP as well.

@Debraheem Debraheem requested a review from rhdtownsend as a code owner March 7, 2025 20:15
if (s% use_Ledoux_criterion) then
gradL = grada + gradL_composition_term ! Ledoux temperature gradient
else
gradL = grada
end if

! maximum convection velocity.
if (k>=1) then
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately checking if associated(s% Csound_face) .and. associated(s% q) still yields in backtrace errors from astero in the fast_from_file and other tests, see https://testhub.mesastar.org/EbF%2Fadd_Cs_limit_to_TDC/commits/0a89a8e.

Using a check for k >=1 seems to work better.

@Debraheem Debraheem merged commit d14dd77 into main Mar 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request tdc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Limiting convective velocities with max_conv_vel_div_csound
3 participants