|
31 | 31 | help="Name of PelePhysics mechanism from Mechanisms",
|
32 | 32 | )
|
33 | 33 | parser.add_argument(
|
34 |
| - "-pp", "--pp_home", default="../../", help="Path to PelePhysics directory" |
| 34 | + "-pp", "--pp_home", default="../../../", help="Path to PelePhysics directory" |
35 | 35 | )
|
36 | 36 | parser.add_argument(
|
37 | 37 | "-f", "--fuel", default="CH4:1", help="Fuel stream mole-basis Cantera composition"
|
|
42 | 42 | default="O2:1, N2:3.76",
|
43 | 43 | help="Oxidizer stream mole-basis Cantera composition",
|
44 | 44 | )
|
| 45 | +parser.add_argument( |
| 46 | + "-Y", |
| 47 | + "--massfrac", |
| 48 | + default=None, |
| 49 | + help="String of mass fractions (overrides -f and -ox options)", |
| 50 | +) |
45 | 51 | parser.add_argument(
|
46 | 52 | "-T",
|
47 | 53 | "--temperature",
|
|
74 | 80 | mechanism = args.mechanism
|
75 | 81 | fuel_species = args.fuel
|
76 | 82 | ox_species = args.oxidizer
|
| 83 | +Y_species = args.massfrac |
77 | 84 |
|
78 | 85 | # General
|
79 | 86 | p = args.pressure # pressure [Pa]
|
|
95 | 102 |
|
96 | 103 | # Print information
|
97 | 104 | label_pre = "pmf-" + mechanism
|
98 |
| -label = fuel_species.split(":")[0] + "_PHI" + str(phi) + "_T" + str(tin) + "_P" + str(p) |
| 105 | +if Y_species is not None: |
| 106 | + num_input_species = len([item for item in Y_species.split(',') if ':' in item]) |
| 107 | + label = "Y" + str(num_input_species) + "_T" + str(tin) + "_P" + str(p) |
| 108 | +else: |
| 109 | + label = fuel_species.split(":")[0] + "_PHI" + str(phi) + "_T" + str(tin) + "_P" + str(p) |
99 | 110 |
|
100 | 111 | #################
|
101 | 112 | # Find mechanism in PelePhysics
|
|
149 | 160 |
|
150 | 161 | # Set gas state to that of the unburned gas
|
151 | 162 | gas = Solution(mech_path, "gas")
|
152 |
| -gas.TP = tin, p |
153 |
| -gas.set_equivalence_ratio(phi, fuel_species, ox_species, basis="mole") |
| 163 | +if Y_species is None: |
| 164 | + gas.TP = tin, p |
| 165 | + gas.set_equivalence_ratio(phi, fuel_species, ox_species, basis="mole") |
| 166 | +else: |
| 167 | + gas.TPY = tin, p, Y_species |
| 168 | + print("\nMass fractions read into Cantera:") |
| 169 | + for spec, massfrac in zip(gas.species_names, gas.Y): |
| 170 | + print(f" {spec}: {massfrac}") |
154 | 171 |
|
155 | 172 | # Create the free laminar premixed flame
|
156 | 173 | f = FreeFlame(gas, initial_grid)
|
|
0 commit comments