-
-
Notifications
You must be signed in to change notification settings - Fork 144
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
ENH: Generic Surfaces and Generic Linear Surfaces #680
base: develop
Are you sure you want to change the base?
Conversation
Co-authored-by: kevin-alcaniz <[email protected]>
Co-authored-by: kevin-alcaniz <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #680 +/- ##
===========================================
- Coverage 75.40% 74.80% -0.61%
===========================================
Files 96 98 +2
Lines 10832 11036 +204
===========================================
+ Hits 8168 8255 +87
- Misses 2664 2781 +117 ☔ View full report in Codecov by Sentry. |
Needles to say that this should be done before every commit.
ENH: generic surfaces pylint
DOC: Generic Surface
Make format didn't work. Will run it after review and fixes.
Make format didn't work. Will run it after review and fixes.
def _compute_from_coefficients( | ||
self, | ||
rho, | ||
stream_speed, | ||
alpha, | ||
beta, | ||
mach, | ||
reynolds, | ||
pitch_rate, | ||
yaw_rate, | ||
roll_rate, | ||
): |
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.
When I used all arguments as 0 (or null vectors/tuples, depending on the type) on the GenericSurfaces
class, the function worked and returned 0 for all its return values. For this function here in LinearGenericSurfaces
, I got a division by zero error.
dyn_pressure_area = 0.5 * rho * stream_speed**2 * self.reference_area | ||
dyn_pressure_area_damping = ( | ||
dyn_pressure_area * self.reference_length / (2 * stream_speed) | ||
) | ||
dyn_pressure_area_length = dyn_pressure_area * self.reference_length | ||
dyn_pressure_area_length_damping = ( | ||
dyn_pressure_area_length * self.reference_length / (2 * stream_speed) | ||
) |
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.
dyn_pressure_area = 0.5 * rho * stream_speed**2 * self.reference_area | |
dyn_pressure_area_damping = ( | |
dyn_pressure_area * self.reference_length / (2 * stream_speed) | |
) | |
dyn_pressure_area_length = dyn_pressure_area * self.reference_length | |
dyn_pressure_area_length_damping = ( | |
dyn_pressure_area_length * self.reference_length / (2 * stream_speed) | |
) | |
dyn_pressure_area = 0.5 * rho * stream_speed**2 * self.reference_area | |
if stream_speed == 0: | |
dyn_pressure_area_length = 0 | |
dyn_pressure_area_length_damping = 0 | |
else: | |
dyn_pressure_area_damping = ( | |
dyn_pressure_area * self.reference_length / (2 * stream_speed) | |
) | |
dyn_pressure_area_length = dyn_pressure_area * self.reference_length | |
dyn_pressure_area_length_damping = ( | |
dyn_pressure_area_length * self.reference_length / (2 * stream_speed) | |
) |
Possible division by 0. Since the numerator has stream_speed**2
and the denominator stream_speed
, the limit is 0 when stream_speed
goes to 0, so it could be a good idea to just set these variables to 0 when stream_speed
is zero.
Pull request type
Checklist
black rocketpy/ tests/
) has passed locallypytest tests -m slow --runslow
) have passed locallyCHANGELOG.md
has been updated (if relevant)Description
Added the
GenericSurface
class that takes in coefficients defined by either a function or a .csvAdded the
LinearGenericSurface
class that takes in coefficients derivatives and calculates the total coefficients assuming linearityChanged all
add_surfaces
position
arguments to be 3 dimensionalImproved
Flight
class structure to be indifferent to the type of AeroSurfaceThere is an example simulation in
coeff_testing.ipynb
of calisto using coefficients that were extracted directly from rocketpy's standard model (Barrowman's). It uses the .csvs that have been committed. These .csvs have a LOT of points, this is due to theshepard
interpolation in the Function class, which makes the interpolated values used in the simulation extremely noisy. The files are this big for validation purposes. We should reduce them and create tests with themBreaking change
Remaining Tasks
GenericSurface
orLinearGenericSurface
and use its coefficients for simulation, overwriting any other added aerodynamic surface. The aerodynamic surfaces should still be used for the drawing though. The received generic surface should be positioned in the center of the dry mass of the rocket for the desired behaviorIt would be truly great to get some help on these minor tasks
Future Tasks
GenericSurfaces
andLinearGenericSurfaces
are currently not included in those analysis.Contributors
Special thanks to @kevin-alcaniz and Faraday Rocketry UPV for their contributions!!