Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
58fc74f
Jet-in-crossflow deck as case.py with an extrapolation outflow; prech…
sbryngelson Nov 25, 2026
d365576
Serial restart through pre_process old_ic: read the interior record, …
sbryngelson Nov 25, 2026
f4c32f2
Refuse igr in 1D; note that IGR needs elliptic_smoothing for a sharp …
sbryngelson Nov 25, 2026
ed57d61
2D Taylor-Green patch: exact initial pressure (#2465)
sbryngelson Nov 25, 2026
3129c1c
Reacting mixing-layer examples: one IC directory per cache key, writt…
sbryngelson Nov 25, 2026
d951d23
IBM: a cell inside two bodies takes the largest encoded id, independe…
sbryngelson Nov 25, 2026
866a13c
Chemistry: free the species flux_src_n fields; match the energy-diffu…
sbryngelson Nov 25, 2026
843c603
IBM: correct the moment of inertia (#1994, #2068)
sbryngelson Nov 25, 2026
dcfeaac
Rescale clamped face volume fractions whose sum exceeds 1 (#1911)
sbryngelson Nov 25, 2026
ef26afc
Toolchain: default build -j to min(cores, 16) and print it (#1876)
sbryngelson Nov 25, 2026
47c2100
Docs and comments: stale build, parameter and interpolation claims (#…
sbryngelson Nov 25, 2026
594364b
Leftover review items from merged PRs (#2083)
sbryngelson Nov 25, 2026
4f67f63
Tests: 09FDDC81 off the cell faces; goldens: regenerate 09FDDC81, add…
sbryngelson Nov 26, 2026
5138990
Tests: override_tol_single for the single-precision lane (harness cha…
sbryngelson Nov 26, 2026
430dc5d
Tests: 09FDDC81 single-precision tolerance from the measured 1e-2 sin…
sbryngelson Nov 26, 2026
4836d1c
Review fixes: batch validation against the default build, LTO partiti…
sbryngelson Nov 26, 2026
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
3 changes: 2 additions & 1 deletion .github/scripts/preflight.sh
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ run_probe() {
# reasons -- no input file, no restart data, a missing module -- and none of them
# say anything about the node. Treating any non-zero status as a fault here would
# exclude every healthy node in the cluster. 132 is 128+4, a child killed by
# SIGILL; bash reports signals that way, and mpirun/srun forward it.
# SIGILL; bash reports signals that way, and mpirun/srun forward it. Some
# launchers do not pass 132 on, so the "Illegal instruction" text is matched too.
isa_probe() {
isa_bin=$(newest_for_device pre_process)
[ -n "$isa_bin" ] || return 0
Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/submit-slurm-job.sh
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ while :; do
# 34183404644 exactly this way. sacct knows the node whether or not the
# .out exists, so identification no longer depends on the marker.
if [ -z "$faulted_node" ]; then
faulted_node=$(sacct -j "$job_id" -X -n -o NodeList 2>/dev/null | head -n1 | tr -d ' ')
faulted_node=$(sacct -j "$job_id" -X -n -o NodeList 2>/dev/null | head -n1 | tr -d ' ' || true)
case "$faulted_node" in ""|None*|*[,\[]*) faulted_node="" ;; esac
fi
if [ "$node_attempt" -lt "$MFC_MAX_NODE_RESUBMITS" ]; then
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ docs/post_process/readme.md
docs/api/readme.md

examples/**/IC/*.dat
examples/**/IC/.cache_key.json
examples/**/IC/**/.cache_key.json
examples/*batch/*/
examples/**/D/*
examples/**/p*
Expand Down
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ if (CMAKE_Fortran_COMPILER_ID STREQUAL "Cray")
list(PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/toolchain/cmake/cce")
endif()

if (CMAKE_Fortran_COMPILER_ID STREQUAL "LLVMFlang")
if (CMAKE_Fortran_COMPILER_ID STREQUAL "LLVMFlang" AND MFC_OpenMP)
# Otherwise the GPU targets are never up to date and every build redoes the
# whole-image device LTO link -- ~20 minutes on Frontier, paid on each mfc.sh
# invocation even when nothing changed. CMake asks the linker for its
Expand All @@ -149,7 +149,8 @@ if (CMAKE_Fortran_COMPILER_ID STREQUAL "LLVMFlang")
# Directory scope, not a target property: LINK_DEPENDS_USE_LINKER exists only as
# a variable, and set_target_properties would silently create a custom property
# that does nothing. Setting it inside MFC_SETUP_TARGET would be function-scoped
# and equally silent.
# and equally silent. MFC_OpenMP is the amdflang offload build; CPU builds keep
# the linker's dependency tracking.
set(CMAKE_LINK_DEPENDS_USE_LINKER OFF)
endif()

Expand Down
2 changes: 1 addition & 1 deletion docs/documentation/architecture.md.in
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ To add a new source term or physics model:
1. **Create a module** in `src/simulation/` (e.g., `m_my_model.fpp`)
2. **Add initialization/finalization** subroutines called from `m_start_up`
3. **Add RHS contributions** called from the dimensional loop in `m_rhs:s_compute_rhs`
4. **Add parameters** to `m_global_parameters` and input validation to `m_checker`
4. **Add parameters** to `toolchain/mfc/params/definitions.py` and input validation to `toolchain/mfc/case_validator.py`
5. **Add a module-level brief** (enforced by the linter in `lint_docs.py`)
6. **Add the module to `docs/module_categories.json`** so it appears in this page

Expand Down
5 changes: 3 additions & 2 deletions docs/documentation/case.md
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ These physical parameters must be consistent with fluid material's parameters de

Initial conditions in which not all patches support the `patch_icpp(j)%%smoothen` parameter can still be smoothed by applying iterations of the heat equation to the initial condition.
This is enabled by adding ``'elliptic_smoothing': "T",`` and ``'elliptic_smoothing_iters': N,`` to the case dictionary, where `N` is the number of smoothing iterations to apply.
With `igr`, an initial condition with a sharp jump (a shock tube) needs it: a Sod tube without smoothing gives NaN within 10 steps.

### 4. Immersed Boundary Patches {#sec-immersed-boundary-patches}

Expand Down Expand Up @@ -672,7 +673,7 @@ See @ref equations "Equations" for the mathematical models these parameters cont
| `riemann_hypo_ADC` | Logical | Enable hypo anti-diffusion correction for HLLC/HLLD (default F) |
| `ADC_kappa` | Real | ADC sensor scaling parameter (default 1.0) |
| `hypo_hll_interface_rhs` | Logical | HLL uses interface-consistent hypo RHS (default F) |
| `igr` | Logical | Enable solution via information geometric regularization (IGR) \cite Cao24 |
| `igr` | Logical | Enable solution via information geometric regularization (IGR) \cite Cao24 (2D and 3D only) |
| `igr_order` | Integer | Order of reconstruction for IGR [3,5] |
| `alf_factor` | Real | Alpha factor for IGR entropic pressure (default 10) |
| `igr_pres_lim` | Logical | Limit IGR pressure to avoid negative values (default F) |
Expand Down Expand Up @@ -1701,7 +1702,7 @@ The entries labeled "Characteristic." are characteristic boundary conditions bas

This boundary condition can be used for subsonic inflow (`bc_[x,y,z]%[beg,end]` = -7) and subsonic outflow (`bc_[x,y,z]%[beg,end]` = -8) characteristic boundary conditions. These are based on \cite Pirozzoli13. This enables to provide inflow and outflow conditions outside the computational domain.

`bc_[x,y,z]%%vel_in_ramp` starts the inflow smoothly instead of holding it constant, which is what a jet or a tunnel accelerating from rest requires: the start-up is the event of interest, not a transient to be discarded. The inflow velocity is scaled by \f$f(t) = f_0 + (1 - f_0)\left[1 + \tanh\left(6 (t - t_0)/\tau - 3\right)\right]/2\f$, with \f$\tau\f$ = `vel_in_ramp`, \f$t_0\f$ = `vel_in_t0` and \f$f_0\f$ = `vel_in_frac0`, so it leaves \f$f_0\f$ of the final velocity at \f$t_0\f$ and is within half a percent of it at \f$t_0 + \tau\f$. A boundary with `vel_in_ramp = 0` is held constant, as before. The ramp acts on a GRCBC inflow (`grcbc_in`) or on the ghost-cell velocity of a Dirichlet (-17) boundary or boundary patch normal to that direction, such as a nozzle set into a wall.
`bc_[x,y,z]%%vel_in_ramp` starts the inflow smoothly instead of holding it constant, which is what a jet or a tunnel accelerating from rest requires: the start-up is the event of interest, not a transient to be discarded. The inflow velocity is scaled by \f$f(t) = f_0 + (1 - f_0)\left[1 + \tanh\left(6 (t - t_0)/\tau - 3\right)\right]/2\f$, with \f$\tau\f$ = `vel_in_ramp`, \f$t_0\f$ = `vel_in_t0` and \f$f_0\f$ = `vel_in_frac0`, so it leaves \f$\approx f_0\f$ of the final velocity at \f$t_0\f$ and is within half a percent of it at \f$t_0 + \tau\f$. A boundary with `vel_in_ramp = 0` is held constant, as before. The ramp acts on a GRCBC inflow (`grcbc_in`) or on the ghost-cell velocity of a Dirichlet (-17) boundary or boundary patch normal to that direction, such as a nozzle set into a wall.

### Patch types {#patch-types}

Expand Down
4 changes: 2 additions & 2 deletions docs/documentation/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,13 +227,13 @@ For more options, see @ref visualization "Flow Visualization" or run `./mfc.sh v

### Parameter Lookup

MFC has over 3,000 case parameters. Use the `params` command to search and explore them:
MFC has over 4,000 case parameters. Use the `params` command to search and explore them:

```shell
./mfc.sh params dt # Search for parameters matching "dt"
./mfc.sh params -d dt # Show parameter with description
./mfc.sh params patch # Find all patch-related parameters
./mfc.sh params --family # List all parameter families
./mfc.sh params --families # List all parameter families
```

### Creating a New Case
Expand Down
2 changes: 1 addition & 1 deletion docs/documentation/gpuParallelization.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Note: Ordering is not guaranteed or stable, so use key-value pairing when using
In order to parallelize a loop, simply place two macro calls on either end of the loop:

```C
$:$GPU_PARALLEL_LOOP(...)
$:GPU_PARALLEL_LOOP(...)
{code}
$:END_GPU_PARALLEL_LOOP()
```
Expand Down
2 changes: 1 addition & 1 deletion docs/documentation/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ where `<computer name>` could be `phoenix` or any of the others in the [template
You can create new templates with the appropriate run commands or omit this option.
The use of `--` in the above command passes options to the `./mfc.sh run` command underlying the `./mfc.sh test`.

The comparison tolerance is set per case in `compute_tolerance` (`toolchain/mfc/test/case.py`): a default of 1e-12, looser for cases whose physics amplifies round-off (examples, hypoelasticity, IBM, bubbles and others), and `override_tol` on a `define_case_d` call for a single case. Set an `override_tol` from the spread seen across compiler and device lanes, not from one machine, and in single precision it is floored at the default single-precision tolerance. When a default or an algorithm changes, regenerate the affected goldens in the same change (see [Keeping the goldens current](@ref validation)).
The comparison tolerance is set per case in `compute_tolerance` (`toolchain/mfc/test/case.py`): a default of 1e-12, looser for cases whose physics amplifies round-off (examples, hypoelasticity, IBM, bubbles and others), and `override_tol` on a `define_case_d` call for a single case. Set an `override_tol` from the spread seen across compiler and device lanes, not from one machine, and in single precision it is floored at the default single-precision tolerance. Where single-precision round-off is measured to exceed that floor, `override_tol_single` sets the single comparison of that case alone (the double comparison keeps `override_tol`). When a default or an algorithm changes, regenerate the affected goldens in the same change (see [Keeping the goldens current](@ref validation)).

The build configuration is remembered between commands (`build/lock.yaml`), so pass `--no-debug --no-reldebug --no-single` explicitly when you need a plain build after a debug or single-precision one.

Expand Down
3 changes: 1 addition & 2 deletions docs/documentation/validation_shock_tubes.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,7 @@ smaller scale (densities differ by 1.1e-2; L1 8.871e-2 and 8.864e-2). WENO5-JS a

## Known limitations

- **IGR has no 1D path** ([#2463](https://github.com/MFlowCode/MFC/issues/2463)): a 1D case with `igr = T` passes validation and
segfaults. The IGR rows use a 2D strip of 8 cells in y (periodic) with `elliptic_smoothing` (10 iterations); without the smoothing
- **IGR has no 1D path** ([#2463](https://github.com/MFlowCode/MFC/issues/2463)): the validator refuses `igr = T` with `n = 0`. The IGR rows use a 2D strip of 8 cells in y (periodic) with `elliptic_smoothing` (10 iterations); without the smoothing
the Sod strip gives NaN within 10 steps. With `alf_factor = 10` its error is 6 to 7 times that of WENO5-M (the regularization
widens the shock over several cells), and it converges at the same order. The 123 problem fails with IGR (NaN, also with
`igr_pres_lim`).
Expand Down
4 changes: 2 additions & 2 deletions docs/documentation/validation_vortex_order.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ run agrees with the CPU to 1e-12 in density and to all printed digits in the tab

- The Taylor-Green check is at a Reynolds number of 1.2e-5 and a Mach number of 3e-4, where the flow is a single decaying mode. The
3D Re = 1600 transition (`examples/3D_TaylorGreenVortex`) and the IGR Taylor-Green examples are not checked here.
- The initial pressure of the 2D Taylor-Green patch is a quarter of the exact one ([#2465](https://github.com/MFlowCode/MFC/issues/2465)).
At this Mach number the start-up acoustic transient does not affect the decay rate measurably.
- The 2D Taylor-Green patch sets the exact initial pressure since [#2465](https://github.com/MFlowCode/MFC/issues/2465) (it was a
quarter of it); the table above, measured before the fix, is unchanged at the printed digits (32 cells, rerun after the fix).
- The time-step order is not measured here: the spatial error dominates the vortex, and the suite covers the RK1-3 orders on 1D
advection (`Convergence -> Temporal`).
- WENO7 needs at least 36 cells per direction (`num_stcls_min * weno_order`).
Expand Down
3 changes: 1 addition & 2 deletions examples/2D_TaylorGreenVortex/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ energy, against the exact solution:
./mfc.sh run examples/2D_TaylorGreenVortex/case.py -t pre_process simulation -n 1 -- -N 64
python3 examples/2D_TaylorGreenVortex/check_tgv.py <run N=32> <run N=64> [--tol 1e-4]

The rate error is 7e-7 at 32 cells and 1e-10 at 128. Results and limits (the initial pressure of the patch is a quarter of the
exact one, #2465): @ref validation_vortex_order.
The rate error is 7e-7 at 32 cells and 1e-10 at 128. Results and limits: @ref validation_vortex_order.
5 changes: 1 addition & 4 deletions examples/2D_ibm_thin_plate_force/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,11 @@
t_end = t0 + t_p + 4.0
x0, x1, y0, y1 = -2.0, 5.0, -2.5, 2.5

# L4 added after the first three failed to converge: refining 2 -> 4 -> 8 cells across the thickness moved
# NCELL=16 added after 2, 4 and 8 failed to converge: refining 2 -> 4 -> 8 cells across the thickness moved
# the peak lift 6.41 -> 4.68 -> 4.46 against a reference of 7.00, i.e. away from it and then stalling.
# Two under-resolved answers landing near each other is not convergence. If a few cells across a thin
# body is simply too few for the immersed boundary, 16 should move back toward the reference; if the
# finite thickness is genuinely the difference, it should stay near 4.5.
LEVELS = {"L1": 0.0125, "L2": 0.00625, "L3": 0.003125, "L4": 0.0015625}


NCELL = int(os.environ.get("NCELL", 4))
dx = THICK / NCELL
m, n = int((x1 - x0) / dx) - 1, int((y1 - y0) / dx) - 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env python3
import json
import math

Expand Down Expand Up @@ -62,7 +63,7 @@
"elliptic_smoothing": "T",
"elliptic_smoothing_iters": 10, # 50,
"bc_x%beg": -17,
"bc_x%end": -12,
"bc_x%end": -3,
"bc_y%beg": -17,
"bc_y%end": -3,
"num_bc_patches": 0,
Expand Down
2 changes: 1 addition & 1 deletion examples/2D_reacting_mixing_layer/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
cross_coord, grid = flamelet_ic.compute_grid(vort_thickness, cross_min, cross_max, points_per_cross, stream_min, stream_max, num_y)
fluid = flamelet_ic.reference_fluid_properties(sol, temperature_ox, pressure, mole_fraction_ox)

ic_dir = os.path.join(current_dir, "IC")
# Key the cache on grid size + mode + physics so a cached IC isn't silently reused across
# a --hot/cold switch or a physical-parameter change that leaves the line count unchanged.
cache_key = {
Expand All @@ -64,6 +63,7 @@
"initializer": flamelet_ic.INITIALIZER_VERSION,
"mechanism": flamelet_ic.mechanism_fingerprint(sol),
}
ic_dir = flamelet_ic.keyed_ic_dir(current_dir, cache_key)
if not flamelet_ic.ic_cache_valid(ic_dir, "000000", len(cross_coord), cache_key):
flamelet_ic.generate_ic_files(
output_dir=ic_dir,
Expand Down
4 changes: 3 additions & 1 deletion examples/2D_reacting_mixing_layer/flamelet_ic.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
sys.path.insert(0, str(Path(__file__).resolve().parents[2] / "toolchain"))
from mfc.flamelet import (
INITIALIZER_VERSION,
atomic_write,
create_simulation_fields,
density,
ic_cache_valid,
keyed_ic_dir,
mechanism_fingerprint,
reference_fluid_properties,
streams,
Expand Down Expand Up @@ -75,7 +77,7 @@ def write_hcid_ic(output_dir, cross_coord, density, streamwise_velocity, pressur

for n, values in enumerate(columns, start=1):
path = os.path.join(output_dir, f"prim.{n}.00.{file_extension}.dat")
with open(path, "w") as fh:
with atomic_write(path) as fh:
for x, v in zip(cross_coord, values):
fh.write(f"{float(x)!r} {float(v)!r}\n")

Expand Down
2 changes: 1 addition & 1 deletion examples/2D_spatial_reacting_mixing_layer/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@
bf_freq = 2 * np.pi * 0.25 * freq_nom * (np.arange(8) + rng.uniform(-0.5, 0.5, size=8))
bf_phase = rng.uniform(0, 2 * np.pi, size=8)

ic_dir = os.path.join(current_dir, "IC")
# Key the cache on grid size + mode + physics so a cached IC isn't silently reused across
# a --hot/cold switch or a physical-parameter change that leaves the line count unchanged.
cache_key = {
Expand All @@ -107,6 +106,7 @@
"initializer": flamelet_ic.INITIALIZER_VERSION,
"mechanism": flamelet_ic.mechanism_fingerprint(sol),
}
ic_dir = flamelet_ic.keyed_ic_dir(current_dir, cache_key)
if not flamelet_ic.ic_cache_valid(ic_dir, "000000", len(stream_coord) * len(cross_coord), cache_key):
flamelet_ic.generate_ic_files_spatial(
output_dir=ic_dir,
Expand Down
4 changes: 3 additions & 1 deletion examples/2D_spatial_reacting_mixing_layer/flamelet_ic.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
sys.path.insert(0, str(Path(__file__).resolve().parents[2] / "toolchain"))
from mfc.flamelet import (
INITIALIZER_VERSION,
atomic_write,
create_simulation_fields,
density,
ic_cache_valid,
keyed_ic_dir,
mechanism_fingerprint,
reference_fluid_properties,
streams,
Expand Down Expand Up @@ -83,7 +85,7 @@ def write_hcid274_ic(output_dir, stream_coord, cross_coord, density, streamwise_

for n, values in enumerate(columns, start=1):
path = os.path.join(output_dir, f"prim.{n}.00.{file_extension}.dat")
with open(path, "w") as fh:
with atomic_write(path) as fh:
for x in stream_coord:
for y, v in zip(cross_coord, values):
fh.write(f"{float(x)!r} {float(y)!r} {float(v)!r}\n")
Expand Down
7 changes: 5 additions & 2 deletions examples/3D_ibm_neighborhood_radius/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,10 @@
if os.environ.get("SUMMARY"):
bound = 0.5 * math.sqrt(c**2 + SPAN**2 + THICK**2)
print(f"plate half-extent (s_get_ib_bound, geometry 9): {bound:.4f}")
print(f"rank extents at 64 ranks (16 x 2 x 2): x {(x1 - x0) / 16:.3f}, " f"y {(y1 - y0) / 2:.3f}, z {(z1 - z0) / 2:.3f}")
print(f"hops needed across the thinnest rank: ceil(1.1 * {bound:.4f} / {(x1 - x0) / 16:.3f}) = " f"{max(1, math.ceil(1.1 * bound / ((x1 - x0) / 16)))}")
# Ranks per direction, as MFC's topology search picks them for 400 x 50 x 50 at 64 ranks; set TOPOLOGY otherwise.
topo = [int(t) for t in os.environ.get("TOPOLOGY", "16,2,2").split(",")]
ext = [(hi - lo) / t for (lo, hi), t in zip(((x0, x1), (y0, y1), (z0, z1)), topo)]
print(f"rank extents at {topo[0] * topo[1] * topo[2]} ranks ({' x '.join(map(str, topo))}): x {ext[0]:.3f}, y {ext[1]:.3f}, z {ext[2]:.3f}")
print(f"hops needed across the thinnest rank: ceil(1.1 * {bound:.4f} / {min(ext):.3f}) = {max(1, math.ceil(1.1 * bound / min(ext)))}")
else:
print(json.dumps(case, indent=4))
2 changes: 1 addition & 1 deletion examples/3D_reacting_mixing_layer/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
cross_coord, x_coord, grid = flamelet_ic.compute_grid_3d(vort_thickness, cross_min, cross_max, points_per_cross, stream_min, stream_max, num_x, span_min, span_max, num_z)
fluid = flamelet_ic.reference_fluid_properties(sol, temperature_ox, pressure, mole_fraction_ox)

ic_dir = os.path.join(current_dir, "IC")
# Key the cache on grid size + mode + physics so a cached IC isn't silently reused across
# a --hot/cold switch or a physical-parameter change that leaves the line count unchanged.
cache_key = {
Expand All @@ -86,6 +85,7 @@
"mechanism": flamelet_ic.mechanism_fingerprint(sol),
"perturb_seed": perturb_seed,
}
ic_dir = flamelet_ic.keyed_ic_dir(current_dir, cache_key)
if not flamelet_ic.ic_cache_valid(ic_dir, "000000", len(x_coord) * len(cross_coord), cache_key):
flamelet_ic.generate_ic_files(
output_dir=ic_dir,
Expand Down
5 changes: 4 additions & 1 deletion examples/3D_reacting_mixing_layer/flamelet_ic.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
sys.path.insert(0, str(Path(__file__).resolve().parents[2] / "toolchain"))
from mfc.flamelet import (
INITIALIZER_VERSION,
atomic_write,
create_simulation_fields,
density,
ic_cache_valid,
keyed_ic_dir,
mechanism_fingerprint,
reference_fluid_properties,
streams,
Expand Down Expand Up @@ -166,7 +168,8 @@ def write_hcid370_ic(output_dir, x_coord, cross_coord, density, streamwise_veloc
for n, values_2d in enumerate(columns_2d, start=1):
path = os.path.join(output_dir, f"prim.{n}.00.{file_extension}.dat")
rows = np.column_stack((xy_flat, np.asarray(values_2d, dtype=float).ravel()))
np.savetxt(path, rows, fmt="%.17g")
with atomic_write(path) as fh:
np.savetxt(fh, rows, fmt="%.17g")

return len(columns_2d), ny

Expand Down
Loading
Loading