From de56e11348c47ff7d5f726af0c8dbb1cffbe20d1 Mon Sep 17 00:00:00 2001 From: David A Minton Date: Fri, 13 Aug 2021 17:04:41 -0400 Subject: [PATCH] Got the energy conservation working, but broke angular momentum conservation :-( --- src/fragmentation/fragmentation.f90 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/fragmentation/fragmentation.f90 b/src/fragmentation/fragmentation.f90 index 7e58a07c0..5e1e93fbe 100644 --- a/src/fragmentation/fragmentation.f90 +++ b/src/fragmentation/fragmentation.f90 @@ -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 @@ -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