try:
    from Database.database_functions import DatabaseConnector
    from Integrator import Integration
    from MOIcalc.moicalc import inertia
except ModuleNotFoundError:
    import sys
    from os import path

    sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
    from Database.database_functions import DatabaseConnector
    from Integrator import Integration
    from MOIcalc.moicalc import inertia

database_connector = DatabaseConnector()

wing_span = database_connector.load_value("wing_span") / 2
outer_diameter = database_connector.load_value("df,outer")
radius_fuselage = outer_diameter / 2

E_Modulus = 68.9E9
# function of Mx(span)

# whole function Mx(span)/Ixx(span)

# (-1/E)*(sp.integrate.quad(func, 0, y)) ? Also non linear functions
# first interval is (0 to y)
# second interval (0 to 26)

try:
    with open("../InertialLoadingCalculator/data.pickle", 'rb') as file:
        data = pickle.load(file)
Example #2
0
try:
    from Database.database_functions import DatabaseConnector
except ModuleNotFoundError:
    import sys
    from os import path
    sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
    from Database.database_functions import DatabaseConnector

database_connector = DatabaseConnector()

chord_r = database_connector.load_value("root_chord")
taper = database_connector.load_value("taper_ratio")
half_span = database_connector.load_value("wing_span") / 2

#Determines the chord length at every y position along the span
def chord_function(y):
    return chord_r - chord_r*(1-taper)*(y/half_span)
Example #3
0
#__plot(__main_w_c)

# ***********************************************
# POLAR MOMENT OF INERTIA
# ***********************************************

# ***********************************************
# BENDING DEFLECTION
# ***********************************************

# will depend mainly on constant values that we put inside the the moment of inertia functions
# E is a constant, therefore (-1/E) is a constant and goes in front of integral
# v(span) = (-1/E) *integal(0, 26.smth) integral (0 , span) (Mx/Ixx)dspan dspan

wing_span = database_connector.load_value("wing_span") / 2


def inertia(b):  #[0] is ixx, [1] is izz
    # t1, t2, t3, t4, t5 , Ns, As
    """
    CHANGE THESE VALUES!
    """

    t1 = 0.045  # spar LE
    t2 = 0.045  # spar TE
    t3 = 0.06  # top plate
    t4 = 0.06  # bottom plate
    t5 = 0.045  # spar middle
    As = 0.0075  # Area of single stringer
    if b < 10:
    from Integrator import Integration
    import Importer.xflr5 as aerodynamic_data
    from Database.database_functions import DatabaseConnector
except ModuleNotFoundError:
    import sys
    from os import path

    sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
    import Importer.xflr5 as aerodynamic_data
    from Database.database_functions import DatabaseConnector
    from Integrator import Integration

database_connector = DatabaseConnector()

# Import basic geometry
wing_span = database_connector.load_value("wing_span") / 2
outer_diameter = database_connector.load_value("df,outer")
radius_fuselage = outer_diameter / 2
surface_area = database_connector.load_value("surface_area") / 2
root_chord = database_connector.load_value("root_chord")
tip_chord = database_connector.load_value("tip_chord")
taper_ratio = database_connector.load_value("taper_ratio")
spanwise_location_engine = database_connector.load_value(
    "engine_spanwise_location")

chord_at_engine_location = aerodynamic_data.chord_function(
    spanwise_location_engine)
radius_engine = database_connector.load_value("d_engine") / 2

moment_arm_engine = (
    0.25 + 0.2) * aerodynamic_data.chord_function(spanwise_location_engine)
Example #5
0
try:
    from Database.database_functions import DatabaseConnector
except ModuleNotFoundError:
    sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
    from Database.database_functions import DatabaseConnector

# Init database connection
database_connector = DatabaseConnector()

# Locate wingbox file destination
wingbox_creator_folder = os.path.dirname(
    os.path.abspath(inspect.getfile(inspect.currentframe())))
wingbox_file_destination = wingbox_creator_folder.replace(
    "\\", "/").removesuffix("/WingboxCreator") + '/Database/wingbox.json'

halfspan = database_connector.load_value("wing_span") / 2
quarter_chord_sweep = database_connector.load_value("quarter_chord_sweep")
dihedral_angle = database_connector.load_value("dihedral_angle")
""" Determination of the wingbox coordinates """


def airfoil_definition_converter(
        airfoil_file):  # Previously 'text_to_array_converter'
    # the x and y are arranged vertically
    a_foil_array_1_top_surface = np.genfromtxt(airfoil_file,
                                               skip_header=1,
                                               skip_footer=100,
                                               usecols=(0, 1))
    a_foil_array_1_bottom_surface = np.genfromtxt(airfoil_file,
                                                  skip_header=101,
                                                  usecols=(0, 1))
Example #6
0
import matplotlib.pyplot as plt

try:
    import Importer.xflr5 as aerodynamic_data
    from Database.database_functions import DatabaseConnector
except ModuleNotFoundError:
    import sys
    from os import path
    sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
    import Importer.xflr5 as aerodynamic_data
    from Database.database_functions import DatabaseConnector

database_connector = DatabaseConnector()

# Import basic geometry
wing_span = database_connector.load_value("wing_span")
Outer_diameter = database_connector.load_value("df,outer")
radius_fuselage = Outer_diameter / 2
surface_area = database_connector.load_value("surface_area")
# Import weight and location of the engine
weight_engine = database_connector.load_value("engine_weight")
spanwise_location_engine = database_connector.load_value(
    "engine_spanwise_location")
# Import the weight of the wing and fuel (Class II)
weight_wing = database_connector.load_value("wing_weight")
weight_fuel = database_connector.load_value("fuel_max")


def lift_distribution(y, density, velocity):
    return aerodynamic_data.lift_coef_function_10(y) * 0.5 * density * (
        velocity**2) * surface_area
except ModuleNotFoundError:
    import sys
    from os import path

    sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
    from Database.database_functions import DatabaseConnector
    from WingData.chord_function import chord_function
    from Integrator import Integration

database_connector = DatabaseConnector()

G = 26 * 10**9  # database_connector.load_value("shear_modulus_pa")
t1 = 0.035  # database_connector.load_wingbox_value("...") left and right spar
t2 = 0.035  # database_connector.load_wingbox_value("...") skin
t3 = 0.035  # database_connector.load_wingbox_value("...") mid spar
engine_pos = database_connector.load_value("engine_spanwise_location")

wingbox_points = database_connector.load_wingbox_value("wingbox_corner_points")

b_one = (wingbox_points[0][1] - wingbox_points[5][1])
b_two = (wingbox_points[2][1] - wingbox_points[3][1])
b_three = (wingbox_points[1][1] - wingbox_points[4][1])
a_one = sqrt((wingbox_points[0][1] - wingbox_points[1][1])**2 +
             (wingbox_points[1][0] - wingbox_points[0][0])**2)
a_two = sqrt((wingbox_points[4][1] - wingbox_points[5][1])**2 +
             (wingbox_points[4][0] - wingbox_points[5][0])**2)
c_one = sqrt((wingbox_points[1][1] - wingbox_points[2][1])**2 +
             (wingbox_points[1][0] - wingbox_points[2][0])**2)
c_two = sqrt((wingbox_points[3][1] - wingbox_points[4][1])**2 +
             (wingbox_points[3][0] - wingbox_points[4][0])**2)
Area_first = 0.5 * (b_one + b_three) * (wingbox_points[1][0] -