Skip to content

Commit

Permalink
Merge pull request #459 from RocketPy-Team/enh/generic-motor-flow-rate
Browse files Browse the repository at this point in the history
ENH: Add mass_flow_rate() to GenericMotor class
  • Loading branch information
Gui-FernandesBR authored Nov 10, 2023
2 parents 2352f0c + a02c9c2 commit 799b677
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions rocketpy/motors/motor.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,8 @@ def total_mass_flow_rate(self):
- The ``LiquidMotor`` class favors the more accurate data from the
Tanks's mass flow rates. Therefore this value is numerically
independent of the ``LiquidMotor.mass_flow_rate``.
- The ``GenericMotor`` class considers the total_mass_flow_rate as the
same as the mass_flow_rate.
It should be noted that, for hybrid motors, the oxidizer mass flow
rate should not be greater than `total_mass_flow_rate`, otherwise the
Expand Down Expand Up @@ -1219,6 +1221,14 @@ def exhaust_velocity(self):
"""
return self.total_impulse / self.propellant_initial_mass

@funcify_method("Time (s)", "Mass Flow Rate (kg/s)")
def mass_flow_rate(self):
"""Time derivative of propellant mass. Assumes constant exhaust
velocity. The formula used is the opposite of thrust divided by
exhaust velocity.
"""
return -1 * self.thrust / self.exhaust_velocity

@funcify_method("Time (s)", "center of mass (m)")
def center_of_propellant_mass(self):
"""Estimates the propellant center of mass as fixed in the chamber
Expand Down

0 comments on commit 799b677

Please sign in to comment.