Beispiel #1
0
 def rotated_flap(self):
     deflected_flap = RotatedShape(
         self.wing_parts[1],
         self.hinge_points[0],  # Rotate around hinge
         p2v(self.hinge_points[0]) - p2v(self.hinge_points[1]),
         angle=-self.flap_deflection * np.pi / 180)
     center_point = v2p(
         p2v(self.hinge_points[0]) / 2 +
         p2v(self.hinge_points[1]) / 2)  # Rotation point for corrections
     deflected_flap = RotatedShape(
         deflected_flap,
         center_point,
         Vector(0, 0, 1),
         angle=self.z_rot_correction)  # Adjust rotation around z axis
     return RotatedShape(
         deflected_flap,
         center_point,
         Vector(1, 0, 0),
         angle=self.x_rot_correction)  # Adjust rotation around x axis
Beispiel #2
0
 def camber_line(self):
     xb, zb, xt, zt = split_coordinates(self.airfoil_coordinates)
     x_locations = np.linspace(self.flap_hinge_location, 1, 25)
     points_list_1, points_list_2 = [], []
     for i in range(len(x_locations)):
         z_bottom = interp_coords(xb, zb, x_locations[i])
         z_top = interp_coords(xt, zt, x_locations[i])
         margin = (x_locations[i] - self.flap_hinge_location) * 0.01
         points_list_1.append(
             Point(x_locations[i], 0, (z_top + z_bottom) / 2))
         points_list_2.append(
             Point(x_locations[i], 0, (z_top + z_bottom) / 2 + margin))
     lines_1, lines_2 = [], []
     for i in range(2):
         lines_1.append(
             FittedCurve(
                 np.array(points_list_1) * self.chords[i] +
                 p2v(self.points[i])))
         lines_2.append(
             FittedCurve(
                 np.array(points_list_2) * self.chords[i] +
                 p2v(self.points[i])))
     return lines_1, lines_2
Beispiel #3
0
 def airfoils(self):
     out = [0, 0]
     for i in range(2):
         scaled_airfoil = ScaledCurve(self.unit_airfoil, factor=self.chords[i], reference_point=Point(0, 0, 0))
         out[i] = TranslatedCurve(scaled_airfoil, p2v(self.points[i]))
     return out
Beispiel #4
0
 def flap(self):
     return RotatedShape(self.wing_parts.solids[0],
                         self.hinge_location[0],
                         vector=p2v(self.hinge_location[1]) -
                         p2v(self.hinge_location[0]),
                         angle=self.flap_deflection * np.pi / 180)
Beispiel #5
0
 def circle_center(self):
     out = [0, 0]
     for i in range(2):
         out[i] = self.point + p2v(self.points[i])
     return out
Beispiel #6
0
 def flap(self):
     return RotatedShape(self.wing_parts.solids[0],
                         self.hinge_points[0],
                         p2v(self.hinge_points[0]) -
                         p2v(self.hinge_points[1]),
                         angle=-self.flap_deflection * np.pi / 180)