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

Commit

Permalink
Trying one more convergence scheme. The behavior still doesn't make s…
Browse files Browse the repository at this point in the history
…ense. It keeps putting all the angular momentum in spin and so never converges on energy
  • Loading branch information
daminton committed Jan 13, 2023
1 parent a5a1b86 commit 6dc4889
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/fraggle/fraggle_generate.f90
Original file line number Diff line number Diff line change
Expand Up @@ -537,8 +537,10 @@ module subroutine fraggle_generate_vel_vec(collider, nbody_system, param, lfailu
call collider_local%get_energy_and_momentum(nbody_system, param, phase="after")
! Check for any residual angular momentum, and if there is any, put it into spin of the largest body
L_residual(:) = collider_local%L_total(:,2) - collider_local%L_total(:,1)
fragments%L_spin(:,1) = fragments%L_spin(:,1) - L_residual(:)
fragments%rot(:,1) = fragments%L_spin(:,1) / (fragments%mass(1) * fragments%radius(1)**2 * fragments%Ip(:,1))
do i = 1, fragments%nbody
fragments%L_spin(:,i) = fragments%L_spin(:,i) - L_residual(:) * fragments%mass(i) / fragments%mtot
fragments%rot(:,i) = fragments%L_spin(:,i) / (fragments%mass(i) * fragments%radius(i)**2 * fragments%Ip(:,i))
end do
fragments%rotmag(:) = .mag.fragments%rot(:,:)

call collider_local%get_energy_and_momentum(nbody_system, param, phase="after")
Expand Down

0 comments on commit 6dc4889

Please sign in to comment.