|
MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
|
Wall losses of a duct as friction and viscosity on the volume velocity. More...
#include "DuctGrid.hpp"Go to the source code of this file.
Classes | |
| class | MayaFlux::Kinesis::Acoustics::DuctLoss |
| Prepared implicit loss step for one duct grid. More... | |
Namespaces | |
| namespace | MayaFlux |
| Main namespace for the Maya Flux audio engine. | |
| namespace | MayaFlux::Kinesis |
| namespace | MayaFlux::Kinesis::Acoustics |
Functions | |
| double | MayaFlux::Kinesis::Acoustics::viscothermal_attenuation (double radius, double frequency, double sound_speed=343.0, double air_density=1.2) noexcept |
| Plane wave attenuation of a circular tube from its wall boundary layers. | |
| std::pair< double, double > | MayaFlux::Kinesis::Acoustics::viscothermal_rates (double radius, double sound_speed=343.0, double air_density=1.2, double low_frequency=150.0, double high_frequency=3000.0) noexcept |
| Friction and viscosity that match the tube's attenuation at two frequencies. | |
Wall losses of a duct as friction and viscosity on the volume velocity.
A lossless duct rings forever and keeps every harmonic, which sounds bright, buzzy and saturated. In a real tube the walls take energy from the flow in a boundary layer a fraction of a millimetre thick, and they take more from high frequencies than from low ones. Two terms in the momentum equation stand for that:
du/dt = ... - friction u + viscosity d2u/dx2
Friction takes the same fraction of every frequency. Viscosity takes more of the shorter waves: a plane wave of frequency f loses amplitude at rate alpha = friction / (2 c) + viscosity (2 pi f)^2 / (2 c^3) per metre. Between them they can follow the measured loss of a tube over the range that matters, and viscothermal_rates fits the two to the Kirchhoff attenuation at a low and a high frequency. The true loss grows as the square root of the frequency, so this is a fit and not the law; a passive fractional model of the square root is the later refinement.
The step is implicit: the velocity after the wave update is replaced by the solution of a tridiagonal system, weighted by each section's inertance, so the step cannot add energy and is stable for any coefficients.
Definition in file DuctLoss.hpp.