3.1 Creating a Config file

The Config file for this example serves two principal purposes; (1) to specify the required units and (2) to register runtime parameters.  

# configuration file for our example problem
REQUIRES Driver
REQUIRES physics/Eos/EosMain/Gamma
REQUIRES physics/Hydro
The lines above define the FLASH units required by the Sod problem. Note that we do not ask for particular implementations of the Hydro unit, since for this problem many implementations will satisfy the requirements. However, we do ask for the gamma-law equation of state (physics/Eos/EosMain/Gamma) specifically, since that implementation is the only valid option for this problem. In FLASH4-alpha, the PARAMESH 4 Grid implementation is passed to Driver by default. As such, there is no need to specify a Grid unit explicitly, unless a simulation requires an alternative Grid implementation. Also important to note is that we have not explicitly required IO, which is included by default. In constructing the list of requirements for a problem, it is important to keep them as general as the problem allows. We recommend asking for specific implementations of units as command line options or in the Units file when the problem is being setup, to avoid the necessity of modifying the Config files. For example, if there was more than one implementation of Hydro that could handle the shocks, any of them could be picked at setup time without having to modify the Config file. However, to change the Eos to an implementation other than Gamma, the Config file would have to be modified. For command-line options of the setup script and the description of the Units file see Chp:The FLASH configuration script.

After specifying the units, the Config file lists the runtime parameters specific to this problem. The names of runtime parameters are case-insensitive. Note that no unit is constrained to use only the parameters defined in its own Config file. It can legitimately access any runtime parameter registered by any unit included in the simulation.  

PARAMETER sim_rhoLeft   REAL    1.       [0 to ]
PARAMETER sim_rhoRight  REAL    0.125    [0 to ]
PARAMETER sim_pLeft     REAL    1.       [0 to ]
PARAMETER sim_pRight    REAL    0.1      [0 to ]
PARAMETER sim_uLeft     REAL    0.
PARAMETER sim_uRight    REAL    0.
PARAMETER sim_xangle    REAL    0.       [0 to 360]
PARAMETER sim_yangle    REAL    90.      [0 to 360]
PARAMETER sim_posn      REAL    0.5

Here we define (sim_rhoLeft), (sim_pLeft) and (sim_uLeft) as density, pressure and velocity to the left of the discontinuity, and (sim_rhoRight), (sim_pRight) and (sim_uRight) as density, pressure and velocity to the right of the discontinuity. The parameters (sim_xangle) and (sim_yangle) give the angles with respect to the $ x$ and $ y$ axes, and (sim_posn) specifies the intersection between the shock plane and $ x$ axis. The quantities in square brackets define the permissible range of values for the parameters. The default value of any parameter (like sim_xangle) can be overridden at runtime by including a line (i.e. sim_xangle = 45.0) defining a different value for it in the flash.par file.