def _generate_combustion_parameters(combustion_init_dict, json_interpreter): """ _generate_combustion_parameters performs all of the necessary calculations (if there are )required to set the inputs for the combustion module :param combustion_init_dict: dictionary containing the data required to prepare the inputs for the combustion module. :param json_interpreter: JsonInterpreter instance :return: combustion_parameters dictionary """ # ------------- Generate the objects: # Geometry geometry_obj = combustion_init_dict['geometric_params'].pop('type') geometry_obj = geometry_obj(**combustion_init_dict['geometric_params']) # Nozzle nozzle_obj = Nozzle(**combustion_init_dict['nozzle_params']) nozzle_obj.set_design(**combustion_init_dict['design_params']) # Return output return { 'json_interpreter': json_interpreter, 'geometry_object': geometry_obj, 'nozzle_object': nozzle_obj }
def test_combustion_three_port_geometry(): """ perform the test over the combustion module """ # ------------ Define parameters: geometric_params = {'L': 0.6, 'portsIntialRadius': 0.01, 'r_ext': 0.07} 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': 1.0, 'safety_thickness': 0.005, 'dt': 0.05} # ------------- Generate objects: geometry_obj = Geom.ThreeCircularPorts(**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 = CombustionObjectClassic(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_1d_implementation_single_circular_port_balanced_nozzle(): """ test_1d_implementation_single_circular_port_balanced_nozzle intends to test the implementation of the balanced nozzle based on the fixed point method. """ # ------------ Generate the data-layer: json_interpreter = generate_data_layer( "Griffon Data - ABS - H2O2 - 36 bar.json") combustion_table = json_interpreter.return_combustion_table() # ------------ Define parameters: geometric_params = {'L': 0.4, 'r_init': 0.03, 'r_ext': 0.05, 'N': 200} nozzle_params = { 'At': 0.000589, 'expansion': 5.7, 'lambda_e': 0.98, 'erosion': 0 } simulation_params = { 'ox_flow': 1.43, 'safety_thickness': 0.005, 'dt': 0.01, 'max_burn_time': None, 'tol_press': 1e-1 } # ------------- Generate objects: geometry_obj = Geom.SingleCircularPort1D(**geometric_params) nozzle_obj = Noz.Nozzle(**nozzle_params) regression_mod = Reg.MarxmanAndConstantFloodingRegimeModel( **combustion_table) # Instantiate the combustion module combustion_obj = Combustion.CombustionObject1D( json_interpreter=json_interpreter, nozzle_object=nozzle_obj, geometry_object=geometry_obj, regression_model=regression_mod) # -------------- Run simulation & Plot: combustion_obj.run_balanced_nozzle_analysis(**simulation_params) # Print the module print(combustion_obj) # Plot the results combustion_obj.plot_results() # Show plots plt.show()
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_combustion_image_geometry(): """ perform the test over the combustion module """ # ------------ Generate Data Layer: json_interpreter = generate_data_layer() combustion_table = json_interpreter.return_combustion_table() # ------------ Define parameters: geometric_params = {'L': 0.4, 'externalRadius': 0.45, 'imagePixelSize': 2048, 'imageMeterSize': 0.1, 'regressionModel': Reg.MarxmanAndConstantFloodingRegimeModel(**combustion_table)} shape_params = {'a' : [0.07552083333333333, -0.22916666666666666, 0.3151041666666667], 'b' : [], 'baseRadius' : 0.036, 'branches' : 8, 'impact' : 0.3, 'n' : 40} nozzle_params = {'At': 0.000589, 'expansion': 5.7, 'lambda_e': 0.98, 'erosion': 0} design_params = {'gamma': 1.27, 'p_chamber': 3200000, 'p_exit': 100000, 'c_star': 1500, 'ox_flow': 1., 'OF': 9} simulation_params = {'ox_flow': 0.96875, 'safety_thickness': 0.000000001, 'max_burn_time' : 5, 'dt': 0.05} # ------------- Generate objects: geometry_obj = Geom.SinglePortImageGeometry(**geometric_params) geometry_obj.generateFourier(**shape_params) #geometry_obj.draw_geometry() nozzle_obj = Noz.Nozzle(**nozzle_params) nozzle_obj.set_design(**design_params) json_interpreter = generate_data_layer() # Instantiate the combustion module combustion_obj = Comb.CombustionObjectImage(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_1d_implementation_single_circular_port(): """ 1D test of the Combustion Module 1D implementation """ # ------------ Generate the data-layer: json_interpreter = generate_data_layer("Griffon Data - Mock.json") combustion_table = json_interpreter.return_combustion_table() # ------------ Define parameters: geometric_params = {'L': 4.572, 'r_init': 0.152 / 2, 'r_ext': 0.5, 'N': 12} nozzle_params = { 'At': 0.000589, 'expansion': 5.7, 'lambda_e': 0.98, 'erosion': 0 } simulation_params = { 'ox_flow': 7.95, 'safety_thickness': 0.005, 'dt': 0.1, 'max_burn_time': 70, 'file_name': '../data/data_tests/myGeometry.txt', 'times': [0.1, 20, 60] } # ------------- Generate objects: geometry_obj = Geom.SingleCircularPort1D(**geometric_params) nozzle_obj = Noz.Nozzle(**nozzle_params) regression_mod = Reg.SingleRegimeMarxmanModel(**combustion_table) # Instantiate the combustion module combustion_obj = Combustion.CombustionObject1D( json_interpreter=json_interpreter, nozzle_object=nozzle_obj, geometry_object=geometry_obj, regression_model=regression_mod) # -------------- 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() # Show plots plt.show()
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()
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()
def define_onera_physical_hycom_14_test_combustion_object(): """ Define the ONERA physical test CombustionObject for Hycom 14 test :return combustion object """ # ------------ Generate the data layer: json_interpreter = generate_data_layer("DataLayerONERATests_Hycom14.json") # Use same data-layer used for Griffon (same pressure) combustion_table = json_interpreter.return_combustion_table() # ------------ Define parameters: geometric_params = { 'L': 0.130, 'rintInitial': 13.30e-3 / 2, 'rext0': 94.5e-3 / 2, 'regressionModel': Reg.TwoRegimesMarxmanAndFloodedModel(**combustion_table) } nozzle_params = { 'At': (np.pi / 4) * 7.25e-3**2, 'expansion': 6.3, 'lambda_e': 0.98, 'erosion': 0 } simulation_params = { 'ox_flow': 0.080, 'safety_thickness': 0.005, 'dt': 0.01, 'max_burn_time': 8.5 } # ------------- Generate objects: geometry_obj = Geom.OneCircularPort(**geometric_params) nozzle_obj = Noz.Nozzle(**nozzle_params) # Instantiate the combustion module combustion_object = CombustionObjectClassic( json_interpreter=json_interpreter, geometry_object=geometry_obj, nozzle_object=nozzle_obj) # -------------- Run simulation & Plot: combustion_object.run_simulation_constant_fuel_sliver(**simulation_params) # Return the combustion object return combustion_object
def generate_combustion_parameters(combustion_init_dict, json_interpreter): """ generate_combustion_parameters performs all of the necessary calculations (if there are )required to set the inputs for the combustion module :param combustion_init_dict: dictionary containing the data required to prepare the inputs for the combustion module. :param json_interpreter: JsonInterpreter instance :return: combustion_parameters dictionary """ # ------------- Generate the objects: # Geometry geometry_type = combustion_init_dict['geometric_params'].pop('type') regression_obj = Reg.MarxmanAndConstantFloodingRegimeModel( **json_interpreter.return_combustion_table()) combustion_init_dict['geometric_params'][ 'regressionModel'] = regression_obj geometry_obj = geometry_type( **combustion_init_dict['geometric_params']) if geometry_type == SinglePortImageGeometry: geometry_obj.generateFourier( **combustion_init_dict['shape_params']) # Nozzle nozzle_obj = Nozzle(**combustion_init_dict['nozzle_params']) # Set the nozzle design if combustion_init_dict['set_nozzle_design']: nozzle_obj.set_design(**combustion_init_dict['design_params']) # Return output return { 'json_interpreter': json_interpreter, 'geometry_object': geometry_obj, 'nozzle_object': nozzle_obj }
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()
def test_combustion(): """ perform the test over the combustion module """ # ------------ Generate Data Layer: json_interpreter = generate_data_layer() combustion_table = json_interpreter.return_combustion_table() # ------------ Define parameters: geometric_params = {'L': 0.4, 'rintInitial': 0.05, 'rext0': 0.07, 'regressionModel': Reg.MarxmanAndConstantFloodingRegimeModel(**combustion_table)} nozzle_params = {'At': 0.000589, 'expansion': 5.7, 'lambda_e': 0.98, 'erosion': 0} design_params = {'gamma': 1.27, 'p_chamber': 3200000, 'p_exit': 100000, 'c_star': 1500, 'ox_flow': 1.2, 'OF': 5} simulation_params = {'ox_flow': 1.3, '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 = CombustionObjectClassic(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_combustion_onera_data(): """ perform the test over the combustion module but with Onera Test Data """ # ------------ Generate the data layer: json_interpreter = generate_data_layer(data_file="Thermodynamic Data Onera 41 bar H2O2 87_5.json") combustion_table = json_interpreter.return_combustion_table() # ------------ Define parameters: geometric_params = {'L': 0.235, 'rintInitial': 0.0186658954, 'rext0': 0.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.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) json_interpreter = generate_data_layer(data_file="Thermodynamic Data Onera 41 bar H2O2 87_5.json") # Instantiate the combustion module combustion_obj = CombustionObjectClassic(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 define_onera_physical_hycom_16_test_combustion_object(): """ Define the ONERA physical test CombustionObject for Hycom 16 test :return combustion object """ # ------------ Generate the data layer: json_interpreter = generate_data_layer("DataLayerONERATests_Hycom16.json") # Use same data-layer used for Griffon (same pressure) combustion_table = json_interpreter.return_combustion_table() # ------------ Define parameters: shape_params = { 'polynom': [-0.2701822916666667, 0.15625, 0], 'baseRadius': 0.02, 'branches': 5, 'n': 50 } geometric_params = { 'L': 0.130, 'externalRadius': 74.5 / 2000, 'imagePixelSize': 2048, 'imageMeterSize': 0.09, 'regressionModel': Reg.TwoRegimesMarxmanAndFloodedModel(**combustion_table) } nozzle_params = { 'At': 4.243e-5, 'expansion': 6.3, 'lambda_e': 0.98, 'erosion': 0 } simulation_params = { 'ox_flow': 0.0975, 'safety_thickness': 0.005, 'max_burn_time': 7.5 } # ------------- Generate objects: geometry_obj = Geom.SinglePortImageGeometry(**geometric_params) geometry_obj.generatePolynom(**shape_params) nozzle_obj = Noz.Nozzle(**nozzle_params) # Instantiate the combustion module combustion_object = CombustionObjectImage( json_interpreter=json_interpreter, geometry_object=geometry_obj, nozzle_object=nozzle_obj) # -------------- Run simulation & Plot: combustion_object.run_simulation_constant_fuel_sliver_image_geometry( **simulation_params) # Return the combustion object return combustion_object