Skip to content

Commit

Permalink
Merge branch 'develop' into enh/draw-motors
Browse files Browse the repository at this point in the history
  • Loading branch information
Gui-FernandesBR committed Nov 13, 2023
2 parents d1e4a37 + 445a57d commit cdc3d48
Show file tree
Hide file tree
Showing 14 changed files with 790 additions and 1,000 deletions.
Binary file modified docs/static/positions/cm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/static/positions/nozzletcomb.png
Binary file not shown.
24 changes: 12 additions & 12 deletions docs/user/positions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ And with ``coordinate_system_orientation = nose_to_tail``:

.. important::

- The coordinate system origin is the point where the axis intersect. This
- The coordinate system origin is the point where the axes intersect. This
point is not explicitly specified and can be chosen by the user. All
positions given by the user must be relative to this point.
- The coordinate system origin does not need to be inside the rocket. It can
Expand Down Expand Up @@ -102,13 +102,13 @@ the coordinate system origin at the center of mass without motor:

.. important::

- The coordinate system origin is at the tip of the nose cone. This point is
not explicitly specified and can be chosen by the user. All positions given
by the user must be relative to this point.
- Since the coordinate system origin is at the tip of the nose cone, the
position of the nose cone is **zero**.
- We are using the ``nose_to_tail`` coordinate system orientation. This means
that the ``center_of_mass_without_motor`` is positive.
- The coordinate system origin is at the center of mass without motor. This
point is not explicitly specified and can be chosen by the user. All
positions given by the user must be relative to this point.
- Since the coordinate system origin is at the center of mass without motor,
the position of the ``center_of_mass_without_motor`` is **zero**.
- We are using the ``tail_to_nose`` coordinate system orientation. This means
that the position of the nose cone is positive.

.. _addsurface:

Expand Down Expand Up @@ -226,15 +226,15 @@ an arbitrary point and the

.. note::

Liquid motors are do not have the ``grains_center_of_mass_position`` parameter.
Liquid motors do not have the ``grains_center_of_mass_position`` parameter.

.. figure:: ../static/positions/nozzletocomb.png
:align: center
:alt: Rocket coordinate system origin

.. note::

We have, in this case:
In this case:

- ``nozzle_position`` is negative.
- ``grains_center_of_mass_position`` is negative.
Expand All @@ -248,15 +248,15 @@ And with ``coordinate_system_orientation = combustion_chamber_to_nozzle``:

.. note::

We have, in this case:
In this case:

- ``nozzle_position`` is positive.
- ``grains_center_of_mass_position`` is positive.
- ``center_of_dry_mass_position`` is positive.

.. important::

- The coordinate system origin is the point where the axis intersect. This
- The coordinate system origin is the point where the axes intersect. This
point is not explicitly specified and can be chosen by the user. All
positions given by the user must be relative to this point.
- The coordinate system origin does not need to be outside the motor. It can
Expand Down
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
13 changes: 3 additions & 10 deletions rocketpy/plots/environment_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,14 @@ def __wind_components(self, ax):
ax.plot(
[self.environment.wind_velocity_x(i) for i in self.grid],
self.grid,
label="Wind U",
label="wind u",
)
ax.plot(
[self.environment.wind_velocity_y(i) for i in self.grid],
self.grid,
label="Wind V",
label="wind v",
)
# ax.legend(loc="best").set_draggable(True)
ax.legend(loc="best")
ax.set_ylabel("Height Above Sea Level (m)")
ax.set_xlabel("Wind Speed (m/s)")
ax.grid(True)
Expand Down Expand Up @@ -221,7 +221,6 @@ def atmospheric_model(self):
# Create wind u and wind v subplot
ax3 = plt.subplot(223)
ax3 = self.__wind_components(ax3)
# ax3.legend(loc="best").set_draggable(True)

# Create pressure and temperature subplot
ax4 = plt.subplot(224)
Expand Down Expand Up @@ -255,7 +254,6 @@ def ensemble_member_comparison(self):
self.grid,
label=i,
)
# ax5.legend(loc='best').set_draggable(True)
ax5.set_ylabel("Height Above Sea Level (m)")
ax5.set_xlabel("Wind Speed (m/s)")
ax5.set_title("Wind U - Ensemble Members")
Expand All @@ -270,7 +268,6 @@ def ensemble_member_comparison(self):
self.grid,
label=i,
)
# ax6.legend(loc='best').set_draggable(True)
ax6.set_ylabel("Height Above Sea Level (m)")
ax6.set_xlabel("Wind Speed (m/s)")
ax6.set_title("Wind V - Ensemble Members")
Expand All @@ -283,7 +280,6 @@ def ensemble_member_comparison(self):
ax7.plot(
[self.environment.wind_speed(i) for i in self.grid], self.grid, label=i
)
# ax7.legend(loc='best').set_draggable(True)
ax7.set_ylabel("Height Above Sea Level (m)")
ax7.set_xlabel("Wind Speed (m/s)")
ax7.set_title("Wind Speed Magnitude - Ensemble Members")
Expand All @@ -298,7 +294,6 @@ def ensemble_member_comparison(self):
self.grid,
label=i,
)
# ax8.legend(loc='best').set_draggable(True)
ax8.set_ylabel("Height Above Sea Level (m)")
ax8.set_xlabel("Degrees True (°)")
ax8.set_title("Wind Direction - Ensemble Members")
Expand All @@ -311,7 +306,6 @@ def ensemble_member_comparison(self):
ax9.plot(
[self.environment.pressure(i) for i in self.grid], self.grid, label=i
)
# ax9.legend(loc='best').set_draggable(True)
ax9.set_ylabel("Height Above Sea Level (m)")
ax9.set_xlabel("Pressure (P)")
ax9.set_title("Pressure - Ensemble Members")
Expand All @@ -324,7 +318,6 @@ def ensemble_member_comparison(self):
ax10.plot(
[self.environment.temperature(i) for i in self.grid], self.grid, label=i
)
# ax10.legend(loc='best').set_draggable(True)
ax10.set_ylabel("Height Above Sea Level (m)")
ax10.set_xlabel("Temperature (K)")
ax10.set_title("Temperature - Ensemble Members")
Expand Down
Loading

0 comments on commit cdc3d48

Please sign in to comment.