Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion Utilities/Python/scripts/cantera_yaml_2_fds.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,24 @@
import sys
import math

# Define str2bool function
def str2bool(v):
if isinstance(v, bool):
return v
if v.lower() in ('yes', 'true', 't', 'y', '1'):
return True
elif v.lower() in ('no', 'false', 'f', 'n', '0'):
return False
else:
raise argparse.ArgumentTypeError('Boolean value expected.')

parser = argparse.ArgumentParser()

parser.add_argument("--background", help="Background species formula",default='noinput',required=True)
parser.add_argument("--yaml_file",help="yaml file",default='noinput',required=True)
parser.add_argument("--spec_file",help="Cantera to FDS species name lookup csv file (default is yaml_file.spec) with column headings FORMULA and NAME ",default='noinput')
parser.add_argument("--fds_prop",help="Set to True (default) to use FDS properties when species is in spec_file. ",type=bool,default=True)
parser.add_argument("--fds_prop", type=str2bool, nargs='?', const=True, default=True,
help="Set to True (default) to use FDS properties when species is in spec_file.")
parser.add_argument("--radcal",help="Set to True (default) to use the RADCAL ID in the spec_file. ",type=bool,default=True)
parser.add_argument("--mf0_file",help="csv file containing MASS_FRACTION_0 with column headings FORMULA and MF0",default='noinput')
args = parser.parse_args()
Expand Down