16.7 Unit Test

The unit test of the Eos function can exercise all three implementations. Because the Gamma law allows only one species, the setup required for the three implementations is specific. To invoke any three-dimensional Eos unit test, the command is:

./setup unitTest/Eos/implementation -auto -3d
where implementation is one of Gamma, Multigamma, Helmholtz. The Eos unit test works on the assumption that if the four physical variables in question (density, pressure, energy and temperature) are in thermal equilibrium with one another, then applying the equation of state to any two of them should leave the other two completely unchanged. Hence, if we initialize density and temperature with some arbitrary values, and apply the equation of state to them in MODE_DENS_TEMP, then we should get pressure and energy values that are thermodynamically consistent with density and temperature. Now after saving the original temperature value, we apply the equation of state to density and newly calculated pressure. The new value of the temperature should be identical to the saved original value. This verifies that the Eos unit is computing correctly in MODE_DENS_PRES mode. By repeating this process for the remaining two modes, we can say with great confidence that the Eos unit is functioning normally.

In our implementation of the Eos unit test, the initial conditions applied to the domain create a gradient for density along the $ x$ axis and gradients for temperature and pressure along the $ y$ axis. If the test is being run for the Multigamma or Helmholtz implementations, then the species are initialized to have gradients along the $ z$ axis.