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§
- Fluid
Fdtd Config - Configuration for the 3D staggered-grid fluid acoustic FDTD solver.
- Fluid
Fdtd State - Complete restartable state for the 3D staggered fluid acoustic FDTD solver.
- Fluid
Medium - Stationary homogeneous fluid medium parameters (Schema 200 subset).
- Pressure
Velocity Record - Mode
0x0000(pressure_velocity_continuum) 64-byte wire record. - Staggered
Fluid Offsets - Staggered component offsets in fractions of grid spacing and solver clock ticks (AQ-02).
Enums§
- Fluid
Boundary Condition - Boundary condition kind for the 3D fluid FDTD solver.
- Numerical
Error - 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.