Skip to content

feat(cfd): root-mean-square interior vorticity#413

Merged
nochallenge merged 1 commit into
masterfrom
feat/cfd-rms-vorticity
Jun 8, 2026
Merged

feat(cfd): root-mean-square interior vorticity#413
nochallenge merged 1 commit into
masterfrom
feat/cfd-rms-vorticity

Conversation

@nochallenge

Copy link
Copy Markdown
Owner

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, and enstrophy, but no RMS magnitude. omega_rms completes the peak / mean / rms vorticity-statistics set — mirroring the pressure family's mean / std / rms_pressure (#394). It relates to the enstrophy by omega_rms = sqrt(2E/A) (enstrophy is 1/2 * integral(omega^2 dA)), and is always >= |mean vorticity| by Cauchy-Schwarz. Mirrors the mean_vorticity interior central-difference stencil; returns 0 for a grid too small (nx < 3 or ny < 3).

Test

rms_vorticity_is_the_root_mean_square_interior_vorticity (uniform shear u(y)=gamma*y, omega = -gamma everywhere):

  • (a) analyticomega_rms = |omega| = gamma = 2;
  • (b) threads enstrophy (non-tautological, different code path) — omega_rms = sqrt(2E/A);
  • (c) rms >= |mean| (Cauchy-Schwarz), with equality for this uniform field;
  • (d) small grid — too small for an interior difference -> 0.

Pure method on FlowSolution, no lib.rs change. valenx-cfd-native 123 lib tests (was 122); cargo clippy -p valenx-cfd-native --all-targets -- -D warnings clean. Research-grade post-processing reducer.

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.
@nochallenge nochallenge merged commit 56ede2e into master Jun 8, 2026
@nochallenge nochallenge deleted the feat/cfd-rms-vorticity branch June 8, 2026 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant