-
-
Notifications
You must be signed in to change notification settings - Fork 201
ENH: Tank Fluids with Variable Density from Temperature and Pressure #852
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #852 +/- ##
===========================================
+ Coverage 80.02% 80.19% +0.17%
===========================================
Files 98 103 +5
Lines 12004 12730 +726
===========================================
+ Hits 9606 10209 +603
- Misses 2398 2521 +123 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for variable density fluids in tank simulations by enabling the Fluid
class to accept density as a function of temperature and pressure. Previously, only constant densities were supported, limiting simulation accuracy for liquid and hybrid motor tanks.
Key changes:
- Enhanced the
Fluid
class to support density functions based on temperature and pressure - Added temperature and pressure parameters to tank classes for time-dependent modeling
- Updated tank inertia and volume calculations to use variable density functions
Reviewed Changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
rocketpy/motors/fluid.py | Converted Fluid from dataclass to regular class with variable density support |
rocketpy/motors/tank.py | Added temperature/pressure parameters and variable density calculations |
rocketpy/prints/fluid_prints.py | Updated print methods to handle variable density functions |
rocketpy/plots/fluid_plots.py | Added density function plotting capabilities |
tests/ | Added comprehensive test coverage for variable density functionality |
docs/user/motors/tanks.rst | Updated documentation with examples of variable density usage |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very good PR, great addition.
I have a few minor comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, great addition!!
Pull request type
Checklist
make format
) has passed locallypytest tests -m slow --runslow
) have passed locallyCHANGELOG.md
has been updated (if relevant)Current behavior
Only constant valued densities are supported by the
Fluid
class, which hinders theLiquid
andHybrid
motor simulation accuracy.New behavior
This PR aims to bring support for defining a
Fluid
with a density value that can be a function of Temperature (K) and Pressure (Pa). For instance:So as to model the density evolution in time in the
Tank
simulation, the optional parameterstemperature
andpressure
were added to the tank classes, which correspond to simulation/static fire data as a function of time one may have of these parameters.Breaking change
Additional Information
Documentation could probably be expanded with a more throughout example of this feature and a description of the new modeling assumptions, but this does not block the review of the implementation.