Add intrinsic three-component thin-disk AGN SED with strict energy-closure scaling#1069
Add intrinsic three-component thin-disk AGN SED with strict energy-closure scaling#1069
Conversation
…sure scaling Agent-Logs-Url: https://github.com/galacticusorg/galacticus/sessions/778af29a-8341-4215-8139-89b04ce8ab9e Co-authored-by: abensonca <7468651+abensonca@users.noreply.github.com>
…thod to specify the type of disk being inquired about
…he correct bolometric luminosity
Embedded XML/LaTeX warnings (click to expand)
|
Embedded XML/LaTeX warnings (click to expand)
|
Embedded XML/LaTeX warnings (click to expand)
|
Embedded XML/LaTeX warnings (click to expand)
|
These are read as lists of `numpy` arrays - we convert to simple `numpy` arrays to make them easier to work with.
Embedded XML/LaTeX warnings (click to expand)
|
Adds
accretionDiskSpectraThinDisk, a pure-Fortran accretion disk spectra class that computes a three-component AGN SED directly from BH properties (mass, spin, accretion rate), extending to hard X-rays (~300 keV). Unlike the existinghopkins2007implementation, this requires no external code download or HDF5 table at runtime.Components & energy closure
All three components share the bolometric luminosity exactly (
f_disk + f_warm + f_hot = 1):T(x) = T_max x^{-3/4}(1 − x^{-1/2})^{1/4}. Peak temperature derived analytically fromL_disk = 4π σ r_isco² T_max⁴ / 3; spectrum computed by radial quadrature overt = ln(r/r_isco).ν^{−Γ_warm} exp(−hν/E_warm), normalized viaΓ(1−Γ, E_min/E_warm)(upper incomplete gamma) so∫S dν = f_warm L_bolexactly.Γ_hot,E_hot; integral equalsf_hot L_bolexactly.Thin-disk gate & caching
ṁ/ṁ_Edd < mdotThinMinimum(default 0.01).node%uniqueID()+lastSEDComputedflag; cache cleared oncalculationResetEvent.Parameters (all have defaults)
mdotThinMinimumfractionHot/fractionWarmtemperatureHot/temperatureWarmspectralIndexHot/spectralIndexWarmenergyMinimumHot/energyMinimumWarmmassBlackHoleFiducial/spinBlackHoleFiducialspectrumMassRateExample parameter block:
Original prompt
Add strict energy-closure scaling to the new intrinsic thin-disk AGN SED implementation (disk + warm + hot corona), and open a PR.
Repo: galacticusorg/galacticus
Base branch: master
Context
Task
Implement (or update) the new Fortran module file:
source/accretion_disks.spectra.disk_corona_intrinsic.F90
defining an accretionDiskSpectra implementation named:
accretionDiskSpectraDiskCoronaIntrinsic
that returns intrinsic SED Lsun/Hz at wavelength (Angstrom).
Add a strict energy-closure fix for the disk component:
Keep the model pure Fortran (no runtime downloads/compiles) and include hard X-rays up to 300 keV (lambdaMinA ~ 12.3984193/300 Å).
Preserve/implement caching using node%uniqueID() so per-node expensive normalizations are computed only when node changes.
Add basic safeguards:
Add/maintain input parameters in the directive block to make the main model parameters configurable:
mdotThinMinimum, lambdaCount, lambdaMinA, lambdaMaxA, radialCount, rOutRg, rCorRg,
useColorCorrection, fColor,
warm: fWarm, gammaWarm, kTeWarm_keV, EminWarm_keV, EmaxWarm_keV, warmEnergyCount,
hot: fHot, gammaHot, eCut_keV, EminHot_keV, EmaxHot_keV, hotEnergyCount.
Notes
Deliverables
Reference file
The following is the prior conversation context from the user's chat exploration (may be truncated):
User: We have just one, kinda old, implementation of an AGN SED model. Since we're working on improving this aspect of the model it would be nice to find some better, more recent model that we could use to add as a new implementation of this class.
Assistant: A good next step is to add at least one modern, modular AGN SED option that (a) is widely used post-2010, (b) has a clean parameterization you can sample over (BH mass, Eddington ratio, obscuration, viewing angle, etc.), and (c) is feasible to ship in Galacticus without relying on a fragile external download/compile at runtime (your current Hopkins2007 implementation literally downloads and builds
agn_spectrum.con demand; see lines ~192–202 insource/accretion_disks.spectra.Hopkins2007.F90).Here are “better / more recent” families that are commonly used in galaxy/AGN modeling, with a suggestion for what makes sense as a new
accretionDiskSpectra...implementation.1) Physically-motivated accretion disk + corona SEDs (recommended if you want “model”, not just templates)
Done et al. 2012 OPTXAGNF / OPTXCONV
How it would fit Galacticus: create
accretion_disks.spectra.Done2012.F90that tab...This pull request was created from Copilot chat.