def run(): from spitfire.chemistry.mechanism import ChemicalMechanismSpec from spitfire.chemistry.tabulation import build_unreacted_library import spitfire.chemistry.analysis as sca test_xml = abspath(join('tests', 'test_mechanisms', 'h2-burke.xml')) m = ChemicalMechanismSpec(cantera_xml=test_xml, group_name='h2-burke') pressure = 101325. air = m.stream(stp_air=True) air.TP = 1200., pressure fuel = m.stream('TPY', (300., pressure, 'H2:1')) flamelet_specs = { 'mech_spec': m, 'oxy_stream': air, 'fuel_stream': fuel, 'grid_points': 34 } l = build_unreacted_library(flamelet_specs, verbose=False) l = sca.compute_specific_enthalpy(m, l) l = sca.compute_isochoric_specific_heat(m, l) l = sca.compute_isobaric_specific_heat(m, l) l = sca.compute_density(m, l) l = sca.compute_pressure(m, l) l = sca.compute_viscosity(m, l) return l
def run(num_procs): from spitfire.chemistry.mechanism import ChemicalMechanismSpec from spitfire.chemistry.tabulation import build_nonadiabatic_defect_steady_slfm_library import spitfire.chemistry.analysis as sca import numpy as np test_xml = abspath(join('tests', 'test_mechanisms', 'h2-burke.xml')) m = ChemicalMechanismSpec(cantera_xml=test_xml, group_name='h2-burke') pressure = 101325. air = m.stream(stp_air=True) air.TP = 1200., pressure fuel = m.stream('TPY', (300., pressure, 'H2:1')) flamelet_specs = { 'mech_spec': m, 'oxy_stream': air, 'fuel_stream': fuel, 'grid_points': 34 } l = build_nonadiabatic_defect_steady_slfm_library( flamelet_specs, verbose=False, diss_rate_values=np.logspace(0, 1, 4), integration_args={'transient_tolerance': 1e-10}, num_procs=num_procs) l = sca.compute_specific_enthalpy(m, l) l = sca.compute_isochoric_specific_heat(m, l) l = sca.compute_isobaric_specific_heat(m, l) l = sca.compute_density(m, l) l = sca.compute_pressure(m, l) l = sca.compute_viscosity(m, l) return l
def run(): from spitfire.chemistry.mechanism import ChemicalMechanismSpec from spitfire.chemistry.tabulation import build_adiabatic_eq_library, apply_mixing_model, PDFSpec import spitfire.chemistry.analysis as sca test_xml = abspath(join('tests', 'test_mechanisms', 'h2-burke.xml')) m = ChemicalMechanismSpec(cantera_xml=test_xml, group_name='h2-burke') pressure = 101325. air = m.stream(stp_air=True) air.TP = 1200., pressure fuel = m.stream('TPY', (300., pressure, 'H2:1')) flamelet_specs = { 'mech_spec': m, 'oxy_stream': air, 'fuel_stream': fuel, 'grid_points': 34 } l = build_adiabatic_eq_library(flamelet_specs, verbose=False) l = sca.compute_specific_enthalpy(m, l) l = sca.compute_isochoric_specific_heat(m, l) l = sca.compute_isobaric_specific_heat(m, l) l = sca.compute_density(m, l) l = sca.compute_pressure(m, l) l = sca.compute_viscosity(m, l) scaled_variance_values = np.linspace(0., 1., 5) l_t = apply_mixing_model(l, { 'mixture_fraction': PDFSpec(pdf='ClipGauss', scaled_variance_values=scaled_variance_values) }, num_procs=1) return l_t