17.1 Introduction

The Eos unit implements the equation of state needed by the hydrodynamics and nuclear burning solvers. The function Eos provides the interface for operating on a one-dimensional vector. The same interface can be used for a single cell by reducing the vector size to 1. Additionally, this function can be used to find the thermodynamic quantities either from the density, temperature, and composition or from the density, internal energy, and composition. For user's convenience, a wrapper function (Eos_wrapped) is provided, which takes a section of a block and translates it into the data format required by the Eos function, then calls the function. Upon return from the Eos function, the wrapper translates the returned data back to the same section of the block.

Four implementations of the (Eos) unit are available in the current release of FLASH4: Gamma, which implements a perfect-gas equation of state; Gamma/RHD, which implements a perfect-gas equation taking relativistic effects into account; Multigamma, which implements a perfect-gas equation of state with multiple fluids, each of which can have its own adiabatic index ($ \gamma$); and Helmholtz, which uses a fast Helmholtz free-energy table interpolation to handle degenerate/relativistic electrons/positrons and includes radiation pressure and ions (via the perfect gas approximation).

As described in previous sections, FLASH evolves the Euler equations for compressible, inviscid flow. This system of equations must be closed by an additional equation that provides a relation between the thermodynamic quantities of the gas. This relationship is known as the equation of state for the material, and its structure and properties depend on the composition of the gas.

It is common to call an equation of state (henceforth EOS) routine more than $ 10^9$ times during a two-dimensional simulation and more than $ 10^{11}$ times during the course of a three-dimensional simulation of stellar phenomena. Thus, it is very desirable to have an EOS that is as efficient as possible, yet accurately represents the relevant physics. While FLASH is capable of using any general equation of state, we discuss here the three equation of state routines that are supplied: an ideal-gas or gamma-law EOS, an EOS for a fluid composed of multiple gamma-law gases, and a tabular Helmholtz free energy EOS appropriate for stellar interiors. The two gamma-law EOSs consist of simple analytic expressions that make for a very fast EOS routine both in the case of a single gas or for a mixture of gases. The Helmholtz EOS includes much more physics and relies on a table look-up scheme for performance.