5.3. exec/compressible_stag – compressible staggered-grid FHD
- Purpose
Solves the compressible fluctuating Navier–Stokes equations for an ideal-gas mixture of up to
MAX_SPECspecies, with momentum on the staggered grid. Optional features are bulk chemistry (src_chemistry), mean-field surface chemistry (src_MFsurfchem), particle reservoirs, membranes and turbulence forcing.- Libraries
src_compressible_stag(which providesmain_driver),src_compressible,src_chemistry,src_MFsurfchem,src_rng,src_analysis,src_common.- Build options
MAX_SPEC(default 8) andMAX_REAC(default 5) bound the number of species and reactions.DO_TURB = TRUEcompiles in turbulence forcing. The scriptsbuild_perlmutter.shandbuild_frontier.shshow GPU builds on NERSC Perlmutter (CUDA) and OLCF Frontier (HIP).- Algorithm
Explicit three-stage Runge–Kutta time stepping (
RK3stepStagintimeStepStag.cpp). The state is stored as conserved variablescu(density, momentum, total energy, species densities) and derived primitive variablesprim. The driver checks thatnvars = AMREX_SPACEDIM + 2 + nspecies, andnprimvars = AMREX_SPACEDIM + 3 + 2*nspecies
and aborts otherwise. Both must therefore be set consistently in the inputs file (e.g.
nvars = 9,nprimvars = 14for four species in 3D), together withngc = 2 2 2ghost cells.- Key parameters
Parameter
Meaning
prob_typeInitial condition, e.g. 1 = constant concentration, 2 = Rayleigh–Taylor, 3 = diffusion barrier. Further cases (4, 5 and 100–111) are defined in
src_compressible_stag.algorithm_type1 = single component, 2 = multispecies.
visc_type1 = non-symmetric, 2 = symmetric, 3 = symmetric with bulk viscosity (1D/2D runs require 1 or 2).
advection_type1 = interpolate primitive, 2 = interpolate conserved quantities.
nspecies,molmass,diameter,dof,hcv,hcpSpecies properties (CGS units in the examples).
k_B,Runiv,T_init,rho0Physical constants and initial state.
bc_vel_lo/hi,bc_mass_lo/hi,bc_therm_lo/hiVelocity (-1 periodic, 1 slip, 2 no-slip), mass (1 wall, 2 concentration, 3 reservoir) and thermal (1 adiabatic, 2 isothermal with
t_lo/hi) boundary conditions. Periodic velocity forces all boundary conditions in that direction to be periodic.transport_typeTransport-coefficient model (1 = Giovangigli, the default); see compressible.
plot_means,plot_vars,plot_covars,plot_cross,cross_cellStatistics written to plotfiles.
- Example inputs
inputs_regression_*cover periodic, slip/adiabatic, temperature gradient, concentration and reservoir boundaries in 1D and 3D. Thetest_*subdirectories contain chemistry and surface-chemistry test cases.