Microphysics icon indicating copy to clipboard operation
Microphysics copied to clipboard

[WIP] Adaptive Statistical Equilibrium

Open zhichen3 opened this issue 2 years ago • 1 comments

Current task: Need to be able to pick out individual rates in the network.

zhichen3 avatar Sep 17 '22 04:09 zhichen3

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.

zhichen3 avatar Oct 08 '22 22:10 zhichen3

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.

zhichen3 avatar Nov 04 '22 02:11 zhichen3

I wonder if the issue is that we don't have the partition functions in yet.

zingale avatar Nov 04 '22 09:11 zingale

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.

zhichen3 avatar Nov 04 '22 15:11 zhichen3

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.

zhichen3 avatar Nov 09 '22 21:11 zhichen3

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.

zhichen3 avatar Nov 10 '22 20:11 zhichen3

is this ready for review now?

zingale avatar Nov 11 '22 22:11 zingale

not yet, there is a small bug I'm fixing right now.

zhichen3 avatar Nov 11 '22 22:11 zhichen3

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?)

zingale avatar Nov 30 '22 22:11 zingale

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.

zhichen3 avatar Nov 30 '22 23:11 zhichen3

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.

zingale avatar Nov 30 '22 23:11 zingale

Yup, will do.

zhichen3 avatar Nov 30 '22 23:11 zhichen3

tests pass: http://groot.astro.sunysb.edu/Microphysics/test-suite/gfortran/2022-11-30-001/index.html

zingale avatar Nov 30 '22 23:11 zingale