Next:
0. License
Contents
Index
FLASH User's Guide
Version 4.8
May 2024 (last updated May 6, 2024)
Flash Center for Computational Science
University of Rochester
0
. License
0
.
1
Acknowledgments in Publication
0
.
2
Full License Agreement
Contents
1
. Introduction
1
.
1
What's New in FLASH4
1
.
2
External Contributions
1
.
3
Known Issues in This Release
1
.
4
About the User's Guide
I
. Getting Started
2
. Quick Start
2
.
1
System requirements
2
.
2
Unpacking and configuring FLASH for quick start
2
.
3
Alternative Configuration With a Docker Image
2
.
4
Running FLASH
3
. Setting Up New Problems
3
.
1
Creating a
Config
file
3
.
2
Creating a
Makefile
3
.
3
Creating a
Simulation_data.F90
3
.
4
Creating a
Simulation_init.F90
3
.
5
Creating a
Simulation_initBlock.F90
3
.
6
Creating a
Simulation_freeUserArrays.F90
3
.
7
The runtime parameter file (
flash.par
)
3
.
8
Running your simulation
II
. The FLASH Software System
4
. Overview of FLASH architecture
4
.
1
FLASH Inheritance
4
.
2
Unit Architecture
4
.
2
.
1
Stub Implementations
4
.
2
.
2
Subunits
4
.
2
.
3
Unit Data Modules,
_init
, and
_finalize
routines
4
.
2
.
4
Private Routines: kernels and helpers
4
.
3
Unit Test Framework
5
. The FLASH configuration script (
setup
)
5
.
1
Setup Arguments
5
.
2
Comprehensive List of Setup Arguments
5
.
3
Using Shortcuts
5
.
4
Setup Variables and Preprocessing
Config
Files
5
.
5
Config
Files
5
.
5
.
1
Configuration file syntax
5
.
5
.
2
Configuration directives
5
.
6
Creating a Site-specific
Makefile
5
.
7
Files Created During the
setup
Process
5
.
7
.
1
Informational files
5
.
7
.
2
Code generated by the
setup
call
5
.
7
.
3
Makefiles generated by
setup
5
.
8
Setup a hybrid MPI+OpenMP FLASH application
5
.
9
Setup a FLASH+Chombo application
5
.
9
.
1
Overview
5
.
9
.
2
Build procedure
5
.
10
Setup a FLASH application with cmake
6
. The
Flash.h
file
6
.
1
UNK
,
FACE(XYZ)
Dimensions
6
.
2
Property Variables, Species and Mass Scalars
6
.
3
Fluxes
6
.
4
Scratch Vars
6
.
5
Fluid Variables Example
6
.
6
Particles
6
.
6
.
1
Particles Types
6
.
6
.
2
Particles Properties
6
.
7
Non-Replicated Variable Arrays
6
.
7
.
1
Per-Array Macros
6
.
7
.
2
Array Partitioning Macros
6
.
7
.
3
Example
6
.
8
Other Preprocessor Symbols
III
. Driver Unit
7
. Driver Unit
7
.
1
Driver Routines
7
.
1
.
1
Driver_initFlash
7
.
1
.
2
Driver_evolveFlash
7
.
1
.
3
Driver_finalizeFlash
7
.
1
.
4
Driver accessor functions
7
.
1
.
5
Time Step Limiting
IV
. Infrastructure Units
8
. Grid Unit
8
.
1
Overview
8
.
2
GridMain
Data Structures
8
.
3
Computational Domain
8
.
4
Boundary Conditions
8
.
4
.
1
Boundary Condition Types
8
.
4
.
2
Boundary Conditions at Obstacles
8
.
4
.
3
Implementing Boundary Conditions
8
.
5
Uniform Grid
8
.
5
.
1
FIXEDBLOCKSIZE Mode
8
.
5
.
2
NONFIXEDBLOCKSIZE mode
8
.
6
Adaptive Mesh Refinement (AMR) Grid with Paramesh
8
.
6
.
1
Additional Data Structures
8
.
6
.
2
Grid Interpolation
8
.
6
.
3
Refinement
8
.
7
Chombo
8
.
7
.
1
Using Chombo in a UG configuration
8
.
7
.
2
Using Chombo in an AMR configuration
8
.
8
GridMain Usage
8
.
9
GridParticles
8
.
9
.
1
GridParticlesMove
8
.
9
.
2
GridParticlesMapToMesh
8
.
10
GridSolvers
8
.
10
.
1
Pfft
8
.
10
.
2
Poisson equation
8
.
10
.
3
Using the Poisson solvers
8
.
10
.
4
HYPRE
8
.
11
Grid Geometry
8
.
11
.
1
Understanding 1D, 2D, Curvilinear
8
.
11
.
2
Choosing a Geometry
8
.
11
.
3
Geometry Information in Code
8
.
11
.
4
Available Geometries
8
.
11
.
5
Conservative Prolongation/Restriction on Non-Cartesian Grids
8
.
12
Unit Test
9
. IO Unit
9
.
1
IO Implementations
9
.
2
Output Files
9
.
2
.
1
Checkpoint files - Restarting a Simulation
9
.
2
.
2
Plotfiles
9
.
2
.
3
Particle files
9
.
2
.
4
Integrated Grid Quantities - flash.dat
9
.
2
.
5
General Runtime Parameters
9
.
3
Restarts and Runtime Parameters
9
.
4
Output Scalars
9
.
5
Output User-defined Arrays
9
.
6
Output Scratch Variables
9
.
7
Face-Centered Data
9
.
8
Output Filenames
9
.
9
Output Formats
9
.
9
.
1
HDF5
9
.
9
.
2
Parallel-NetCDF
9
.
9
.
3
Direct IO
9
.
9
.
4
Output Side Effects
9
.
10
Working with Output Files
9
.
11
Unit Test
9
.
12
Chombo
9
.
13
Derived data type I/O
10
. Runtime Parameters Unit
10
.
1
Defining Runtime Parameters
10
.
2
Identifying Valid Runtime Parameters
10
.
3
Routine Descriptions
10
.
4
Example Usage
11
. Multispecies Unit
11
.
1
Defining Species
11
.
2
Initializing Species Information in
Simulation_initSpecies
11
.
3
Specifying Constituent Elements of a Species
11
.
4
Alternative Method for Defining Species
11
.
5
Routine Descriptions
11
.
6
Example Usage
11
.
7
Unit Test
12
. Physical Constants Unit
12
.
1
Available Constants and Units
12
.
2
Applicable Runtime Parameters
12
.
3
Routine Descriptions
12
.
4
Unit Test
13
. Cpp & Python units
13
.
1
Cpp
13
.
2
Python
13
.
2
.
1
Setup Generated Files
V
. Physics Units
14
. 3T Capabilities for Simulation of HEDP Experiments
15
. Hydrodynamics Units
15
.
1
Gas hydrodynamics
15
.
1
.
1
Usage
15
.
1
.
2
The piecewise-parabolic method (PPM)
15
.
1
.
3
The unsplit hydro solver
15
.
1
.
4
The Volume-of-Fluid Solver
15
.
1
.
5
Multitemperature extension for Hydro
15
.
1
.
6
Chombo compatible Hydro
15
.
2
Relativistic hydrodynamics (RHD)
15
.
2
.
1
Overview
15
.
2
.
2
Equations
15
.
2
.
3
Relativistic Equation of State
15
.
2
.
4
Additional Runtime Parameter
15
.
3
Magnetohydrodynamics (MHD)
15
.
3
.
1
Description
15
.
3
.
2
Usage
15
.
3
.
3
Algorithm: The Unsplit Staggered Mesh Solver
15
.
3
.
4
Algorithm: The Eight-wave Solver
15
.
3
.
5
Extended MHD
15
.
4
Radiation-Flux-Limiter Aware Hydrodynamics
16
. Incompressible Navier-Stokes Unit
17
. Equation of State Unit
17
.
1
Introduction
17
.
2
Gamma Law and Multigamma
17
.
2
.
1
Ideal Gamma Law for Relativistic Hydrodynamics
17
.
3
Helmholtz
17
.
4
Multitemperature extension for Eos
17
.
4
.
1
Gamma
17
.
4
.
2
Multigamma
17
.
4
.
3
Tabulated
17
.
4
.
4
Multitype
17
.
5
MultiFluid
17
.
6
Usage
17
.
6
.
1
Initialization
17
.
6
.
2
Runtime Parameters
17
.
6
.
3
Direct and Wrapped Calls
17
.
7
Unit Test
18
. Local Source Terms
18
.
1
Burn Unit
18
.
1
.
1
Algorithms
18
.
1
.
2
Reaction networks
18
.
1
.
3
Detecting shocks
18
.
1
.
4
Energy generation rates and reaction rates
18
.
1
.
5
Temperature-based timestep limiting
18
.
2
Ionization Unit
18
.
2
.
1
Algorithms
18
.
2
.
2
Usage
18
.
3
Stir Unit
18
.
3
.
1
Stir Unit: Generate Implementation
18
.
3
.
2
Stir Unit: FromFile Implementation
18
.
3
.
3
Using the StirFromFile Unit
18
.
3
.
4
Stirring Unit Test
18
.
4
Energy Deposition Unit
18
.
4
.
1
Ray Tracing in the Geometric Optics Limit
18
.
4
.
2
Laser Power Deposition
18
.
4
.
3
Laser Energy Density
18
.
4
.
4
Algorithmic Implementations of the Ray Tracing
18
.
4
.
5
Setting up the Laser Pulse
18
.
4
.
6
Setting up the Laser Beam
18
.
4
.
7
Setting up the Rays
18
.
4
.
8
3D Laser Ray Tracing in 2D Cylindrical Symmetry
18
.
4
.
9
Ray Tracing in 3D Cylindrical Domains
18
.
4
.
10
Synchronous and Asynchronous Ray Tracing
18
.
4
.
11
Usage
18
.
4
.
12
Unit Tests for 3D/2D Cartesian Domain Geometries
18
.
4
.
13
Unit Tests for 3D Cylindrical Domain Geometries
18
.
5
Heatexchange
18
.
5
.
1
Spitzer Heat Exchange
18
.
5
.
2
LeeMore Heat Exchange
18
.
6
Flame
18
.
6
.
1
Reaction-Diffusion Forms
18
.
6
.
2
Unit Structure
18
.
7
Turbulence Measurement
18
.
8
Circuit
18
.
8
.
1
Constant
18
.
8
.
2
FileInput
18
.
8
.
3
McBride
18
.
8
.
4
CESZAR
19
. Diffusive Terms
19
.
1
Diffuse Unit
19
.
1
.
1
Diffuse Flux-Based implementations
19
.
1
.
2
General Implicit Diffusion Solver
19
.
1
.
3
Flux Limiters
19
.
1
.
4
Isotropic Thermal Diffusion
19
.
1
.
5
Anisotropic Thermal Diffusion
19
.
1
.
6
Magnetic Diffusion
20
. Gravity Unit
20
.
1
Introduction
20
.
2
Externally Applied Fields
20
.
2
.
1
Constant Gravitational Field
20
.
2
.
2
Plane-parallel Gravitational field
20
.
2
.
3
Gravitational Field of a Point Mass
20
.
2
.
4
User-Defined Gravitational Field
20
.
3
Self-gravity
20
.
3
.
1
Coupling Gravity with Hydrodynamics
20
.
3
.
2
Tree Gravity
20
.
4
Usage
20
.
4
.
1
Tree Gravity Unit Usage
20
.
5
Unit Tests
21
. Particles Unit
21
.
1
Time Integration
21
.
1
.
1
Active Particles (Massive)
21
.
1
.
2
Charged Particles - Hybrid PIC
21
.
1
.
3
Passive Particles
21
.
2
Mesh/Particle Mapping
21
.
2
.
1
Quadratic Mesh Mapping
21
.
2
.
2
Cloud in Cell Mapping
21
.
3
Using the Particles Unit
21
.
3
.
1
Particles Runtime Parameters
21
.
3
.
2
Particle Attributes
21
.
3
.
3
Particle I/O
21
.
3
.
4
Unit Tests
21
.
4
Sink Particles
21
.
4
.
1
Basics of Sink Particles
21
.
4
.
2
Using the Sink Particle Unit
21
.
4
.
3
The Sink Particle Method
21
.
4
.
4
Sink Particle Unit Test
22
. Cosmology Unit
22
.
1
Algorithms and Equations
22
.
2
Using the Cosmology unit
22
.
3
Unit Test
23
. Material Properties Units
23
.
1
Thermal Conductivity
23
.
1
.
1
Anisotropic Thermal Conductivity
23
.
2
Magnetic Resistivity
23
.
2
.
1
Constant resistivity
23
.
2
.
2
Spitzer HighZ resistivity
23
.
2
.
3
DaviesWen resistivity
23
.
2
.
4
Vacuum resistivity
23
.
3
Viscosity
23
.
3
.
1
Constant Viscosity
23
.
3
.
2
Spitzer Viscosity
23
.
4
Thermoelectric Coefficients
23
.
4
.
1
Constant thermoelectric coefficients
23
.
4
.
2
DaviesWen thermoelectric coefficients
23
.
5
Opacity
23
.
5
.
1
Constant Implementation
23
.
5
.
2
Constcm2g Implementation
23
.
5
.
3
BremsstrahlungAndThomson Implementation
23
.
5
.
4
OPAL Implementation
23
.
5
.
5
Multispecies Implementation
23
.
5
.
6
The IONMIX EOS/Opacity Format
23
.
6
Mass Diffusivity
24
. Physics Utilities
24
.
1
PlasmaState
25
. Radiative Transfer Unit
25
.
1
Multigroup Diffusion
25
.
1
.
1
Using Multigroup Radiation Diffusion
25
.
1
.
2
Using Mesh Replication with MGD
25
.
1
.
3
Specifying Initial Conditions
25
.
1
.
4
Altering the Radiation Spectrum
VI
. Monitor Units
26
. Logfile Unit
26
.
1
Meta Data
26
.
2
Runtime Parameters, Physical Constants, and Multispecies Data
26
.
3
Accessor Functions and Timestep Data
26
.
4
Performance Data
26
.
5
Example Usage
27
. Timer and Profiler Units
27
.
1
Timers
27
.
1
.
1
MPINative
27
.
1
.
2
Tau
27
.
2
Profiler
VII
. Diagnostic Units
28
. Proton Imaging Unit
28
.
0
.
1
Proton Deflection by Lorentz Force
28
.
0
.
2
Setting up the Proton Beam
28
.
0
.
3
Creating the Protons
28
.
0
.
4
Setting up the Detector Screens
28
.
0
.
5
Time Resolved Proton Imaging
28
.
0
.
6
Usage
28
.
0
.
7
Unit Test
29
. Proton Emission Unit
29
.
0
.
1
Proton Generation
29
.
0
.
2
Proton Detector Screens
29
.
0
.
3
Proton Emission Boxes
29
.
0
.
4
Usage
30
. Thomson Scattering Unit
30
.
1
Thomson Scattering including Ray Tracing and Deflection
30
.
1
.
1
Identifying the Interaction Region
30
.
1
.
2
Assembling the Thomson Scattering Spectra
30
.
1
.
3
Usage
30
.
2
Simple Thomson Scattering without Ray Tracing
30
.
2
.
1
Ray Tracing in the Geometric Optics Limit
30
.
2
.
2
Laser Power Deposition
30
.
2
.
3
Laser Energy Density
30
.
2
.
4
Algorithmic Implementations of the Ray Tracing
30
.
2
.
5
Setting up the Probe Laser Pulse
30
.
2
.
6
Setting up the Laser Beam
30
.
2
.
7
Creating the Rays
30
.
2
.
8
Setting up the Detectors
30
.
2
.
9
Usage
30
.
2
.
10
Example Setup
31
. X-ray Imaging Unit
31
.
0
.
1
X-ray Paths through Domain
31
.
0
.
2
Creating and Tracing the X-rays
31
.
0
.
3
Setting up and Recording on the X-ray Detector Screens
31
.
0
.
4
Usage
31
.
0
.
5
Unit Test
VIII
. Numerical Tools Units
32
. Interpolate Unit
32
.
1
Introduction
32
.
2
Piecewise Cubic Interpolation
32
.
3
Usage
33
. Roots Unit
33
.
1
Introduction
33
.
2
Roots of Quadratic Polynomials
33
.
3
Roots of Cubic Polynomials
33
.
4
Roots of Quartic Polynomials
33
.
5
Usage
33
.
6
Unit Tests
33
.
6
.
1
Quadratic Polynomials Root Test
33
.
6
.
2
Cubic Polynomials Root Test
33
.
6
.
3
Quartic Polynomials Root Test
34
. RungeKutta Unit
34
.
1
Introduction
34
.
2
Runge Kutta Integration
34
.
3
Usage
34
.
4
Unit Tests
34
.
4
.
1
Runge Kutta FLASH Test for a 2D Elliptical Path
34
.
4
.
2
Runge Kutta FLASH Test for Binomial Homogeneous Higher Order ODE
IX
. Simulation Units
35
. The Supplied Test Problems
35
.
1
Hydrodynamics Test Problems
35
.
1
.
1
Sod Shock-Tube
35
.
1
.
2
Variants of the Sod Problem in Curvilinear Geometries
35
.
1
.
3
Interacting Blast-Wave
Blast2
35
.
1
.
4
Sedov Explosion
35
.
1
.
5
Isentropic Vortex
35
.
1
.
6
The double Mach reflection problem
35
.
1
.
7
Wind Tunnel With a Step
35
.
1
.
8
The Shu-Osher problem
35
.
1
.
9
Driven Turbulence
StirTurb
35
.
1
.
10
Relativistic Sod Shock-Tube
35
.
1
.
11
Relativistic Two-dimensional Riemann
35
.
1
.
12
Flow Interactions with Stationary Rigid Body
35
.
2
Magnetohydrodynamics Test Problems
35
.
2
.
1
Brio-Wu MHD Shock Tube
35
.
2
.
2
Orszag-Tang MHD Vortex
35
.
2
.
3
Magnetized Accretion Torus
35
.
2
.
4
Magnetized Noh Z-pinch
35
.
2
.
5
MHD Rotor
35
.
2
.
6
MHD Current Sheet
35
.
2
.
7
Field Loop
35
.
2
.
8
3D MHD Blast
35
.
3
Gravity Test Problems
35
.
3
.
1
Jeans Instability
35
.
3
.
2
Homologous Dust Collapse
35
.
3
.
3
Huang-Greengard Poisson Test
35
.
3
.
4
MacLaurin
35
.
4
Particles Test Problems
35
.
4
.
1
Two-particle
Orbit
35
.
4
.
2
Zel'dovich Pancake
35
.
4
.
3
Modified Huang-Greengard Poisson Test
35
.
5
Burn Test Problem
35
.
5
.
1
Cellular Nuclear Burning
35
.
6
RadTrans Test Problems
35
.
6
.
1
Infinite Medium, Energy Equilibration
35
.
6
.
2
Radiation Step Test
35
.
7
Other Test Problems
35
.
7
.
1
The non-equilibrium ionization test problem
35
.
7
.
2
The Delta-Function Heat Conduction Problem
35
.
7
.
3
The HydroStatic Test Problem
35
.
7
.
4
Hybrid-PIC Test Problems
35
.
7
.
5
Full-physics Laser Driven Simulation
35
.
7
.
6
Laser Driven Simulation with Thomson Scattering Diagnostics
35
.
7
.
7
Z-pinch Simulation
35
.
8
3T Shock Simulations
35
.
8
.
1
Shafranov Shock
35
.
8
.
2
Non-Equilibrium Radiative Shock
35
.
8
.
3
Blast Wave with Thermal Conduction
35
.
9
Matter+Radiation Simulations
35
.
9
.
1
Radiation-Inhibited Bondi Accretion
35
.
9
.
2
Radiation Blast Wave
35
.
9
.
3
1D Supernova
X
. Tools
36
. VisIt
37
. Serial FLASH Output Comparison Utility (
sfocu
)
37
.
1
Building
sfocu
37
.
2
Using
sfocu
38
. Drift
38
.
1
Introduction
38
.
2
Enabling drift
38
.
3
Typical workflow
38
.
4
Caveats and Annoyances
39
. FLASH IDL Routines (
fidlr3.0
)
39
.
1
Installing and Running
fidlr3.0
39
.
1
.
1
Setting Up
fidlr3.0
Environment Variables
39
.
1
.
2
Running IDL
39
.
2
xflash3
: A Widget Interface to Plotting FLASH Datasets
39
.
2
.
1
File Menu
39
.
2
.
2
Defaults Menu
39
.
2
.
3
Colormap Menu
39
.
2
.
4
X/Y plot count Menu
39
.
2
.
5
Plotting options available from the GUI
39
.
2
.
6
Plotting buttons
39
.
3
Comparing two datasets
40
. convertspec3d
40
.
1
Installation
40
.
2
Usage
XI
. Going Further with FLASH
41
. Adding new solvers
42
. Porting FLASH to other machines
42
.
1
Writing a
Makefile.h
43
. Multithreaded FLASH
43
.
1
Overview
43
.
2
Threading strategies
43
.
3
Running multithreaded FLASH
43
.
3
.
1
OpenMP variables
43
.
3
.
2
FLASH variables
43
.
3
.
3
FLASH constants
43
.
4
Verifying correctness
43
.
5
Performance results
43
.
5
.
1
Multipole solver
43
.
5
.
2
Helmholtz EOS
43
.
5
.
3
Sedov
43
.
5
.
4
LaserSlab
43
.
6
Conclusion
Back Matter
References
Index
About this document ...