feat(aero): Mach from stagnation pressure ratio (pitot-static)#416
Merged
Conversation
Add report::mach_from_stagnation_pressure_ratio(p0_over_p, gamma), the Mach number recovered from a measured total-to-static pressure ratio: M = sqrt(2*((p0/p)^((gamma-1)/gamma) - 1)/(gamma - 1)) the inverse of isentropic_stagnation_pressure_ratio -- the SUBSONIC pitot-static (Rayleigh-pitot) airspeed reduction, the most common compressible airspeed measurement. Mirrors the #403 temperature-ratio inverse's sentinel style: returns the at-rest 0.0 (the inverse of the ratio's 1.0 no-rise identity) for non-physical input (non-finite, p0/p < 1, or gamma <= 1). Analytic test mach_from_stagnation_pressure_ratio_inverts_the_ratio: (a) round-trip threading isentropic_stagnation_pressure_ratio (both directions); (b) worked: at M=1, gamma=1.4 the critical ratio p0/p = 1.2^3.5 -> M=1; (c) consistency with the temperature-ratio inverse (#403): for the same Mach, the pressure-ratio and temperature-ratio reductions agree; (d) at rest: p0/p = 1 -> M = 0; (e) 0-sentinel guard for p0/p < 1, gamma <= 1, non-finite. Free fn in report.rs (not re-exported), no lib.rs change. valenx-aero 213 lib tests (was 212), cargo clippy --all-targets -D warnings clean.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
report::mach_from_stagnation_pressure_ratio(p0_over_p, gamma)— the Mach number recovered from a measured total-to-static pressure ratio:Why
report.rshas the #403 temperature-ratio inverse but not the pressure-ratio one.mach_from_stagnation_pressure_ratioinvertsisentropic_stagnation_pressure_ratio— the subsonic pitot-static (Rayleigh-pitot) airspeed reduction, the most common compressible airspeed measurement (Mach from a measured total-to-static pressure ratio). Mirrors the #403 sentinel style: returns the at-rest0.0(inverse of the ratio's1.0no-rise identity) for non-physical input (non-finite,p0/p < 1, orgamma <= 1).Test
mach_from_stagnation_pressure_ratio_inverts_the_ratio:isentropic_stagnation_pressure_ratio(both directions);M=1, gamma=1.4the critical ratiop0/p = 1.2^3.5 -> M=1;p0/p = 1 -> M = 0;0-sentinel forp0/p < 1,gamma <= 1, non-finite.Free fn in
report.rs(not re-exported), nolib.rschange.valenx-aero213 lib tests (was 212);cargo clippy -p valenx-aero --all-targets -- -D warningsclean. Research-grade compressible-flow data-reduction primitive.