MESAHub / MESAHub/mesa

Angular momentum conservation check

Open
#259 0 comments 0 reactions 1 assignee Claimed by @orlox View on GitHub
Dominant language
Fortran
Stars
249
Forks
82
Avg merge
1d 3h
Merged PRs (30d)
3

Description

Looking through solve_omega_mix I noticed that we only check if angular momentum was conserved if there are no other torques:
```
if (.not. (s% use_other_torque .or. s% use_other_torque_implicit .or. &
associated(s% binary_other_torque))) then
! check conservation for cases with no extra torque
J_tot1 = total_angular_momentum(s) ! what we have
if (abs(J_tot0 - J_tot1) > s% angular_momentum_error_retry*abs(J_tot0)) then
s% retry_message = 'retry: failed to conserve angular momentum in mixing'
write(*,*) "angular momentum error larger than angular_momentum_error_retry", abs(J_tot0 - J_tot1)/abs(J_tot0)
do_solve_omega_mix = retry
else if (abs(J_tot0 - J_tot1) > s% angular_momentum_error_warn*abs(J_tot0)) then
write(*,*) "angular momentum error larger than angular_momentum_error_warn", abs(J_tot0 - J_tot1)/abs(J_tot0)
end if
if (dbg) then
write(*,2) 'final J_tot1', s% model_number, J_tot1
write(*,2) '(J_tot1 - J_tot0)/J_tot0', &
steps_used, (J_tot1 - J_tot0)/J_tot0, J_tot0, J_tot1
end if
end if
```
Shouldn't we be checking this even if there are other torques (and just comparing the change against the net torque)?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.