|
| 1 | +*********************************** |
| 2 | +Unit Test Common Runtime Parameters |
| 3 | +*********************************** |
| 4 | + |
| 5 | +There are a number of runtime parameters that are common to all (or most) of the unit tests. |
| 6 | +These are defined in the top-level ``unit_test/_parameters`` file. |
| 7 | + |
| 8 | +Thermodynamics |
| 9 | +============== |
| 10 | + |
| 11 | +The equation of state enforces minimum density and temperatures, which must be set |
| 12 | +upon initialization. These are controlled by the following runtime parameters: |
| 13 | + |
| 14 | +* ``unit_test.small_temp`` : the low temperature cutoff used in the equation of state |
| 15 | + |
| 16 | +* ``unit_test.small_dens`` : the low density cutoff used in the equation of state |
| 17 | + |
| 18 | + |
| 19 | +.. _sec:defining_unit_test_composition: |
| 20 | + |
| 21 | +Defining composition |
| 22 | +==================== |
| 23 | + |
| 24 | +Most of the unit tests require a composition to be defined (for the |
| 25 | +initial mass-fractions, $X_k$). There are a few ways this can be done |
| 26 | +(depending on the test). |
| 27 | + |
| 28 | +* One-zone (``*_cell``) tests (see :ref:`sec:one_zone_tests`) usually do one of: |
| 29 | + |
| 30 | + * *Explicitly setting the individual mass fractions.* This is |
| 31 | + controlled by the parameters ``unit_test.X1``, ``unit_test.X2``, ..., ``unit_test.X35``, |
| 32 | + e.g.: |
| 33 | + |
| 34 | + :: |
| 35 | + |
| 36 | + unit_test.X1 = 0.5 |
| 37 | + unit_test.X2 = 0.2 |
| 38 | + unit_test.X3 = 0.2 |
| 39 | + unit_test.X4 = 0.1 |
| 40 | + |
| 41 | + While many of the tests will renormalize the abundances, the user |
| 42 | + should take care to ensure that the mass fractions sum to unity. |
| 43 | + |
| 44 | + * *Setting the composition to be uniform.* This is controlled by |
| 45 | + ``unit_test.uniform_xn``. If this is set to ``1``, then each mass fraction |
| 46 | + is initialized to ``1 / NumSpec``. |
| 47 | + |
| 48 | +* Comprehensive tests (see :ref:`sec:comprehensive_tests`) need many different compositions, since they are creating a cube |
| 49 | + of varying thermodynamic properties, and thus require a prescription |
| 50 | + to create the composition. This is done by setting ``unit_test.primary_species_1``, |
| 51 | + ``unit_test.primary_species_2``, and ``unit_test.primary_species_3`` to one of the |
| 52 | + *names* of the species in the network. |
| 53 | + |
| 54 | + The function ``setup_composition()`` is then used to set limits on |
| 55 | + the species abundances (it takes a parameter which is the index into |
| 56 | + the cube of data that is being initialized) which is then used by |
| 57 | + ``get_xn()`` to create the individual mass fractions. Both of these |
| 58 | + routines are contained in ``react_util.H``. |
0 commit comments