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
2 changes: 1 addition & 1 deletion run_scripts/cantera/compute_nonpremixed_flamelets.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ def update_flame(flame, strain_factor):
# Create and Solve initial flame
gas = ct.Solution(mechanism, eos)
if metadata_file != "" and rank == 0:
gas.P = press
gas.TP = oxmix.T, press # putting a dummy temperature
save_table_metadata(gas, os.path.join(outdir, metadata_file))
Comment on lines +244 to 245
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sets gas.TP using oxmix.T, but gas is later reused to construct the CounterflowDiffusionFlame. That means the initial gas temperature now changes (only when metadata_file is set and rank == 0), which can unintentionally affect the initial guess / convergence behavior of the first flame. To avoid side effects, use a separate ct.Solution instance for metadata, or set pressure while preserving the existing temperature (e.g., set TP using gas.T rather than oxmix.T).

Suggested change
gas.TP = oxmix.T, press # putting a dummy temperature
save_table_metadata(gas, os.path.join(outdir, metadata_file))
# Use a separate Solution instance for metadata to avoid
# changing the initial temperature of `gas`
metadata_gas = ct.Solution(mechanism, eos)
metadata_gas.TP = metadata_gas.T, press
save_table_metadata(metadata_gas, os.path.join(outdir, metadata_file))

Copilot uses AI. Check for mistakes.
metadata_file = ""
Comment on lines 245 to 246
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

metadata_file is written once and then cleared, using the current loop's press. If pressures contains multiple values, the metadata will silently correspond to whichever pressure happens to be first on rank 0, which is likely incorrect for downstream consumers (the metadata includes a single nominal_pressure). Consider either erroring when multiple pressures are requested (as is done in compute_premixed_flamelets.py) or writing one metadata file per pressure/condition.

Suggested change
save_table_metadata(gas, os.path.join(outdir, metadata_file))
metadata_file = ""
base_name, ext = os.path.splitext(metadata_file)
pressure_tag = f"P{press:g}"
metadata_filename = f"{base_name}_{pressure_tag}{ext}" if ext else f"{base_name}_{pressure_tag}"
save_table_metadata(gas, os.path.join(outdir, metadata_filename))

Copilot uses AI. Check for mistakes.

Expand Down
Loading