Merged
Conversation
Add max_wake_rows, max_wake_chords, and max_wake_cycles parameters to Movement, with validation and conversion logic mirroring num_steps/num_chords/num_cycles. Propagate max_wake_rows through UnsteadyProblem to the solver, which caps pre-allocated wake arrays and truncates wake points and vortices each time step once the threshold is reached.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an optional “wake truncation” capability to the unsteady ring vortex lattice method (UVLM) workflow so long unsteady simulations can cap wake growth, reducing memory and runtime while keeping results reasonably close.
Changes:
- Extends
Movementwith mutually-exclusivemax_wake_rows / max_wake_chords / max_wake_cyclesoptions (with validation + conversion tomax_wake_rows). - Propagates
max_wake_rowsthroughUnsteadyProblemintoUnsteadyRingVortexLatticeMethodSolver, which now caps wake preallocation and truncates wake point/vortex rows during shedding. - Adds unit + integration tests and updates developer documentation to reflect the new attributes and docstring guidance.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
pterasoftware/movements/movement.py |
Adds wake truncation configuration/validation and conversion to an internal max_wake_rows. |
pterasoftware/problems.py |
Propagates max_wake_rows from Movement to UnsteadyProblem. |
pterasoftware/unsteady_ring_vortex_lattice_method.py |
Implements wake array preallocation capping and runtime truncation of wake points/vortices. |
tests/unit/test_movement.py |
Adds unit tests for new Movement parameters (defaults, validation, conversion, constraints). |
tests/integration/test_unsteady_ring_vortex_lattice_method_wake_truncation.py |
New integration test comparing truncated vs non-truncated runs and checking capped wake growth. |
tests/integration/__init__.py |
Registers the new integration test module import. |
tests/unit/test_wing_cross_section.py |
Adds IDE suppression comments in existing tests. |
docs/CLASSES_AND_IMMUTABILITY.md |
Documents new immutable attributes for Movement / UnsteadyProblem. |
docs/TYPE_HINT_AND_DOCSTRING_STYLE.md |
Clarifies docstring expectations for simple getter properties. |
.idea/scopes/to_inspect.xml |
Updates IDE inspection scope exclusions. |
Files not reviewed (1)
- .idea/scopes/to_inspect.xml: Language not supported
tests/integration/test_unsteady_ring_vortex_lattice_method_wake_truncation.py
Show resolved
Hide resolved
tests/integration/test_unsteady_ring_vortex_lattice_method_wake_truncation.py
Show resolved
Hide resolved
tests/integration/test_unsteady_ring_vortex_lattice_method_wake_truncation.py
Show resolved
Hide resolved
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #122 +/- ##
==========================================
+ Coverage 91.32% 91.39% +0.06%
==========================================
Files 32 32
Lines 6111 6159 +48
==========================================
+ Hits 5581 5629 +48
Misses 530 530 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Description
Add wake truncation support for the UVLM solver, allowing users to cap the maximum wake length and reduce memory usage and run time for long simulations.
Motivation
In the unsteady ring vortex lattice method, the wake grows by one chordwise row per time step, causing memory and computation costs to scale with the number of steps. For long simulations, the far-downstream wake has negligible influence on the bound circulation. Wake truncation discards the oldest wake rows beyond a user-specified limit, reducing memory usage and run times while preserving accuracy.
Relevant Issues
This new feature will be particularly useful in the development of coupled free flight simulations (Issue: #65, PR: #66)
Changes
Movement.__init__:max_wake_rows,max_wake_chords, andmax_wake_cycles, with mutual exclusivity validation and appropriate static/non-static constraints.Movementto translatemax_wake_chordsandmax_wake_cyclestomax_wake_rowsusing the same formulas asnum_chords/num_cyclestonum_steps.max_wake_rowsthroughUnsteadyProblemto theUnsteadyRingVortexLatticeMethodSolver.RingVortexrows and wake point grid rows during the simulation.CLASSES_AND_IMMUTABILITY.mdto document the new attributes inMovementandUnsteadyProblem.TYPE_HINT_AND_DOCSTRING_STYLE.mdfor simple getter properties.# noinspectioncomments to suppress false IDE warnings.New Dependencies
None.
Change Magnitude
Moderate: Medium-sized change that adds or modifies a feature without large-scale impact.
Checklist
mainand is up to date with the upstreammainbranch.--in-place --black). See the style guide for type hints and docstrings for more details.pterasoftwarepackage use type hints. See the style guide for type hints and docstrings for more details.testspackage.testspackage.codespell,black,mypy, andtests).