47 const double lambda = 0.5 * (d1 - n1);
48 const double gamma = 2.0 * lambda * lambda / (lambda * (d1 + n1) - d2) - 1.0;
49 const double theta = (0.5 * (d1 + n1) * (1.0 + gamma) - lambda) / gamma;
50 return { gamma, lambda, theta };
102 const RadiationSpec& spec,
double end_area,
double end_pressure_gain)
noexcept;
117 double upstream_flow)
noexcept
119 const double mean = (end_pressure
120 + coefficients.end_half_gain
121 * (upstream_flow - state.inductor_flow
122 + coefficients.memory_conductance * state.branch_pressure))
123 * coefficients.reciprocal;
125 const double flow = state.inductor_flow
126 - coefficients.memory_conductance * state.branch_pressure
127 + coefficients.conductance * mean;
129 const double branch_mean = coefficients.branch_weight * mean
130 + coefficients.branch_memory * state.branch_pressure;
132 state.inductor_flow += coefficients.inductor_gain * mean;
133 state.branch_pressure = 2.0 * branch_mean - state.branch_pressure;
135 return { 2.0 * mean - end_pressure, flow };
149 double flow,
double previous_flow,
double time_step,
double air_density,
double distance = 1.0) noexcept
151 return air_density / (4.0 * std::numbers::pi *
distance) * (flow - previous_flow) / time_step;
constexpr RadiationModel flanged_radiation
Pipe in an infinite flange, end correction 0.8216 a.
std::optional< RadiationCoefficients > make_radiation_coefficients(const RadiationSpec &spec, double end_area, double end_pressure_gain) noexcept
Prepare the coefficients of a radiating end.
std::array< double, 3 > RadiationModel
The three dimensionless constants of the radiation network, as gamma, lambda and theta.
constexpr RadiationModel radiation_model_from_pade(double n1, double d1, double d2) noexcept
Network constants from the numerator and denominator of the Pade reflection coefficient R = -(1 - n1 ...
constexpr RadiationModel unflanged_radiation
Unflanged circular pipe, end correction 0.6133 a.
constexpr double radiated_pressure(double flow, double previous_flow, double time_step, double air_density, double distance=1.0) noexcept
Pressure radiated into free space by a flow out of the end.
std::pair< double, double > radiation_step(const RadiationCoefficients &coefficients, RadiationState &state, double end_pressure, double upstream_flow) noexcept
Advance the end cell and the load one sample.
SpatialField distance(const glm::vec3 &anchor, float radius, DistanceMetric metric=DistanceMetric::EUCLIDEAN)
Normalized distance from an anchor point using the specified metric.
double memory_conductance
Prepared coefficients of one end, built once per bore or step change.
What the network constants are scaled by.
Inductor flow and branch pressure, zero at rest.