|
MFC
Exascale flow solver
|
This page records what MFC has been checked against: exact solutions, reference data and conservation laws. Each section is one family of checks. It gives the status, the code version, the setup, the reference, the measured values with signed errors, and the limits. Every check has an example in examples/ with a checker script and a README, and a small version of it runs in the test suite (./mfc.sh test).
Status words: validated (agrees with the reference within the stated error), partially validated (agrees where measured; a regime or quantity is open), open discrepancy (disagrees, cause known or not), comparison only (reference data are qualitative). Errors are (MFC − reference)/reference.
Status: validated. Code: master at 067f23074, with the stage-consistent position update of #2040. Examples: examples/2D_mibm_constant_acceleration, examples/3D_mibm_wall_collision.
Two-way coupled bodies (moving_ibm = 2) are advanced from the force on them. Particle-resolved runs depend on the integration being exact where an exact answer exists, and on collisions returning the prescribed restitution.
| Item | Value |
|---|---|
| Body | circle, R = 50 µm, 1000 kg/m, moving_ibm = 2 |
| Gas | air at rest, 1e5 Pa, 1.2 kg/m³, inviscid; the gas force is negligible against the body force |
| Drive | bf_x = T, g_x = 1e5 m/s², k_x = w_x = p_x = 0 |
| Numerics | first-order reconstruction, HLLC, SSP-RK3, fixed \(\Delta t\) at acoustic CFL 0.4, 200 steps, 6R half-width, extrapolation boundaries |
| Reference | exact kinematics: \(x = g t^2/2\), \(v = g t\) |
| Measured | final centroid and velocity from restart_data/ib_state_*.dat, checked by check_kinematics.py |
| Cells per radius | Position error | Velocity error |
|---|---|---|
| 5 | −3.6e-13 | −2.3e-13 |
| 10 | −2.9e-13 | −1.9e-13 |
Both are round-off. A build with the stage weights of the position update from before #2040 gave a position error of 1.2e-3 with an exact velocity (measured earlier on a build without #2040; not repeated). The check cannot see a wrong stage velocity in the velocity, only in the position, which is why it uses a position.
Limits: only constant acceleration is checked. For a prescribed body (moving_ibm = 1) with an analytic velocity such as \(U_0\sin\omega t\), the velocity is evaluated at the step time rather than the stage time, and the centroid is off by about 1e-3 relative (measured earlier; the cause is not verified and is not addressed here).
| Item | Value |
|---|---|
| Body | sphere, R = 5 m, mass 1e6 (gas force negligible), impact speed 3.9 m/s |
| Wall | y = 0, bc_y%beg = -15; other boundaries extrapolation |
| Model | collision_model = 1, collision_time = N \(\Delta t\), \(\Delta t\) = 5e-6 s, coefficient_of_restitution e, ib_coefficient_of_friction \(\mu\) |
| Numerics | first-order reconstruction, HLLC, SSP-RK3, fixed \(\Delta t\), 16³ cells, air at 1e5 Pa (the gas plays no role) |
| Reference | rigid-body impact of a sphere on a fixed wall with Coulomb friction and no tangential elasticity (Maw et al. [42]): \(v_n' = -e v_n\); sliding throughout ( \(\tan\theta \ge 3.5\mu(1+e)\)): \(v_t' = v_t - \mu(1+e)|v_n|\); sticking ( \(\tan\theta < 3.5\mu(1+e)\)): \(v_t' = \frac{5}{7}v_t\). Setup after Di Maio and Di Renzo [18] | | Measured | \(e_n = -v_y^\text{out}/v_y^\text{in}\) and \(v_x^\text{out}\) from the last ib_state record, by check_collision.py |
| Case | Prescribed | Measured | Error |
|---|---|---|---|
| normal, e = 0.5 | 0.5000 | 0.4765 | −4.70 % |
| normal, e = 0.8 | 0.8000 | 0.7877 | −1.54 % |
| normal, e = 0.98 | 0.9800 | 0.97948 | −0.05 % |
| 30°, \(\mu\) = 0, e = 0.98: \(v_x^\text{out}\) | 1.9500 | 1.94998 | 0.00 % |
| 30°, \(\mu\) = 0.092, e = 0.98: \(v_x^\text{out}\) (sticking) | 1.3929 | 1.3958 | +0.21 % |
| 50°, \(\mu\) = 0.092, e = 0.98: \(v_x^\text{out}\) (sliding) | 2.5309 | 2.5310 | +0.00 % |
Error in \(e_n\) against the steps per collision:
| e | 20 | 40 | 80 |
|---|---|---|---|
| 0.5 | −4.70 % | −2.33 % | −1.16 % |
| 0.8 | −1.54 % | not run | −0.37 % |
The restitution error is first order in the steps per collision. At the default of 20 steps, expect a few percent in e at low e. Its size and sign depend on where in a step the contact begins: an earlier run with the contact beginning on a step boundary gave +2.17 % and +0.69 % for e = 0.5 and 0.8 at 20 steps. Without friction the tangential velocity is conserved exactly. The sticking and sliding regimes both match the rigid-body result.
Limits: one sphere against a wall, three angles. Body-body collisions, spin and other speeds are not covered. The first-order behavior is in the collision force; whether it is the force evaluation or the contact detection is not separated.
The small cases run in the test suite as 2D -> IBM -> Moving Circle -> Constant Acceleration and 3D -> IBM -> Wall Collision -> Normal and -> Sliding Friction. The tables above were measured with GNU 13.3 (CPU, one rank). The golden tolerance is 1e-6 for both. Against goldens generated on the current master, the GNU, Intel, NVHPC and macOS CI lanes agreed to 1e-13 absolute on the fields and 5e-9 relative on the contact force; the checker scripts validate the physics, and the golden is a regression guard. Both tests are skipped in the single-precision lane. The sticking case is checked by check_collision.py and is not a golden, because the friction direction there depends on round-off.
Status: validated (plane channel; the same source in particle arrays is not). Code: master at 1e3f1be0b, with the thermally developed source mean_temp_wall of #2200. Example: examples/2D_thermal_channel.
Periodic flow with a heated or cooled wall never reaches a uniform temperature, so the mean-temperature source (mean_temp, mean_temp_wall) removes the streamwise decay: it solves for the periodic part \(\psi\) of the thermally developed state \(T = T_s + \psi\,e^{-\beta x}\) Sun et al. [66] and holds the mixing-cup temperature at its target. A plane channel with isothermal walls has an exact developed Nusselt number, so it tests the source, its decay rate \(\beta\) and the wall heat transfer together.
| Item | Value |
|---|---|
| Geometry | 2D plane channel, gap \(H\) = 34.28 µm ( \(D_h = 2H\)), periodic length 25 cells |
| Gas | air (O2 0.233, N2 0.767 by mass, h2o2.yaml, reactions off), 1 atm, mixing-cup \(T_m\) held at 300 K, bulk Mach 0.1 ( \(U_b\) = 34.8 m/s), \(\mathrm{Re}_{D_h}\) = 150, \(\mathrm{Pe}_H\) = 53.3 |
| Boundaries | x periodic; y no-slip isothermal walls (bc_y%beg = bc_y%end = -16) at \(T_s\) = 330 K (hot) or 270 K (cold) |
| Numerics | WENO5 (mapped), HLLC, SSP-RK3, fd_order = 4, mixture-averaged transport, fixed \(\Delta t\) = 0.4 \(\Delta y/(U_b + a)\) |
| Drive and source | mean_mflux and mean_dpdx (gain 0.05); mean_temp = 300 K (gain 0.05) with mean_temp_wall = \(T_s\) |
| Reference | constant-property laminar flow between parallel plates, constant wall temperature, fully developed: Nu = 7.5407 Shah and London [62]. With axial conduction at the run's \(\mathrm{Pe}_H\), the eigenproblem \(\psi'' + (6\,\mathrm{Pe}_H\,\eta(1-\eta)\,b + b^2)\psi = 0\), \(\psi(0) = \psi(1) = 0\), \(b = \beta H\), gives Nu = 7.5417 and \(\beta H\) = 0.14122; check_nu.py solves it |
| Measured | mean_temp.dat ( \(T_m\), \(\dot q\), \(V_f\), \(\beta\)) and the last save, by check_nu.py |
\(\mathrm{Nu}_\mathrm{src} = q_w D_h/(k(T_s - T_m))\) takes the wall heat from the source total, \(q_w = -\dot q V_f/(2L_x)\), which equals it at steady state. \(\mathrm{Nu}_\mathrm{grad}\) takes it from the temperature gradient at the walls (second-order one-sided) and does not use the source. The pair value uses half-differences between the hot and the cold run, which cancels viscous heating and the first-order property asymmetry. Averages are over the last 10 % of the steps; the state is developed by about 0.1 \(H^2/\alpha\).
| Cells across \(H\) | Run [ \(H^2/\alpha\)] | \(T_m\) hold (max error) | \(\beta H\) hot / cold (exact 0.1412) | \(\mathrm{Nu}_\mathrm{src}\) pair | \(\mathrm{Nu}_\mathrm{grad}\) pair |
|---|---|---|---|---|---|
| 32 | 0.3 | 2e-8 | 0.1457 / 0.1371 | 7.552 (+0.13 %) | 7.554 (+0.16 %) |
| 64 | 0.15 | 7e-9 | 0.1456 / 0.1371 | 7.546 (+0.05 %) | 7.546 (+0.05 %) |
Limits:
The cold run uses --tw 270 in a copy of the directory (the output is written next to case.py). The tables were measured with GNU 13.3 (CPU, one rank, -O3). The suite runs the first 100 steps of the hot case as 2D -> Chemistry -> Thermal Channel -> Wall Temperature; its golden holds the conservative fields, and the tolerance is 1e-6 (GNU 13 double -O3, reldebug and debug agree to 5e-8, AMD MI250X and an AMD CPU build to 8e-8 and 6e-8; single precision differs from double by 4e-4, so the test is skipped in that lane).
Status: partially validated. Example: examples/2D_ibm_cylinder_drag_nu. The face-flux immersed-boundary force and the face heat of a no-slip isothermal cylinder at Re 20, 40 and 100 against Dennis and Chang, Williamson and the Nusselt-number correlations, with a momentum balance as an independent drag. Results and limits: Validation: Circular Cylinder Drag and Nusselt Number.
One ## section per family, with an anchor {#sec-validation-<family>}: status and code version, one setup table per check, the reference and how it was obtained, a results table with signed errors, and the limits. Put each check's example, checker script and README under examples/, and register a small version in toolchain/mfc/test/cases.py. Cite references with \cite keys from docs/references.bib.
The registered tests are regression guards: their goldens hold the output of the code at the time they were generated. When a default or an algorithm in the numerics a test exercises changes (for moving bodies, for example the ib_mass_relax default), regenerate the goldens with ./mfc.sh test --generate --only <UUID> in the same change, and re-run the checker scripts to confirm the physics results above. A case whose tolerance must be looser than the default takes override_tol chosen from the spread between compiler and device lanes (Testing).