Skip to content

Commit

Permalink
Version attribute and fuselage fix.
Browse files Browse the repository at this point in the history
Added __version__ to the package init instead of package main.

Fixed the Fuselage.Cover.panel_flutter dynamic pressure. Pressures are provided in thousands of feet.
  • Loading branch information
Czarified committed May 15, 2024
1 parent 774ade6 commit a0ebaa8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/hyperstruct/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
"""Hyperstruct."""

from dataclasses import dataclass
from importlib.metadata import version


__version__ = version("hyperstruct")


@dataclass
Expand Down
12 changes: 9 additions & 3 deletions src/hyperstruct/fuselage.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,22 +255,28 @@ def panel_flutter(self, mach: float, altitude: float) -> float:
To find the final required thickness, this method must be looped
over for all Mach and altitudes corresponding to the flight
envelope conditions of the aircraft.
Inputs: Mach Number, and Altitude (in thousands of feet)
Returns: Field Thickness
"""
# Dynamic pressures based on standard day atmosphere.
# Dynamic Pressure, q, in [psf]
# Altitudes must be measured in [ft]
if altitude <= 20000:
if altitude <= 20:
q = mach**2 * (1479.757 - 52.187 * altitude + 0.619868 * altitude**2)
elif 20000 < altitude <= 70000:
elif 20 < altitude <= 70:
q = mach**2 * (
1465.175
- 50.76695 * altitude
+ 0.6434412 * altitude**2
- 0.002907194 * altitude**3
)
elif altitude > 70000:
elif altitude > 70:
q = mach**2 * (199.659 / altitude) ** 4

# Dynamic pressure is in [psf] convert to [psi]
q = q / 144

# Calculate the Mach Number Effect
# The Mach Number Effect, FM, is a 3 piece function from SWEEP.
# This function is more conservative than the AFRL baseline curve,
Expand Down

0 comments on commit a0ebaa8

Please sign in to comment.