Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge #566, #572 and #578 #579

Merged
merged 38 commits into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
236548f
add inject_randomwind.f90 name change asteroidwind
Jul 9, 2024
25f0c60
remove *asteroidwind* from Makefile_setups
Jul 9, 2024
70025fa
fixed name change inject_asteroidwind to inject_randomwind and added …
moverton000 Jul 11, 2024
a3a7a0a
fixed email
moverton000 Jul 11, 2024
043922d
fixed compile time choices for setup randomwind
moverton000 Jul 12, 2024
f7a98c1
(gr) can use tabulated metric independently of einstein toolkit
DavidBAMBA Jul 12, 2024
cf21ad4
Merge branch 'danieljprice:master' into master
moverton000 Jul 16, 2024
5714d7b
an unpadte to randomwind
Jul 25, 2024
0a42f84
Unnecessary Setup 'randomwind' is removed
moverton000 Jul 30, 2024
6895b7f
(solarsystem) build failure on gfortran v14 fixed; allow sampling of …
danieljprice Jul 30, 2024
6fc2db9
Merge branch 'master' into mega-merge
danieljprice Jul 30, 2024
7ce5055
Merge branch 'master' of https://github.com/moverton000/phantom into …
danieljprice Jul 30, 2024
53f2f7a
Merge branch 'moverton000-master' into mega-merge
danieljprice Jul 30, 2024
8200c0d
Merge branch 'tabulated_metric' of https://github.com/DavidBAMBA/phan…
danieljprice Jul 30, 2024
7df0b70
(metric_et) remove dependency on eos_shen
danieljprice Jul 30, 2024
821e45b
merge
danieljprice Jul 31, 2024
3122cbd
(randomwind) fixed warnings
danieljprice Jul 31, 2024
c9e1e4e
(randomwind) test failure fixed
danieljprice Jul 31, 2024
61838a3
[header-bot] updated file headers
danieljprice Jul 31, 2024
d5a13a0
[space-bot] whitespace at end of lines removed
danieljprice Jul 31, 2024
c294323
[author-bot] updated AUTHORS file
danieljprice Jul 31, 2024
0b8ea09
[format-bot] end if -> endif; end do -> enddo; if( -> if (
danieljprice Jul 31, 2024
f4ffc6a
[indent-bot] standardised indentation
danieljprice Jul 31, 2024
bf0ecdb
update .mailmap
danieljprice Jul 31, 2024
82fe89a
[header-bot] updated file headers
danieljprice Jul 31, 2024
2f7c230
[author-bot] updated AUTHORS file
danieljprice Jul 31, 2024
c1ee6a9
(#55) remove ifdefs, fix test failure with SETUP=flrw and properly co…
danieljprice Jul 31, 2024
728aafa
(#55) .F90->.f90 for metric utility routines
danieljprice Jul 31, 2024
6d780da
(set_orbit) fix problem with header bot giving repeated splats of sam…
danieljprice Jul 31, 2024
d0b8020
test failure fixed
danieljprice Jul 31, 2024
ac7156f
(HII regions) minor formatting issues fixed; do not print useless lin…
danieljprice Jul 31, 2024
6d079a7
(ptmass) avoid unneccessary cluttering of .in file
danieljprice Jul 31, 2024
6833c4c
(inject_randomwind) fix mdot_type = 2; read/write r_ref from .in file…
danieljprice Jul 31, 2024
fe823e9
(ptmass/viscosity) minor formatting; subroutine purposes added
danieljprice Jul 31, 2024
53756bd
(cons2prim) improved comments/documentation
danieljprice Jul 31, 2024
2aa5493
(cullendehnen) improved comments/documentation
danieljprice Jul 31, 2024
79384e4
Merge branch 'master' into mega-merge
danieljprice Aug 4, 2024
c4a2d9f
(datafiles) update docs
danieljprice Aug 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,16 @@ Megha Sharma <[email protected]> megha sharma <[email protected]>
Megha Sharma <[email protected]> Megha Sharma <[email protected]>
Megha Sharma <[email protected]> Megha Sharma <[email protected]>
Megha Sharma <[email protected]> Megha Sharma <[email protected]>
Mike Lau <[email protected]> Mike Lau <[email protected]>
Mike Lau <[email protected]> Mike Lau <[email protected]>
Mike Lau <[email protected]> Mike Lau <[email protected]>
Elisabeth Borchert <[email protected]> emborchert <[email protected]>
Ward Homan <[email protected]> ward <[email protected]>
Ward Homan <[email protected]> wardhoman <[email protected]>
Benedetta Veronesi <[email protected]> benedetta veronesi <[email protected]>
Benedetta Veronesi <[email protected]> <[email protected]>
Phantom benchmark bot <[email protected]> Ubuntu <[email protected]>
Stephane Michoulier <[email protected]> StephaneMichoulier <[email protected]>
Stephane Michoulier <[email protected]> MICHOULIER Stephane <smichoulier@sidus11>
Jolien Malfait <[email protected]> Jolien128 <[email protected]>
Martina Toscani <[email protected]> <[email protected]>
Martina Toscani <[email protected]> <[email protected]>
Expand All @@ -115,4 +117,11 @@ 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]>
Madeline Overton <[email protected]> Madeline Overton <[email protected]>
Nicolás Cuello <[email protected]> Nicolas Cuello <[email protected]>
Rebecca Martin <[email protected]> rebeccagmartin <[email protected]>
Stephen Nielson <[email protected]> s-neilson <[email protected]>
Stephen Nielson <[email protected]> Stephen Neilson <[email protected]>
Yann Bernard <[email protected]> Yrisch <[email protected]>
David Bamba <[email protected]> DavidBamba <[email protected]>
42 changes: 21 additions & 21 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
# Edit .mailmap if your name or email are wrong #
#-------------------------------------------------------#
Daniel Price <[email protected]>
Mike Lau <mike.lau@monash.edu>
Mike Lau <mike.lau@h-its.org>
Conrad Chan <[email protected]>
James Wurster <[email protected]>
David Liptai <[email protected]>
Lionel Siess <[email protected]>
Fangyi (Fitz) Hu <[email protected]>
Daniel Mentiplay <[email protected]>
Yrisch <[email protected]>
Yann Bernard <[email protected]>
Megha Sharma <[email protected]>
Arnaud Vericel <[email protected]>
Mark Hutchison <[email protected]>
Expand All @@ -26,50 +26,50 @@ Terrence Tricco <[email protected]>
Stephane Michoulier <[email protected]>
Simone Ceppi <[email protected]>
Spencer Magnall <[email protected]>
Caitlyn Hardiman <[email protected]>
Enrico Ragusa <[email protected]>
Caitlyn Hardiman <[email protected]>
Cristiano Longarini <[email protected]>
Sergei Biriukov <[email protected]>
Giovanni Dipierro <[email protected]>
Roberto Iaconi <[email protected]>
Amena Faruqi <[email protected]>
Hauke Worpel <[email protected]>
Alison Young <[email protected]>
Stephen Neilson <36410751+s-neilson@users.noreply.github.com>
Stephen Nielson <stephen.neilson@students.mq.edu.au>
Martina Toscani <[email protected]>
Benedetta Veronesi <[email protected]>
Sahl Rowther <[email protected]>
Simon Glover <[email protected]>
Sahl Rowther <[email protected]>
Thomas Reichardt <[email protected]>
Jean-François Gonzalez <[email protected]>
Christopher Russell <[email protected]>
Alessia Franchini <alessia.franchini@unlv.edu>
Madeline Overton <overtm2@unlv.nevada.edu>
Alex Pettitt <[email protected]>
Jolien Malfait <[email protected]>
Phantom benchmark bot <[email protected]>
Kieran Hirsh <[email protected]>
Mike Lau <[email protected]>
Jolien Malfait <[email protected]>
Alessia Franchini <[email protected]>
Nicole Rodrigues <[email protected]>
David Trevascus <dtre10@student.monash.edu>
Kieran Hirsh <kieran.hirsh1@monash.edu>
Farzana Meru <[email protected]>
David Trevascus <[email protected]>
Nicolás Cuello <[email protected]>
Chris Nixon <[email protected]>
Miguel Gonzalez-Bolivar <[email protected]>
Benoit Commercon <[email protected]>
Giulia Ballabio <[email protected]>
Joe Fisher <[email protected]>
Maxime Lombart <[email protected]>
Orsola De Marco <[email protected]>
Zachary Pellow <[email protected]>
s-neilson <[email protected]>
Ariel Chitan <[email protected]>
Chunliang Mu <[email protected]>
Cox, Samuel <[email protected]>
Orsola De Marco <[email protected]>
Joe Fisher <[email protected]>
Benoit Commercon <[email protected]>
Giulia Ballabio <[email protected]>
Rebecca Martin <[email protected]>
Jorge Cuadra <[email protected]>
Hugh Griffiths <[email protected]>
Jeremy Smallwood <[email protected]>
Jorge Cuadra <[email protected]>
MICHOULIER Stephane <smichoulier@sidus11>
David Bamba <[email protected]>
Cox, Samuel <[email protected]>
Chunliang Mu <[email protected]>
Shunquan Huang <[email protected]>
Steven Rieder <[email protected]>
Stéven Toupin <[email protected]>
Taj Jankovič <[email protected]>
rebeccagmartin <[email protected].com>
Ariel Chitan <arielchitan@gmail.com>
20 changes: 19 additions & 1 deletion build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ ifdef METRIC
else
SRCMETRIC= metric_minkowski.f90
endif
SRCGR=inverse4x4.f90 einsteintk_utils.f90 $(SRCMETRIC) metric_tools.f90 utils_gr.f90 interpolate3D.f90 tmunu2grid.f90
SRCGR=inverse4x4.f90 metric_et_utils.f90 einsteintk_utils.f90 $(SRCMETRIC) metric_tools.f90 utils_gr.f90 interpolate3D.f90 tmunu2grid.f90
#
# chemistry and cooling
#
Expand Down Expand Up @@ -1230,6 +1230,24 @@ combinedustdumps: checksys checkparams $(OBJCDD)
cleancombinedustdumps:
rm -f $(BINDIR)/combinedustdumps

#----------------------------------------------------
# these are the sources for the tabulate_metric tility
.PHONY: tabulate_metric
SRCTAB= io.F90 utils_infiles.f90 metric_${METRIC}.f90 metric_et_utils.f90 tabulate_metric.f90 #metric_tools.F90
OBJTAB1= $(SRCTAB:.F90=.o)
OBJTAB= $(OBJTAB1:.f90=.o)

tabulate_metric: checksys $(OBJTAB)
@echo ""
@echo "tabulate_metric: Because grids are great"
@echo ""
$(FC) $(FFLAGS) -o $(BINDIR)/$@ $(OBJTAB)

cleantabulatemetric:
rm -f $(BINDIR)/tabulate_metric




include Makefile_qscripts

Expand Down
12 changes: 11 additions & 1 deletion build/Makefile_setups
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,17 @@ 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
KNOWN_SETUP=yes
endif

ifeq ($(SETUP), randomwind)
# asteroid emitting a wind (Trevascus et al. 2021)
SETUPFILE=setup_disc.f90
SRCINJECT=utils_binary.f90 inject_randomwind.f90
IND_TIMESTEPS=yes
CONST_AV=yes
ISOTHERMAL=yes
Expand Down
2 changes: 1 addition & 1 deletion docs/developer-guide/datafiles.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ order for your modules to be portable.
Small files
-----------

For *very small files* (under 1Mb), you can simply add these to the git
For *very small files* (under 100Kb), you can simply add these to the git
repository in a subdirectory of the phantom/data directory:

::
Expand Down
80 changes: 48 additions & 32 deletions src/main/H2regions.f90
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,17 @@
!--------------------------------------------------------------------------!
module HIIRegion
!
! HIIRegion
! Feedback from HII regions
!
! :References: Fujii et al. (2021), Hopkins et al. (2012)
!
! :Owner: Yrisch
! :Owner: Yann Bernard
!
! :Runtime parameters: None
!
! :Dependencies: dim, eos, infile_utils, io, linklist, part, physcon,
! sortutils, timing, units
!
! contains routines to model HII region expansion due to ionization and radiation pressure..
! routine originally made by Hopkins et al. (2012),reused by Fujii et al. (2021)
! and adapted in Phantom by Yann Bernard

implicit none

public :: update_ionrates,update_ionrate, HII_feedback,initialize_H2R,read_options_H2R,write_options_H2R
Expand Down Expand Up @@ -52,17 +48,18 @@ module HIIRegion

contains

!-----------------------------------------------------------------------
!+
! Initialise stellar feedbacks
!+
!-----------------------------------------------------------------------
!-----------------------------------------------------------------------
!+
! Initialise stellar feedbacks
!+
!-----------------------------------------------------------------------
subroutine initialize_H2R
use io, only:iprint,iverbose,id,master
use part, only:isionised
use units, only:udist,umass,utime
use physcon, only:mass_proton_cgs,kboltz,pc,eV,solarm
use eos , only:gmw,gamma
use eos, only:gmw,gamma

isionised(:)=.false.
!calculate the useful constant in code units
mH = gmw*mass_proton_cgs
Expand All @@ -85,15 +82,14 @@ subroutine initialize_H2R
write(iprint,"(a,es18.10,es18.10)") " Max strögrem radius (code/pc) : ", Rst_max, Rmax
write(iprint,"(a,es18.10,es18.10)") " Min feedback mass (code/Msun) : ", Minmass, Mmin
endif
return

end subroutine initialize_H2R

!-----------------------------------------------------------------------
!+
! Calculation of the the ionizing photon rate of all stars (Only for restart)
!+
!-----------------------------------------------------------------------

subroutine update_ionrates(nptmass,xyzmh_ptmass,h_acc)
use io, only:iprint,iverbose
use units, only:umass
Expand All @@ -104,6 +100,7 @@ subroutine update_ionrates(nptmass,xyzmh_ptmass,h_acc)
real, intent(in) :: h_acc
real :: logmi,log_Q,mi,hi
integer :: i

nHIIsources = 0
!$omp parallel do default(none) &
!$omp shared(xyzmh_ptmass,iprint,iverbose,umass)&
Expand All @@ -122,7 +119,7 @@ subroutine update_ionrates(nptmass,xyzmh_ptmass,h_acc)
xyzmh_ptmass(irstrom,i) = -1.
nHIIsources = nHIIsources + 1
if (iverbose >= 0) then
write(iprint,"(/a,es18.10,es18.10/)")"Massive stars detected : Log Q, Mass : ",log_Q,mi
write(iprint,"(/a,es18.10,es18.10/)") "Massive stars detected : Log Q, Mass : ",log_Q,mi
endif
else
xyzmh_ptmass(irateion,i) = -1.
Expand All @@ -133,9 +130,14 @@ subroutine update_ionrates(nptmass,xyzmh_ptmass,h_acc)
if (iverbose > 1) then
write(iprint,"(/a,i8/)") "nb_feedback sources : ",nHIIsources
endif
return

end subroutine update_ionrates

!-----------------------------------------------------------------------
!+
! update the ionizing photon rate
!+
!-----------------------------------------------------------------------
subroutine update_ionrate(i,xyzmh_ptmass,h_acc)
use io, only:iprint,iverbose
use units, only:umass
Expand All @@ -145,6 +147,7 @@ subroutine update_ionrate(i,xyzmh_ptmass,h_acc)
real, intent(inout) :: xyzmh_ptmass(:,:)
real, intent(in) :: h_acc
real :: logmi,log_Q,mi,hi

mi = xyzmh_ptmass(4,i)
hi = xyzmh_ptmass(ihacc,i)
if (mi > Minmass .and. hi < h_acc) then
Expand All @@ -156,7 +159,7 @@ subroutine update_ionrate(i,xyzmh_ptmass,h_acc)
xyzmh_ptmass(irstrom,i) = -1.
nHIIsources = nHIIsources + 1
if (iverbose >= 0) then
write(iprint,"(/a,es18.10,es18.10/)")"Massive stars detected : Log Q, Mass : ",log_Q,mi
write(iprint,"(/a,es18.10,es18.10/)") "Massive stars detected : Log Q, Mass : ",log_Q,mi
endif
else
xyzmh_ptmass(irateion,i) = -1.
Expand All @@ -166,15 +169,14 @@ subroutine update_ionrate(i,xyzmh_ptmass,h_acc)
if (iverbose > 1) then
write(iprint,"(/a,i8/)") "nb_feedback sources : ",nHIIsources
endif
return
end subroutine update_ionrate

!-----------------------------------------------------------------------
!+
! Main subroutine : Application of the HII feedback using Hopkins's like prescription
!+
!-----------------------------------------------------------------------
end subroutine update_ionrate

!-----------------------------------------------------------------------
!+
! Main subroutine : Application of the HII feedback using Hopkins's like prescription
!+
!-----------------------------------------------------------------------
subroutine HII_feedback(nptmass,npart,xyzh,xyzmh_ptmass,vxyzu,isionised,dt)
use part, only:rhoh,massoftype,ihsoft,igas,irateion,isdead_or_accreted,&
irstrom
Expand Down Expand Up @@ -268,10 +270,10 @@ subroutine HII_feedback(nptmass,npart,xyzh,xyzmh_ptmass,vxyzu,isionised,dt)
r_in = sqrt((xi-xyzh(1,j))**2 + (yi-xyzh(2,j))**2 + (zi-xyzh(3,j))**2)
mHII = ((4.*pi*(r**3-r_in**3)*rhoh(xyzh(4,j),pmass))/3)
if (mHII>3*pmass) then
!$omp parallel do default(none) &
!$omp shared(mHII,listneigh,xyzh,sigd,dt) &
!$omp shared(mH,vxyzu,log_Qi,hv_on_c,npartin,pmass,xi,yi,zi) &
!$omp private(j,dx,dy,dz,vkx,vky,vkz,xj,yj,zj,r,taud)
!$omp parallel do default(none) &
!$omp shared(mHII,listneigh,xyzh,sigd,dt) &
!$omp shared(mH,vxyzu,log_Qi,hv_on_c,npartin,pmass,xi,yi,zi) &
!$omp private(j,dx,dy,dz,vkx,vky,vkz,xj,yj,zj,r,taud)
do k=1,npartin
j = listneigh(1)
xj = xyzh(1,j)
Expand All @@ -290,35 +292,48 @@ subroutine HII_feedback(nptmass,npart,xyzh,xyzmh_ptmass,vxyzu,isionised,dt)
vxyzu(2,j) = vxyzu(2,j) + vky*dt
vxyzu(3,j) = vxyzu(3,j) + vkz*dt
enddo
!$omp end parallel do
!$omp end parallel do
endif
endif
enddo
endif
call get_timings(t2,tcpu2)
call increment_timer(itimer_HII,t2-t1,tcpu2-tcpu1)
return

end subroutine HII_feedback

!-----------------------------------------------------------------------
!+
! write options to input file
!+
!-----------------------------------------------------------------------
subroutine write_options_H2R(iunit)
use infile_utils, only:write_inopt
use physcon, only:solarm
integer, intent(in) :: iunit
write(iunit,"(/,a)") '# options controlling HII region expansion feedback'
if (iH2R>0) then

if (iH2R > 0) then
write(iunit,"(/,a)") '# options controlling HII region expansion feedback'
call write_inopt(iH2R, 'iH2R', "enable the HII region expansion feedback in star forming reigon", iunit)
call write_inopt(Mmin, 'Mmin', "Minimum star mass to trigger HII region (MSun)", iunit)
call write_inopt(Rmax, 'Rmax', "Maximum radius for HII region (pc)", iunit)
endif

end subroutine write_options_H2R

!-----------------------------------------------------------------------
!+
! read options from input file
!+
!-----------------------------------------------------------------------
subroutine read_options_H2R(name,valstring,imatch,igotall,ierr)
use io, only:fatal
character(len=*), intent(in) :: name,valstring
logical, intent(out) :: imatch,igotall
integer, intent(out) :: ierr
integer, save :: ngot = 0
character(len=30), parameter :: label = 'read_options_H2R'

imatch = .true.
select case(trim(name))
case('iH2R')
Expand All @@ -337,6 +352,7 @@ subroutine read_options_H2R(name,valstring,imatch,igotall,ierr)
imatch = .true.
end select
igotall = (ngot >= 3)

end subroutine read_options_H2R

end module HIIRegion
Loading
Loading