Exemplo n.º 1
0
import thermo as th
import configparser

config_file = 'ropsi.ini'
config = configparser.ConfigParser()
try:
    with open(config_file, 'r') as config_file:
        dataset = config.readfp(config_file)
except IOError:
    print("Wrong file name: %s" % config_file)
else:
    thermo_module = config['General']['ThermoModule']
    if(thermo_module in th.THERMO_MODULE_CANTERA):
        thermo_file = config['Cantera']['ThermoFile']
        gas1 = th.get_thermo_wrap(thermo_module, thermo_file)
        gas1.transport_model = config['Cantera']['TransportModel']
    else:
        thermo_file = None
        gas1 = th.get_thermo_wrap(thermo_module, thermo_file)
    print("Thermo module  : %-12s    Thermo file     : %s" %
          (thermo_module, thermo_file))
    lista = gas1.species_names

    # Display formula of fuel specie1
    fuel_specie1 = config['FuelSpecie1']['Formula']
    fs1 = fuel_specie1.split()
    if fs1[0] not in lista:
        print("Cannot find specie:", fs1[0])

    # Display formula for oxidiser specie1
Exemplo n.º 2
0
 def test_thermoWrap_should_createThermoHandler(self):
     self.assertIsInstance(thermo.get_thermo_wrap('cantera', 'gri30.xml'),
                           thermo.ThermoHandlerCantera)