6.2 Property Variables, Species and Mass Scalars

The unk data structure stores, in order, property variables (like density, pressure, temperature), the mass fraction of species, and mass scalars 6.1. However, in FLASH4 the user does not need to be intimately aware of the unk array layout, as starting and ending indices of these groups of quantities are defined in Flash.h. The following pre-processor symbols define the indices of the various quantities related to a given cell. These symbols are primarily used to perform some computation with all property variables, species mass fractions, or all mass scalars.

NPROP_VARS
  The number of property variables in the simulation
NSPECIES
  The total number of species in the simulation
NMASS_SCALARS
  The number of mass scalars in the simulation
NUNK_VARS
  The total number of quantities stored for each cell in the simulation. This equals NPROP_VARS + NSPECIES + NMASS_SCALARS
PROP_VARS_BEGIN,PROP_VARS_END
  The indices in the unk array used for property variable data
SPECIES_BEGIN,SPECIES_END
  The indices in the unk array used for species data
MASS_SCALARS_BEGIN,MASS_SCALARS_END
  The indices in the unk array used for mass scalars data
UNK_VARS_BEGIN,UNK_VARS_END
  The low and high indices for the unk array

The indices where specific properties (e.g., density) are stored can also be accessed via pre-processor symbols. All properties are declared in Config files and consist of 4 letters. For example, if a Config file declares a “dens” variable, its index in the unk array is available via the pre-processor symbol DENS_VAR (append _VAR to the uppercase name of the variable) which is guaranteed to be an integer. The same is true for species and mass scalars. In the case of species, the pre-processor symbol is created by appending _SPEC to the uppercase name of the species (e.g., SF6_SPEC, AIR_SPEC). Finally, for mass scalars, _MSCALAR is appended to the uppercase name of the mass scalars.

It is inadvisable to name variables, species, and mass scalars with the same prefix as post-processing routines have difficulty deciphering the type of data from the output files. For example, don't create a variable “temp" to hold temperature and a mass scalar “temp" indicating a temporary variable. Although the Flash.h file can distinguish between these two types of variables, many plotting routines such as fidlr3.0cannot.