RocketPy
RocketPy copied to clipboard
ENH: Allow for time variable density to Tank Fluids.
Pull request type
- [X] Code changes (bugfix, features)
Checklist
- [X] Tests for the changes have been added (if needed)
- [X] Docs have been reviewed and added / updated
- [X] Lint (
black rocketpy/ tests/) has passed locally - [X] All tests (
pytest tests -m slow --runslow) have passed locally - [X]
CHANGELOG.mdhas been updated (if relevant)
Current behavior
Currently, the Tank class assumes in its computations that its fluid densities are a constant in time. This approximation can be rather inaccurate, specially for tanks that experiment large variations in fluid density (e.g. due to changes in temperature and pressure) during the flow.
New behavior
This PR essentially allows for time variable densities when defining the Fluid and the Tank subclasses discretize these values in time for code speed.
Breaking change
- [ ] Yes
- [X] No
Additional Information
The tests for the Tank class would benefit a lot from a refactor. However, I preferred to keep this PR focused on the new functionalities.
Codecov Report
Attention: Patch coverage is 95.23810% with 1 lines in your changes are missing coverage. Please review.
Project coverage is 73.03%. Comparing base (
43b2b0d) to head (e020aaa). Report is 1 commits behind head on develop.
| Files | Patch % | Lines |
|---|---|---|
| rocketpy/motors/fluid.py | 87.50% | 1 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## develop #593 +/- ##
========================================
Coverage 73.03% 73.03%
========================================
Files 57 57
Lines 9596 9609 +13
========================================
+ Hits 7008 7018 +10
- Misses 2588 2591 +3
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.