RocketPy-Team / RocketPy

Next generation High-Power Rocketry 6-DOF Trajectory Simulation
https://docs.rocketpy.org/
MIT License
570 stars 137 forks source link

ENH: Allow for time variable density to Tank Fluids. #593

Open phmbressan opened 2 months ago

phmbressan commented 2 months ago

Pull request type

Checklist

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

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[bot] commented 2 months ago

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 ```diff @@ 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.