feat(cfd): RMS strain rate (L2 deformation rate)#435
Merged
Conversation
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
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.
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_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 dissipationeps = 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), mirroringrms_vorticity(#406) — so vorticity and strain-rate, the two halves ofgrad-u, now each have a full statistic set.Test
rms_strain_rate_is_the_l2_deformation_rate(5x5 unit grid):u(y)=gamma*y->|S|=gammauniformly ->rms=gamma, and since|S|=|omega|=gammafor a pure shear,rms_strain_rate == rms_vorticity(threadsrms_vorticityvia the grad-u decomposition);0while rms vorticity =2*Omega(strain != rotation);rms >= mean > 0(Jensen);0.Pure method on
FlowSolution, nolib.rschange.valenx-cfd-native128 lib tests (was 127);cargo clippy -p valenx-cfd-native --all-targets -- -D warningsclean. Research-grade flow-deformation / dissipation diagnostic.