Skip to content
Open
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ __pycache__
toolchain/mfc/_version.py

.DS_Store

!examples/**/IC/*.dat
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Gitignore negation pattern is in wrong position and will be ineffective.

The negation !examples/**/IC/*.dat on line 26 appears before the broader ignore pattern examples/**/*.dat on line 47. In .gitignore, later patterns override earlier ones, so IC .dat files will still be ignored.

Move this line after line 47 (or after line 64 where similar negations exist) to ensure IC data files are properly tracked.

Suggested fix

Move line 26 to after line 64, grouping it with similar negation patterns:

 examples/**/*.f90
 !examples/3D_lag_bubbles_shbubcollapse/input/lag_bubbles.dat
 !examples/3D_lag_bubbles_bubblescreen/input/lag_bubbles.dat
+!examples/**/IC/*.dat
 workloads/

And remove the current line 26.

🤖 Prompt for AI Agents
In @.gitignore at line 26, The negation pattern "!examples/**/IC/*.dat" is
placed before the broader ignore "examples/**/*.dat" so it is ineffective;
relocate the line containing "!examples/**/IC/*.dat" to after the broader ignore
pattern "examples/**/*.dat" (or after the block of similar negations) and remove
the original occurrence so the IC .dat files are actually un-ignored.

/tests/*/**
!/tests/*/golden.txt
!/tests/*/golden-metadata.txt
Expand Down Expand Up @@ -92,4 +92,4 @@ benchmarks/*.png
*.avi

**isolation_rules/
**.supercode/
**.supercode/
4 changes: 2 additions & 2 deletions docs/documentation/case.md
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,8 @@ The code provides three pre-built patches for dimensional extrusion of initial c
- `case(270)`: Extrude 1D data to 2D domain
- `case(370)`: Extrude 2D data to 3D domain

Setup: Only requires specifying `init_dir` and filename pattern via `zeros_default`. Grid dimensions are automatically detected from the data files.
Implementation: All variables and file handling are managed in `src/pre_process/include/ExtrusionHardcodedIC.fpp` with no manual grid configuration needed.
Setup: Only requires specifying `files_dir` and filename pattern via `file_extension`. The files are located, for example, at `examples/2D_case/IC`, and their format is `prim.XX.YY.files_extension.dat`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion: Clarify the example filename format in the documentation to show a concrete example, such as prim.XX.YY.dat, instead of using file_extension as a literal part of the name. [general, importance: 4]

Suggested change
Setup: Only requires specifying `files_dir` and filename pattern via `file_extension`. The files are located, for example, at `examples/2D_case/IC`, and their format is `prim.XX.YY.files_extension.dat`.
Setup: Only requires specifying `files_dir` and filename pattern via `file_extension`. The files are located, for example, at `examples/2D_case/IC`, and their format is `prim.XX.YY.dat` (assuming `file_extension` is set to `.dat`).

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Jan 28, 2026

Choose a reason for hiding this comment

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

P3: The filename example uses files_extension while the text defines the key as file_extension. This mismatch is likely a typo and could mislead users about the required filename pattern.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At docs/documentation/case.md, line 254:

<comment>The filename example uses `files_extension` while the text defines the key as `file_extension`. This mismatch is likely a typo and could mislead users about the required filename pattern.</comment>

<file context>
@@ -251,8 +251,8 @@ The code provides three pre-built patches for dimensional extrusion of initial c
 
-Setup: Only requires specifying `init_dir` and filename pattern via `zeros_default`. Grid dimensions are automatically detected from the data files.
-Implementation: All variables and file handling are managed in `src/pre_process/include/ExtrusionHardcodedIC.fpp` with no manual grid configuration needed.
+Setup: Only requires specifying `files_dir` and filename pattern via `file_extension`. The files are located, for example, at `examples/2D_case/IC`, and their format is `prim.XX.YY.files_extension.dat`.
+Implementation: All variables and file handling are managed in the `case.py` file of the simulation.
 Usage: Ideal for initializing simulations from lower-dimensional solutions, enabling users to add perturbations or modifications to the base extruded fields for flow instability studies.
</file context>
Suggested change
Setup: Only requires specifying `files_dir` and filename pattern via `file_extension`. The files are located, for example, at `examples/2D_case/IC`, and their format is `prim.XX.YY.files_extension.dat`.
Setup: Only requires specifying `files_dir` and filename pattern via `file_extension`. The files are located, for example, at `examples/2D_case/IC`, and their format is `prim.XX.YY.file_extension.dat`.
Fix with Cubic

Implementation: All variables and file handling are managed in the `case.py` file of the simulation.
Usage: Ideal for initializing simulations from lower-dimensional solutions, enabling users to add perturbations or modifications to the base extruded fields for flow instability studies.

#### Parameter Descriptions
Expand Down
1,200 changes: 1,200 additions & 0 deletions examples/1D_flamelet/IC/prim.1.00.000000.dat

Large diffs are not rendered by default.

1,200 changes: 1,200 additions & 0 deletions examples/1D_flamelet/IC/prim.10.00.000000.dat

Large diffs are not rendered by default.

1,200 changes: 1,200 additions & 0 deletions examples/1D_flamelet/IC/prim.11.00.000000.dat

Large diffs are not rendered by default.

1,200 changes: 1,200 additions & 0 deletions examples/1D_flamelet/IC/prim.12.00.000000.dat

Large diffs are not rendered by default.

1,200 changes: 1,200 additions & 0 deletions examples/1D_flamelet/IC/prim.13.00.000000.dat

Large diffs are not rendered by default.

1,025 changes: 1,025 additions & 0 deletions examples/1D_flamelet/IC/prim.14.00.000000.dat

Large diffs are not rendered by default.

1,200 changes: 1,200 additions & 0 deletions examples/1D_flamelet/IC/prim.2.00.000000.dat

Large diffs are not rendered by default.

1,200 changes: 1,200 additions & 0 deletions examples/1D_flamelet/IC/prim.3.00.000000.dat

Large diffs are not rendered by default.

1,200 changes: 1,200 additions & 0 deletions examples/1D_flamelet/IC/prim.4.00.000000.dat

Large diffs are not rendered by default.

1,200 changes: 1,200 additions & 0 deletions examples/1D_flamelet/IC/prim.5.00.000000.dat

Large diffs are not rendered by default.

1,200 changes: 1,200 additions & 0 deletions examples/1D_flamelet/IC/prim.6.00.000000.dat

Large diffs are not rendered by default.

1,200 changes: 1,200 additions & 0 deletions examples/1D_flamelet/IC/prim.7.00.000000.dat

Large diffs are not rendered by default.

1,200 changes: 1,200 additions & 0 deletions examples/1D_flamelet/IC/prim.8.00.000000.dat

Large diffs are not rendered by default.

1,200 changes: 1,200 additions & 0 deletions examples/1D_flamelet/IC/prim.9.00.000000.dat

Large diffs are not rendered by default.

72 changes: 72 additions & 0 deletions examples/1D_flamelet/case.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#!/usr/bin/env python3
import json
import argparse
import math
import os
import cantera as ct

current_dir = os.path.dirname(os.path.abspath(__file__))
ctfile = "sandiego.yaml"
sol_L = ct.Solution(ctfile)
sol_L.TPX = 300, 8000, "O2:2,N2:2,H2O:5"
L = 0.016
Nx = 1199
dx = L / Nx
dt = 1e-8
Tend = 0.60e-3
NT = int(Tend / dt)
SAVE_COUNT = 1000
NS = 1000
case = {
"run_time_info": "T",
"x_domain%beg": -L / 2,
"x_domain%end": +L / 2,
"m": Nx,
"n": 0,
"p": 0,
"dt": float(dt),
"t_step_start": 0,
"t_step_stop": NT,
"t_step_save": NS,
"t_step_print": 100,
"parallel_io": "F",
"model_eqns": 2,
"num_fluids": 1,
"num_patches": 1,
"mpp_lim": "F",
"mixture_err": "F",
"time_stepper": 3,
"weno_order": 5,
"weno_eps": 1e-16,
"weno_avg": "F",
"mapped_weno": "T",
"mp_weno": "T",
"riemann_solver": 2,
"wave_speeds": 2,
"avg_state": 1,
"bc_x%beg": -8,
"bc_x%end": -8,
"viscous": "F",
"files_dir": os.path.join(current_dir, "IC"),
"file_extension": "000000",
"chemistry": "T",
"chem_params%diffusion": "T",
"chem_params%reactions": "T",
"chem_params%transport_model": 2,
"format": 1,
"precision": 2,
"prim_vars_wrt": "T",
"patch_icpp(1)%geometry": 1,
"patch_icpp(1)%hcid": 170,
"patch_icpp(1)%x_centroid": 0,
"patch_icpp(1)%length_x": L,
"patch_icpp(1)%vel(1)": "0",
"patch_icpp(1)%pres": 1.01325e5,
"patch_icpp(1)%alpha(1)": 1,
"patch_icpp(1)%alpha_rho(1)": "1",
Comment on lines +63 to +66
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion: Several fields in the case dict that represent numeric configuration values are provided as strings (for example patch_icpp(1)%vel(1) and patch_icpp(1)%alpha_rho(1)), which can cause downstream config parsers to treat them as strings and fail numeric operations; make these entries numeric (remove the quotes). [type error]

Severity Level: Major ⚠️
- ❌ Simulation config fields parsed as wrong types.
- ⚠️ Downstream numeric operations may misbehave.
Suggested change
"patch_icpp(1)%vel(1)": "0",
"patch_icpp(1)%pres": 1.01325e5,
"patch_icpp(1)%alpha(1)": 1,
"patch_icpp(1)%alpha_rho(1)": "1",
"patch_icpp(1)%vel(1)": 0,
"patch_icpp(1)%alpha_rho(1)": 1,
Steps of Reproduction ✅
1. Run the example script to emit JSON: `python examples/1D_flamelet/case.py`; the script
prints the `case` dict as JSON.

2. Parse the output JSON (e.g., `json.loads(...)`) and inspect keys "patch_icpp(1)%vel(1)"
and "patch_icpp(1)%alpha_rho(1)" defined at lines 63 and 66; both values are strings ("0"
and "1").

3. If a downstream consumer expects numeric types (e.g., performing arithmetic on these
config entries), it will receive strings and either convert them or raise a type-related
error in the consumer.

4. Observed result: mis-typed configuration values in produced JSON; behavior depends on
downstream code but can lead to incorrect numeric operations.
Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** examples/1D_flamelet/case.py
**Line:** 63:66
**Comment:**
	*Type Error: Several fields in the `case` dict that represent numeric configuration values are provided as strings (for example `patch_icpp(1)%vel(1)` and `patch_icpp(1)%alpha_rho(1)`), which can cause downstream config parsers to treat them as strings and fail numeric operations; make these entries numeric (remove the quotes).

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.

"fluid_pp(1)%gamma": 1.0e00 / (1.5e00 - 1.0e00),
"fluid_pp(1)%pi_inf": 0,
"cantera_file": ctfile,
}
if __name__ == "__main__":
print(json.dumps(case))
Loading
Loading