diff --git a/.github/workflows/jac_cell.yml b/.github/workflows/jac_cell.yml index 91a05a46cd..5be0992002 100644 --- a/.github/workflows/jac_cell.yml +++ b/.github/workflows/jac_cell.yml @@ -34,7 +34,7 @@ jobs: - name: Run jac_cell run: | cd unit_test/jac_cell - ./main3d.gnu.ex inputs_aprox13 > test.out + ./main3d.gnu.ex inputs > test.out - name: Compare to stored output run: | diff --git a/Docs/source/eos_cell.rst b/Docs/source/eos_cell.rst index ff7fc94553..4039f8ee78 100644 --- a/Docs/source/eos_cell.rst +++ b/Docs/source/eos_cell.rst @@ -1,3 +1,5 @@ +.. _sec:eos_cell: + ************ ``eos_cell`` ************ diff --git a/Docs/source/jac_cell.rst b/Docs/source/jac_cell.rst new file mode 100644 index 0000000000..51db309555 --- /dev/null +++ b/Docs/source/jac_cell.rst @@ -0,0 +1,98 @@ +.. _sec:jac_cell: + +************ +``jac_cell`` +************ + +.. index:: jac_cell, numerical_jacobian.H + +``jac_cell`` is used to test the accuracy of an analytic Jacobian +provided by a network, but comparing to a finite-difference +approximation. Given a thermodynamic state, ``jac_cell`` evaluates +the analytic Jacobian as well as a numerical approximation to it, and +then outputs (to ``stdout``) the Jacobian elements side-by-side for +each method of computing the Jacobian. + +.. note:: + + Some integrators, like VODE, have their own numerical Jacobian + routines. This test uses the implementation in + ``integration/util/numerical_jacobian.H``, which closely follows the ideas + of the VODE numerical approximation, as described in :cite:`lsode`. + + +Getting Started +=============== + +The ``jac_cell`` code is located in +``Microphysics/unit_test/jac_cell``. An inputs file which sets the +default parameters for your thermodynamic state is needed to run the +test. + +Setting the thermodynamics +-------------------------- + +The parameters that affect the thermodynamics are: + +* ``unit_test.density`` : the initial density + +* ``unit_test.temperature`` : the initial temperature + +* ``unit_test.small_temp`` : the low temperature cutoff used in the equation of state + +* ``unit_test.small_dens`` : the low density cutoff used in the equation of state + +While the mass fractions can be set individually (using +``unit_test.X1``, ``unit_test.X2``, ...), it is recommended to use +``unit_test.uniform_xn=1`` to initialize all the mass fractions to be +equal. + + +Building and Running the Code +============================= + +The code can be built simply as: + +.. prompt:: bash + + make + +.. note:: + + By default, this will build with the ``aprox13`` network, which + uses the C++ templating method (:ref:`sec:templated_rhs`) of + building the analytic Jacobian at compile-time. The network can be + changed via the build parameter ``NETWORK_DIR``. + +.. important:: + + The screening routines provided by Microphysics do not return the + derivative of the screening factor with respect to composition. This + means that the analytic Jacobian provided by the network will ignore + this contribution, but the numerical Jacobian will implicitly include + it. + + To compare just the network Jacobian elements, it is suggested that + you build with ``SCREEN_METHOD=null``. + + +The build process will automatically create links in the build +directory to any required EOS table. + +To run the code, in the ``jac_cell`` directory run:: + + ./main3d.gnu.ex inputs + +where ``inputs`` is the provided inputs file. You may edit the +thermodynamic state in that file prior to running. + + +Output +====== + +All output is directed to ``stdout``. Example output is shown below +(this output includes screening, highlighting the difference that the +screening composition derivatives make): + + +.. literalinclude:: ../../unit_test/jac_cell/ci-benchmarks/jac_cell_aprox13.out diff --git a/Docs/source/one_zone_tests.rst b/Docs/source/one_zone_tests.rst index fa4a4c9060..8a34952ef4 100644 --- a/Docs/source/one_zone_tests.rst +++ b/Docs/source/one_zone_tests.rst @@ -12,3 +12,4 @@ have analysis scripts, which we describe in the next sections. burn_cell.rst eos_cell.rst + jac_cell.rst diff --git a/Docs/source/refs.bib b/Docs/source/refs.bib index 1807faffd4..7c44a3c95f 100644 --- a/Docs/source/refs.bib +++ b/Docs/source/refs.bib @@ -774,3 +774,12 @@ @ARTICLE{tillotson:1962 journal = {Internal Report, General Atomics}, url = {https://apps.dtic.mil/sti/citations/AD0486711} } + +@article{lsode, + title = {Description and {Use} of {LSODE}, the {Livermore} {Solver} for {Ordinary} {Differential} {Equations}}, + language = {en}, + year = {1993}, + author = {{Radhakrishnan}, Krishnan and {Hindmarsh}, Alan C.}, + journal = {Lawrence Livermore National Laboratory Report UCRL-ID-113855}, + pages = {124} +} \ No newline at end of file diff --git a/Docs/source/templated_networks.rst b/Docs/source/templated_networks.rst index 2f64c65af2..50f419e545 100644 --- a/Docs/source/templated_networks.rst +++ b/Docs/source/templated_networks.rst @@ -1,3 +1,5 @@ +.. _sec:templated_rhs: + ********************************* Templated Network Righthand Sides ********************************* diff --git a/Docs/source/unit_tests.rst b/Docs/source/unit_tests.rst index adba5a8085..6c01f664c7 100644 --- a/Docs/source/unit_tests.rst +++ b/Docs/source/unit_tests.rst @@ -120,7 +120,7 @@ One-zone tests * ``burn_cell`` : given a $\rho$, $T$, and $X_k$, integrate a reaction network through a specified time - and output the new state. + and output the new state. See :ref:`sec:burn_cell` for more information. * ``burn_cell_primordial_chem`` : @@ -133,14 +133,14 @@ One-zone tests * ``eos_cell`` : given a $\rho$, $T$, and $X_k$, call the equation of state and print out - the thermodynamic information. + the thermodynamic information. See :ref:`sec:eos_cell` for more information. * ``jac_cell`` : for a single thermodynamic state, compute the analytic Jacobian (using the functions provided by the network) and a numerical finite-difference approximation to the Jacobian and output them, - element-by-element, to the display. + element-by-element, to the display. See :ref:`sec:jac_cell` for more information. * ``nse_table_cell`` : diff --git a/unit_test/jac_cell/README.md b/unit_test/jac_cell/README.md index 0d972f1f25..c09b05e00e 100644 --- a/unit_test/jac_cell/README.md +++ b/unit_test/jac_cell/README.md @@ -3,3 +3,9 @@ For a single thermodynamic condition, evaluate the Jacobian using both the analytic version from the network and the finite-difference numerical approximation. + +Note: most analytic Jacobians do not consider the derivative of the +screening factor with respect to composition. To get a more accurate +comparison of how the analytic and numerical terms compare, considering +just the reactive part, build with `SCREEN_METHOD=null`. + diff --git a/unit_test/jac_cell/_parameters b/unit_test/jac_cell/_parameters index 9047a84f8e..5894a90b97 100644 --- a/unit_test/jac_cell/_parameters +++ b/unit_test/jac_cell/_parameters @@ -1,19 +1,8 @@ @namespace: unit_test -run_prefix string "" - small_temp real 1.e5 small_dens real 1.e5 -# the final time to integrate to -tmax real 1.e-2 - -# first output time -- we will output in nsteps logarithmically spaced steps between [tfirst, tmax] -tfirst real 0.0 - -# number of steps (logarithmically spaced) -nsteps int 100 - density real 1.e7 temperature real 3.e9 diff --git a/unit_test/jac_cell/ci-benchmarks/jac_cell_aprox13.out b/unit_test/jac_cell/ci-benchmarks/jac_cell_aprox13.out index b85220eaee..8a3899192b 100644 --- a/unit_test/jac_cell/ci-benchmarks/jac_cell_aprox13.out +++ b/unit_test/jac_cell/ci-benchmarks/jac_cell_aprox13.out @@ -1,214 +1,215 @@ -Initializing AMReX (24.07-16-gdcb9cc0383dc)... -AMReX (24.07-16-gdcb9cc0383dc) initialized +Initializing AMReX (24.12-14-gb3f67385e62f)... +AMReX (24.12-14-gb3f67385e62f) initialized starting the single zone burn... -J( 1, 1) = -22.83252156 -22.76871089 -J( 1, 2) = -7074.184809 -7070.885902 -J( 1, 3) = -146332.0024 -146331.961 -J( 1, 4) = -2840218.246 -2840216.758 -J( 1, 5) = -1480087.416 -1480081.685 -J( 1, 6) = -150293.5967 -150288.8284 -J( 1, 7) = -155563.9558 -155558.7711 -J( 1, 8) = -90256.26203 -90254.79555 -J( 1, 9) = -4338.739586 -4338.971348 -J( 1, 10) = -1367.526773 -1364.641738 -J( 1, 11) = -754.4182788 -751.4739669 -J( 1, 12) = -164.8910475 -163.1314012 -J( 1, 13) = 0.177283612 8.045249939e-06 -J( 1, 14) = 2.036804679e-18 2.036804635e-18 + element numerical analytic +J( He4, He4) = -386901.0562 -389364.2481 +J( He4, C12) = 1538.83613 1527.484671 +J( He4, O16) = -11984.43367 -11604.67208 +J( He4, Ne20) = -226229.9236 -225570.3475 +J( He4, Mg24) = -118533.7928 -117650.0754 +J( He4, Si28) = -13102.92749 -12026.86162 +J( He4, S32) = -13739.13964 -12490.59603 +J( He4, Ar36) = -8735.824012 -7328.055338 +J( He4, Ca40) = -1917.505444 -359.8025782 +J( He4, Ti44) = -1801.580358 -100.6766494 +J( He4, Cr48) = -1902.430547 -63.38388515 +J( He4, Fe52) = -1987.160097 -13.86553734 +J( He4, Ni56) = -2104.486528 8.889625789e-06 +J( He4, e) = -3.302305762e-14 -3.302305672e-14 -J( 2, 1) = 22.83252156 22.76871089 -J( 2, 2) = -21223.06355 -21215.80687 -J( 2, 3) = -0.1431906097 0.01577663496 -J( 2, 4) = -0.1527366503 0 -J( 2, 5) = -0.1591006774 0 -J( 2, 6) = -0.1636464111 0 -J( 2, 7) = -0.1670557113 0 -J( 2, 8) = -0.1697073892 0 -J( 2, 9) = -0.1718287316 0 -J( 2, 10) = -0.1735643754 0 -J( 2, 11) = -0.1750107452 0 -J( 2, 12) = -0.1762345965 0 -J( 2, 13) = -0.177283612 0 -J( 2, 14) = -2.036804679e-18 -2.036804635e-18 +J( C12, He4) = -1544.888563 -1669.808542 +J( C12, C12) = -14163.60628 -14170.71908 +J( C12, O16) = -26.31037223 -15.90510669 +J( C12, Ne20) = -22.40516055 0 +J( C12, Mg24) = -31.64594981 0 +J( C12, Si28) = -39.31004354 0 +J( C12, S32) = -45.98896291 0 +J( C12, Ar36) = -52.01096713 0 +J( C12, Ca40) = -57.57313075 0 +J( C12, Ti44) = -62.80086484 0 +J( C12, Cr48) = -67.77757842 0 +J( C12, Fe52) = -72.56164943 0 +J( C12, Ni56) = -77.19392628 0 +J( C12, e) = -1.637120092e-15 -1.637119821e-15 -J( 3, 1) = -5.632962675e-25 -5.570411722e-25 -J( 3, 2) = 28286.69277 28286.69277 -J( 3, 3) = -585327.8861 -585327.8861 -J( 3, 4) = 6128.217777 6128.217777 -J( 3, 5) = -1.739488553e-26 0 -J( 3, 6) = -1.789188226e-26 0 -J( 3, 7) = -1.826462981e-26 0 -J( 3, 8) = -1.855454457e-26 0 -J( 3, 9) = -1.878647638e-26 0 -J( 3, 10) = -1.897623876e-26 0 -J( 3, 11) = -1.913437409e-26 0 -J( 3, 12) = -1.92681809e-26 0 -J( 3, 13) = -1.938287245e-26 0 -J( 3, 14) = -2.226890848e-43 -2.226890927e-43 +J( O16, He4) = -44251.69974 -44202.73796 +J( O16, C12) = 2167.279422 2205.366875 +J( O16, O16) = -46494.3376 -46450.60357 +J( O16, Ne20) = 6268.468387 6319.326423 +J( O16, Mg24) = -58.72063931 0 +J( O16, Si28) = -67.00603097 0 +J( O16, S32) = -75.55571467 0 +J( O16, Ar36) = -84.28093184 0 +J( O16, Ca40) = -93.12930016 0 +J( O16, Ti44) = -102.0668362 0 +J( O16, Cr48) = -111.0723391 0 +J( O16, Fe52) = -120.129117 0 +J( O16, Ni56) = -129.2264943 0 +J( O16, e) = 4.384415228e-16 4.384411885e-16 -J( 4, 1) = -1.366807088e-23 -1.347708423e-23 -J( 4, 2) = 4.753870727e-12 1.2621475e-25 -J( 4, 3) = 731659.8313 731659.8313 -J( 4, 4) = -14216404.34 -14216404.34 -J( 4, 5) = 0.003363940593 0.003363940593 -J( 4, 6) = -1.093051048e-24 0 -J( 4, 7) = -1.115822945e-24 0 -J( 4, 8) = -1.13353442e-24 0 -J( 4, 9) = -1.1477036e-24 0 -J( 4, 10) = -1.159296566e-24 0 -J( 4, 11) = -1.168957371e-24 0 -J( 4, 12) = -1.177131898e-24 0 -J( 4, 13) = -1.184138635e-24 0 -J( 4, 14) = -1.360452377e-41 -1.360452352e-41 +J(Ne20, He4) = -1071437.231 -1077714.229 +J(Ne20, C12) = 10295.4965 10403.37149 +J(Ne20, O16) = 56883.61948 58036.66646 +J(Ne20, Ne20) = -1145561.976 -1143650.054 +J(Ne20, Mg24) = -2527.616919 0.003495578555 +J(Ne20, Si28) = -3061.548719 0 +J(Ne20, S32) = -3544.317148 0 +J(Ne20, Ar36) = -3993.040141 0 +J(Ne20, Ca40) = -4417.866583 0 +J(Ne20, Ti44) = -4825.366803 0 +J(Ne20, Cr48) = -5219.853315 0 +J(Ne20, Fe52) = -5604.291196 0 +J(Ne20, Ni56) = -5980.914429 0 +J(Ne20, e) = -8.494068043e-14 -8.494067874e-14 -J( 5, 1) = 8.302657095e-24 8.170002764e-24 -J( 5, 2) = 3.153014201e-25 1.88760336e-28 -J( 5, 3) = 3.547140976e-25 1.88760336e-28 -J( 5, 4) = 17050492.88 17050492.88 -J( 5, 5) = -8880490.115 -8880490.115 -J( 5, 6) = 0.0001669112793 0.0001669112793 -J( 5, 7) = -5.810350496e-23 0 -J( 5, 8) = -5.809693618e-23 0 -J( 5, 9) = -5.809168116e-23 0 -J( 5, 10) = -5.808738159e-23 0 -J( 5, 11) = -5.808379862e-23 0 -J( 5, 12) = -5.808076688e-23 0 -J( 5, 13) = -5.807816824e-23 0 -J( 5, 14) = 5.045605543e-42 5.045605749e-42 +J(Mg24, He4) = 654844.2806 657000.6182 +J(Mg24, C12) = 435.4230384 15.9212509 +J(Mg24, O16) = 929.9962063 15.9212509 +J(Mg24, Ne20) = 1364203.922 1362901.075 +J(Mg24, Mg24) = -704261.6416 -705900.4607 +J(Mg24, Si28) = 1944.546334 0.0001724818945 +J(Mg24, S32) = 2231.306642 0 +J(Mg24, Ar36) = 2505.576486 0 +J(Mg24, Ca40) = 2770.981131 0 +J(Mg24, Ti44) = 3030.000681 0 +J(Mg24, Cr48) = 3284.193323 0 +J(Mg24, Fe52) = 3534.649522 0 +J(Mg24, Ni56) = 3782.237956 0 +J(Mg24, e) = 3.138100654e-14 3.138100793e-14 -J( 6, 1) = 9.417373366e-24 9.308549997e-24 -J( 6, 2) = 7.540626412e-25 2.20220392e-28 -J( 6, 3) = 6.930014139e-18 2.204043829e-28 -J( 6, 4) = 5.942221324e-23 0 -J( 6, 5) = 10360571.8 10360571.8 -J( 6, 6) = -1052021.799 -1052021.799 -J( 6, 7) = 2.618223472 2.618223472 -J( 6, 8) = 5.952275493e-23 0 -J( 6, 9) = 5.953532264e-23 0 -J( 6, 10) = 5.954560531e-23 0 -J( 6, 11) = 5.955417421e-23 0 -J( 6, 12) = 5.956142481e-23 0 -J( 6, 13) = 5.956763961e-23 0 -J( 6, 14) = 1.206687442e-41 1.206687398e-41 +J(Si28, He4) = 733740.6263 739362.5011 +J(Si28, C12) = -236.8292666 18.57479272 +J(Si28, O16) = 574.578026 18.59079981 +J(Si28, Ne20) = 1117.750234 0 +J(Si28, Mg24) = 825105.1884 823550.5326 +J(Si28, Si28) = -82267.7835 -84188.03177 +J(Si28, S32) = 2244.127686 2.723790242 +J(Si28, Ar36) = 2532.726899 0 +J(Si28, Ca40) = 2803.275313 0 +J(Si28, Ti44) = 3058.658852 0 +J(Si28, Cr48) = 3302.735385 0 +J(Si28, Fe52) = 3538.1484 0 +J(Si28, Ni56) = 3766.666407 0 +J(Si28, e) = 7.404959203e-14 7.404958884e-14 -J( 7, 1) = -4.433213398e-26 -4.216253314e-26 -J( 7, 2) = -1.713032535e-26 0 -J( 7, 3) = 9.755839735e-19 2.590167837e-32 -J( 7, 4) = -2.055639042e-26 0 -J( 7, 5) = -2.141290668e-26 0 -J( 7, 6) = 1202310.628 1202310.628 -J( 7, 7) = -1244476.153 -1244476.153 -J( 7, 8) = 10.56270301 10.56270301 -J( 7, 9) = -2.312593922e-26 0 -J( 7, 10) = -2.335953456e-26 0 -J( 7, 11) = -2.355419735e-26 0 -J( 7, 12) = -2.371891202e-26 0 -J( 7, 13) = -2.386009602e-26 0 -J( 7, 14) = -2.741277362e-43 -2.741278343e-43 +J( S32, He4) = -3580.328682 -3712.987952 +J( S32, C12) = 8.04608259 0 +J( S32, O16) = -10.40027404 0.002248083797 +J( S32, Ne20) = -22.96819788 0 +J( S32, Mg24) = -32.64411602 0 +J( S32, Si28) = 96174.2781 96214.89322 +J( S32, S32) = -99978.56511 -99930.99407 +J( S32, Ar36) = -42.78877369 11.02602735 +J( S32, Ca40) = -59.590923 0 +J( S32, Ti44) = -64.96182659 0 +J( S32, Cr48) = -70.09376854 0 +J( S32, Fe52) = -75.06398858 0 +J( S32, Ni56) = -79.83062948 0 +J( S32, e) = -1.735789154e-15 -1.735789442e-15 -J( 8, 1) = 5.935462112e-25 5.877272628e-25 -J( 8, 2) = 4.909905946e-26 0 -J( 8, 3) = 5.523644189e-26 0 -J( 8, 4) = 5.891887135e-26 0 -J( 8, 5) = 6.137382433e-26 0 -J( 8, 6) = 6.312736216e-26 0 -J( 8, 7) = 1400032.306 1400032.306 -J( 8, 8) = -812316.926 -812316.926 -J( 8, 9) = 1.524756764 1.524756764 -J( 8, 10) = 6.69532629e-26 0 -J( 8, 11) = 6.751120676e-26 0 -J( 8, 12) = 6.79833131e-26 0 -J( 8, 13) = 6.838797568e-26 0 -J( 8, 14) = 7.857068531e-43 7.857069044e-43 +J(Ar36, He4) = 46086.53162 46453.96399 +J(Ar36, C12) = -24.11889018 0 +J(Ar36, O16) = 26.26894988 0 +J(Ar36, Ne20) = 60.49242539 0 +J(Ar36, Mg24) = 86.63689247 0 +J(Ar36, Si28) = 108.1539016 0 +J(Ar36, S32) = 112545.6504 112418.8663 +J(Ar36, Ar36) = -65833.81509 -65977.3066 +J(Ar36, Ca40) = 160.4642177 1.609672543 +J(Ar36, Ti44) = 173.235213 0 +J(Ar36, Cr48) = 186.8760509 0 +J(Ar36, Fe52) = 199.9634644 0 +J(Ar36, Ni56) = 212.5928074 0 +J(Ar36, e) = 4.796861622e-15 4.796861932e-15 -J( 9, 1) = 8.75876269e-25 8.591697512e-25 -J( 9, 2) = 1.000399222e-25 0 -J( 9, 3) = 1.125449125e-25 0 -J( 9, 4) = 1.200479066e-25 0 -J( 9, 5) = 1.250499028e-25 0 -J( 9, 6) = 1.286227571e-25 0 -J( 9, 7) = 1.313023979e-25 0 -J( 9, 8) = 902561.1588 902561.1588 -J( 9, 9) = -43393.10183 -43393.10183 -J( 9, 10) = 136.1591093 136.1591093 -J( 9, 11) = 1.37554893e-25 0 -J( 9, 12) = 1.385168154e-25 0 -J( 9, 13) = 1.393413202e-25 0 -J( 9, 14) = 1.600887132e-42 1.600887039e-42 +J(Ca40, He4) = 68936.76349 69694.52161 +J(Ca40, C12) = -21.37672362 0 +J(Ca40, O16) = 92.60590241 0 +J(Ca40, Ne20) = 172.688813 0 +J(Ca40, Mg24) = 235.8250397 0 +J(Ca40, Si28) = 289.279374 0 +J(Ca40, S32) = 336.6818312 0 +J(Ca40, Ar36) = 73674.38243 73294.33591 +J(Ca40, Ca40) = -3181.015849 -3601.602832 +J(Ca40, Ti44) = 605.9215887 146.8474287 +J(Ca40, Cr48) = 496.0195798 0 +J(Ca40, Fe52) = 531.7806992 0 +J(Ca40, Ni56) = 566.6106385 0 +J(Ca40, e) = 1.005604098e-14 1.00560404e-14 -J( 10, 1) = 3.341465689e-26 3.256971428e-26 -J( 10, 2) = 3.653921958e-27 0 -J( 10, 3) = 4.110662202e-27 0 -J( 10, 4) = 4.384706349e-27 0 -J( 10, 5) = 4.567402447e-27 0 -J( 10, 6) = 4.69789966e-27 0 -J( 10, 7) = 4.79577257e-27 0 -J( 10, 8) = 4.871895944e-27 0 -J( 10, 9) = 47730.54842 47730.54842 -J( 10, 10) = -15310.60916 -15310.60916 -J( 10, 11) = 0.002383888334 0.002383888334 -J( 10, 12) = 5.059276557e-27 0 -J( 10, 13) = 5.089391298e-27 0 -J( 10, 14) = 5.847182318e-44 5.847181188e-44 +J(Ti44, He4) = 2668.743332 2690.820423 +J(Ti44, C12) = 1.238968178 0 +J(Ti44, O16) = 5.219659626 0 +J(Ti44, Ne20) = 8.176705476 0 +J(Ti44, Mg24) = 10.62185414 0 +J(Ti44, Si28) = 12.77460702 0 +J(Ti44, S32) = 14.74456604 0 +J(Ti44, Ar36) = 16.5926625 0 +J(Ti44, Ca40) = 3978.151195 3959.795738 +J(Ti44, Ti44) = -1410.451232 -1430.507487 +J(Ti44, Cr48) = 21.71303639 0.002593936486 +J(Ti44, Fe52) = 23.32886523 0 +J(Ti44, Ni56) = 24.91917548 0 +J(Ti44, e) = 3.036977677e-16 3.036977135e-16 -J( 11, 1) = 7.727968776e-27 7.52140159e-27 -J( 11, 2) = 1.166347238e-27 0 -J( 11, 3) = 1.312140643e-27 0 -J( 11, 4) = 1.399616686e-27 0 -J( 11, 5) = 1.457934048e-27 0 -J( 11, 6) = 1.499589306e-27 0 -J( 11, 7) = 1.53083075e-27 0 -J( 11, 8) = 1.555129651e-27 0 -J( 11, 9) = 1.574568772e-27 0 -J( 11, 10) = 16539.09179 16539.09179 -J( 11, 11) = -9017.692804 -9017.692804 -J( 11, 12) = 0.000548515294 0.000548515294 -J( 11, 13) = 1.624555082e-27 0 -J( 11, 14) = 1.866445159e-44 1.866444877e-44 +J(Cr48, He4) = 614.7614844 623.7272557 +J(Cr48, C12) = -0.1747033379 0 +J(Cr48, O16) = 1.201593305 0 +J(Cr48, Ne20) = 2.1753907 0 +J(Cr48, Mg24) = 2.947870284 0 +J(Cr48, Si28) = 3.605375763 0 +J(Cr48, S32) = 4.190958113 0 +J(Cr48, Ar36) = 4.728616507 0 +J(Cr48, Ca40) = 5.232734331 0 +J(Cr48, Ti44) = 1390.049151 1384.336707 +J(Cr48, Cr48) = -754.4384225 -760.6122813 +J(Cr48, Fe52) = 6.621805499 0.0006014485747 +J(Cr48, Ni56) = 7.057441608 0 +J(Cr48, e) = 1.19432887e-16 1.194328695e-16 -J( 12, 1) = 7.899733031e-27 7.648455578e-27 -J( 12, 2) = 1.384355059e-27 0 -J( 12, 3) = 1.557399442e-27 0 -J( 12, 4) = 1.661226071e-27 0 -J( 12, 5) = 1.730443824e-27 0 -J( 12, 6) = 1.779885076e-27 0 -J( 12, 7) = 1.816966015e-27 0 -J( 12, 8) = 1.845806746e-27 0 -J( 12, 9) = 1.86887933e-27 0 -J( 12, 10) = 1.887756899e-27 0 -J( 12, 11) = 9769.164387 9769.164387 -J( 12, 12) = -2120.709403 -2120.709403 -J( 12, 13) = 0.0001045882492 0.0001045882492 -J( 12, 14) = 2.215311799e-44 2.215311465e-44 +J(Fe52, He4) = 632.9421872 643.7409355 +J(Fe52, C12) = -0.1711193576 0 +J(Fe52, O16) = 1.500523358 0 +J(Fe52, Ne20) = 2.686529769 0 +J(Fe52, Mg24) = 3.629742825 0 +J(Fe52, Si28) = 4.434187596 0 +J(Fe52, S32) = 5.15193241 0 +J(Fe52, Ar36) = 5.811846257 0 +J(Fe52, Ca40) = 6.431285246 0 +J(Fe52, Ti44) = 7.02131108 0 +J(Fe52, Cr48) = 831.5828167 823.9935726 +J(Fe52, Fe52) = -172.1130683 -180.2532886 +J(Fe52, Ni56) = 8.67797769 0.0001155651353 +J(Fe52, e) = 1.4407613e-16 1.440761083e-16 -J( 13, 1) = 2.36704737e-27 2.283840256e-27 -J( 13, 2) = 4.518871185e-28 0 -J( 13, 3) = 5.083730083e-28 0 -J( 13, 4) = 5.422645422e-28 0 -J( 13, 5) = 5.648588981e-28 0 -J( 13, 6) = 5.809977238e-28 0 -J( 13, 7) = 5.93101843e-28 0 -J( 13, 8) = 6.02516158e-28 0 -J( 13, 9) = 6.1004761e-28 0 -J( 13, 10) = 6.16209707e-28 0 -J( 13, 11) = 6.213447879e-28 0 -J( 13, 12) = 2283.840256 2283.840256 -J( 13, 13) = -0.0001126334991 -0.0001126334991 -J( 13, 14) = 7.231315828e-45 7.231315425e-45 +J(Ni56, He4) = 190.5614891 194.1182245 +J(Ni56, C12) = -0.04871014481 0 +J(Ni56, O16) = 0.5045792589 0 +J(Ni56, Ne20) = 0.8977755497 0 +J(Ni56, Mg24) = 1.210925284 0 +J(Ni56, Si28) = 1.478328594 0 +J(Ni56, S32) = 1.717144845 0 +J(Ni56, Ar36) = 1.936906672 0 +J(Ni56, Ca40) = 2.143324048 0 +J(Ni56, Ti44) = 2.340035525 0 +J(Ni56, Cr48) = 2.52947455 0 +J(Ni56, Fe52) = 196.8315355 194.1182245 +J(Ni56, Ni56) = 2.892625537 -0.0001244547611 +J(Ni56, e) = 4.749774962e-17 4.749774706e-17 -J( 14, 1) = 1.335535433e+19 1.331810907e+19 -J( 14, 2) = 1.672678172e+22 1.221628179e+22 -J( 14, 3) = 1.764169333e+23 1.669883326e+23 -J( 14, 4) = 6.38519349e+24 6.382691446e+24 -J( 14, 5) = 3.575435081e+24 3.56443165e+24 -J( 14, 6) = 2.522960852e+23 2.518972785e+23 -J( 14, 7) = 2.567887496e+23 2.492143743e+23 -J( 14, 8) = 1.63734141e+23 1.532779936e+23 -J( 14, 9) = 1.46197563e+22 5.363178614e+21 -J( 14, 10) = 1.41303877e+22 2.541660459e+21 -J( 14, 11) = 7.680250114e+21 1.43978686e+21 -J( 14, 12) = 6.72190453e+21 3.147552442e+20 -J( 14, 13) = -1.03705583e+17 -1.56260658e+13 -J( 14, 14) = -1.191469501 -1.191474366 +J( e, He4) = 8.557355646e+23 8.612933787e+23 +J( e, C12) = 3.253492329e+21 3.293956754e+21 +J( e, O16) = 1.407824852e+22 1.326089094e+22 +J( e, Ne20) = 5.099953876e+23 5.085260898e+23 +J( e, Mg24) = 2.852905494e+23 2.833327761e+23 +J( e, Si28) = 2.258348807e+22 2.015807656e+22 +J( e, S32) = 2.278872757e+22 2.001064883e+22 +J( e, Ar36) = 1.55712523e+22 1.244521857e+22 +J( e, Ca40) = 3.918079028e+21 4.446572283e+20 +J( e, Ti44) = 3.973002198e+21 1.959966253e+20 +J( e, Cr48) = 4.23547637e+21 1.21440394e+20 +J( e, Fe52) = 4.413681758e+21 2.675297734e+19 +J( e, Ni56) = 4.682037199e+21 -1.725529485e+13 +J( e, e) = 74499.43446 74499.57032 -AMReX (24.07-16-gdcb9cc0383dc) finalized +AMReX (24.12-14-gb3f67385e62f) finalized diff --git a/unit_test/jac_cell/inputs b/unit_test/jac_cell/inputs new file mode 100644 index 0000000000..4da177146d --- /dev/null +++ b/unit_test/jac_cell/inputs @@ -0,0 +1,7 @@ +unit_test.small_temp = 1.e5 +unit_test.small_dens = 1.e5 + +unit_test.density = 1.e6 +unit_test.temperature = 3.e9 + +unit_test.uniform_xn = 1 diff --git a/unit_test/jac_cell/inputs_aprox13 b/unit_test/jac_cell/inputs_aprox13 deleted file mode 100644 index 5e138fc92d..0000000000 --- a/unit_test/jac_cell/inputs_aprox13 +++ /dev/null @@ -1,38 +0,0 @@ -unit_test.run_prefix = "react_aprox13_" - -unit_test.small_temp = 1.e5 -unit_test.small_dens = 1.e5 - -integrator.burner_verbose = 0 - -# Set which jacobian to use -# 1 = analytic jacobian -# 2 = numerical jacobian - -integrator.jacobian = 2 - -integrator.renormalize_abundances = 0 - -integrator.rtol_spec = 1.0e-6 -integrator.rtol_enuc = 1.0e-6 -integrator.atol_spec = 1.0e-6 -integrator.atol_enuc = 1.0e-6 - -unit_test.tmax = 1.e-2 - -unit_test.density = 1.e6 -unit_test.temperature = 3.e9 - -unit_test.X1 = 1.0 -unit_test.X2 = 0.0 -unit_test.X3 = 0.0 -unit_test.X4 = 0.0 -unit_test.X5 = 0.0 -unit_test.X6 = 0.0 -unit_test.X7 = 0.0 -unit_test.X8 = 0.0 -unit_test.X9 = 0.0 -unit_test.X10 = 0.0 -unit_test.X11 = 0.0 -unit_test.X12 = 0.0 -unit_test.X13 = 0.0 diff --git a/unit_test/jac_cell/jac_cell.H b/unit_test/jac_cell/jac_cell.H index 33f03cb0c3..54560a56dd 100644 --- a/unit_test/jac_cell/jac_cell.H +++ b/unit_test/jac_cell/jac_cell.H @@ -1,5 +1,5 @@ -#ifndef BURN_CELL_H -#define BURN_CELL_H +#ifndef JAC_CELL_H +#define JAC_CELL_H #include #include @@ -67,9 +67,15 @@ void jac_cell_c() // output + // header + std::cout << std::setw(16) << "element" << std::setw(20) + << "numerical" << std::setw(20) << "analytic" << std::endl; + for (int ii = 1; ii <= neqs; ++ii) { + std::string ilabel = (ii < neqs) ? short_spec_names_cxx[ii-1] : "e"; for (int jj = 1; jj <= neqs; ++jj) { - std::cout << "J(" << std::setw(3) << ii << ", " << std::setw(3) << jj << ") = " + std::string jlabel = (jj < neqs) ? short_spec_names_cxx[jj-1] : "e"; + std::cout << "J(" << std::setw(4) << ilabel << ", " << std::setw(4) << jlabel << ") = " << std::setw(20) << jac_numerical(ii,jj) << " " << std::setw(20) << jac_analytic(ii,jj) << std::endl; }