Skip to content

Conversation

zingale
Copy link
Member

@zingale zingale commented Sep 1, 2025

This will allow for a table generated by our new C++ EOS, which uses better quadrature and precision and should be more accurate overall for the electron-positron component.

@zingale zingale added the EOS label Sep 1, 2025
@AMReX-Astro AMReX-Astro deleted a comment from zingale Sep 1, 2025
@zingale
Copy link
Member Author

zingale commented Sep 3, 2025

Here's a comparison of test_eos with the old and new tables:


            variable name            absolute error            relative error
                                        (||A - B||)         (||A - B||/||A||)
 ----------------------------------------------------------------------------
 level = 0
 density                                          0                         0
 temperature                                      0                         0
 specific_enthalpy                  8.079280964e+19           2.982940776e-06
 specific_energy                    6.095835231e+19           2.980379594e-06
 pressure                           6.068397046e+21           4.547890027e-07
 specific_entropy                        8079280958           2.982939321e-06
 X_hydrogen-1                                     0                         0
 X_helium-3                                       0                         0
 X_helium-4                                       0                         0
 X_carbon-12                                      0                         0
 X_nitrogen-14                                    0                         0
 X_oxygen-16                                      0                         0
 X_neon-20                                        0                         0
 X_magnesium-24                                   0                         0
 X_silicon-28                                     0                         0
 X_sulfur-32                                      0                         0
 X_argon-36                                       0                         0
 X_calcium-40                                     0                         0
 X_titanium-44                                    0                         0
 X_chromium-48                                    0                         0
 X_iron-52                                        0                         0
 X_iron-54                                        0                         0
 X_nickel-56                                      0                         0
 X_neutron                                        0                         0
 X_proton                                         0                         0
 err_T_eos_rh                       4.463145742e-10               1.042990214
 err_rho_eos_tp                         6.667819099               1.051192241
 err_T_eos_rp                       1.097922213e-10              0.9788131459
 err_T_eos_re                       6.344377762e-10              0.9932798702
 err_rho_eos_ps                      2.00036147e-13              0.8982993348
 err_T_eos_ps                       2.727631179e-11              0.8926206267
 err_rho_eos_ph                     9.138613768e-13               3.825521075
 err_T_eos_ph                       6.301744143e-10               1.098603558
 err_rho_eos_th                     2.760014189e-06           1.529514792e-05
 c_v                                2.454254217e+10           2.973657129e-06
 c_p                                1.569158872e+18           4.762952204e-06
 n_e                                4.653342571e+26           1.715461361e-07
 n_p                                              0                         0
 eta                                   0.1070367233           1.150363746e-06
 p_ele                              1.856725216e+21           1.889507739e-07
 p_pos                                            0                         0
 mu                                               0                         0
 mu_e                                             0                         0
 Y_e                                              0                         0
 dp_dT                              6.857777685e+11           1.071302253e-06
 dp_drho                            3.563847897e+14           0.0001098986724
 de_dT                              2.454254217e+10           2.973657129e-06
 de_drho                            6.095841843e+18           2.980380935e-06
 ds_dT                                  2.454254217           2.973657129e-06
 ds_drho                                807928760.9           2.982941798e-06
 dh_dT                              3.262182892e+10           2.975951162e-06
 dh_drho                             8.07928756e+18           2.982941837e-06
 dp_dX_hydrogen-1                   4.477957259e+21           5.292565765e-07
 dp_dX_helium-3                     2.955480122e+21           5.449484792e-07
 dp_dX_helium-4                     3.666564805e+21           4.514851085e-07
 dp_dX_carbon-12                    4.499587302e+21           5.103719659e-07
 dp_dX_nitrogen-14                  4.559088908e+21           5.142248082e-07
 dp_dX_oxygen-16                     4.60371511e+21           5.170862364e-07
 dp_dX_neon-20                      4.666191796e+21           5.210522543e-07
 dp_dX_magnesium-24                 4.707842925e+21           5.236707102e-07
 dp_dX_silicon-28                   4.737593728e+21           5.255286733e-07
 dp_dX_sulfur-32                     4.75990683e+21           5.269154434e-07
 dp_dX_argon-36                     4.777261463e+21            5.27990096e-07
 dp_dX_calcium-40                   4.791145172e+21           5.288473444e-07
 dp_dX_titanium-44                   4.80250457e+21           5.295471004e-07
 dp_dX_chromium-48                  4.811970735e+21           5.301291139e-07
 dp_dX_iron-52                      4.819980567e+21            5.30620796e-07
 dp_dX_iron-54                      4.856270873e+21           5.195117893e-07
 dp_dX_nickel-56                    4.826846138e+21           5.310416625e-07
 dp_dX_neutron                      2.625333235e+21           2.148602067e-07
 dp_dX_proton                       4.477957259e+21           5.292565765e-07
 de_dX_hydrogen-1                   7.163573926e+13           7.963816484e-06
 de_dX_helium-3                     2.967237308e+13           1.078331614e-05
 de_dX_helium-4                     6.260349865e+13           1.157983329e-05
 de_dX_carbon-12                    6.262494428e+13            1.11549118e-05
 de_dX_nitrogen-14                  6.262647611e+13           1.112576112e-05
 de_dX_oxygen-16                    6.262762499e+13           1.110399883e-05
 de_dX_neon-20                      6.262923341e+13           1.107367558e-05
 de_dX_magnesium-24                 6.263030569e+13           1.105355279e-05
 de_dX_silicon-28                   6.263107161e+13            1.10392245e-05
 de_dX_sulfur-32                    6.263164604e+13           1.102850287e-05
 de_dX_argon-36                     6.263209283e+13           1.102017835e-05
 de_dX_calcium-40                   6.263245026e+13           1.101352786e-05
 de_dX_titanium-44                   6.26327427e+13           1.100809257e-05
 de_dX_chromium-48                   6.26329864e+13            1.10035673e-05
 de_dX_iron-52                       6.26331926e+13           1.099974116e-05
 de_dX_iron-54                      6.629110678e+13           1.108852509e-05
 de_dX_nickel-56                    6.263336935e+13           1.099646374e-05
 de_dX_neutron                      1.612682015e+14           1.099696415e-05
 de_dX_proton                       7.163573926e+13           7.963816484e-06
 dh_dX_hydrogen-1                   2.208836234e+20           2.982940319e-06
 dh_dX_helium-3                     4.880186719e+19           2.982940577e-06
 dh_dX_helium-4                     5.679959933e+19            2.98294069e-06
 dh_dX_carbon-12                    7.279505742e+19           2.982940612e-06
 dh_dX_nitrogen-14                  7.393759015e+19           2.982940608e-06
 dh_dX_oxygen-16                    7.479448969e+19           2.982940605e-06
 dh_dX_neon-20                      7.599414905e+19           2.982940601e-06
 dh_dX_magnesium-24                 7.679392195e+19           2.982940598e-06
 dh_dX_silicon-28                   7.736518832e+19           2.982940596e-06
 dh_dX_sulfur-32                     7.77936381e+19           2.982940595e-06
 dh_dX_argon-36                      7.81268768e+19           2.982940593e-06
 dh_dX_calcium-40                   7.839346777e+19           2.982940593e-06
 dh_dX_titanium-44                  7.861158765e+19           2.982940592e-06
 dh_dX_chromium-48                  7.879335422e+19           2.982940591e-06
 dh_dX_iron-52                      7.894715671e+19           2.982940591e-06
 dh_dX_iron-54                       7.90155137e+19           2.982940602e-06
 dh_dX_nickel-56                     7.90789874e+19           2.982940591e-06
 dh_dX_neutron                      2.208837497e+20           2.982939437e-06
 dh_dX_proton                       2.208836234e+20           2.982940319e-06
 Gamma_1                            0.0004564659514           0.0002671683353
 soundspeed                             4460444.231           1.496112105e-06
 Abar                                             0                         0
 Zbar                                             0                         0
 dp_dA                              4.882463921e+21            3.57698987e-07
 dp_dZ                              1.487885257e+21            1.25343828e-07
 de_dA                              1.128574092e+14            1.16597423e-05
 de_dZ                               1.38118338e+14           1.138328243e-05
 dp_de_rho                              603.7507143           1.908034674e-07
 dp_drho_e                          2.006708034e+19           2.989665516e-06

@zingale zingale changed the base branch from main to development September 11, 2025 23:57
@zingale
Copy link
Member Author

zingale commented Sep 23, 2025

Here's a simulation (flame_wave) run with the original and new table -- they look basically the same.

original table:
image

new table:
image

@zingale
Copy link
Member Author

zingale commented Sep 29, 2025

This has been updated now to use approximate functions for log and pow, and seems to get better performance. It needs more testing, in particular, the comparison of test_eos shows large-ish errors for de_dX (but not dp_dX or dh_dX)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant