Skip to content

Support density-scaled body quadratic drag vectors - #503

Merged
cmccomb merged 1 commit into
masterfrom
feat/body-quadratic-cd-area
Oct 17, 2026
Merged

cmccomb merged 1 commit into
masterfrom
feat/body-quadratic-cd-area

Conversation

@cmccomb

@cmccomb cmccomb commented Oct 17, 2026

Copy link
Copy Markdown
Member

Summary

  • Add WEC.body(quadratic_drag_coefficient=..., quadratic_drag_area=...) for WEC-Sim's six-component body.quadDrag.cd and body.quadDrag.area form. The effective diagonal matrix is computed at run time as 0.5 * rho * cd * area; the existing explicit 6×6 matrix remains available. Validate the paired inputs and reject unsupported joint layouts.
  • Preserve the public Python case representation and document both input forms. Narrow the local MATLAB fixture runner's path to pinned WEC-Sim source so unrelated example post-processors cannot alter the run.
  • Add a portable full-duration Sphere source fixture and paired Python gate. The source input changes only cd and area from pinned Free_Decay/1m.

Evidence

  • Local R2025b ran the 40 s, 4,001-sample coefficient/area case. Its motion and viscous-force CSVs are byte-identical to the independently generated explicit-matrix case with the same effective 250,000 N s²/m² heave drag.
  • MATLAB's logged viscous force matches 0.5 * rho * cd * area * v * abs(v) within 2.45e-9 N. Independent public Python heave and speed differ from MATLAB by at most 0.0289 mm and 0.0377 mm/s, below predeclared 0.1 mm and 0.1 mm/s gates.
  • A separate public API invariant checks density scaling at rho=1025. The input/model/HDF5/output hashes and reproduction command are recorded in the fixture README.
  • This is a derived configuration gate; published-case badges remain unchanged. It does not claim Cable or nonlinear-hydro motion parity.

Local verification

  • python -m pytest -q tests/test_sphere_quadratic_drag_parity.py tests/test_sphere_quadratic_cd_area_parity.py tests/test_case_dynamics.py tests/test_pto_connections.py: 42 passed.
  • python -m compileall -q wecsim and git diff --check: passed.

@cmccomb
cmccomb merged commit 217d48f into master Oct 17, 2026
14 checks passed
@cmccomb
cmccomb deleted the feat/body-quadratic-cd-area branch October 17, 2026 16:47
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