Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Example: Focused Ultrasound Water Tank

Crate: kwavers
Run: cargo run -p kwavers --example focused_ultrasound_water_tank
Source: crates/kwavers/examples/focused_ultrasound_water_tank.rs

What This Example Demonstrates

Multi-solver comparison of focused ultrasound in a homogeneous water tank. Four solvers (FDTD+CPML, PSTD+CPML, DG-2D, DG-3D) are driven with the same phased line aperture and compared against the analytical O’Neil pressure field.

SolverMethodReference
FDTD+CPMLStaggered-grid finite differences + CPML absorberYee (1966)
PSTD+CPMLk-space pseudospectral + CPMLTreeby & Cox (2010)
DG-2DNodal discontinuous Galerkin, 2DHesthaven & Warburton (2008)
DG-3DNodal DG, tensor-product 3DCockburn & Shu (2001)

Outputs

  • target/focused_water_tank/focused_water_tank.png — peak-pressure maps
  • target/focused_water_tank/focused_water_tank_metrics.csv — solver accuracy metrics
  • target/focused_water_tank/focused_water_tank_profiles.csv — axial pressure profiles

Key Code Snippet

use kwavers_transducer::PhasedArrayTransducer;

// Drive a 16-element phased array with analytical focus delays
let transducer = PhasedArrayTransducer::builder()
    .elements(16)
    .element_pitch(0.5e-3)   // λ/2 at 1.5 MHz in water
    .focus_point([0.0, 0.0, 30e-3]) // 30 mm focal depth
    .build()?;

Book Chapter

← Sources and Transducers