def main():

    # Define internal combustion engine from Cessna Regression Aircraft
    vehicle = vehicle_setup()

    # Setup the modified constant speed version of the network
    vehicle = ICE_CS(vehicle)

    # Setup analyses and mission
    analyses = base_analysis(vehicle)
    analyses.finalize()
    mission = mission_setup(analyses)

    # evaluate
    results = mission.evaluate()

    P_truth = 53734.90184388173
    mdot_truth = 0.004721271494265418

    P = results.segments.cruise.state.conditions.propulsion.power[-1, 0]
    mdot = results.segments.cruise.state.conditions.weights.vehicle_mass_rate[
        -1, 0]

    # Check the errors
    error = Data()
    error.P = np.max(np.abs((P - P_truth) / P_truth))
    error.mdot = np.max(np.abs((mdot - mdot_truth) / mdot_truth))

    print('Errors:')
    print(error)

    for k, v in list(error.items()):
        assert (np.abs(v) < 1e-6)

    return
Exemple #2
0
def main():

    # Define internal combustion engine from Cessna Regression Aircraft
    vehicle = vehicle_setup()

    # Setup analyses and mission
    analyses = base_analysis(vehicle)
    analyses.finalize()
    mission = mission_setup(analyses)

    # evaluate
    results = mission.evaluate()

    P_truth = 113274.953368933
    mdot_truth = 0.008752685036290996

    P = results.segments.cruise.state.conditions.propulsion.power[-1, 0]
    mdot = results.segments.cruise.state.conditions.weights.vehicle_mass_rate[
        -1, 0]

    # Check the errors
    error = Data()
    error.P = np.max(np.abs((P - P_truth) / P_truth))
    error.mdot = np.max(np.abs((mdot - mdot_truth) / mdot_truth))

    print('Errors:')
    print(error)

    for k, v in list(error.items()):
        assert (np.abs(v) < 1e-6)

    return
Exemple #3
0
def main():

    # Define internal combustion engine from Cessna Regression Aircraft
    vehicle = vehicle_setup()

    # Setup analyses and mission
    analyses = base_analysis(vehicle)
    analyses.finalize()
    mission = mission_setup(analyses, vehicle)

    # evaluate
    results = mission.evaluate()

    h = 0.008757244664175039

    P_truth = 54141.22575147851
    mdot_truth = 0.004756972043006517

    P = results.segments.cruise.state.conditions.propulsion.power[-1, 0]
    mdot = results.segments.cruise.state.conditions.weights.vehicle_mass_rate[
        -1, 0]

    # Check the errors
    error = Data()
    error.P = np.max(np.abs((P - P_truth) / P_truth))
    error.mdot = np.max(np.abs((mdot - mdot_truth) / mdot_truth))

    print('Errors:')
    print(error)

    for k, v in list(error.items()):
        assert (np.abs(v) < 1e-6)

    return
Exemple #4
0
def main():

    # Define internal combustion engine from Cessna Regression Aircraft
    vehicle = vehicle_setup()
    ice_engine = vehicle.propulsors.internal_combustion.engine

    # Define conditions
    conditions = Data()
    conditions.freestream = Data()
    conditions.propulsion = Data()
    conditions.freestream.altitude = np.array([[8000]]) * Units.feet
    conditions.freestream.delta_ISA = 0.0
    conditions.propulsion.combustion_engine_throttle = np.array([[0.8]])

    ice_engine.power(conditions)

    # Truth values for propeller with airfoil geometry defined
    P_truth = 81367.49237183
    P_sfc_truth = 0.52
    FFR_truth = 0.007149134158858348
    Q_truth = 287.7786359548746

    P = ice_engine.outputs.power[0][0]
    P_sfc = ice_engine.outputs.power_specific_fuel_consumption
    FFR = ice_engine.outputs.fuel_flow_rate[0][0]
    Q = ice_engine.outputs.torque[0][0]

    # Store errors
    error = Data()
    error.P = np.max(np.abs(P - P_truth))
    error.P_sfc = np.max(np.abs(P_sfc - P_sfc_truth))
    error.FFR = np.max(np.abs(FFR - FFR_truth))
    error.Q = np.max(np.abs(Q - Q_truth))

    print('Errors:')
    print(error)

    for k, v in list(error.items()):
        assert (np.abs(v) < 1e-6)

    return