Skip to content

Conversation

@brittonsmith
Copy link
Contributor

This pull request merges the newchem-cpp branch, which contains several major updates including:

For more information, see PR #177 and PR #143.

@brittonsmith
Copy link
Contributor Author

@mabruzzo we seem to have some merger conflicts with main now. Are you able to resolve these?

@mabruzzo
Copy link
Collaborator

mabruzzo commented Apr 9, 2025 via email

@mabruzzo
Copy link
Collaborator

mabruzzo commented Apr 16, 2025

That force push just happened because I accidentally pushed to this branch 2 seconds earlier (the force-push simply removed the new commit)

@brittonsmith brittonsmith mentioned this pull request Apr 17, 2025
endif

! ignore metal chemistry/cooling below this metallicity
min_metallicity = 1.d-9 / z_solar
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In solar units, this is a metallicity of just under 1e-7 Zsun. I suspect I've done this wrong and that the min metallicity is meant to be 1e-9 Zsun. This would be consistent with other places in the code where this is done by hand.

Comment on lines 3257 to 3267
! HII, HeII, HeIII recombination heating

edot(i) = edot(i) - chunit * (
& 13.6_DKIND*( k1(i) * HI(i,j,k) * de(i,j,k)
& - k2(i) * HII(i,j,k) * de(i,j,k) )
& + 24.6_DKIND*( k3(i) * HeI(i,j,k) * de(i,j,k)/4._DKIND
& - k4(i) * HeII(i,j,k) * de(i,j,k)/4._DKIND )
& + 79.0_DKIND*( k5(i) * HeII(i,j,k) * de(i,j,k)/4._DKIND
& - k6(i) * HeIII(i,j,k)* de(i,j,k)/4._DKIND )
& )

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gregbryan, @jwise77 I would really like to get your thoughts on this block of code here. With this, we are now adding a heating term proportional to the recombination rate minus the collisional ionization rate. This sort of cancels out the conventional recombination cooling term in cool1d_multi_g.F. I think the assumption here is that recombination photons are being reabsorbed. Does that sound right? The main result is a slightly higher (~20%) equilibrium temperature when a uv background is present. Does this seem like a reasonable addition?

The second thing to point out is that this term is not being applied in cool1d_mult, but in solve_rate_cool near to where chemical heating from H2 formation is being applied. This basically means that the cooling rate applied during solve_rate_cool is inconsistent with what one would derive by calling calculate_cooling_time. I assume this was done here as it relies on the k-rate values, which are not being passed into cool1d_multi. If this is a term worth keeping, do you think it's worth moving into cool1d_multi properly?

Comment on lines 386 to 387
real*8, parameter :: kgr1 = 4.0e-4_DKIND / 0.009387d0
real*8, parameter :: kgr200 = 16.0_DKIND / 0.009387d0
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I concur that this normalization needs to be there. Specifically, equation 17 of Omukai (2000) gives kappa at Z = Z_local. However, just below that this paper seems define dust-to-gas ratio at Z_local as 0.934e-2 whereas the value used here is from Pollack (1994). As well, the T^2 proportionality used here is taken from Dopcke et al. (2011), who have a slightly different normalization (by about a factor of 2). This at least needs to be pointed out here.

@mabruzzo
Copy link
Collaborator

@brittonsmith, I made a minor mistake. I was intending to open a new PR that merged in the recent changes from main (and bump the gold-standard-nccv3 to gold-standard-nccv4 to account for the change from PR #367), but I accidentally pushed to this branch.

This isn't a significant change, so I'm inclined to live with it, but let me know if you want me to revert it

brittonsmith and others added 30 commits November 26, 2025 09:55
…or handling statements will be removed in the future.
…ulated dust temperature within solve_rate_cool. **NOT YET TESTED**
…o changed read() commands to exit() so that the code does not hang and waste compute time
…h new variables in chemistry_data. Added defauly values for these in set_default_chemistry_data. Moved SEC_PER_YEAR macro into grackle_defs.h
[newchem-cpp] Add dust_growth_and_destruction commit history
…InfoEntry

This information will only be used after we transcribe
`calc_grain_size_increment_1d` (at which point we will remove the
corresponding constants from phys_constants.h and can entirely delete
the dust_const.def file
I moved them from initialize_dust_yields.cpp where the comments were out
of place to dust/grain_species_info.cpp
…seidel

[newchem-cpp] transcribe `step_rate_g`
[newchem-cpp] Introduce the `GrainSpeciesInfo` type
[newchem-cpp] convert `solve_chemistry.{c->cpp}` and `calculate_*.{c->cpp}`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

6 participants