def establish_processor(self, loop_counter=0): if loop_counter == 0 and self.master_equation_flag == False: new_file, original_rxn_eqs, master_rxn_eqs = ctic.cti_write2( original_cti=os.path.join(self.data_directory, self.cti_file_name), working_directory=self.data_directory, file_name=self.cti_file_name.replace('.cti', '') + '_updated') self.new_cti_file = new_file if loop_counter == 0 and self.master_equation_flag == True: new_file, original_rxn_eqs, master_rxn_eqs = ctic.cti_write2( original_cti=os.path.join(self.data_directory, self.cti_file_name), master_rxns=os.path.join( self.data_directory, self.master_reaction_equation_cti_name), master_index=self.master_index, working_directory=self.data_directory, file_name=self.cti_file_name.replace('.cti', '') + '_updated') self.new_cti_file = new_file processor = pr.Processor(self.new_cti_file) #processor = pr.Processor(self.data_directory +'/'+ self.cti_file_name) self.processor = processor return
N2 = df['N2'] wavelength = 210 for i in range(df.shape[0]): Press = pressure[i] Temp = temperature[i] k_value = k[i] Cl2_mf = Cl2[i] CH3OH_mf = CH3OH[i] HO2_mf = HO2[i] N2_mf = N2[i] species_list = [HO2_mf,N2_mf] species_string = ['ho2','n2'] uncertainty_string = [2.3,2.3,2.3,2.3] # # test_p = pr.Processor('MSI/data/automating_lightfoot_1988/i-pentanol_one_reaction.cti') test_p.solution.set_multiplier(k_value,i_reaction=0) print(test_p.solution.multiplier(0)) conditions_dict = {} temp_uncertainty = [] temp_uncertainty_species = [] for ii,specie in enumerate(species_list): if specie !=0.0: conditions_dict[species_string[ii]] = specie if species_string[ii] != 'Ar': temp_uncertainty.append(uncertainty_string[ii]) temp_uncertainty_species.append(species_string[ii]) test_tube = st.shockTube(pressure=Press, temperature=Temp, observables=['h2o2','ho2'],
Press = pressure[i] Temp = temperature[i] k_value = k[i] O2_mf = O2[i] OH_mf = OH[i] H_mf = H[i] H2O_mf = H2O[i] NH3_mf = NH3[i] NH2_mf = NH2[i] Ar_mf = Ar[i] species_list = [O2_mf,OH_mf,H_mf,H2O_mf,NH3_mf,NH2_mf, Ar_mf] species_string = ['O2','OH','H','H2O','NH3','NH2','Ar'] uncertainty_string = [.05,2.3,2.3,.05,.05,2.3,0] test_p = pr.Processor('MSI/data/automating_HO2/one_reaction.cti') test_p.solution.set_multiplier(k_value,i_reaction=0) print(test_p.solution.multiplier(0)) conditions_dict = {} temp_uncertainty = [] temp_uncertainty_species = [] for ii,specie in enumerate(species_list): if specie !=0.0: conditions_dict[species_string[ii]] = specie if species_string[ii] != 'Ar': temp_uncertainty.append(uncertainty_string[ii]) temp_uncertainty_species.append(species_string[ii]) print(conditions_dict) test_tube = st.shockTube(pressure=Press,
import sys sys.path.append( '.' ) #get rid of this at some point with central test script or when package is built import os os.chdir('C:\\Users\\Skoron\\Desktop') import MSI.simulations.instruments.flames as f import MSI.cti_core.cti_processor as pr import cantera as ct import matplotlib.pyplot as plt import numpy as np test_p = pr.Processor( 'C:\\Users\\Skoron\\Google Drive\\Burke Group\\Codes\\Mechanisms\\FFCM-1\\FFCM1.cti' ) f1 = f.flamespeed_multi_condition(pressures=[1.00], temperatures=[298.0], kineticSens=1, physicalSens=0, conditions=[{ 'H2': 0.5, 'O2': 0.5, 'He': 4.0 }, { 'H2': 0.75, 'O2': 0.5, 'He': 4.0 }, { 'H2': 1.0, 'O2': 0.5, 'He': 4.0
import sys import sys, os sys.path.append( '../../' ) #get rid of this at some point with central test script or when package is built os.chdir('../../') import MSI.simulations.instruments.shock_tube as st import MSI.cti_core.cti_processor as pr import MSI.optimization.matrix_loader as ml import MSI.optimization.opt_runner as opt import MSI.simulations.absorbance.curve_superimpose as csp import MSI.simulations.yaml_parser as yp import cantera as ct # test_p = pr.Processor( '/Users/carlylagrotta/Desktop/MSI/data/test_data/FFCM1_custom.cti') yaml_file_list = [ ('MSI/data/test_data/Hong_4.yaml', 'MSI/data/test_data/Hong_4_abs.yaml'), ('MSI/data/test_data/Hong_1.yaml', ), ('MSI/data/test_data/Troe_6.yaml', 'MSI/data/test_data/Troe_6_abs.yaml'), ('MSI/data/test_data/Hong_4.yaml', 'MSI/data/test_data/Hong_4_abs.yaml') ] yaml_instance = yp.Parser() list_of_yaml_objects = yaml_instance.load_yaml_list(yaml_list=yaml_file_list) list_of_experiment_dicts = yaml_instance.parsing_multiple_dictonaries( list_of_yaml_objects=list_of_yaml_objects) optimization_instance = opt.Optimization_Utility() test = optimization_instance.looping_over_parsed_yaml_files( list_of_experiment_dicts,
import sys sys.path.append( '.' ) #get rid of this at some point with central test script or when package is built import MSI.simulations.instruments.shock_tube as st import MSI.cti_core.cti_processor as pr import cantera as ct import time ### testing FFCM start = time.time() gas = ct.Solution('MSI/data/test_data/FFCM1.cti') all_species = gas.species_names test_p = pr.Processor('MSI/data/test_data/FFCM1.cti') test_tube = st.shockTube(pressure=1.74, temperature=1880, observables=all_species, kineticSens=1, physicalSens=0, conditions={ 'H2O': .013, 'O2': .0099, 'H': .0000007, 'Ar': 0.9770993 }, initialTime=0, finalTime=0.1, thermalBoundary='Adiabatic', mechanicalBoundary='constant pressure', processor=test_p,
import sys sys.path.append('.') #get rid of this at some point with central test script or when package is built import MSI.simulations.instruments.shock_tube as st import MSI.cti_core.cti_processor as pr import MSI.simulations.absorbance.curve_superimpose as csp import MSI.simulations.yaml_parser as yp import cantera as ct test_p = pr.Processor('MSI/data/test_data/optimized_burke.cti') test_tube = st.shockTube(pressure=3.44187, temperature=1079, observables=['OH','H2O'], kineticSens=1, physicalSens=0, conditions={'H2O2':0.00195373,'Ar':0.99804627}, initialTime=0, finalTime=0.0014, thermalBoundary='Adiabatic', mechanicalBoundary='constant pressure', processor=test_p, save_timeHistories=1, save_physSensHistories=1) test_tube.run() parser = yp.Parser() abs_instance = csp.Absorb() exp_loaded = parser.load_to_obj('MSI/data/test_data/Troe_6.yaml') abs_loaded = parser.load_to_obj('MSI/data/test_data/Troe_6_abs.yaml')
H2 = df['H2'] O = df['O'] He = df['He'] for i in range(df.shape[0]): Press = pressure[i] Temp = temperature[i] k_value = k[i] O_mf = O[i] H2_mf = H2[i] He_mf = He[i] species_list = [O_mf, H2_mf, He_mf] species_string = ['O', 'H2', 'He'] uncertainty_string = [2.3, .05, 0] test_p = pr.Processor( 'MSI/data/automating_O_H2_sutherland/one_reaction.cti') test_p.solution.set_multiplier(k_value, i_reaction=0) print(test_p.solution.multiplier(0)) conditions_dict = {} temp_uncertainty = [] temp_uncertainty_species = [] for ii, specie in enumerate(species_list): if specie != 0.0: conditions_dict[species_string[ii]] = specie if species_string[ii] != 'Ar': temp_uncertainty.append(uncertainty_string[ii]) temp_uncertainty_species.append(species_string[ii]) test_tube = st.shockTube(pressure=Press, temperature=Temp, observables=['OH'],
import MSI.simulations.instruments.shock_tube as st import MSI.cti_core.cti_processor as pr import MSI.utilities.uncertainty_merge as um import cantera as ct test_p = pr.Processor('MSI/data/test_data/glarborg_custom.cti') reaction_equations = test_p.solution.reaction_equations() #df = um.get_uncertainties(reaction_equations,uncert_file='MSI/data/test_data/uncertainty.csv') df = um.get_uncertainties( reaction_equations, uncert_file='MSI/data/test_data/FFCM1_reaction_uncertainty_FFCM_values.csv' ) #test_tube = st.shockTube(pressure=1.355, # temperature=1590, # observables=['OH'], # kineticSens=0, # physicalSens=0, # conditions={'H2O':.001234,'H2O2':.00254,'O2':.00062,'Ar':.995606}, # initialTime=0, # finalTime=0.0025, # thermalBoundary='Adiabatic', # mechanicalBoundary='constant pressure', # processor=test_p, # save_timeHistories=1, # save_physSensHistories=1)
He = df['He'] for i in range(df.shape[0]): Press = pressure[i] Temp = temperature[i] k_value = k[i] O_mf = O[i] H2_mf = H2[i] He_mf = He[i] species_list = [O_mf,H2_mf,He_mf] species_string = ['O','H2','He'] uncertainty_string = [2.3,.05,0] test_p = pr.Processor('MSI/data/automating_O_H2_michael/one_reaction.cti') test_p.solution.set_multiplier(k_value,i_reaction=0) print(test_p.solution.multiplier(0)) conditions_dict = {} temp_uncertainty = [] temp_uncertainty_species = [] for ii,specie in enumerate(species_list): if specie !=0.0: conditions_dict[species_string[ii]] = specie if species_string[ii] != 'Ar': temp_uncertainty.append(uncertainty_string[ii]) temp_uncertainty_species.append(species_string[ii]) test_tube = st.shockTube(pressure=Press, temperature=Temp,
'../../' ) #get rid of this at some point with central test script or when package is built os.chdir('../../') import MSI.simulations.instruments.shock_tube as st import MSI.cti_core.cti_processor as pr import MSI.optimization.matrix_loader as ml import MSI.optimization.opt_runner as opt import MSI.simulations.absorbance.curve_superimpose as csp import MSI.simulations.yaml_parser as yp import cantera as ct import pandas as pd # #test_p = pr.Processor('C:\\Users\\Skoron\\Google Drive\\Burke Group\\Codes\\Mechanisms\\FFCM-1\\FFCM1.cti') test_p = pr.Processor( 'MSI/data/DME-Methanol_Blends_RCM/DME-MeOH_combined_mech_Hongfu(Cantera).cti' ) yaml_file_list = [('MSI/data/DME-Methanol_Blends_RCM_2/Wang_0_short.yaml', )] yaml_instance = yp.Parser() list_of_yaml_objects = yaml_instance.load_yaml_list(yaml_list=yaml_file_list) list_of_experiment_dicts = yaml_instance.parsing_multiple_dictonaries( list_of_yaml_objects=list_of_yaml_objects) # # # optimization_instance = opt.Optimization_Utility() test = optimization_instance.looping_over_parsed_yaml_files( list_of_experiment_dicts, yaml_file_list,
import sys sys.path.append( '.' ) #get rid of this at some point with central test script or when package is built import MSI.simulations.instruments.shock_tube as st import MSI.cti_core.cti_processor as pr import MSI.simulations.absorbance.curve_superimpose as csp import MSI.simulations.yaml_parser as yp import cantera as ct import pandas as pd import matplotlib.pyplot as plt test_p = pr.Processor('MSI/data/test_data/Hong.cti') test_tube = st.shockTube(pressure=1.635, temperature=1283, observables=['OH', 'H2O'], kineticSens=0, physicalSens=0, conditions={ 'H2O2': 0.003094, 'H2O': 0.001113, 'O2': 0.000556, 'Ar': 0.999623 }, initialTime=0, finalTime=0.001, thermalBoundary='Adiabatic', mechanicalBoundary='constant pressure', processor=test_p, save_timeHistories=1,
import sys sys.path.append( '.' ) #get rid of this at some point with central test script or when package is built import MSI.simulations.instruments.shock_tube as st import MSI.cti_core.cti_processor as pr import cantera as ct import matplotlib.pyplot as plt test_p = pr.Processor('MSI/data/test_data/hong_reproduction_of_data.cti') test_tube = st.shockTube(pressure=1.653, temperature=1283, observables=['OH', 'H2O'], kineticSens=0, physicalSens=0, conditions={ 'H2O2': 0.003094, 'H2O': 0.001113, 'O2': 0.000556, 'Ar': 0.995237 }, initialTime=0, finalTime=0.001, thermalBoundary='Adiabatic', mechanicalBoundary='constant pressure', processor=test_p, save_timeHistories=1, save_physSensHistories=1) test_tube.run() test_tube.printVars()
import sys, os sys.path.append( '../../' ) #get rid of this at some point with central test script or when package is built os.chdir('../../') import MSI.simulations.instruments.shock_tube as st import MSI.cti_core.cti_processor as pr import MSI.simulations.absorbance.curve_superimpose as csp import MSI.simulations.yaml_parser as yp import cantera as ct import pandas as pd import matplotlib.pyplot as plt test_p = pr.Processor( 'MSI/data/branching_reaction_study/FFCM1_custom_cheb_extra_zeros_new_extra_reactions_precursor.cti' ) test_tube = st.shockTube(pressure=0.772, temperature=2188, observables=['OH'], kineticSens=0, physicalSens=0, conditions={ 'CH3I': 0.000009954, 'CH3OH': 0.000006016, 'Ar': .999984 }, initialTime=0, finalTime=0.004, thermalBoundary='Adiabatic', mechanicalBoundary='constant pressure',
sys.path.append( '.' ) #get rid of this at some point with central test script or when package is built import os os.chdir('C:\\Users\\HP USER\\Desktop') #import MSI.simulations.instruments.flames as f import MSI.cti_core.cti_processor as pr import cantera as ct import matplotlib.pyplot as plt import numpy as np import MSI.simulations.instruments.ignition_delay as ig #test_p = pr.Processor('C:\\Users\\HP USER\\Google Drive\\Burke #Group\\Codes\\Mechanisms\\heptane_lowT\\Mech.cti') test_p = pr.Processor( 'C:\\Users\\HP USER\\Desktop\\MSI\\data\\rodger_plotting_error_testing\\Glarborg_HNO_updated.cti' ) s = ig.ignition_delay_wrapper( pressures=[1.422800621], temperatures=[ 1970.89, 1982.38, 2060.95, 2078.74, 2162.57, 2224.36, 2262.05, 2327.96, 2353.06, 2391.77 ], observables=['OH'], kineticSens=0, physicalSens=0, conditions=[{ 'NH3': 0.007273181, 'O2': 0.002727294, 'Ar': 0.987550463 }],
import sys, os sys.path.append( '../../' ) #get rid of this at some point with central test script or when package is built os.chdir('../../') import MSI.simulations.instruments.RCM as rcm import MSI.cti_core.cti_processor as pr import cantera as ct import matplotlib.pyplot as plt test_p = pr.Processor('MSI/data/RCM/mech.cti') #test_p = pr.Processor('MSI/data/chebyshev_data/FFCM1_custom_cheb.cti') #test_p = pr.Processor('MSI/data/chebyshev_data/FFCM1_custom_cheb_test.cti') test_tube = rcm.RCM(pressure=1.4939057488280285, temperature=323, observables=['H2O'], kineticSens=0, physicalSens=0, conditions={ 'C3H8': 0.024950099800399205, 'CH3OCH3': 0.024950099800399205, 'N2': 0.7504990019960079, 'O2': 0.1996007984031936 }, initialTime=0, finalTime=.1, thermalBoundary='Adiabatic', mechanicalBoundary='constant volume', processor=test_p,
'../../' ) #get rid of this at some point with central test script or when package is built os.chdir('../../') import MSI.simulations.instruments.shock_tube as st import MSI.cti_core.cti_processor as pr import MSI.optimization.matrix_loader as ml import MSI.optimization.opt_runner as opt import MSI.simulations.absorbance.curve_superimpose as csp import MSI.simulations.yaml_parser as yp import cantera as ct import pandas as pd import MSI.simulations.instruments.ignition_delay as ig # #test_p = pr.Processor('C:\\Users\\Skoron\\Google Drive\\Burke Group\\Codes\\Mechanisms\\FFCM-1\\FFCM1.cti') test_p = pr.Processor('C:\\Users\\Skoron\\Desktop\\MSI\\data\\chem.cti') yaml_file_list = [( 'C:\\Users\\Skoron\\Desktop\\MSI\\data\\ignition_delay_template_h2o2_3temp_Ttarget.yaml', )] yaml_instance = yp.Parser() list_of_yaml_objects = yaml_instance.load_yaml_list(yaml_list=yaml_file_list) list_of_experiment_dicts = yaml_instance.parsing_multiple_dictonaries( list_of_yaml_objects=list_of_yaml_objects) # optimization_instance = opt.Optimization_Utility() test = optimization_instance.looping_over_parsed_yaml_files( list_of_experiment_dicts, yaml_file_list,
H = df['H'] for i in range(df.shape[0]): Press = pressure[i] Temp = temperature[i] k_value = k[i] O2_mf = O2[i] H2_mf = H2[i] Ar_mf = Ar[i] H_mf = H[i] species_list = [O2_mf, H2_mf, H_mf, Ar_mf] species_string = ['O2', 'H2', 'H', 'Ar'] uncertainty_string = [.05, 2.3, 2.3, .05] #test_p = pr.Processor('MSI/data/automating_HO2_masten/masten_paper.cti') test_p = pr.Processor('MSI/data/automating_OH_O_hong/GRI30-1999.cti') #chage this to be a handmade cti file test_p.solution.set_multiplier(k_value, i_reaction=0) print(test_p.solution.multiplier(0)) conditions_dict = {} for ii, specie in enumerate(species_list): if specie != 0.0: conditions_dict[species_string[ii]] = specie temp_uncertainty = [] temp_uncertainty_species = [] for ii, specie in enumerate(species_list): if specie != 0.0: if species_string[ii] != 'Ar': temp_uncertainty.append(uncertainty_string[ii])
sys.path.append( '.' ) #get rid of this at some point with central test script or when package is built import MSI.simulations.instruments.jsr_steadystate as jsr import MSI.cti_core.cti_processor as pr import cantera as ct import matplotlib.pyplot as plt import numpy as np #test_p = pr.Processor('C:\\Users\\HP USER\\Google Drive\\Burke #Group\\Codes\\Mechanisms\\heptane_lowT\\Mech.cti') data = 'C:\\Users\\HP USER\\Google Drive\\Burke Group\\JSR Experiments\\LeClercMethane\\oxygen_profile.csv' data2 = 'C:\\Users\\HP USER\\Google Drive\\Burke Group\\JSR Experiments\\LeClercMethane\\data_08082019.csv' test_p = pr.Processor( 'C:\\Users\\HP USER\\Google Drive\\Burke Group\\Codes\\Mechanisms\\CH4_DME\\chem_760_762_763.cti' ) jsr1 = jsr.JSR_multiTemp_steadystate(volume=8.5e-5, pressure=1.0520602, temperatures=np.linspace(850, 1250, 100), observables=['OH', 'H2O'], kineticSens=1, physicalSens=0, conditions={ 'CH4': 0.063, 'O2': 0.063, 'He': 0.874 }, thermalBoundary='Adiabatic', mechanicalBoundary='constant pressure', processor=test_p,
absp2 = parser2.load_to_obj( 'MSI/data/klip_optimization_with_raw_data/Hong_HO2_fake_data_' + str(value) + '_abs.yaml') loaded_tube2 = parser2.parse_shock_tube_obj(loaded_exp=exp2, loaded_absorption=absp2) pressure2 = loaded_tube2['pressure'] temperature2 = loaded_tube2['temperature'] conditions2 = loaded_tube2['conditions'] print("THESE ARE THE HONG CONDITIONS") print(pressure2) print(temperature2) print(conditions2) test_p = pr.Processor( 'MSI/data/klip_optimization_with_raw_data/FFCM1_custom_extra_reaction_updated.cti' ) #HONG YAML FILES AND CONDITIONS test_tube = st.shockTube(pressure=pressure, temperature=temperature, observables=['OH', 'H2O', 'H2O2'], kineticSens=0, physicalSens=0, conditions=conditions, initialTime=0, finalTime=0.0035, thermalBoundary='Adiabatic', mechanicalBoundary='constant pressure', processor=test_p,
# 'Ar': 0.9974968858350951}, # initialTime=0, # finalTime=.07, # thermalBoundary='Adiabatic', # mechanicalBoundary='constant volume', # processor=test_p, # save_timeHistories=1, # save_physSensHistories=1, # volumeTrace='MSI/data/RCM/volume_trace_file.csv') # test_tube.run() # #test_tube.printVars() # time_History = test_tube.timeHistory test_p = pr.Processor( '/Users/carlylagrotta/Dropbox/Columbia/MSI/data/branching_reaction_study/FFCM1_custom_cheb_extra_zeros_new_extra_reactions_precursor.cti' ) test_tube = st.shockTube(pressure=0.6008089141308347, temperature=1925, observables=['OH'], kineticSens=0, physicalSens=0, conditions={ 'CH3OH': 0.000023898, 'Ar': 0.999976102 }, initialTime=0, finalTime=.002, thermalBoundary='Adiabatic', mechanicalBoundary='constant volume',
import sys sys.path.append( '.' ) #get rid of this at some point with central test script or when package is built import numpy as np import MSI.simulations.instruments.shock_tube as st import MSI.cti_core.cti_processor as pr import cantera as ct test_p2 = pr.Processor('MSI/data/chebyshev_data/FFCM1_custom_cheb_test.cti') test_tube = st.shockTube(pressure=1.909, temperature=1398, observables=['OH', 'H2O'], kineticSens=1, physicalSens=0, conditions={ 'O2': 0.00062, 'H2O': 0.001234, 'H2O2': 0.00254, 'Ar': 0.9974968858350951 }, initialTime=0, finalTime=.0002, thermalBoundary='Adiabatic', mechanicalBoundary='constant volume', processor=test_p2, save_timeHistories=1, save_physSensHistories=1) csv_paths = [
O2 = df['O2'] H2 = df['H2'] Ar = df['Ar'] for i in range(df.shape[0]): Press = pressure[i] Temp = temperature[i] k_value = k[i] O2_mf = O2[i] H2_mf = H2[i] Ar_mf = Ar[i] species_list = [O2_mf, H2_mf, Ar_mf] species_string = ['O2', 'H2', 'Ar'] #test_p = pr.Processor('MSI/data/automating_HO2_masten/masten_paper.cti') test_p = pr.Processor( 'MSI/data/automating_HO2_masten/masten_paper_gri_thermo.cti') #chage this to be a handmade cti file test_p.solution.set_multiplier(k_value, i_reaction=1) print(test_p.solution.multiplier(1)) conditions_dict = {} for ii, specie in enumerate(species_list): if specie != 0.0: conditions_dict[species_string[ii]] = specie print(conditions_dict) test_tube = st.shockTube(pressure=Press, temperature=Temp, observables=['OH'], kineticSens=0, physicalSens=0,
import MSI.cti_core.cti_processor as pr import cantera as ct import matplotlib.pyplot as plt import numpy as np import time import pandas as pd #test_p = pr.Processor('C:\\Users\\HP USER\\Google Drive\\Burke #Group\\Codes\\Mechanisms\\heptane_lowT\\Mech.cti') #data='C:\\Users\\HP USER\\Google Drive\\Burke Group\\JSR Experiments\\RodgerSymposium\\exp58.csv' #data2='C:\\Users\\HP USER\\Google Drive\\Burke Group\\JSR Experiments\\LeClercMethane\\data_08082019.csv' #_760_762_763 #outfile='C:\\Users\\HP USER\\Google Drive\\Burke Group\\JSR Experiments\\N2O_AR\\glar_comp_lam_2027.csv' #outfile2='C:\\Users\\HP USER\\Google Drive\\Burke Group\\JSR Experiments\\N2O_AR\\glar_comp_lam_2027_ksens.csv' test_p = pr.Processor( 'C:\\Users\\HP USER\\Google Drive\\Burke Group\\Codes\\Mechanisms\\Lamoreaux\\lam.cti' ) jsr1 = jsr.JSR_multiTemp_steadystate(volume=8.2e-5, pressure=1.02069, temperatures=[1050], observables=['N2'], kineticSens=1, physicalSens=0, conditions={ 'N2O': 0.045, 'Ar': 0.955 }, thermalBoundary='Adiabatic', mechanicalBoundary='constant pressure', processor=test_p, save_physSensHistories=0,
Ar = df['Ar'] wavelength = 227.5 for i in range(df.shape[0]): Press = pressure[i] Temp = temperature[i] k_value = k[i] Cl_mf = Cl[i] CH3OH_mf = CH3OH[i] O2_mf = O2[i] Ar_mf = Ar[i] species_list = [Cl_mf, CH3OH_mf, O2_mf, Ar_mf] species_string = ['cl', 'ch3oh', 'o2', 'ar'] uncertainty_string = [2.3, 2.3, 2.3, 2.3] # ## test_p = pr.Processor( 'MSI/data/automating_kircher_Ar_1983/i-pentanol_one_reaction.cti') test_p.solution.set_multiplier(k_value, i_reaction=0) print(test_p.solution.multiplier(0)) conditions_dict = {} temp_uncertainty = [] temp_uncertainty_species = [] for ii, specie in enumerate(species_list): if specie != 0.0: conditions_dict[species_string[ii]] = specie if species_string[ii] != 'ar': temp_uncertainty.append(uncertainty_string[ii]) temp_uncertainty_species.append(species_string[ii]) test_tube = st.shockTube(pressure=Press, temperature=Temp, observables=['h2o2', 'ho2'], kineticSens=0,
import sys sys.path.append( '.' ) #get rid of this at some point with central test script or when package is built import MSI.simulations.instruments.shock_tube as st import MSI.cti_core.cti_processor as pr import MSI.simulations.absorbance.curve_superimpose as csp import MSI.simulations.yaml_parser as yp import cantera as ct import pandas as pd import matplotlib.pyplot as plt test_p = pr.Processor( 'MSI/data/hong_H2O2_fake_data/Hong_new_full_temperature_dep_new_approach_high_temperature.cti' ) test_tube = st.shockTube(pressure=1.635, temperature=1283, observables=['OH', 'H2O'], kineticSens=0, physicalSens=0, conditions={ 'H2O2': 0.003049, 'H2O': 0.001113, 'O2': 0.000556, 'Ar': 0.995212 }, initialTime=0, finalTime=0.001, thermalBoundary='Adiabatic',
import sys sys.path.append( '.' ) #get rid of this at some point with central test script or when package is built import numpy as np import MSI.simulations.instruments.shock_tube as st import MSI.cti_core.cti_processor as pr import cantera as ct import pandas as pd import matplotlib.pyplot as plt test_p = pr.Processor('MSI/data/test_data/FFCM1_custom_updated.cti') #test_tube = st.shockTube(pressure=1.672, # temperature=1182, # observables=['OH','H2O'], # kineticSens=1, # physicalSens=0, # conditions={'H2O':0.001113, # 'H2O2':0.002046, # 'O2':0.000556, # 'Ar':0.996285}, # initialTime=0, # finalTime=0.003, # thermalBoundary='Adiabatic', # mechanicalBoundary='constant pressure', # processor=test_p, # save_timeHistories=1, # save_physSensHistories=1) #test_tube = st.shockTube(pressure=1.635, # temperature=1283, # observables=['OH','H2O'], # kineticSens=1,
import sys sys.path.append( '.' ) #get rid of this at some point with central test script or when package is built import MSI.simulations.instruments.jsr_steadystate as jsr import MSI.cti_core.cti_processor as pr import cantera as ct import matplotlib.pyplot as plt test_p = pr.Processor( 'C:\\Users\\HP USER\\Google Drive\\Burke Group\\Codes\\Mechanisms\\grimech3\\gri30.cti' ) jsr = jsr.JSR_steadystate(pressure=1.0, temperature=1283, observables=['OH', 'H2O'], kineticSens=1, physicalSens=0, conditions={ 'H2O2': 0.003094, 'H2O': 0.001113, 'O2': 0.000556, 'Ar': 0.995237 }, thermalBoundary='Adiabatic', mechanicalBoundary='constant pressure', processor=test_p, save_physSensHistories=1) jsr.set_geometry(volume=9.19523225755e-5) a, b = jsr.run()
import sys, os sys.path.append( '../../' ) #get rid of this at some point with central test script or when package is built os.chdir('../../') import MSI.simulations.instruments.shock_tube as st import MSI.cti_core.cti_processor as pr import cantera as ct test_p = pr.Processor('MSI/data/test_data/FFCM1.cti') test_tube = st.shockTube(pressure=1.74, temperature=1880, observables=['OH', 'H2O'], kineticSens=1, physicalSens=0, conditions={ 'H2O': .013, 'O2': .0099, 'H': .0000007, 'Ar': 0.9770993 }, initialTime=0, finalTime=0.1, thermalBoundary='Adiabatic', mechanicalBoundary='constant pressure', processor=test_p, save_timeHistories=1) test_tube.run() test_tube.sensitivity_adjustment(temp_del=.01) test_tube.species_adjustment(spec_del=.01)
def establish_processor(self): processor = pr.Processor(self.data_directory + '/' + self.cti_file_name) self.processor = processor return