Add rotational viscous damping fix (torque = -gamma * omega)#22
Add rotational viscous damping fix (torque = -gamma * omega)#22
Conversation
Implements angular velocity-proportional damping in mddem_fixes, mirroring the existing translational viscous fix. Registered at PostForce, accesses DemAtom via AtomDataRegistry for omega and torque fields. Includes 4 tests covering torque opposition, zero-at-rest, group filtering, and linear scaling. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Maintainer Review: ❌ CHANGES REQUESTEDGood physics implementation, but there's an architectural layering issue. Issue:
|
Fixes architectural layering: mddem_* (shared infra) should not depend on dem_* (DEM-specific) crates. Rotational viscous damping needs DemAtom for omega/torque access, so it belongs in dem_granular. - Remove dem_atom dependency from mddem_fixes - Add RotationalViscousPlugin to dem_granular::rotational_viscous - Re-export from mddem prelude - All 4 rotational viscous tests preserved and passing Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fix: Moved rotational viscous from mddem_fixes to dem_granularAddressed the architectural layering issue:
|
Summary
RotationalViscousDefandapply_rotational_viscoussystem tomddem_fixes, the rotational analog of the existing translational viscous dampingτ = -γ * ω, removing angular kinetic energy to help particles stop spinning during settlingScheduleSet::PostForce(same as translational viscous); only active when[[rotational_viscous]]config is present (zero overhead otherwise)DemAtomomega/torque viaAtomDataRegistryConfiguration
Test plan
cargo test -p mddem_fixes --no-default-features)🤖 Generated with Claude Code