use rill_core::Transcendental;
#[derive(Debug, Clone)]
pub struct HelmholtzParams<T: Transcendental> {
pub volume: T,
pub neck_area: T,
pub neck_length: T,
pub sound_speed: T,
pub radiation_loss: T,
pub viscous_loss: T,
pub excitation: u8,
pub pressure: T,
}
impl<T: Transcendental> Default for HelmholtzParams<T> {
fn default() -> Self {
Self {
volume: T::from_f64(0.001),
neck_area: T::from_f64(0.0001),
neck_length: T::from_f64(0.02),
sound_speed: T::from_f64(343.0),
radiation_loss: T::from_f64(0.01),
viscous_loss: T::from_f64(0.005),
excitation: 0,
pressure: T::ZERO,
}
}
}
#[derive(Debug, Clone)]
pub struct CavityArrayParams<T: Transcendental> {
pub num_cavities: usize,
pub cavity_params: HelmholtzParams<T>,
pub coupling: T,
pub input_index: usize,
pub output_index: usize,
}
impl<T: Transcendental> Default for CavityArrayParams<T> {
fn default() -> Self {
Self {
num_cavities: 4,
cavity_params: HelmholtzParams::default(),
coupling: T::from_f64(0.1),
input_index: 0,
output_index: 3,
}
}
}