Run Scripts

These scripts all use the TomlParmParse utility to manage configuration/inputs. Sample inputs with descriptions are included in .toml files with the same base file name as the script. All scripts can be run using:

python script_name.py script_name.toml

Adding the -h flag will give the additional command line inputs that are associated with the TomlParmParse utility:

positional arguments:
  infile                Input file to parse inputs from

options:
  -h, --help            show this help message and exit
  -o OUTPUT, --output OUTPUT
                        File (.toml) or directory in which to write used inputs/outputs
  -t OUTPUT_TYPE, --output_type OUTPUT_TYPE
                        Type of output file: *doc*: include comments documenting used inputs *clean*: no comments, only used inputs *original*: input file in original formatting
  -a ARGS, --args ARGS  Override arguments, as a toml string
  -w, --no_overwrite    Disallow overwriting entries once they have been used or set
  -e, --error_unused    Raise error if there are unused inputs
  -l, --live_update     Update output file continuously as code runs

Notably, specifying -o will result in a new toml file with the configuration that was used, including documentation for each input by default, and -a allows inputs that are usually specified in the input file to be specified on the command line.


cantera

These python scripts use Cantera to generate 1D flame solutions that will then be compiled into tabulated chemistry tables.


compute_premixed_flamelets.py

Compute 1D unstrained premixed flamelets using Cantera.

Flames can be computed across a range of conditions including pressures, temperatures, and compositions. Three methods are possible for specifying composition sweeps: equivalence ratio, mixture fraction, and directly specifying a composition.

Uses TOML format input files (see example input file for more details) and requires specification of an output directory on the command line:

python compute_premixed_flamelets.py compute_premixed_flamelets.toml -o output

compute_nonpremixed_flamelets.py

Script to solve 1D nonpremixed flames at varied conditions using Cantera.

The user specified physical conditions including pressure (constant) and the temperature and composition of up to three streams: fuel, oxidizer, and a dilution stream that is mixed with one of these streams prior to reaction. Supports computations with varied mechanisms, transport models, and equations of state (all handled through Cantera).

Uses TOML format input files (see example input file for more details) and requires specification of an output directory on the command line:

python compute_nonpremixed_flamelets.py compute_nonpremixed_flamelets.toml -o output

.


ctable

These python scripts use the CMLM package to generate tabulated chemistry data.


create_dummy_table_nd.py

Create sample chemtables with dummy data for testing purposes.

Uses TOML format input files (see example input file for more details):

python create_dummy_table_nd.py create_dummy_table_nd.toml

create_spray_table_nd.py

Create chemtable for nonreacting multicomponent spray evaporation problems.

The table will have a number of dimensions (mixture fractions) equal to the number of spray components, because mixing with oxidizer is also considered. If the use_fmix option is specified, instead of standard mixture fractions (sum to 1, state space is the unit simplex), the table is populated in terms of normalized mixture fractions (each goes from 0 to 1, state space is a unit cube). Liquid fuel temperatures and latent heats are specified for each fuel; it is assumed that the gas phase temperature adjacent to the droplet is temperature that conserves enthalpy (i.e., it is lower than the liquid temperature due to the vaporization process).

This script uses Cantera and the user must specify a Cantera yaml format chemical mechanism. The liquid_fuels_nonreacting mechanism that comes with PelePhysics is likely a good choice.

Uses TOML format input files (see example input file for more details):

python create_spray_table_nd.py create_spray_table_nd.toml