feat(cfd): root-mean-square interior vorticity#413
Merged
Conversation
Add FlowSolution::rms_vorticity(), the root-mean-square interior vorticity:
omega_rms = sqrt(<omega^2>) (1/s)
the magnitude scale of the central-difference vorticity, completing the
peak / mean / rms vorticity-statistics set (mirrors the pressure family's
mean / std / rms_pressure). It relates to the enstrophy by
omega_rms = sqrt(2E/A) (enstrophy is 1/2 integral(omega^2 dA)), and is
always >= |mean vorticity| (Cauchy-Schwarz). Mirrors the mean_vorticity
interior stencil; returns 0 for a grid too small (nx < 3 or ny < 3).
Analytic test rms_vorticity_is_the_root_mean_square_interior_vorticity
(uniform shear u(y)=gamma*y, omega = -gamma everywhere):
(a) analytic: omega_rms = |omega| = gamma = 2;
(b) threads enstrophy (non-tautological, different code path):
omega_rms = sqrt(2E/A);
(c) rms >= |mean| (Cauchy-Schwarz), equality for the uniform field;
(d) grid too small for an interior difference -> 0.
Pure method on FlowSolution, no lib.rs change. cfd-native 123 lib tests
(was 122), 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
FlowSolution::rms_vorticity()— the root-mean-square interior vorticity:// omega_rms = sqrt(<omega^2>) (1/s)Why
The vorticity family has
max_vorticity(peak),mean_vorticity(#400, area-average),circulation, andenstrophy, but no RMS magnitude.omega_rmscompletes the peak / mean / rms vorticity-statistics set — mirroring the pressure family'smean/std/rms_pressure(#394). It relates to theenstrophybyomega_rms = sqrt(2E/A)(enstrophy is1/2 * integral(omega^2 dA)), and is always>= |mean vorticity|by Cauchy-Schwarz. Mirrors themean_vorticityinterior central-difference stencil; returns0for a grid too small (nx < 3orny < 3).Test
rms_vorticity_is_the_root_mean_square_interior_vorticity(uniform shearu(y)=gamma*y,omega = -gammaeverywhere):omega_rms = |omega| = gamma = 2;omega_rms = sqrt(2E/A);0.Pure method on
FlowSolution, nolib.rschange.valenx-cfd-native123 lib tests (was 122);cargo clippy -p valenx-cfd-native --all-targets -- -D warningsclean. Research-grade post-processing reducer.