Skip to content
This repository has been archived by the owner on Oct 30, 2022. It is now read-only.

Issue #01: team-02 - Add aero surface info to Rocket.allinfo() #99

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 41 additions & 2 deletions rocketpy/Rocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,16 @@ def finNumCorrection(n):
"cl": cl,
"roll parameters": rollParameters,
"name": "Fins",
'addFins parameters': {
'n': n,
'span': span,
'rootChord': rootChord,
'tipChord': tipChord,
'distanceToCM': distanceToCM,
'radius': radius,
'cantAngle': cantAngle,
'airfoil': airfoil,
},
}
self.aerodynamicSurfaces.append(fin)

Expand Down Expand Up @@ -960,8 +970,37 @@ def allInfo(self):
+ "{:.3f}".format(self.centerOfMass(0))
+ " m"
)
print("\nAerodynamic Components Parameters")
print("Currently not implemented.")

# Print Aerodynamic Components Information
print("\nAerodynamic Components")
print(self.aerodynamicSurfaces)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest a minor change here so the user can better visualize the outputs:

Suggested change
print(self.aerodynamicSurfaces)
for surface in self.aerodynamicSurfaces:
if 'name' in surface:
print(surface['name'])
else:
print('Unnamed Surface:')
print(surface)

for index, surface in enumerate(self.aerodynamicSurfaces):
# Get aerodynamic surface prefix
# If Surface has a name, print it alongside the index
if 'name' in surface:
name = surface['name']
prefix = f"\nAerodynamic Surface {index} \"{name}\" parameters"
else:
prefix = f"\nAerodynamic Surface {index} parameters"
print(prefix)

# Print possible parameters
if 'cp' in surface:
print(f"Center of Pressure Location: {surface['cp']}")
if 'cl' in surface:
print(f"Coefficient of Lift:")
surface['cl']()

# Print parameters specific to fins
if 'addFins parameters' in surface:
parameters = surface['addFins parameters']
print(f"Number of Fins: {parameters['n']}")
print(f"Fin Span (m): {parameters['span']}")
print(f"Fin Root Chord (m): {parameters['rootChord']}")
print(f"Fin Tip Chord (m): {parameters['tipChord']}")
print(f"Fin Distance from Fin Leading Edge Geometric Center to Rocket Unloaded Center of Mass (m): {parameters['distanceToCM']}")
print(f"Fin Root Radius from Center of Rocket (m): {parameters['radius']}")
print(f"Fin Cant Angle with Respect to Rocket Centerline(deg): {parameters['cantAngle']}")

# Print rocket aerodynamics quantities
print("\nAerodynamics Lift Coefficient Derivatives")
Expand Down