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

Commit

Permalink
Fixed initial conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Jun 4, 2021
1 parent e000456 commit bbcdfc5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/symba/symba_frag_pos.f90
Original file line number Diff line number Diff line change
Expand Up @@ -534,22 +534,22 @@ subroutine set_fragment_tangential_velocities(lerr)

allocate(v_t_initial, mold=v_t_mag)

f_spin = 1e-3_DP
f_spin = 1e-2_DP

! Convert a fraction of the pre-impact angular momentum into fragment spin angular momentum
L_frag_spin(:) = f_spin * L_frag_tot(:)
L_frag_orb(:) = L_frag_tot(:) - L_frag_spin(:)
L_orb_mag = norm2(L_frag_orb(:))
! Divide up the pre-impact spin angular momentum equally amongst the fragments and calculate the spin kinetic energy
do i = 1, nfrag
do i = 7, nfrag
rot_frag(:,i) = L_frag_spin(:) / (nfrag * m_frag(i) * Ip_frag(3, i) * rad_frag(i)**2)
call util_crossproduct(v_r_unit(:, i), z_col_unit, r_cross_L(:))
rbar = rmag(i) * norm2(r_cross_L(:))
v_t_mag(i) = L_orb_mag / (m_frag(i) * rbar * nfrag)
v_t_initial(i) = L_orb_mag / (m_frag(i) * rbar * nfrag)
end do
objective_function = lambda_obj(tangential_objective_function, lerr)
v_t_mag(7:nfrag) = util_minimize_bfgs(objective_function, nfrag-6, v_t_initial(7:nfrag), TOL, lerr)
v_t_initial(:) = v_t_mag(:)
v_t_initial(7:nfrag) = v_t_mag(7:nfrag)
v_t_mag(1:nfrag) = solve_fragment_tangential_velocities(v_t_mag_input=v_t_initial(7:nfrag), lerr=lerr)
! Shift the radial velocity vectors to align with the center of mass of the collisional system (the origin)
vb_frag(:,1:nfrag) = vmag_to_vb(v_r_mag(1:nfrag), v_r_unit(:,1:nfrag), v_t_mag(1:nfrag), v_t_unit(:,1:nfrag), m_frag(1:nfrag), vcom(:))
Expand Down

0 comments on commit bbcdfc5

Please sign in to comment.