From 86bf520d9960b12abe3c275c9eb6a46995214623 Mon Sep 17 00:00:00 2001 From: Spencer Bryngelson Date: Thu, 26 Nov 2026 16:41:13 -0800 Subject: [PATCH] Remove the inert ib_smooth_contact parameter #2517 made HLLC use the central tangential velocity in the viscous work everywhere, so ib_smooth_contact had no effect. Remove it from the registry, descriptions, validator AMR lists, Fortran default and docs. Case files that still set it get an 'it was removed ... delete it from the case file' error (new REMOVED_PARAMS next to RENAMED_PARAMS), with a unit test. --- docs/documentation/case.md | 2 -- docs/documentation/ibm.md | 2 +- docs/documentation/validation_burning_body.md | 2 +- src/simulation/m_global_parameters.fpp | 1 - toolchain/mfc/case_validator.py | 2 -- toolchain/mfc/params/definitions.py | 2 -- toolchain/mfc/params/descriptions.py | 1 - toolchain/mfc/params/errors.py | 7 +++++++ toolchain/mfc/params_tests/test_validate.py | 7 +++++++ 9 files changed, 16 insertions(+), 10 deletions(-) diff --git a/docs/documentation/case.md b/docs/documentation/case.md index 3466d1d56a..a59d6fb736 100644 --- a/docs/documentation/case.md +++ b/docs/documentation/case.md @@ -379,7 +379,6 @@ The measured accuracy of the wall value and wall-normal gradient, and which opti | `ib_mass_relax` | Integer | Immersed-boundary mass conservation: N > 0 returns each body's spurious gas mass over about N steps; 0 off; -1 (default) auto, see below. | | `ib_uncover_fill` | Logical | A cell a moving body uncovers takes the mean density, species and pressure of its fluid neighbours instead of its stale ghost state (`model_eqns = 2`, HLLC, Cartesian, no `amr`). | | `wall_column_dt_frac` | Real | Wall columns: largest fraction of a near-wall cell's heat span a step's column drain may take, a time-step limit (`WCOL`; default 0.1). | -| `ib_smooth_contact` | Logical | No effect; kept so older case files run (HLLC now always uses the central tangential velocity in the viscous work). | | `ib_visc_compact` | Logical | With `weno_Re_flux`, compact velocity gradients on the viscous faces within two cells of a body (default T where it applies). | | `geometry` | Integer | Geometry configuration of the patch.| | `x[y,z]_centroid` | Real | Centroid of the applied geometry in the [x,y,z]-direction. | @@ -515,7 +514,6 @@ Additional details on this specification can be found in [NACA airfoil](https:// Measured gain (non-reacting ideal gas, tip or peak Mach 0.05, 4 to 80 cells across the gap, NVHPC on an A100): between flat walls (plane Poiseuille) the velocity and flow-rate errors are 10 to 20 times smaller than with order 1 and converge at about order 1.5 to 1.9 until they reach the level of a domain no-slip boundary, whatever the wall position inside a cell; order 1 converges at order 1 with the no-slip acting about 0.75 cell outside the wall. In a Taylor-Couette annulus (curved walls, one rotating) the gain is 25 to 40 % of the velocity error and a factor 2 or more in the torque, and neither option converges monotonically: an error of about 0.5 % of the torque and 0.3 % of the wall speed remains at 80 cells per inner radius, and the rotating wall keeps a velocity deficit that this option halves but does not remove. With 4 to 6 cells across the gap 15 to 32 % of the ghost points use the linear mirror and the quadratic fill is not accurate (26 % velocity error at 4 cells across a flat channel). The wall shear read back from a fit to the near-wall cells does not converge for either option; use the flow rate or an integrated force instead. - `ib_mass_relax = N` (N > 0) makes the gas gain exactly the mass each body gasifies (none for an inert body). The ghost-cell treatment does not conserve mass at a moving or slip wall: gas flows through the body's faces into ghost cells whose values are then overwritten, and cells change side as a body moves, so the gas total drifts with the distance travelled and converges slowly with the grid. Each step the gas mass a body exchanged (the face fluxes, as `ib_heat_wrt` reports them, and the cells it covered or uncovered) minus its gasification rate is added to that body's account, and 1/N of the account is taken out of (or put into) the fluid cells within two cells of the body, scaling their partial densities, momentum, energy and species by one factor, so velocity, temperature and composition are unchanged. `N = 1` returns the mass in the step it occurs (the choice for a fixed slip wall); a larger N smooths the correction over N steps. Only mass is booked for the swept cells; their energy is not. The account is saved in the IB state record (`restart_data/ib_state`), so a restart continues the relaxation exactly. Requires `model_eqns = 2`, Cartesian coordinates, and no `igr`, bubbles or `amr`. The default `-1` resolves at start-up to `N = 30` when any body moves, else to 0; a fixed slip wall keeps the leak unless `ib_mass_relax = 1` is set (it returns the mass in the step it occurs, at a few percent of a step on an A100 and more on an MI300A). It is also 0 whenever an explicit value would be refused (`amr`, cylindrical coordinates, `igr`, bubbles, `model_eqns /= 2`, a blowing body), when a body has a surface reaction (`ib_flux_wall` conserves the gas there), and with `hypoelasticity` or `mhd` (their extra variables are not scaled). `0` turns it off. Measured (inviscid ideal gas, A100 and MI300A agree to the printed digits): a circle translating at Mach 0.3 through gas at rest in a periodic box 8 diameters long changes the gas mass by +1.6e-3, +9e-4 and +6e-4 per passage through the box at 16, 24 and 32 cells per diameter, and by under 3e-5 with `N = 5` or `30`; a fixed slip circle at Mach 0.5 gains 0.27 to 0.36 % per flow-through at 16 to 32 cells per diameter and 2e-13 with `N = 1`. The correction takes under 1e-4 of the shell's gas per step, and changes the drag by 0.2 % (`N = 30`) to 1 % (`N = 1`); it hardly moves a body's Galilean twin (a translating body against the same body held in moving gas): at 40 cells per diameter the twin mismatch of the force changes by under 0.01, and the moving-to-held ratio of the conducted heat of a cold cylinder rises from 0.755 to 0.788 at 16 cells per diameter and from 0.879 to 0.915 at 32. For fixed no-slip bodies with chemistry `ib_flux_wall` already conserves the gas to round-off, and `N = 1` reaches the same total with it or without it. - `ib_uncover_fill = T` gives a cell that a moving body uncovers (solid at the last Runge-Kutta placement, fluid now) the mean density, species and pressure of the neighbours in its 3x3(x3) that were fluid at both placements, instead of the cold ghost state it last held (its velocity is kept: averaging it too made the drag of a moving body agree worse with its Galilean twin). With the default, a cold moving wall leaves a trail of such cells, which creates gas mass and drains energy at a rate first order in the cell size. The filled state is also what `ib_heat_wrt` and `ib_mass_relax` book for the uncovered cell, so their accounts stay closed. Off by default. -- `ib_smooth_contact` has no effect and is kept only so older case files run. It blended the HLLC tangential interface velocity of the viscous work near the contact; HLLC now uses the central average of the two sides there everywhere (see `riemann_solver`). - `ib_visc_compact = T` (requires `weno_Re_flux`) replaces the WENO velocity gradient on the viscous faces within two cells of a body cell by the compact one of `weno_Re_flux = F`: the normal difference across the face and the mean of the two cells' central tangential differences. The gradient of `weno_Re_flux` is built from reconstructed face values, a divergence-theorem cell gradient and a second reconstruction, a stencil about five cells wide, while the ghost values extend the flow only a layer or two into the body (the mirror leaves a kink at the wall), so the wide stencil carries the kink into the fluid faces next to the wall. Faces farther than two cells from a body are unchanged. It is on by default wherever it applies (a body, `viscous`, `weno_Re_flux` and Cartesian coordinates): without it the WENO gradient reads solid cells past the filled ghost layers, which hold the frozen wall velocity rather than the ghost fill, so with the quadratic wall (`ib_wall_order = 2`) or `ib_second_order_vel` the fluid depended on how many layers were filled (#2041). `ib_visc_compact = F` gives the earlier gradient, and with it (or in cylindrical coordinates, where the option does not apply) the dependence on the number of filled layers remains (#2041). With it on and `weno_Re_flux_compact = F`, the viscous time-step cap is 0.67/0.72 (2D/3D) instead of 1. - `ib_neighborhood_radius` controls the size of the neighborhood size. A value of $r$ indicates that any given rank is aware of IBs up to $r$ ranks away. This value defaults to 0, which leaves the radius unset so that it is selected automatically. This parameter is required to strong-scale a case when IBs eventually grow to be larger than one full processor domain wide. diff --git a/docs/documentation/ibm.md b/docs/documentation/ibm.md index 8ef22c9aa7..50acfa8aae 100644 --- a/docs/documentation/ibm.md +++ b/docs/documentation/ibm.md @@ -25,7 +25,7 @@ Moving-body kinematics and the restitution of a wall collision are checked in [V | `ib_second_order_vel`, `ib_ip_min_dist` | linear ghost-velocity extrapolation; minimum image-point distance | | `ib_ip_interp` | 2 (default): triangular-shaped-cloud image-point weights; 1: inverse-distance weights | | `ib_wall_order` | 2 (default): two-probe quadratic wall-normal ghost velocity at no-slip walls; 1: the wall value | -| `ib_slip_ccst`, `ib_uncover_fill` | slip-wall ghost state, fill of cells a moving body uncovers (`ib_smooth_contact` no longer has an effect) | +| `ib_slip_ccst`, `ib_uncover_fill` | slip-wall ghost state, fill of cells a moving body uncovers | | `weno_Re_flux`, `weno_Re_flux_compact`, `ib_visc_compact` | the face-normal viscous gradient as a face difference and the compact velocity gradient on the viscous faces within two cells of a body (both on by default) | | `ib_mass_relax` | returns the spurious gas mass of a body over about N steps; the default resolves at start-up (see the parameter entry) | diff --git a/docs/documentation/validation_burning_body.md b/docs/documentation/validation_burning_body.md index 28a5e9d29b..4deaef062d 100644 --- a/docs/documentation/validation_burning_body.md +++ b/docs/documentation/validation_burning_body.md @@ -39,7 +39,7 @@ The cause of the gap to the earlier study was traced by rerunning the 12-cell cy | the earlier study's build (pre-merge, `ib_ip_interp = 2` by default), this case, GNU 13 CPU | +0.92 % | +0.08 % | | `master`, defaults | +1.87 % | +1.36 % | | `master`, `ib_ip_interp = 2` (TSC image points) | +1.39 % | +0.80 % | -| `master`, `ib_smooth_contact = T` | +1.87 % | not run | +| `master`, `ib_smooth_contact = T` (an option since removed) | +1.87 % | not run | | `master`, `ib_mass_relax = 30` or `1` | +1.86 % | not run | | `master`, `weno_Re_flux_compact = T` | +1.86 % | +1.85 % (end of run) | | `master` before #2248 (wall conduction through the unbounded mirror temperature) | burn rate equal to `master` to 5 digits through 5 us | | diff --git a/src/simulation/m_global_parameters.fpp b/src/simulation/m_global_parameters.fpp index fd5725d8ab..f18bc0af5c 100644 --- a/src/simulation/m_global_parameters.fpp +++ b/src/simulation/m_global_parameters.fpp @@ -720,7 +720,6 @@ contains ib_wall_order = -1 ! auto (s_initialize_ibm_module): 2, or 1 with ib_second_order_vel ib_mass_relax = -1 wall_column_dt_frac = 0.1_wp - ib_smooth_contact = .false. ib_visc_compact = .true. ib_uncover_fill = .false. diff --git a/toolchain/mfc/case_validator.py b/toolchain/mfc/case_validator.py index f4528412d1..cb467bb601 100644 --- a/toolchain/mfc/case_validator.py +++ b/toolchain/mfc/case_validator.py @@ -414,7 +414,6 @@ class CaseConstraintError(MFCException): "down_sample", "nv_uvm_*", "rdma_mpi", - "ib_smooth_contact", # no effect (HLLC always uses the central tangential velocity in the viscous work) ) # Logical switches AMR accepts (fnmatch patterns over the case's keys). AMR fails closed: a switch set true and absent here is @@ -446,7 +445,6 @@ class CaseConstraintError(MFCException): "ib", "ib_second_order_vel", "ib_slip_ccst", - "ib_smooth_contact", "many_ib_patch_parallelism", "patch_ib(*)%slip", "igr", diff --git a/toolchain/mfc/params/definitions.py b/toolchain/mfc/params/definitions.py index ecbeab0e9b..6f14c386b1 100644 --- a/toolchain/mfc/params/definitions.py +++ b/toolchain/mfc/params/definitions.py @@ -725,7 +725,6 @@ def _load(): _r("ib_wall_order", INT, {"ib"}) _r("ib_mass_relax", INT, {"ib"}) _r("wall_column_dt_frac", REAL, {"ib"}) - _r("ib_smooth_contact", LOG, {"ib", "viscosity"}) _r("ib_visc_compact", LOG, {"ib", "viscosity"}) _r("ib_uncover_fill", LOG, {"ib"}) @@ -1597,7 +1596,6 @@ def _decl(targets: set, *names: str) -> None: "ib_wall_order", "ib_mass_relax", "wall_column_dt_frac", - "ib_smooth_contact", "ib_visc_compact", "ib_uncover_fill", "tau_star", diff --git a/toolchain/mfc/params/descriptions.py b/toolchain/mfc/params/descriptions.py index 8745b916de..8c04a5b8ac 100644 --- a/toolchain/mfc/params/descriptions.py +++ b/toolchain/mfc/params/descriptions.py @@ -175,7 +175,6 @@ "ib_mass_relax": "Immersed-boundary mass conservation: N > 0 returns each body's spurious gas mass over about N steps; 0 off; -1 (default) auto: 30 for a moving body, else 0", "ib_slip_ccst": "Slip immersed boundaries: isentropic ghost density and total-enthalpy tangential speed (curvature-corrected symmetry technique)", "ib_wall_order": "Immersed-boundary wall treatment: 1 wall-value ghost fill, 2 two-probe quadratic wall-normal ghost velocity at no-slip walls (default; 1 with ib_second_order_vel)", - "ib_smooth_contact": "No effect (kept for older case files): HLLC always uses the central tangential velocity in the viscous work", "ib_visc_compact": "Compact velocity gradients on the viscous faces next to an immersed body when weno_Re_flux is on (default T)", "ib_uncover_fill": "A cell a moving immersed boundary uncovers takes the mean density, species and pressure of its fluid neighbours instead of its stale ghost state (off by default)", "wall_column_dt_frac": "Wall columns: largest fraction of a near-wall cell's heat span one step's column drain may take (time-step limit WCOL; default 0.1)", diff --git a/toolchain/mfc/params/errors.py b/toolchain/mfc/params/errors.py index 2fe96a1818..75742d24c4 100644 --- a/toolchain/mfc/params/errors.py +++ b/toolchain/mfc/params/errors.py @@ -194,6 +194,11 @@ def dimension_error(param: str, requirement: str) -> str: "lag_params%solver_approach": '\'lag_params%coupling\' ("one_way" for 1, "two_way" for 2)', } +# Parameters removed outright, with why +REMOVED_PARAMS = { + "ib_smooth_contact": "it had no effect once HLLC used the central tangential velocity in the viscous work (#2517)", +} + def unknown_param_error(param: str, suggestions: Optional[List[str]] = None) -> str: """ @@ -209,6 +214,8 @@ def unknown_param_error(param: str, suggestions: Optional[List[str]] = None) -> base_msg = f"Unknown parameter {format_param(param)}" if param in RENAMED_PARAMS: return f"{base_msg}: it was renamed to {RENAMED_PARAMS[param]}" + if param in REMOVED_PARAMS: + return f"{base_msg}: it was removed ({REMOVED_PARAMS[param]}); delete it from the case file" if suggestions: if len(suggestions) == 1: return f"{base_msg}. Did you mean {format_param(suggestions[0])}?" diff --git a/toolchain/mfc/params_tests/test_validate.py b/toolchain/mfc/params_tests/test_validate.py index 7c5c27da8a..50cb28a74e 100644 --- a/toolchain/mfc/params_tests/test_validate.py +++ b/toolchain/mfc/params_tests/test_validate.py @@ -85,6 +85,13 @@ def test_renamed_param_names_replacement(self): self.assertEqual(len(errors), 1) self.assertIn("renamed to 'lag_params%coupling'", errors[0]) + def test_removed_param_says_why(self): + """A removed parameter should say it was removed and why.""" + errors = check_unknown_params({"ib_smooth_contact": "T"}) + self.assertEqual(len(errors), 1) + self.assertIn("it was removed", errors[0]) + self.assertIn("delete it from the case file", errors[0]) + def test_family_attr_typo_gives_targeted_error(self): """Typo in family attribute should list valid attributes.""" params = {"patch_ib(1)%geometri": 1}