Skip to content

Commit

Permalink
Propeller computation change
Browse files Browse the repository at this point in the history
Wasn't part of the original PR but still made some change. We were unnecessarily extensive on how many propeller pitch we wre testing. Now we only do it once per degree before it was more every third of degree. Also attempted to provide smart initial values to the induced speed but it makes the low speed not converge 😦
  • Loading branch information
florentLutz committed Feb 19, 2024
1 parent 0fcd7dd commit f1d6603
Show file tree
Hide file tree
Showing 7 changed files with 1,203 additions and 1,224 deletions.
8 changes: 4 additions & 4 deletions integration_tests/oad_process/test_oad_process.py
Expand Up @@ -117,9 +117,9 @@ def test_oad_process_vlm_be76(cleanup):
assert_allclose(problem.get_val("data:mission:sizing:fuel", units="kg"), 258.0, atol=1)
assert_allclose(problem["data:handling_qualities:stick_fixed_static_margin"], 0.25, atol=1e-2)
# noinspection PyTypeChecker
assert_allclose(problem.get_val("data:weight:aircraft:MTOW", units="kg"), 1747.0, atol=1)
assert_allclose(problem.get_val("data:weight:aircraft:MTOW", units="kg"), 1748.0, atol=1)
# noinspection PyTypeChecker
assert_allclose(problem.get_val("data:weight:aircraft:OWE", units="kg"), 1109.0, atol=1)
assert_allclose(problem.get_val("data:weight:aircraft:OWE", units="kg"), 1110.0, atol=1)


def test_oad_process_tbm_900(cleanup):
Expand Down Expand Up @@ -194,10 +194,10 @@ def test_oad_process_vlm_mission_vector(cleanup):
_check_weight_performance_loop(problem)

# noinspection PyTypeChecker
assert_allclose(problem.get_val("data:mission:sizing:fuel", units="kg"), 252.0, atol=1)
assert_allclose(problem.get_val("data:mission:sizing:fuel", units="kg"), 253.0, atol=1)
assert_allclose(problem["data:handling_qualities:stick_fixed_static_margin"], 0.15, atol=1e-2)
# noinspection PyTypeChecker
assert_allclose(problem.get_val("data:weight:aircraft:MTOW", units="kg"), 1656.0, atol=1)
assert_allclose(problem.get_val("data:weight:aircraft:MTOW", units="kg"), 1657.0, atol=1)
# noinspection PyTypeChecker
assert_allclose(problem.get_val("data:weight:aircraft:OWE", units="kg"), 1028.0, atol=1)

Expand Down
Expand Up @@ -231,7 +231,11 @@ def construct_table(self, inputs, speed_interp, altitude, omega):

for v_inf in speed_interp:
self.compute_extreme_pitch(inputs, v_inf)
theta_interp = np.linspace(self.theta_min, self.theta_max, 100)
# Compute performances for evenly space theta every degree
theta_interp = np.append(
np.arange(self.theta_min, self.theta_max, 1.0),
np.array([self.theta_max]),
)
local_thrust_vect = []
local_theta_vect = []
local_eta_vect = []
Expand Down
Expand Up @@ -42,6 +42,10 @@ def __init__(self, **kwargs):
self.theta_min = 0.0
self.theta_max = 0.0

# Store values for induced velocities
self.vi_vect = None
self.vt_vect = None

def initialize(self):
self.options.declare("sections_profile_position_list", types=list)
self.options.declare("sections_profile_name_list", types=list)
Expand Down Expand Up @@ -103,7 +107,16 @@ def compute_extreme_pitch(self, inputs, v_inf):
self.theta_max = phi_75 + 25.0

def compute_pitch_performance(
self, inputs, theta_75, v_inf, altitude, omega, radius, alpha_list, cl_list, cd_list
self,
inputs,
theta_75,
v_inf,
altitude,
omega,
radius,
alpha_list,
cl_list,
cd_list,
):

"""
Expand Down Expand Up @@ -142,8 +155,12 @@ def compute_pitch_performance(
theta_75_ref = np.interp(0.75, radius_ratio_vect, twist_vect)

# Initialise vectors
vi_vect = np.zeros_like(radius)
vt_vect = np.zeros_like(radius)
if self.vi_vect is None:
self.vi_vect = np.zeros_like(radius)

if self.vt_vect is None:
self.vt_vect = np.zeros_like(radius)

thrust_element_vector = np.zeros_like(radius)
torque_element_vector = np.zeros_like(radius)
alpha_vect = np.zeros_like(radius)
Expand Down Expand Up @@ -182,8 +199,8 @@ def compute_pitch_performance(
method="hybr",
options={"xtol": 1e-3},
).x
vi_vect[idx] = speed_vect[0]
vt_vect[idx] = speed_vect[1]
self.vi_vect[idx] = speed_vect[0]
self.vt_vect[idx] = speed_vect[1]
results = self.bem_theory(
speed_vect,
radius[idx],
Expand Down

0 comments on commit f1d6603

Please sign in to comment.