Skip to content

Commit

Permalink
Corrections to VLM and Lift Cruise network
Browse files Browse the repository at this point in the history
  • Loading branch information
mclarke2 committed Nov 10, 2021
1 parent 4c9e2bc commit 4a33d72
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 16 deletions.
2 changes: 1 addition & 1 deletion trunk/SUAVE/Components/Energy/Networks/Lift_Cruise.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ def evaluate_thrust(self,state):
# Check to see if magic thrust is needed, the ESC caps throttle at 1.1 already
eta = conditions.propulsion.throttle_lift[:,0,None]
P_lift[eta>1.0] = P_lift[eta>1.0]*eta[eta>1.0]
F_forward[eta[:,0]>1.0,:] = F_lift[eta[:,0]>1.0,:]*eta[eta[:,0]>1.0,:]
F_lift[eta[:,0]>1.0,:] = F_lift[eta[:,0]>1.0,:]*eta[eta[:,0]>1.0,:]


# Run the motor for current
Expand Down
6 changes: 3 additions & 3 deletions trunk/SUAVE/Input_Output/OpenVSP/vsp_wing.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ def read_vsp_wing(wing_id, units_type='SI',write_airfoil_file=True):

# Check if this is vertical tail, this seems like a weird first step but it's necessary
# Get the initial rotation to get the dihedral angles
x_rot = vsp.GetParmVal( wing_id,'X_Rotation','XForm')
if x_rot >=70:
x_rot = vsp.GetParmVal( wing_id,'X_Rotation','XForm')
if abs(x_rot) >=70:
wing = SUAVE.Components.Wings.Vertical_Tail()
wing.vertical = True
x_rot = (90-x_rot) * Units.deg
x_rot = (90-x_rot) * Units.deg
else:
# Instantiate a wing
wing = SUAVE.Components.Wings.Wing()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -707,22 +707,28 @@ def generate_wing_vortex_distribution(VD,wing,n_cw,n_sw,spc,precision):
xi_prime_bs, y_prime_bs, zeta_prime_bs = rotate_points_with_quaternion(quaternion, [xi_prime_bs,y_prime_bs,zeta_prime_bs]) if is_last_section else [None, None, None]

# reflect over the plane y = z for a vertical wing-----------------------------------------------------
inverted_wing = -np.sign(break_dihedral[i_break] - np.pi/2)
if vertical_wing:
y_prime_a1, zeta_prime_a1 = zeta_prime_a1, y_prime_a1
y_prime_ah, zeta_prime_ah = zeta_prime_ah, y_prime_ah
y_prime_ac, zeta_prime_ac = zeta_prime_ac, y_prime_ac
y_prime_a2, zeta_prime_a2 = zeta_prime_a2, y_prime_a2
y_prime_a1, zeta_prime_a1 = zeta_prime_a1, inverted_wing*y_prime_a1
y_prime_ah, zeta_prime_ah = zeta_prime_ah, inverted_wing*y_prime_ah
y_prime_ac, zeta_prime_ac = zeta_prime_ac, inverted_wing*y_prime_ac
y_prime_a2, zeta_prime_a2 = zeta_prime_a2, inverted_wing*y_prime_a2

y_prime_b1, zeta_prime_b1 = zeta_prime_b1, y_prime_b1
y_prime_bh, zeta_prime_bh = zeta_prime_bh, y_prime_bh
y_prime_bc, zeta_prime_bc = zeta_prime_bc, y_prime_bc
y_prime_b2, zeta_prime_b2 = zeta_prime_b2, y_prime_b2
y_prime_b1, zeta_prime_b1 = zeta_prime_b1, inverted_wing*y_prime_b1
y_prime_bh, zeta_prime_bh = zeta_prime_bh, inverted_wing*y_prime_bh
y_prime_bc, zeta_prime_bc = zeta_prime_bc, inverted_wing*y_prime_bc
y_prime_b2, zeta_prime_b2 = zeta_prime_b2, inverted_wing*y_prime_b2

y_prime_ch, zeta_prime_ch = zeta_prime_ch, y_prime_ch
y_prime , zeta_prime = zeta_prime , y_prime
y_prime_ch, zeta_prime_ch = zeta_prime_ch, inverted_wing*y_prime_ch
y_prime , zeta_prime = zeta_prime , inverted_wing*y_prime

y_prime_as, zeta_prime_as = zeta_prime_as, y_prime_as
y_prime_bs, zeta_prime_bs = zeta_prime_bs, y_prime_bs
y_prime_as, zeta_prime_as = zeta_prime_as, inverted_wing*y_prime_as

if np.any(y_prime_bs) == None:
pass
else:
y_prime_bs = inverted_wing*y_prime_bs
y_prime_bs, zeta_prime_bs = zeta_prime_bs, y_prime_bs

# store coordinates of panels, horseshoeces vortices and control points relative to wing root----------
xa1[idx_y*n_cw:(idx_y+1)*n_cw] = xi_prime_a1 # top left corner of panel
Expand Down

0 comments on commit 4a33d72

Please sign in to comment.