rill_core_model/cavity/
params.rs1use rill_core::Transcendental;
2
3#[derive(Debug, Clone)]
5pub struct HelmholtzParams<T: Transcendental> {
6 pub volume: T,
8 pub neck_area: T,
10 pub neck_length: T,
12 pub sound_speed: T,
14 pub radiation_loss: T,
16 pub viscous_loss: T,
18 pub excitation: u8,
20 pub pressure: T,
22}
23
24impl<T: Transcendental> Default for HelmholtzParams<T> {
25 fn default() -> Self {
26 Self {
27 volume: T::from_f64(0.001),
28 neck_area: T::from_f64(0.0001),
29 neck_length: T::from_f64(0.02),
30 sound_speed: T::from_f64(343.0),
31 radiation_loss: T::from_f64(0.01),
32 viscous_loss: T::from_f64(0.005),
33 excitation: 0,
34 pressure: T::ZERO,
35 }
36 }
37}
38
39#[derive(Debug, Clone)]
41pub struct CavityArrayParams<T: Transcendental> {
42 pub num_cavities: usize,
44 pub cavity_params: HelmholtzParams<T>,
46 pub coupling: T,
48 pub input_index: usize,
50 pub output_index: usize,
52}
53
54impl<T: Transcendental> Default for CavityArrayParams<T> {
55 fn default() -> Self {
56 Self {
57 num_cavities: 4,
58 cavity_params: HelmholtzParams::default(),
59 coupling: T::from_f64(0.1),
60 input_index: 0,
61 output_index: 3,
62 }
63 }
64}