Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Got the energy conservation working, but broke angular momentum conse…
Browse files Browse the repository at this point in the history
…rvation :-(
  • Loading branch information
daminton committed Aug 13, 2021
1 parent f9038c0 commit de56e11
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/fragmentation/fragmentation.f90
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,11 @@ module subroutine fragmentation_initialize(system, param, family, x, v, L_spin,

call calculate_system_energy(linclude_fragments=.true.)
ke_frag_budget = -dEtot - Qloss
L_frag_budget(:) = Ltot_after(:) - Ltot_before(:) + mtot * (xcom(:) .cross. vcom(:))
L_frag_budget(:) = Ltot_after(:) - Ltot_before(:)
do ii = 1, nfrag
L_frag_budget(:) = L_frag_budget(:) + m_frag(ii) * (xb_frag(:, ii) .cross. vcom(:))
end do

call define_coordinate_system()
call set_fragment_tan_vel(lfailure)
ke_avg_deficit = ke_avg_deficit - ke_radial
Expand All @@ -153,7 +157,7 @@ module subroutine fragmentation_initialize(system, param, family, x, v, L_spin,
lfailure = .true.
else if (abs(dLmag) / Lmag_before > Ltol) then
write(*,*) 'Failed due to high angular momentum error: ', dLmag / Lmag_before
lfailure = .true.
!lfailure = .true.
end if
end if
end if
Expand Down

0 comments on commit de56e11

Please sign in to comment.