Linear Generic Surface Class#
- class rocketpy.LinearGenericSurface[source]#
Class that defines a generic linear aerodynamic surface. This class is used to define aerodynamic surfaces that have aerodynamic coefficients defined as linear functions of the coefficients derivatives.
- __init__(reference_area, reference_length, coefficients, center_of_pressure=(0, 0, 0), name='Generic Linear Surface')[source]#
Create a generic linear aerodynamic surface, defined by its aerodynamic coefficients derivatives. This surface is used to model any aerodynamic surface that does not fit the predefined classes.
Important
All the aerodynamic coefficients can be input as callable functions of angle of attack, angle of sideslip, Mach number, Reynolds number, pitch rate, yaw rate and roll rate. For CSV files, the header must contain at least one of the following: “alpha”, “beta”, “mach”, “reynolds”, “pitch_rate”, “yaw_rate” and “roll_rate”.
- Parameters:
reference_area (
int
,float
) – Reference area of the aerodynamic surface. Has the unit of meters squared. Commonly defined as the rocket’s cross-sectional area.reference_length (
int
,float
) – Reference length of the aerodynamic surface. Has the unit of meters. Commonly defined as the rocket’s diameter.coefficients (
dict
, optional) –List of coefficients. If a coefficient is omitted, it is set to 0. The valid coefficients are:
- cL_0: callable, str, optional
Coefficient of lift at zero angle of attack. Default is 0.
- cL_alpha: callable, str, optional
Coefficient of lift derivative with respect to angle of attack. Default is 0.
- cL_beta: callable, str, optional
Coefficient of lift derivative with respect to sideslip angle. Default is 0.
- cL_p: callable, str, optional
Coefficient of lift derivative with respect to roll rate. Default is 0.
- cL_q: callable, str, optional
Coefficient of lift derivative with respect to pitch rate. Default is 0.
- cL_r: callable, str, optional
Coefficient of lift derivative with respect to yaw rate. Default is 0.
- cQ_0: callable, str, optional
Coefficient of pitch moment at zero angle of attack. Default is 0.
- cQ_alpha: callable, str, optional
Coefficient of pitch moment derivative with respect to angle of attack. Default is 0.
- cQ_beta: callable, str, optional
Coefficient of pitch moment derivative with respect to sideslip angle. Default is 0.
- cQ_p: callable, str, optional
Coefficient of pitch moment derivative with respect to roll rate. Default is 0.
- cQ_q: callable, str, optional
Coefficient of pitch moment derivative with respect to pitch rate. Default is 0.
- cQ_r: callable, str, optional
Coefficient of pitch moment derivative with respect to yaw rate. Default is 0.
- cD_0: callable, str, optional
Coefficient of drag at zero angle of attack. Default is 0.
- cD_alpha: callable, str, optional
Coefficient of drag derivative with respect to angle of attack. Default is 0.
- cD_beta: callable, str, optional
Coefficient of drag derivative with respect to sideslip angle. Default is 0.
- cD_p: callable, str, optional
Coefficient of drag derivative with respect to roll rate. Default is 0.
- cD_q: callable, str, optional
Coefficient of drag derivative with respect to pitch rate. Default is 0.
- cD_r: callable, str, optional
Coefficient of drag derivative with respect to yaw rate. Default is 0.
- cm_0: callable, str, optional
Coefficient of pitch moment at zero angle of attack. Default is 0.
- cm_alpha: callable, str, optional
Coefficient of pitch moment derivative with respect to angle of attack. Default is 0.
- cm_beta: callable, str, optional
Coefficient of pitch moment derivative with respect to sideslip angle. Default is 0.
- cm_p: callable, str, optional
Coefficient of pitch moment derivative with respect to roll rate. Default is 0.
- cm_q: callable, str, optional
Coefficient of pitch moment derivative with respect to pitch rate. Default is 0.
- cm_r: callable, str, optional
Coefficient of pitch moment derivative with respect to yaw rate. Default is 0.
- cn_0: callable, str, optional
Coefficient of yaw moment at zero angle of attack. Default is 0.
- cn_alpha: callable, str, optional
Coefficient of yaw moment derivative with respect to angle of attack. Default is 0.
- cn_beta: callable, str, optional
Coefficient of yaw moment derivative with respect to sideslip angle. Default is 0.
- cn_p: callable, str, optional
Coefficient of yaw moment derivative with respect to roll rate. Default is 0.
- cn_q: callable, str, optional
Coefficient of yaw moment derivative with respect to pitch rate. Default is 0.
- cn_r: callable, str, optional
Coefficient of yaw moment derivative with respect to yaw rate. Default is 0.
- cl_0: callable, str, optional
Coefficient of roll moment at zero angle of attack. Default is 0.
- cl_alpha: callable, str, optional
Coefficient of roll moment derivative with respect to angle of attack. Default is 0.
- cl_beta: callable, str, optional
Coefficient of roll moment derivative with respect to sideslip angle. Default is 0.
- cl_p: callable, str, optional
Coefficient of roll moment derivative with respect to roll rate. Default is 0.
- cl_q: callable, str, optional
Coefficient of roll moment derivative with respect to pitch rate. Default is 0.
- cl_r: callable, str, optional
Coefficient of roll moment derivative with respect to yaw rate. Default is 0.
center_of_pressure (
tuple
, optional) – Application point of the aerodynamic forces and moments. The center of pressure is defined in the local coordinate system of the aerodynamic surface. The default value is (0, 0, 0).name (
str
) – Name of the aerodynamic surface. Default is ‘GenericSurface’.
- _get_default_coefficients()[source]#
Returns default coefficients
- Returns:
default_coefficients – Dictionary whose keys are the coefficients names and keys are the default values.
- Return type:
dict
- compute_forcing_coefficient(c_0, c_alpha, c_beta)[source]#
Compute the forcing coefficient from the derivatives of the aerodynamic coefficients.
- compute_damping_coefficient(c_p, c_q, c_r)[source]#
Compute the damping coefficient from the derivatives of the aerodynamic coefficients.
- _compute_from_coefficients(rho, stream_speed, alpha, beta, mach, reynolds, pitch_rate, yaw_rate, roll_rate)[source]#
Compute the aerodynamic forces and moments from the aerodynamic coefficients.
- Parameters:
rho (
float
) – Air density.stream_speed (
float
) – Magnitude of the airflow speed.alpha (
float
) – Angle of attack in radians.beta (
float
) – Sideslip angle in radians.mach (
float
) – Mach number.reynolds (
float
) – Reynolds number.pitch_rate (
float
) – Pitch rate in radians per second.yaw_rate (
float
) – Yaw rate in radians per second.roll_rate (
float
) – Roll rate in radians per second.
- Returns:
The aerodynamic forces (lift, side_force, drag) and moments (pitch, yaw, roll) in the body frame.
- Return type:
tuple
offloat