Skip to main content

Module fdtd_fluid

Module fdtd_fluid 

Expand description

3D Staggered Acoustic Pressure-Velocity FDTD Solver (QAC Mode 0x0000).

Implements the C02/C03 contract for pressure_velocity_continuum:

  • 64-byte wire record (PressureVelocityRecord) with strict reserved-tail and finiteness gates.
  • Linear lossless and damped 3D staggered-grid leapfrog time integration on caller-owned slices.
  • Mandatory 3D Courant-Friedrichs-Lewy (CFL) stability gate before stepping: $$\Delta t , c_{\max} \sqrt{\Delta x^{-2} + \Delta y^{-2} + \Delta z^{-2}} \le 1$$
  • Explicit spatiotemporal interpolation of staggered velocity $(n-\tfrac{1}{2}, n+\tfrac{1}{2})$ and face-centered $(i\pm\tfrac{1}{2})$ to cell-center $(i,j,k,n\Delta t)$ before evaluating collocated acoustic energy density $e = \tfrac{1}{2}\rho|\mathbf{v}|^2 + \tfrac{p^2}{2K}$ and instantaneous intensity $\mathbf{I} = p\mathbf{v}$.
  • Boundary conditions: Periodic, Rigid ($\mathbf{v}\cdot\mathbf{n}=0, r=+1$), Pressure-Release ($p=0, r=-1$), first-order Engquist-Majda absorbing, and multi-layer Convolutional Perfectly Matched Layer (CPML) with bit-exact restart serialization.

Structs§

FluidFdtdConfig
Configuration for the 3D staggered-grid fluid acoustic FDTD solver.
FluidFdtdState
Complete restartable state for the 3D staggered fluid acoustic FDTD solver.
FluidMedium
Stationary homogeneous fluid medium parameters (Schema 200 subset).
PressureVelocityRecord
Mode 0x0000 (pressure_velocity_continuum) 64-byte wire record.
StaggeredFluidOffsets
Staggered component offsets in fractions of grid spacing and solver clock ticks (AQ-02).

Enums§

FluidBoundaryCondition
Boundary condition kind for the 3D fluid FDTD solver.
NumericalError
Errors raised by QAC numerical continuum and room/dispersion solvers.

Constants§

MODE_PRESSURE_VELOCITY_CONTINUUM
Canonical QAC mode identifier for pressure_velocity_continuum.
PRESSURE_VELOCITY_RECORD_STRIDE
Exact record stride in bytes for Mode 0x0000.
PV_DEFINED_VALIDITY_MASK
Mask of all defined validity bits in Mode 0x0000.
PV_VALID_ENERGY_DENSITY
Validity bit for collocated energy density energy_density_j_m3.
PV_VALID_INTENSITY
Validity bit for collocated acoustic intensity intensity_w_m2.
PV_VALID_POSITION
Validity bit flags for PressureVelocityRecord.
PV_VALID_PRESSURE
Validity bit for acoustic pressure perturbation pressure_pa.
PV_VALID_VELOCITY
Validity bit for particle velocity vector particle_velocity_m_s.

Functions§

collocate_fluid_cell
Interpolate staggered velocities in space and time to cell center (ix, iy, iz) at step $n$.
evaluate_direct_energy_and_intensity
Evaluate collocated energy density and intensity only when the offsets are collocated; rejects direct multiplication of staggered fields without interpolation (C02 Mode 00).
step_fluid_fdtd_in_place
Advance the 3D staggered-grid fluid FDTD state by one full leapfrog step $\Delta t$ with zero heap allocations on the hot path.