Skip to content

feat(cfd): RMS strain rate (L2 deformation rate)#435

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

feat(cfd): RMS strain rate (L2 deformation rate)#435
nochallenge merged 1 commit into
masterfrom
feat/cfd-rms-strain-rate

Conversation

@nochallenge

Copy link
Copy Markdown
Owner

What

Adds FlowSolution::rms_strain_rate() — the root-mean-square rate-of-strain magnitude over the interior cells:

// rms = sqrt( <|S|^2> )   (1/s)

Why

The L2 deformation rate. Since |S|^2 = 2 S_ij S_ij, this is the quantity that sets the viscous dissipation eps = 2*nu*<S_ij S_ij> = nu*<|S|^2>, so it measures how strongly the flow is being strained (and dissipating energy). Completes the strain-rate family (at_cell / max / mean / rms), mirroring rms_vorticity (#406) — so vorticity and strain-rate, the two halves of grad-u, now each have a full statistic set.

Test

rms_strain_rate_is_the_l2_deformation_rate (5x5 unit grid):

  • (a) pure shear u(y)=gamma*y -> |S|=gamma uniformly -> rms=gamma, and since |S|=|omega|=gamma for a pure shear, rms_strain_rate == rms_vorticity (threads rms_vorticity via the grad-u decomposition);
  • (b) solid-body rotation -> rms strain = 0 while rms vorticity = 2*Omega (strain != rotation);
  • (c) non-uniform quadratic shear -> rms >= mean > 0 (Jensen);
  • (d) grid too small for an interior difference -> 0.

Pure method on FlowSolution, no lib.rs change. valenx-cfd-native 128 lib tests (was 127); cargo clippy -p valenx-cfd-native --all-targets -- -D warnings clean. Research-grade flow-deformation / dissipation diagnostic.

Add FlowSolution::rms_strain_rate(), the root-mean-square rate-of-strain
magnitude over the interior cells:

  rms = sqrt( <|S|^2> )   (1/s)

the L2 deformation rate. Since |S|^2 = 2 S_ij S_ij, this is the quantity
that sets the viscous dissipation eps = 2*nu*<S_ij S_ij> = nu*<|S|^2>, so
it measures how strongly the flow is being strained (and thus dissipating
energy). Completes the strain-rate family (at_cell / max / mean / rms),
mirroring rms_vorticity (#406).

Analytic test rms_strain_rate_is_the_l2_deformation_rate:
(a) pure shear u(y)=gamma*y -> |S|=gamma uniformly -> rms=gamma, and since
    |S|=|omega|=gamma for a pure shear, rms_strain_rate == rms_vorticity
    (threads rms_vorticity via the grad-u decomposition);
(b) solid-body rotation -> rms strain = 0 while rms vorticity = 2*Omega
    (strain != rotation);
(c) non-uniform quadratic shear -> rms >= mean > 0 (Jensen);
(d) grid too small for an interior difference -> 0.

Pure method on FlowSolution, no lib.rs change. cfd-native 128 lib tests
(was 127), cargo clippy --all-targets -D warnings clean.
@nochallenge nochallenge merged commit 080ff5d into master Jun 8, 2026
@nochallenge nochallenge deleted the feat/cfd-rms-strain-rate branch June 8, 2026 23:23
nochallenge added a commit that referenced this pull request Jun 9, 2026
Add beam::hollow_circular_polar_second_moment_of_area(outer_diameter,
inner_diameter), the polar second moment of a tube/pipe about its axis:

  J = pi * (D^4 - d^4) / 32   (m^4)

For a CIRCULAR tube this polar second moment IS the genuine St-Venant
torsion constant (unlike a non-circular section) -- the torsional stiffness
of drive-shaft tubing, far stiffer per weight than a solid shaft. Guard
mirrors hollow_circular_second_moment_of_area.

Analytic test hollow_circular_polar_second_moment_of_area_is_pi_d4_minus_d4_over_32:
(a) worked D=0.1, d=0.05 -> J ~= 9.2038e-6 m^4;
(b) threads hollow_circular_second_moment_of_area (#435) (non-tautological,
    perpendicular-axis theorem): J = 2*I_hollow;
(c) threads circular_polar_second_moment_of_area (#423) (non-tautological,
    annulus): J = J(D) - J(d);
(d) solid limit: a zero bore is a solid shaft;
(e) 0-sentinel guards for D<=0, d>=D, non-finite, negative bore.

Re-exported from lib.rs alphabetically in the beam block. valenx-fem 266
lib tests (was 265), cargo clippy --all-targets -D warnings clean.
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