Microphysics
Microphysics copied to clipboard
[WIP] Adaptive Statistical Equilibrium
Current task: Need to be able to pick out individual rates in the network.
Seems like it is doing what I want it to do, but the test-reaction network doesn't pass the condition of the fast reaction network with extreme thermodynamic condition.
Currently testing using subch_full nuclei. It reaches NSE for density: 1e6~1e7, and T~6.5e9K. It seems like when I increased the density, then the temperature required for reaching NSE also increased. Especially when density is at ~1e9 g/cm^3, the temperature needs to be around ~10^10K.
I also tried to use no screening and set u_c = 0, then it just failed to reach NSE when the density is beyond 1e8 g/cm^3.
I'll add some print statements to see where went wrong.
I wonder if the issue is that we don't have the partition functions in yet.
Oh, I thought we have it already because I saw there is a partition_function.H
generated, but I guess its basically empty for now and only contains the spin. Yeah, then I guess that might be the issue.
After several bug fixes, I think it now works.
I had to set screening to null and set u_c=0, which makes sense since Alex explored these effects in pynucastro as well. Surprisingly, chugunov2007 also worked okay with u_c turned on. Perhaps I can add the potekhin_1998 screening to microphysics that Alex implemented in pynucastro and see how it works. It should work well.
For the network, I just copied and pasted the subch_simple.py
script to the ase
network directory for testing, the only change is I added neutron to the network.
For the unit_tests, I copied and pasted the make_table
we had in nse_solver
and added the part where we check whether we're in nse, perhaps I can just integrate them together, instead of creating a separate one in the test_ase.
Overall, it all just come down to calling in_nse(state, nse_state) by providing the current state and the nse state, and it returns a boolean stating whether we're in nse.
the output from the test changed slightly when the order of the rates are changed (I updated the output from subch_simple.py
using the latest pynucastro pr-494), Probably another bug somewhere.
is this ready for review now?
not yet, there is a small bug I'm fixing right now.
just to understand -- there is nothing special about networks/ase
except that you added neutrons to it, right? This method should work for any pynucastro net that has neutrons? (can it work with the other nets, like aprox13/19?)
Right, I just added neutron to that network script. And it currently only work with pynucastro generated network as long as it has he4,proton,and neutron. It doesn't work with aprox networks for now because they have slightly different syntax in representing the rates, but it should not be difficult to implement them I think.
can you add some documentation to https://amrex-astro.github.io/Microphysics/docs/dev/nse.html#self-consistent-nse explaining how to use this, including what requirements there are on networks.
Yup, will do.
tests pass: http://groot.astro.sunysb.edu/Microphysics/test-suite/gfortran/2022-11-30-001/index.html