Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
21d426a
Stop the coverage unit tests committing into the developer's own repo…
sbryngelson Jul 29, 2026
62e4783
build: base dependency and configure skips on real state, not CMakeCa…
sbryngelson Jul 29, 2026
d101a27
Refactor variable conversion into stage-independent common code (#1679)
sbryngelson Jul 29, 2026
3291cce
test: refresh coverage map [skip ci]
Jul 29, 2026
8dfe8c7
Remove comments referencing invisible external context (#1699)
Moferanoluwa Jul 30, 2026
0c9a1d4
Docs: exclude stackoverflow.com from lychee link check (#1701)
sbryngelson Jul 31, 2026
b40e08f
Remove the four-equation model (model_eqns = 4) (#1713)
sbryngelson Aug 9, 2026
7e4938a
test: refresh coverage map [skip ci]
Aug 9, 2026
d457653
Guard the rapidfuzz-dependent assertion in test_validate (#1705)
sbryngelson Aug 9, 2026
7f69cb5
Fix missing qv term in the Lagrange bubble initial pressure (#1709)
sbryngelson Aug 9, 2026
a125c4c
test: refresh coverage map [skip ci]
Aug 9, 2026
ae4b4c4
Anchored Dual-pass HLLD for Hypoelasticity (+ HLLC and interface-cons…
ChrisZYJ Aug 11, 2026
d963465
test: refresh coverage map [skip ci]
Aug 11, 2026
d90e762
fix: remove integer(wp) and d-literal convention violations in src
BakaOverflow Aug 12, 2026
62a16ff
toolchain: extend lint_source.py for integer(wp) and signed d-literals
BakaOverflow Aug 12, 2026
c9ce9bc
Fix broken star history chart in README (#1726)
Dessalines39394 Aug 12, 2026
bb29773
Avoid NVHPC 25.5 fort2 ICE by expanding f_compute_multidim_cfl_terms …
sbryngelson Aug 15, 2026
a4a5d3c
ci(phoenix): run the post-build syscheck under mpirun (#1728)
sbryngelson Aug 15, 2026
90d738d
Merge branch 'master' into fix-issue-1485
sbryngelson Aug 15, 2026
22046fc
Remove integral output (#1716)
sbryngelson Aug 16, 2026
3db0bd1
Remove MHD + Lax-Friedrichs (#1722)
ChrisZYJ Aug 16, 2026
b7d7883
Large-Scale Startup Optimizations (#1686)
danieljvickers Aug 16, 2026
ca26c4c
Fix hypoelastic probe output (#1721)
ChrisZYJ Aug 17, 2026
b072045
Keep every column of probe output in golden packs (#1712)
sbryngelson Aug 18, 2026
55fb1b1
Move input-only checks to case_validator, delete dead params_tests, e…
sbryngelson Aug 18, 2026
f15f5de
lint: match full d-literal mantissas and integer(kind=wp)
sbryngelson Aug 18, 2026
b281bfe
ci(lychee): exclude the VS Code Marketplace, it returns 503 to automa…
sbryngelson Aug 19, 2026
185392a
Merge branch 'master' into fix-issue-1485
sbryngelson Aug 19, 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
14 changes: 8 additions & 6 deletions .claude/rules/common-pitfalls.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,17 @@ covered in `docs/documentation/contributing.md`.
garbage `v_blow` failed Frontier AMD with `ICFL is NaN` while every NVIDIA lane and all
local CPU/GPU runs passed. A platform-only NaN is the signature of this class.
- Shared-state pattern: namelist declarations (`#:include 'generated_decls.fpp'`), the
`eqn_idx`/`sys_size`/`b_size`/`tensor_size` state variables, and the common defaults
`eqn_idx`/`sys_size` state variables, and the common defaults
core all live in `src/common/m_global_parameters_common.fpp`. Each per-target
`m_global_parameters.fpp` does `use m_global_parameters_common` (default-public), so
`use m_global_parameters` continues to work for all downstream modules without change.
Sim-only declarations (GPU_DECLARE, Re_idx allocation) stay in
`m_global_parameters_common` behind `#ifdef MFC_SIMULATION`. Generated includes
(`generated_decls.fpp`, `generated_bcast.fpp`, `generated_case_opt_decls.fpp`) must exist for every target — the build
emits stubs where the content is sim-only, so a common file that includes one will
compile for pre/post too.
`src/common/` carries no `MFC_PRE_PROCESS`/`MFC_SIMULATION`/`MFC_POST_PROCESS` guards:
stage-varying behavior is passed in as an explicit argument or initialization policy, and
device residency for generated simulation scalars is emitted from `SIM_GPU_DECL_VARS`
(`toolchain/mfc/params/generators/fortran_gen.py`). Generated includes
(`generated_decls.fpp`, `generated_bcast.fpp`, `generated_case_opt_decls.fpp`) must exist for every target — pre/post
get the common computed scalars (`num_dims`, `num_vels`, `weno_polyn`, `muscl_polyn`), so
a common file that includes one will compile for pre/post too.
- Runtime checks (`@:PROHIBIT`) go where they run: shared →
`src/common/m_checker_common.fpp`; simulation-only → `src/simulation/m_checker.fpp`;
pre/post-only → `src/{pre,post}_process/m_checker.fpp` (their `s_check_inputs` are
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/common/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,16 @@ source .github/scripts/retry-build.sh

# Phoenix: smoke-test the syscheck binary to catch architecture mismatches
# (SIGILL from binaries compiled on a different compute node).
#
# Launch under mpirun rather than directly. Phoenix's openmpi/4.1.5 predates the
# PMIx 4.2.6 that came with the Slurm 26.05.2 upgrade, so an MPI binary started
# bare inside an allocation misreads the PMIx environment as an srun launch and
# aborts in MPI_Init ("OPAL ERROR: Unreachable in file ext3x_client.c"). mpirun
# is unaffected, and it is how MFC launches every binary anyway. Output is left
# on stdout so a future failure is diagnosable from the CI log.
validate_cmd=""
if [ "$job_cluster" = "phoenix" ]; then
validate_cmd='syscheck_bin=$(find build/install -name syscheck -type f 2>/dev/null | head -1); [ -z "$syscheck_bin" ] || "$syscheck_bin" > /dev/null 2>&1'
validate_cmd='syscheck_bin=$(find build/install -name syscheck -type f 2>/dev/null | head -1); [ -z "$syscheck_bin" ] || mpirun -np 1 "$syscheck_bin"'
fi

# --- Variant selection ---
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,30 @@ jobs:
/bin/bash mfc.sh test -v --dry-run -j 2 --test-all --gpu mp
'

# Case-optimized build guard.
#
# --case-optimization hard-codes case parameters into the generated
# sources, which sharply increases cross-file inlining pressure in the
# -Mextract/-Minline IPO pass (cmake/MFCTargets.cmake). That pass is
# where NVHPC fort2 has historically hit internal compiler errors, and
# the jobs above cannot see them: they never pass --case-optimization,
# and the self-hosted case-opt jobs run a single pinned NVHPC. NVHPC
# 25.5 shipped an ICE that was invisible to CI for exactly that reason.
#
# One 3D case is enough: the failure is at compile time, so nothing is
# run. 3D specifically, because m_sim_helpers.fpp guards its 3D block
# with "#:if not MFC_CASE_OPTIMIZATION or num_dims > 2" -- a
# case-optimized 2D build elides that code entirely. OpenACC only,
# since the two-pass IPO is disabled for OpenMP offload.
- name: Build (NVHPC GPU, case-optimized)
if: matrix.nvhpc && matrix.target == 'gpu'
run: |
docker exec nvhpc bash -c '
source /etc/nvhpc-env.sh
/bin/bash mfc.sh build -v -j 2 --gpu acc -t simulation \
-i examples/3D_sphbubcollapse/case.py --case-optimization
'

- name: Test (NVHPC)
if: matrix.nvhpc && matrix.target == 'cpu'
run: |
Expand Down
2 changes: 2 additions & 0 deletions .lychee.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,6 @@ exclude = [
"https://www\\.olcf\\.ornl\\.gov/summit", # Returns 503 to automated requests
"https://apps\\.microsoft\\.com/store/detail/", # Microsoft Store detail pages return 403 to automated requests
"https://code\\.visualstudio\\.com/?$", # Root page returns 403 to automated requests
"https://stackoverflow\\.com", # Returns 403 to automated requests
"https://marketplace\\.visualstudio\\.com", # Returns 503 to automated requests
]
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@
"problems.showOn": "toggle",
"problems.defaultViewMode": "list",

// MFC-SCHEMA-CONFIG-BEGIN (auto-generated, do not edit)
// Case-file schema association. Run ./mfc.sh generate to (re)build
// toolchain/mfc-case-schema.json, which these entries point at.
"json.schemas": [
{
"fileMatch": ["**/case.json", "**/input.json", "**/mfc-case.json", "**/mfc.json"],
Expand All @@ -84,5 +85,4 @@
"yaml.schemas": {
"./toolchain/mfc-case-schema.json": ["**/case.yaml", "**/case.yml", "**/input.yaml", "**/input.yml", "**/mfc-case.yaml", "**/mfc.yaml"]
}
// MFC-SCHEMA-CONFIG-END
}
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ And a high-amplitude acoustic wave reflecting and emerging through a circular or
| `./mfc.sh validate case.py` | Check a case file for errors before running |
| `./mfc.sh new my_case` | Create a new case from a template |
| `./mfc.sh clean` | Remove build artifacts |
| `./mfc.sh interactive` | Launch interactive menu-driven interface |

Run `./mfc.sh <command> --help` for detailed options, or see the [full documentation](https://mflowcode.github.io/documentation/index.html). Tab completion for bash and zsh is auto-installed after you have run `./mfc.sh generate` (or any non-`new` command) at least once. Play with the examples in `examples/` ([showcased here](https://mflowcode.github.io/documentation/examples.html)).

Expand Down Expand Up @@ -280,11 +279,11 @@ MFC computations have been run on many supercomputing systems. A partial list is
---

<p align="center">
<a href="https://star-history.com/#MFlowCode/MFC&Date">
<a href="https://star-history.dera.page/#MFlowCode/MFC&Date">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=MFlowCode/MFC&type=Date&theme=dark" />
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=MFlowCode/MFC&type=Date" />
<img src="https://api.star-history.com/svg?repos=MFlowCode/MFC&type=Date&theme=dark" alt="Star History Chart" width="600"/>
<source media="(prefers-color-scheme: dark)" srcset="https://star-history.dera.page/svg?repos=MFlowCode/MFC&type=Date&theme=dark" />
<source media="(prefers-color-scheme: light)" srcset="https://star-history.dera.page/svg?repos=MFlowCode/MFC&type=Date" />
<img src="https://star-history.dera.page/svg?repos=MFlowCode/MFC&type=Date&theme=dark" alt="Star History Chart" width="600"/>
</picture>
</a>
</p>
30 changes: 19 additions & 11 deletions docs/documentation/case.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,6 @@ feature, detecting GPU pointers and performing RDMA accordingly.
| `m` | Integer | Number of grid cells in the $x$-coordinate direction |
| `n` | Integer | Number of grid cells in the $y$-coordinate direction |
| `p` | Integer | Number of grid cells in the $z$-coordinate direction |
| `pref` | Real | Reference pressure |
| `rhoref` | Real | Reference density |

The parameters define the boundaries of the spatial and temporal domains, and their discretization that are used in simulation.

Expand Down Expand Up @@ -489,7 +487,7 @@ See @ref equations "Equations" for the mathematical models these parameters cont
| `bc_[x,y,z]%%beg[end]` | Integer | Beginning [ending] boundary condition in the $[x,y,z]$-direction (negative integer, see table [Boundary Conditions](#boundary-conditions)) |
| `bc_[x,y,z]%%vb[1,2,3]`‡ | Real | Velocity in the (x,1), (y, 2), (z,3) direction applied to `bc_[x,y,z]%%beg` |
| `bc_[x,y,z]%%ve[1,2,3]`‡ | Real | Velocity in the (x,1), (y, 2), (z,3) direction applied to `bc_[x,y,z]%%end` |
| `model_eqns` | Integer | Multicomponent model: [1] \f$\Gamma/\Pi_\infty\f$; [2] 5-equation; [3] 6-equation; [4] 4-equation |
| `model_eqns` | Integer | Multicomponent model: [1] \f$\Gamma/\Pi_\infty\f$; [2] 5-equation; [3] 6-equation |
| `alt_soundspeed` * | Logical | Alternate sound speed and \f$K \nabla \cdot u\f$ for 5-equation model |
| `adv_n` | Logical | Solving directly for the number density (in the method of classes) and compute void fraction from the number density |
| `mpp_lim` | Logical | Mixture physical parameters limits |
Expand All @@ -515,7 +513,8 @@ See @ref equations "Equations" for the mathematical models these parameters cont
| `flux_lim` | Integer | Flux limiter for post-process: [1] minmod; [2] MUSCL; [3] OSPRE; [4] SUPERBEE |
| `ic_eps` | Real | Interface compression threshold (default: 1e-4) |
| `ic_beta` | Real | Interface compression sharpness parameter (default: 1.6) |
| `riemann_solver` | Integer | Riemann solver algorithm: [1] HLL*; [2] HLLC; [3] Exact*; [4] HLLD (only for MHD) |
| `riemann_solver` | Integer | Riemann solver algorithm: [1] HLL*; [2] HLLC; [3] Exact*; [4] HLLD (MHD or hypoelasticity) |
| `hll_u_interface` | Logical | HLL Method 2 (u-interface) for volume fraction advection (default F) |
| `low_Mach` | Integer | Low Mach number correction for HLLC Riemann solver: [0] None; [1] Pressure (\cite Chen22); [2] Velocity (\cite Thornber08) |
| `avg_state` | Integer | Averaged state evaluation method: [1] Roe average*; [2] Arithmetic mean |
| `wave_speeds` | Integer | Wave-speed estimation: [1] Direct (\cite Batten97); [2] Pressure-velocity* (\cite Toro09) |
Expand All @@ -536,6 +535,9 @@ See @ref equations "Equations" for the mathematical models these parameters cont
| `surface_tension` | Logical | Activate surface tension |
| `viscous` | Logical | Activate viscosity |
| `hypoelasticity` | Logical | Activate hypoelasticity* |
| `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_order` | Integer | Order of reconstruction for IGR [3,5] |
| `alf_factor` | Real | Alpha factor for IGR entropic pressure (default 10) |
Expand Down Expand Up @@ -569,7 +571,7 @@ Tangential velocities require viscosity, `weno_avg = T`, and `bc_[x,y,z]%%end =
The difference of the two models is assessed by (\cite Schmidmayer20).
Note that some code parameters are only compatible with 5-equation model.

- `alt_soundspeed` activates the source term in the advection equations for the volume fractions, \f$K\nabla\cdot \underline{u}\f$, that regularizes the speed of sound in the mixture region when the 5-equation model is used.
- `alt_soundspeed` activates the source term in the advection equations for the volume fractions, \f$K\nabla\cdot \underline{u}\f$, that regularizes the speed of sound in the mixture region when the 5-equation model is used. Requires exactly two fluid components (\f$K\f$ is a two-fluid closure).
The effect and use of the source term are assessed by \cite Schmidmayer20.

- `adv_n` activates the direct computation of number density by the Riemann solver instead of computing number density from the void fraction in the method of classes.
Expand Down Expand Up @@ -615,7 +617,11 @@ Setting `muscl_eps = 0` gives textbook limiter behavior where limiters activate

- `riemann_solver` specifies the choice of the Riemann solver that is used in simulation by an integer from 1 through 4.
`riemann_solver = 1`, `2`, and `3` correspond to HLL, HLLC, and Exact Riemann solver, respectively (\cite Toro09).
`riemann_solver = 4` is only for MHD simulations. It resolves 5 of the full seven-wave structure of the MHD equations (\cite Miyoshi05).
`riemann_solver = 4` is the HLLD solver for MHD or hypoelasticity simulations. For MHD it resolves 5 of the full seven-wave structure of the MHD equations (\cite Miyoshi05).

- `hll_u_interface`: Selects between two HLL discretizations of volume fraction advection (`riemann_solver = 1`):
- **Default** (``'F'``): \f$\partial_t \alpha_k + u\,\partial_x \alpha_k = 0\f$
- **u-interface** (``'T'``, consistent with HLLC): \f$\partial_t \alpha_k + \partial_x(\alpha_k\, u) = \alpha_k\,\partial_x u\f$

- `low_Mach` specifies the choice of the low Mach number correction scheme for the HLLC Riemann solver. `low_Mach = 0` is default value and does not apply any correction scheme. `low_Mach = 1` and `2` apply the anti-dissipation pressure correction method (\cite Chen22) and the improved velocity reconstruction method (\cite Thornber08). This feature requires `model_eqns = 2` or `3`. `low_Mach = 1` works for `riemann_solver = 1` and `2`, but `low_Mach = 2` only works for `riemann_solver = 2`.

Expand All @@ -635,7 +641,13 @@ This option requires `weno_Re_flux` to be true because cell boundary values are

- `viscous` activates viscosity when set to ``'T'``. Requires `Re(1)` and `Re(2)` to be set.

- `hypoelasticity` activates elastic stress calculations for fluid-solid interactions. Requires `G` to be set in the fluid material's parameters.
- `hypoelasticity` activates elastic stress calculations for fluid-solid interactions. Requires `G` to be set in `fluid_pp`, and `fd_order` to be set (1, 2, or 4). Compatible with HLL (`riemann_solver = 1`), HLLC (`riemann_solver = 2`), and HLLD (`riemann_solver = 4`). The Riemann solver choice determines how the elastic stress source term \f$\mathbf{S}^e\f$ is discretized:
- **HLL**: finite-difference velocity gradient (default), or interface-consistent velocity gradient when ``hypo_hll_interface_rhs = 'T'`` (matches HLLC).
- **HLLC**: interface-consistent velocity gradient from the Riemann solution.
- **HLLD**: dual-pass approach resolving the elastic wave structure. Requires 2D+ and exactly 2 fluid components.
- With hypoelastic HLLD, use characteristic boundary conditions (`bc_{x,y,z}%%beg/end` between -5 and -12) only where the domain boundary remains in a fluid region throughout the simulation. Keep material interfaces and solids out of the nearby cells used by the boundary calculation. A material present only at the numerical volume-fraction floor is allowed, even if it has nonzero `G`. These boundaries treat acoustic waves only. `alt_soundspeed` is supported.

- `riemann_hypo_ADC`: Enables anti-diffusion correction (ADC) for hypoelastic HLLC or HLLD. Blends the HLLC/HLLD flux locally toward the more diffusive HLL flux where a jump sensor (total normal stress, tangential velocity, and tangential stress) detects a strong contact or material interface, improving robustness and reducing interfacial overshoots. This trades contact and shear resolution for robustness where the sensor activates. `ADC_kappa` (default 1.0) scales the reference jump the sensor is normalized by; smaller values blend more toward HLL (more diffusive and robust). Off by default and recommended off: in MFC's tested hypoelastic cases, including strong shock-interface interactions, HLLD is stable and accurate without ADC. The option is a robustness fallback intended for regimes with intense shocks and intense shear at material interfaces.

#### Boundary Condition Patches {#boundary-condition-patches}

Expand Down Expand Up @@ -719,8 +731,6 @@ To restart the simulation from $k$-th time step, see @ref running "Restarting Ca
| `chem_wrt_T` | Logical | Write temperature field for chemistry output |
| `fft_wrt` | Logical | Enable FFT output |
| `sim_data` | Logical | Write interface and energy data files (post_process) |
| `integral_wrt` | Logical | Write integral data |
| `num_integrals` | Integer | Number of integral regions |
| `down_sample` | Logical | Enable output downsampling |
| `fd_order` | Integer | Order of finite differences for computing the vorticity and the numerical Schlieren function [1,2,4] |
| `schlieren_alpha(i)` | Real | Intensity of the numerical Schlieren computed via `alpha(i)` |
Expand Down Expand Up @@ -873,8 +883,6 @@ Details of the transducer acoustic source model can be found in \cite Maeda17.
| `Ca` | Real | Cavitation number |
| `Web` | Real | Weber number |
| `Re_inv` | Real | Inverse Reynolds number |
| `pref` | Real | Reference pressure for bubble models |
| `rhoref` | Real | Reference density for bubble models |
| `fluid_rho` | Real | Reference fluid density |
| `bub_pp%%R0ref`*†‡ | Real | Reference bubble radius |
| `bub_pp%%p0ref`*†‡ | Real | Reference pressure |
Expand Down
2 changes: 1 addition & 1 deletion docs/documentation/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ Both human reviewers and AI code reviewers reference this section.

### Physics and Model Consistency

- **Pressure formula** must match `model_eqns` value. Model 2/3 (multi-fluid), model 4 (bubbles), MHD, and hypoelastic each use different EOS formulations. Wrong formula = wrong physics.
- **Pressure formula** must match `model_eqns` value. Model 2/3 (multi-fluid), MHD, and hypoelastic each use different EOS formulations. Wrong formula = wrong physics.
- **Conservative-primitive conversion:** Density recovery, kinetic energy, and pressure each have model-specific paths. Verify the correct branch is taken.
- **Volume fractions** must sum to 1. `alpha_rho_K` must be non-negative. Species mass fractions should be clipped to [0,1].
- **Boundary conditions:** Periodic BCs must match at both ends (`bc_x%%beg` and `bc_x%%end`). Cylindrical coordinates have special requirements (`bc_y%%beg = -14` for axis in 3D).
Expand Down
Loading
Loading