Skip to content

ENH: Add simplified opening shock force estimation - #1092

Merged
ArthurJWH merged 5 commits into
developfrom
enh/opening-shock-force
Aug 8, 2026
Merged

ENH: Add simplified opening shock force estimation#1092
ArthurJWH merged 5 commits into
developfrom
enh/opening-shock-force

Conversation

@ArthurJWH

Copy link
Copy Markdown
Contributor

Moving forward with PR #1050 : Add opening shock force estimation to Parachute class

Matanski and others added 2 commits August 5, 2026 08:28
Adds an opening_shock_coefficient parameter and a
calculate_opening_shock_force method to estimate the peak transient
force during parachute inflation, following the simplified model in
Knacke's Parachute Recovery Systems Design Manual (1992, Section 5.5).

Closes #161

Co-authored-by: ArthurJWH <167456467+ArthurJWH@users.noreply.github.com>
@ArthurJWH
ArthurJWH requested a review from a team as a code owner August 5, 2026 13:15
@codecov

codecov Bot commented Aug 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.55%. Comparing base (e0ff281) to head (0d32061).
⚠️ Report is 27 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1092      +/-   ##
===========================================
+ Coverage    82.18%   82.55%   +0.37%     
===========================================
  Files          122      128       +6     
  Lines        16355    16558     +203     
===========================================
+ Hits         13441    13670     +229     
+ Misses        2914     2888      -26     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Gui-FernandesBR Gui-FernandesBR left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved. Moving this out of Parachute into utilities is the right call, and the migration is complete: grep -n "shock" rocketpy/rocket/parachute.py comes back empty, so nothing was left behind from #1050.

What I checked locally:

  • pytest tests/unit/test_utilities.py — 39 passed, 2 skipped
  • ruff check clean, ruff format --check clean, pylint rocketpy/utilities.py — 10.00/10
  • The formula matches Knacke's Cx * Cd*S * q. Spot-checking a realistic case (cd_s=10, rho=1.225, V=30 m/s, Cx=1.5) gives ~8.3 kN, which is the right order of magnitude for sizing a shock cord.
  • The function is pure and nothing in the flight path calls it, so this is a pure addition with no regression surface.
  • It picks up the API reference automatically, since docs/reference/classes/utils/utilities.rst uses .. automodule:: rocketpy.utilities :members:.

One nit, not blocking — in the opening_shock_coefficient docstring:

        :meth:`calculate_opening_shock_force`. Typical values range from

That target is left over from the Parachute-method version in #1050 and no longer exists anywhere in the repo (this line is its only occurrence). Two small consequences: it is a dangling cross-reference, and docs.yml builds with -W --keep-going — that workflow is scoped to PRs targeting master, so it won't go red here, but it could surface on the next develop -> master PR. It is also self-referential, since the parameter is described as feeding the very function it is documented in.

A one-liner fixes it, e.g.:

    opening_shock_coefficient : float, optional
        Empirical coefficient (commonly noted Cx) used to estimate the
        peak transient force experienced during parachute inflation.
        Typical values range from 1.2 to 2.0 depending on the deployment
        method and canopy type. Default value is 1.5.

Happy either way — feel free to fold it in here, or we can take it in a follow-up.

Two things I looked at that need no action: a negative velocity (descent, vz < 0) returns the same force as the positive case, which is correct given the V**2; and the function isn't re-exported in rocketpy/__init__.py, but no utilities function is (fin_flutter_analysis, calculate_equilibrium_altitude and friends aren't either), so it matches the existing convention.

@ArthurJWH
ArthurJWH merged commit dbdb061 into develop Aug 8, 2026
10 checks passed
@ArthurJWH
ArthurJWH deleted the enh/opening-shock-force branch August 8, 2026 13:21
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.

3 participants