"""
Physical model for the forces and torques on a disc.
"""
from dataclasses import dataclass
import numpy as np
[docs]@dataclass
class Model:
"""
Coefficient model for a disc. Holds all of the aerodynamic
parameters coupling the kinematic variables (spins and angles)
to the force magnitudes.
"""
PL0: float = 0.33
PLa: float = 1.9
PD0: float = 0.18
PDa: float = 0.69
PTxwx: float = 0.43
PTxwz: float = -1.4e-2
PTy0: float = -8.2e-2
PTya: float = -1.2e-2
PTywy: float = -1.7e-3
PTzwz: float = -3.4e-5
alpha_0: float = 4 * np.pi / 180
#####################################################################
# Below are functions connecting physical variables to force/torque #
# scaling factors (the `C`s) #
#####################################################################
[docs] def C_lift(self, alpha: float) -> float:
"""
Lift force scale factor. Linear in the angle of attack (`alpha`).
Args:
alpha (float): angle of attack in radians
Returns:
(float) lift force scale factor
"""
return self.PL0 + self.PLa * alpha
[docs] def C_drag(self, alpha: float) -> float:
"""
Drag force scale factor. Quadratic in the angle of attack (`alpha`).
Args:
alpha (float): angle of attack in radians
Returns:
(float) drag force scale factor
"""
return self.PD0 + self.PDa * (alpha - self.alpha_0) ** 2
[docs] def C_x(self, wx: float, wz: float) -> float:
"""
'x'-torque scale factor. Linearly additive in the 'z' angular velocity
(`w_z`) and the 'x' angular velocity (`w_x`).
Args:
wx (float): 'x' angular velocity in radians per second
wz (float): 'z' angular velocity in radians per second
Returns:
(float) 'x'-torque scale factor
"""
return self.PTxwx * wx + self.PTxwz * wz
[docs] def C_y(self, alpha: float, wy: float) -> float:
"""
'y'-torque scale factor. Linearly additive in the 'y' angular velocity
(`w_y`) and the angle of attack (`alpha`).
Args:
alpha (float): angle of attack in radians
wy (float): 'y' angular velocity in radians per second
Returns:
(float) 'y'-torque scale factor
"""
return self.PTy0 + self.PTywy * wy + self.PTya * alpha
[docs] def C_z(self, wz: float) -> float:
"""
'z'-torque scale factor. Linear in the 'z' angular velocity
(`w_z`).
Args:
wz (float): 'z' angular velocity in radians per second
Returns:
(float) 'z'-torque scale factor
"""
return self.PTzwz * wz