def test_combustion_image_geometry_fourier(a, b, baseRadius, branches, ox_flow):
    """ Give the geometry mean Isp as an objective function """

    # ------------ Generate Data Layer:

    json_interpreter = generate_data_layer()
    combustion_table = json_interpreter.return_combustion_table()

    # ------------ Define parameters:

    geometric_params = {'L': 0.13,
                        'externalRadius': 88.5 / 2000,
                        'imagePixelSize': 2048,
                        'imageMeterSize': 0.09,
                        'regressionModel': Reg.MarxmanAndConstantFloodingRegimeModel(**combustion_table)}

    shape_params = {'a': a,
                    'b': b,
                    'impact' : 0.5,
                    'branches': branches,
                    'baseRadius': baseRadius,
                    'n': 20}

    nozzle_params = {'At': 0.000038, 'expansion': 6.3, 'lambda_e': 0.98, 'erosion': 0}

    simulation_params = {'ox_flow': ox_flow, 'safety_thickness': 0.005}

    # ------------- Generate objects:

    geometry_obj = Geom.SinglePortImageGeometry(**geometric_params)
    geometry_obj.generateFourier(**shape_params)
    #geometry_obj.draw_geometry()
    nozzle_obj = Noz.Nozzle(**nozzle_params)
    json_interpreter = generate_data_layer()

    # Instantiate the combustion module
    combustion_obj = CombustionObject(json_interpreter=json_interpreter,
                                      geometry_object=geometry_obj,
                                      nozzle_object=nozzle_obj)

    # -------------- Run simulation

    combustion_obj.run_simulation_constant_fuel_sliver_image_geometry(**simulation_params)

    mean_isp = 0

    if(len(combustion_obj.results["run_values"]['isp']) > 5):

        for k in range(1, len(combustion_obj.results["run_values"]['isp'])):

            mean_isp += combustion_obj.results["run_values"]['isp'][k] * (combustion_obj.results["run_values"]['time'][k] - combustion_obj.results["run_values"]['time'][k-1])

        mean_isp = mean_isp / combustion_obj.results["run_values"]['time'][-1]

    return mean_isp
def test_onera_three_port_geometry_with_center_port():
    """ Study the potential evolution of the geometry associated to a Three Port Geometry
        to be performed at ONERA. The characteristics of the Test are:
        1. Three Port Geometry
        2. Go range: TBD kg/m^2/sec
        3. ox flow: same
        4. Chamber pressure: 36 bar, closest possible to the target pressure of Griffon.
    """

    # ------------ Generate the data layer:

    json_interpreter = generate_data_layer()  # Use same data-layer used for Griffon (same pressure)
    combustion_table = json_interpreter.return_combustion_table()

    # ------------ Define parameters:

    # MultipleCircularPortsWithCircularCenter
    # N, L, regressionModel, ringPortsIntialRadius, centralPortInitialRadius, r_ext

    geometric_params = {'N': 4,
                        'L': 0.130,
                        'ringPortsIntialRadius': 9e-3 / 2,
                        'centralPortInitialRadius': 9e-3 / 2,
                        'r_ext': 94.5e-3 / 2,
                        'regressionModel': Reg.MarxmanAndConstantFloodingRegimeModel(**combustion_table)}

    nozzle_params = {'At': 0.000038, 'expansion': 6.3, 'lambda_e': 0.98, 'erosion': 0}

    simulation_params = {'ox_flow': 0.065, 'safety_thickness': 0.005, 'dt': 0.01, 'max_burn_time': 8}

    # ------------- Generate objects:

    geometry_obj = Geom.MultipleCircularPortsWithCircularCenter(**geometric_params)
    geometry_obj.draw_geometry()
    nozzle_obj = Noz.Nozzle(**nozzle_params)
    json_interpreter = generate_data_layer(data_file="Thermodynamic Data Onera 41 bar H2O2 87_5.json")

    # Instantiate the combustion module
    combustion_obj = CombustionObject(json_interpreter=json_interpreter,
                                      geometry_object=geometry_obj,
                                      nozzle_object=nozzle_obj)

    # -------------- Run simulation & Plot:


    combustion_obj.run_simulation_constant_fuel_sliver(**simulation_params)

    # Print the module
    print(combustion_obj)

    # Plot the results
    combustion_obj.plot_results()
예제 #3
0
def test_combustion_onera_data():
    """ perform the test over the combustion module but with Onera Test Data """

    # ------------ Define parameters:

    geometric_params = {'L': 0.235, 'rintInitial': 0.0186658954, 'rext0': 0.2}

    nozzle_params = {
        'At': 0.000038,
        'expansion': 6.3,
        'lambda_e': 0.98,
        'erosion': 0
    }

    design_params = {
        'gamma': 1.27,
        'p_chamber': 4000000,
        'p_exit': 100000,
        'c_star': 1500,
        'isp': 230,
        'thrust': 30000
    }

    simulation_params = {
        'ox_flow': 0.0855,
        'safety_thickness': 0.005,
        'dt': 0.05,
        'max_burn_time': 8.25
    }

    # ------------- Generate objects:

    geometry_obj = Geom.OneCircularPort(**geometric_params)
    nozzle_obj = Noz.Nozzle(**nozzle_params)
    # nozzle_obj.set_design(**design_params)                            # Do not set the design of the nozzle
    json_interpreter = generate_data_layer(
        data_file="Thermodynamic Data Onera 41 bar H2O2 87_5.json")

    # Instantiate the combustion module
    combustion_obj = CombustionObject(json_interpreter=json_interpreter,
                                      geometry_object=geometry_obj,
                                      nozzle_object=nozzle_obj)

    # -------------- Run simulation & Plot:

    combustion_obj.run_simulation_constant_fuel_sliver(**simulation_params)

    # Print the module
    print(combustion_obj)

    # Plot the results
    combustion_obj.plot_results()
예제 #4
0
def test_combustion():
    """ perform the test over the combustion module """

    # ------------ Define parameters:

    geometric_params = {'L': 0.5, 'rintInitial': 0.04, 'rext0': 0.1}

    nozzle_params = {
        'At': 0.000589,
        'expansion': 5.7,
        'lambda_e': 0.98,
        'erosion': 0
    }

    design_params = {
        'gamma': 1.27,
        'p_chamber': 4000000,
        'p_exit': 100000,
        'c_star': 1500,
        'isp': 230,
        'thrust': 30000
    }

    simulation_params = {'ox_flow': 6, 'safety_thickness': 0.005, 'dt': 0.05}

    # ------------- Generate objects:

    geometry_obj = Geom.OneCircularPort(**geometric_params)
    nozzle_obj = Noz.Nozzle(**nozzle_params)
    nozzle_obj.set_design(**design_params)
    json_interpreter = generate_data_layer()

    # Instantiate the combustion module
    combustion_obj = CombustionObject(json_interpreter=json_interpreter,
                                      geometry_object=geometry_obj,
                                      nozzle_object=nozzle_obj)

    # -------------- Run simulation & Plot:

    combustion_obj.run_simulation_constant_fuel_sliver(**simulation_params)

    # Print the module
    print(combustion_obj)

    # Plot the results
    combustion_obj.plot_results()
def test_onera_physical_test_1_2():
    """ Study the potential evolution of the geometry associated to the 1st physical test
        to be performed at ONERA (version at 36 bar). The characteristics of the Test are:
        1. Single Port Geometry
        2. Go range: [100 - etc] kg/m^2/sec
        3. Chamber pressure: TBD, closest possible to the target pressure of Griffon.
    """

    # ------------ Generate the data layer:

    json_interpreter = generate_data_layer()
    # Use same data-layer used for Griffon (same pressure)
    combustion_table = json_interpreter.return_combustion_table()

    # ------------ Define parameters:

    geometric_params = {'L': 0.130,
                        'rintInitial': 0.015,
                        'rext0': 94.5e-3 / 2,
                        'regressionModel': Reg.MarxmanAndConstantFloodingRegimeModel(**combustion_table)}

    nozzle_params = {'At': 0.000038, 'expansion': 6.3, 'lambda_e': 0.98, 'erosion': 0}

    simulation_params = {'ox_flow': 0.07, 'safety_thickness': 0.005, 'dt': 0.01, 'max_burn_time': 8}

    # ------------- Generate objects:

    geometry_obj = Geom.OneCircularPort(**geometric_params)
    nozzle_obj = Noz.Nozzle(**nozzle_params)

    # Instantiate the combustion module
    combustion_obj = CombustionObject(json_interpreter=json_interpreter,
                                      geometry_object=geometry_obj,
                                      nozzle_object=nozzle_obj)

    # -------------- Run simulation & Plot:

    combustion_obj.run_simulation_constant_fuel_sliver(**simulation_params)

    # Print the module
    print(combustion_obj)

    # Plot the results
    combustion_obj.plot_results()