Skip to content

Commit

Permalink
Merge pull request #627 from sachiwee/Galacticus_nHrange
Browse files Browse the repository at this point in the history
Add summation over HII region n_H densities
  • Loading branch information
abensonca committed Jun 14, 2024
2 parents 1549918 + 9cd2415 commit f5121c7
Show file tree
Hide file tree
Showing 5 changed files with 259 additions and 83 deletions.
20 changes: 20 additions & 0 deletions doc/Galacticus.bib
Original file line number Diff line number Diff line change
Expand Up @@ -8145,6 +8145,26 @@ @article{wong_how_2008
pages = {1023--1028}
}

@article{yang_efficient_2023,
title = {Efficient simulations of ionized {ISM} emission lines: a detailed comparison between the {FIRE} high-redshift suite and observations},
volume = {525},
issn = {0035-8711},
shorttitle = {Efficient simulations of ionized {ISM} emission lines},
url = {https://ui.adsabs.harvard.edu/abs/2023MNRAS.525.5989Y},
doi = {10.1093/mnras/stad2571},
abstract = {The Atacama Large Millimeter/Submillimeter Array (ALMA) in the submillimetre and the JWST in the infrared have achieved robust spectroscopic detections of emission lines from the interstellar medium (ISM) in some of the first galaxies. These unprecedented measurements provide valuable information regarding the ISM properties, stellar populations, galaxy morphologies, and kinematics in these high-redshift galaxies and, in principle, offer powerful tests of state of the art galaxy formation models, as implemented in hydrodynamical simulations. To facilitate direct comparisons between simulations and observations, we develop a fast post-processing pipeline to predict line emission from the H II regions around simulated star particles, accounting for spatial variations in the surrounding gas density, metallicity, and incident radiation spectrum. Our ISM line emission model currently captures H α, H β, and all of the [O III] and [O II] lines targeted by ALMA and JWST at z {\textgreater} 6. We illustrate the power of this approach by applying our line emission model to the publicly available Feedback In Realistic Environments (FIRE) high-z simulation suite and perform a detailed comparison with current observations. We show that the FIRE mass-metallicity relation is in 1σ agreement with ALMA/JWST measurements after accounting for the inhomogeneities in the ISM properties. We also quantitatively validate the description of the one-zone model, which is widely used for interpreting [O III] and H β line luminosity measurements. This model is publicly available and can be implemented on top of a broad range of galaxy formation simulations for comparison with JWST and ALMA measurements.},
urldate = {2024-06-13},
journal = {Monthly Notices of the Royal Astronomical Society},
author = {Yang, Shengqi and Lidz, Adam and Smith, Aaron and Benson, Andrew and Li, Hui},
month = nov,
year = {2023},
note = {Publisher: OUP
ADS Bibcode: 2023MNRAS.525.5989Y},
keywords = {(ISM:) H II regions, Astrophysics - Astrophysics of Galaxies, galaxies: evolution, galaxies: high-redshift, submillimetre: ISM},
pages = {5989--6004},
file = {Full Text PDF:/home/abensonca/.mozilla/firefox/f54gqgdx.default/zotero/storage/RA4XTTTT/Yang et al. - 2023 - Efficient simulations of ionized ISM emission line.pdf:application/pdf},
}

@article{yoshida_gas_2002,
title = {Gas cooling in simulations of the formation of the galaxy population},
volume = {335},
Expand Down
4 changes: 2 additions & 2 deletions source/hiiRegions.density_distributions.F90
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ module HII_Region_Density_Distributions
<description>
Class providing models for the distribution of HII region hydrogen density.
</description>
<default>deltaFunction</default>
<method name="cumulativeDensityFunction" >
<default>logNormal</default>
<method name="cumulativeDensityDistribution">
<description>Return the cumulative distribution of HII region hydrogen density between a minimum and maximum $n_\mathrm{H}$.</description>
<type>double precision</type>
<pass>yes</pass>
Expand Down
14 changes: 7 additions & 7 deletions source/hiiRegions.density_distributions.delta_function.F90
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
!+ Contributions to this file made by: Sachi Weerasooriya

!!{
Implementation of a class for the distribution of hydrogen density in a HII region in which the distribution is a delta function.
Implements a class for the distribution of hydrogen density in a HII region in which the distribution is a delta function.
!!}

!![
Expand All @@ -36,12 +36,12 @@
!!]
type, extends(hiiRegionDensityDistributionClass) :: hiiRegionDensityDistributionDeltaFunction
!!{
Implementation of a density distribution to a delta function
A class for the distribution of hydrogen density in a HII region in which the distribution is a delta function.
!!}
private
double precision :: densityHydrogen
contains
procedure :: cumulativeDensityFunction => deltaFunctionCumulativeDensityFunction
procedure :: cumulativeDensityDistribution => deltaFunctionCumulativeDensityDistribution
end type hiiRegionDensityDistributionDeltaFunction

interface hiiRegionDensityDistributionDeltaFunction
Expand Down Expand Up @@ -94,7 +94,7 @@ function deltaFunctionConstructorInternal(densityHydrogen) result(self)
return
end function deltaFunctionConstructorInternal

double precision function deltaFunctionCumulativeDensityFunction(self,densityHydrogenMinimum,densityHydrogenMaximum) result(distributionFunction)
double precision function deltaFunctionCumulativeDensityDistribution(self,densityHydrogenMinimum,densityHydrogenMaximum) result(distributionFunction)
!!{
Compute the cumulative distribution function of the hydrogen density in HII regions. A delta-function distribution is assumed.
!!}
Expand All @@ -107,10 +107,10 @@ Compute the cumulative distribution function of the hydrogen density in HII regi
& .and. &
& self%densityHydrogen <= densityHydrogenMaximum &
& ) then
distributionFunction=1.0d0
distributionFunction=+1.0d0
else
distributionFunction=0.0d0
distributionFunction=+0.0d0
end if
return
end function deltaFunctionCumulativeDensityFunction
end function deltaFunctionCumulativeDensityDistribution

138 changes: 138 additions & 0 deletions source/hiiRegions.density_distributions.log_normal.F90
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
!! Copyright 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018,
!! 2019, 2020, 2021, 2022, 2023
!! Andrew Benson <abenson@carnegiescience.edu>
!!
!! This file is part of Galacticus.
!!
!! Galacticus is free software: you can redistribute it and/or modify
!! it under the terms of the GNU General Public License as published by
!! the Free Software Foundation, either version 3 of the License, or
!! (at your option) any later version.
!!
!! Galacticus is distributed in the hope that it will be useful,
!! but WITHOUT ANY WARRANTY; without even the implied warranty of
!! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
!! GNU General Public License for more details.
!!
!! You should have received a copy of the GNU General Public License
!! along with Galacticus. If not, see <http://www.gnu.org/licenses/>.

!+ Contributions to this file made by: Sachi Weerasooriya

!!{
Implementation of a class for the distribution of hydrogen density in a HII region which assumes a log-normal distribution.
!!}

use :: Statistics_Distributions, only : distributionFunction1DLogNormal

!![
<hiiRegionDensityDistribution name="hiiRegionDensityDistributionLogNormal">
<description>
A class for the distribution of hydrogen density in a HII region in which the distribution is a lognormal, specifically:
\begin{equation}
p(n_\mathrm{H}) = \left\{ \begin{array}{ll} \frac{1}{\sqrt{2\pi} n_\mathrm{H} \sigma} \exp\left(-\frac{1}{2}\left[\frac{\log(n_\mathrm{H})-\log(n_\mathrm{H,0})}{\sigma}\right]^2\right) &amp; \hbox{ if } n_\mathrm{H,min} &lt; n_\mathrm{H} &lt; n_\mathrm{H,max}, \\ 0 &amp; \hbox{ otherwise.} \end{array} \right.
\end{equation}
</description>
</hiiRegionDensityDistribution>
!!]
type, extends(hiiRegionDensityDistributionClass) :: hiiRegionDensityDistributionLogNormal
!!{
A class for the distribution of hydrogen density in a HII region in which the distribution is a lognormal.
!!}
private
type (distributionFunction1DLogNormal) :: distribution
double precision :: densityHydrogenMinimum , densityHydrogenMaximum, &
& densityHydrogenReference, sigma

contains
procedure :: cumulativeDensityDistribution => lognormalCumulativeDensityDistribution
end type hiiRegionDensityDistributionLogNormal

interface hiiRegionDensityDistributionLogNormal
!!{
Constructors for the {\normalfont \ttfamily hiiRegionDensityDistributionLogNormal} HII region density distribution class.
!!}
module procedure logNormalConstructorParameters
module procedure logNormalConstructorInternal
end interface hiiRegionDensityDistributionLogNormal

contains

function logNormalConstructorParameters(parameters) result(self)
!!{
Constructor for the hiiRegionDensityDistributionLogNormal class.
!!}
use :: Input_Parameters, only : inputParameter, inputParameters
implicit none
type (hiiRegionDensityDistributionLogNormal) :: self
type (inputParameters ), intent(inout) :: parameters
double precision :: densityHydrogenMinimum , densityHydrogenMaximum, &
& densityHydrogenReference, sigma
!![
<inputParameter>
<name>densityHydrogenReference</name>
<defaultValue>250.0d0</defaultValue>
<defaultSource>Fit to FIRE II data from \cite{yang_efficient_2023}, provided by S. Yang (private communication).</defaultSource>
<description>The parameter $n_\mathrm{H,0}$ in the log normal distribution of HII region densities.</description>
<source>parameters</source>
</inputParameter>
<inputParameter>
<name>sigma</name>
<defaultValue>1.8d0</defaultValue>
<defaultSource>Fit to FIRE II data from \cite{yang_efficient_2023}, provided by S. Yang (private communication).</defaultSource>
<description>The parameter $\sigma$ in the log normal distribution of HII region densities.</description>
<source>parameters</source>
</inputParameter>
<inputParameter>
<name>densityHydrogenMinimum</name>
<defaultValue>1.0d1</defaultValue>
<defaultSource>Fit to FIRE II data from \cite{yang_efficient_2023}, provided by S. Yang (private communication).</defaultSource>
<description>Minimum value of hydrogen density in HII regions.</description>
<source>parameters</source>
</inputParameter>
<inputParameter>
<name>densityHydrogenMaximum</name>
<defaultValue>1.0d5</defaultValue>
<defaultSource>Fit to FIRE II data from \cite{yang_efficient_2023}, provided by S. Yang (private communication).</defaultSource>
<description>Maximum value of hydrogen density in HII regions.</description>
<source>parameters</source>
</inputParameter>
!!]
self=hiiRegionDensityDistributionLogNormal(densityHydrogenReference,sigma,densityHydrogenMinimum,densityHydrogenMaximum)
!![
<inputParametersValidate source="parameters"/>
!!]
return
end function logNormalConstructorParameters

function logNormalConstructorInternal(densityHydrogenReference,sigma,densityHydrogenMinimum,densityHydrogenMaximum) result(self)
!!{
Internal constructor for the {\normalfont \ttfamily hiiRegionDensityDistributionLogNormal} class.
!!}
implicit none
type (hiiRegionDensityDistributionLogNormal) :: self
double precision , intent(in ) :: densityHydrogenMinimum , densityHydrogenMaximum, &
& densityHydrogenReference, sigma
!![
<constructorAssign variables="densityHydrogenReference, sigma, densityHydrogenMinimum, densityHydrogenMaximum"/>
!!]

self%distribution=distributionFunction1DLogNormal(x0=densityHydrogenReference,sigma=sigma,limitLower=densityHydrogenMinimum,limitUpper=densityHydrogenMaximum)
return
end function logNormalConstructorInternal

double precision function lognormalCumulativeDensityDistribution(self,densityHydrogenMinimum,densityHydrogenMaximum) result(weightDensityHydrogen)
!!{
Compute the cumulative distribution function of the hydrogen density in HII regions for a log-normal distribution.
!!}
implicit none
class (hiiRegionDensityDistributionLogNormal), intent(inout) :: self
double precision , intent(in ) :: densityHydrogenMinimum, densityHydrogenMaximum

! Compute the distribution of HII regions for a log normal function.
weightDensityHydrogen=+self%distribution%cumulative(densityHydrogenMaximum) &
& -self%distribution%cumulative(densityHydrogenMinimum)

return
end function lognormalCumulativeDensityDistribution

Loading

0 comments on commit f5121c7

Please sign in to comment.