5.1. exec/hydro – incompressible fluctuating hydrodynamics
- Purpose
Solves the incompressible fluctuating Navier–Stokes (or, in the overdamped limit, Stokes) equations on a staggered grid. It is the simplest FHDeX application and the best one to start with.
- Libraries
src_hydro,src_gmres,src_rng,src_analysis,src_common;src_multispecis also compiled in.- Algorithm
Each time step is a predictor–corrector scheme. Viscous terms are treated semi-implicitly (Crank–Nicolson) and advection is treated explicitly with a trapezoidal correction. Both stages solve a Stokes saddle-point system for velocity and pressure with preconditioned GMRES from
src_gmres.algorithm_type = 0selects the inertial scheme; other values select the overdamped (Stokes) limit, in which the deterministic case needs only a single solve per step. Thermal fluctuations enter through the stochastic momentum flux (StochMomFlux), scaled byvariance_coef_mom.- Key parameters
Parameter
Meaning
prob_typeInitial condition: 0 = fluid at rest, 1 = vortex, 2 and 3 = Kelvin–Helmholtz (sine / smooth); see
exec/hydro/Init.cpp.visc_coef,visc_typeViscosity and form of the viscous operator (1 = \(\nabla\cdot\beta\nabla\), 2 = symmetric, 3 = symmetric with bulk viscosity; negative values allow spatially varying coefficients).
variance_coef_mom,initial_variance_momAmplitude of the stochastic momentum flux and of the initial velocity fluctuations (0 = deterministic).
k_B,T_initBoltzmann constant and temperature, which set the noise strength.
bc_vel_lo/hiVelocity boundary conditions per direction: -1 periodic, 1 slip, 2 no-slip.
struct_fact_int,n_steps_skipAccumulate structure factors every
struct_fact_intsteps after skippingn_steps_skipsteps of equilibration.gmres_*,stag_mg_*,mg_*Linear solver controls (gmres).
- Example inputs
inputs_regression_vortex_2d/3d(deterministic vortex),inputs_regression_equil_2d/3dandinputs_incomp_equil_fluct_*(equilibrium fluctuations),inputs_shearwall_*(shear flow),inputs_turbtest_*(forced turbulence).- Convergence tests
run_convergence_tests.shruns coarse, medium and fine versions ofinputs_dtrmnistic_convergence_*d, andcompute_convergence_rate.shcompares them with the AMReX toolDiffSameDomainRefinedStag. The procedure is described inexec/hydro/README.CONVERGENCE.