feat(aero): Mach from stagnation density ratio (completes the trio)#421
Merged
Merged
Conversation
Add report::mach_from_stagnation_density_ratio(rho0_over_rho, gamma), the Mach number recovered from a measured total-to-static density ratio: M = sqrt(2*((rho0/rho)^(gamma-1) - 1)/(gamma - 1)) the inverse of isentropic_stagnation_density_ratio. With the temperature- (#403) and pressure-ratio (#409) inverses it completes the stagnation- ratio inverse trio. Mirrors their sentinel style: returns the at-rest 0.0 (the inverse of the ratio's 1.0 no-compression identity) for non-physical input (non-finite, rho0/rho < 1, or gamma <= 1). Analytic test mach_from_stagnation_density_ratio_inverts_the_ratio: (a) round-trip threading isentropic_stagnation_density_ratio (both directions); (b) worked: at M=1, gamma=1.4 the sonic ratio rho0/rho = 1.2^2.5 -> M=1; (c) consistency with the temperature- and pressure-ratio inverses: for the same Mach all three stagnation-ratio reductions return the same Mach; (d) at rest: rho0/rho = 1 -> M = 0; (e) 0-sentinel guard for rho0/rho < 1, gamma <= 1, non-finite. Free fn in report.rs (not re-exported), no lib.rs change. valenx-aero 214 lib tests (was 213), 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_density_ratio(rho0_over_rho, gamma)— the Mach number recovered from a measured total-to-static density ratio:Why
report.rshad the temperature- (#403) and pressure-ratio (#409) Mach inverses; this is the density-ratio one, invertingisentropic_stagnation_density_ratioand completing the stagnation-ratio inverse trio. Mirrors their sentinel style: returns the at-rest0.0(inverse of the ratio's1.0no-compression identity) for non-physical input (non-finite,rho0/rho < 1, orgamma <= 1).Test
mach_from_stagnation_density_ratio_inverts_the_ratio:isentropic_stagnation_density_ratio(both directions);M=1, gamma=1.4the sonic ratiorho0/rho = 1.2^2.5 -> M=1;rho0/rho = 1 -> M = 0;0-sentinel forrho0/rho < 1,gamma <= 1, non-finite.Free fn in
report.rs(not re-exported), nolib.rschange.valenx-aero214 lib tests (was 213);cargo clippy -p valenx-aero --all-targets -- -D warningsclean. Research-grade compressible-flow data-reduction primitive.