Skip to content

Commit

Permalink
Merge branch 'moverton000-master' into mega-merge
Browse files Browse the repository at this point in the history
  • Loading branch information
danieljprice committed Jul 30, 2024
2 parents 6fc2db9 + 7ce5055 commit 53f2f7a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,5 @@ Amena Faruqi <[email protected]> <[email protected]
Amena Faruqi <[email protected]> Amena Faruqi <[email protected]>
Alison Young <[email protected]> Alison Young <[email protected]>
Simone Ceppi <[email protected]> Simone Ceppi <[email protected]>
Madeline Overton <[email protected]> Madeline Nicole Overton <[email protected]>
Nicolás Cuello <[email protected]> Nicolas Cuello <[email protected]>
2 changes: 1 addition & 1 deletion build/Makefile_setups
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ endif
ifeq ($(SETUP), asteroidwind)
# asteroid emitting a wind (Trevascus et al. 2021)
SETUPFILE=setup_asteroidwind.f90
SRCINJECT=utils_binary.f90 inject_asteroidwind.f90
SRCINJECT=utils_binary.f90 inject_randomwind.f90
IND_TIMESTEPS=yes
CONST_AV=yes
ISOTHERMAL=yes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
!--------------------------------------------------------------------------!
module inject
!
! Injection module for wind from an orbiting asteroid, as used
! Injection module for wind from an orbiting body, as used
! in Trevascus et al. (2021)
!
! :References:
Expand All @@ -25,7 +25,7 @@ module inject
use io, only:error
use physcon, only:pi
implicit none
character(len=*), parameter, public :: inject_type = 'asteroidwind'
character(len=*), parameter, public :: inject_type = 'randomwind'
real, public :: mdot = 5.e8 ! mass injection rate in grams/second

public :: init_inject,inject_particles,write_options_inject,read_options_inject,&
Expand Down Expand Up @@ -73,16 +73,16 @@ subroutine inject_particles(time,dtlast,xyzh,vxyzu,xyzmh_ptmass,vxyz_ptmass,&
real, intent(out) :: dtinject
real, dimension(3) :: xyz,vxyz,r1,r2,v2,vhat,v1
integer :: i,ipart,npinject,seed,pt
real :: dmdt,rasteroid,h,u,speed,inject_this_step
real :: dmdt,rbody,h,u,speed,inject_this_step
real :: m1,m2,r
real :: dt
real, save :: have_injected,t_old
real, save :: semia

if (nptmass < 2 .and. iexternalforce == 0) &
call fatal('inject_asteroidwind','not enough point masses for asteroid wind injection')
call fatal('inject_randomwind','not enough point masses for random wind injection')
if (nptmass > 2) &
call fatal('inject_asteroidwind','too many point masses for asteroid wind injection')
call fatal('inject_randomwind','too many point masses for random wind injection')

if (nptmass == 2) then
pt = 2
Expand All @@ -97,7 +97,7 @@ subroutine inject_particles(time,dtlast,xyzh,vxyzu,xyzmh_ptmass,vxyz_ptmass,&
endif

r2 = xyzmh_ptmass(1:3,pt)
rasteroid = xyzmh_ptmass(ihsoft,pt)
rbody = xyzmh_ptmass(ihsoft,pt)
m2 = xyzmh_ptmass(4,pt)
v2 = vxyz_ptmass(1:3,pt)

Expand Down Expand Up @@ -130,14 +130,13 @@ subroutine inject_particles(time,dtlast,xyzh,vxyzu,xyzmh_ptmass,vxyz_ptmass,&
endif

!
!-- Randomly inject particles around the asteroids outer 'radius'.
! Only inject them on the side that is facing the central sink
!-- Randomly inject particles around the body's outer 'radius'.
!
do i=1,npinject
xyz = r2 + rasteroid*get_random_pos_on_sphere(seed)
xyz = r2 + rbody*get_random_pos_on_sphere(seed)
vxyz = (1.-vlag/100)*speed*vhat
u = 0. ! setup is isothermal so utherm is not stored
h = hfact*(rasteroid/2.)
h = hfact*(rbody/2.)
ipart = npart + 1
call add_or_update_particle(igas,xyz,vxyz,h,u,ipart,npart,npartoftype,xyzh,vxyzu)
enddo
Expand Down

0 comments on commit 53f2f7a

Please sign in to comment.