Skip to content

Commit f89ab2e

Browse files
sbryngelsonclaude
andcommitted
Fix additional review items: docs typos, _is_numeric, CI coverage
- Fix missing %% in double-backtick code spans (patch_icpp(2)smoothen, patch_icpp(j)alpha, etc.) and stray backslashes in case.md - Add _is_numeric guard for num_fluids in check_eos_parameter_sanity - Include benchmark.py files in CI example validation - Extend Doxygen % lint to catch double-backtick spans too Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent c2b616d commit f89ab2e

4 files changed

Lines changed: 11 additions & 10 deletions

File tree

.github/workflows/lint-toolchain.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ jobs:
4444
run: |
4545
failed=0
4646
passed=0
47-
for case in examples/*/case.py; do
47+
for case in examples/*/case.py examples/*/benchmark.py; do
48+
[ -f "$case" ] || continue
4849
output=$(./mfc.sh validate "$case" 2>&1)
4950
if [ $? -eq 0 ]; then
5051
passed=$((passed + 1))

docs/documentation/case.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -281,12 +281,12 @@ For instance, in a 2D simulation, when a cylindrical `patch(2)` is immersed in a
281281

282282
- `smoothen` activates smoothening of the boundary of the patch that alters the existing patch.
283283
When smoothening occurs, fluids of the two patches are mixed in the region of the boundary.
284-
For instance, in the aforementioned case of the cylindrical patch immersed in the rectangular patch, smoothening occurs when ``patch_icpp(2)smoothen = 'T'``.
284+
For instance, in the aforementioned case of the cylindrical patch immersed in the rectangular patch, smoothening occurs when ``patch_icpp(2)%%smoothen = 'T'``.
285285
`smooth_coeff` controls the thickness of the region of smoothening (sharpness of the mixture region).
286286
The default value of `smooth_coeff` is unity. The region of smoothening is thickened with decreasing the value.
287287
Optimal choice of the value of `smooth_coeff` is case-dependent and left to the user.
288288

289-
- `patch_icpp(j)alpha(i)`, `patch_icpp(j)alpha_rho(i)`, `patch_icpp(j)pres`, and `patch_icpp(j)vel(i)` define for $j$-th patch the void fraction of `fluid(i)`, partial density of `fluid(i)`, the pressure, and the velocity in the $i$-th coordinate direction.
289+
- `patch_icpp(j)%%alpha(i)`, `patch_icpp(j)%%alpha_rho(i)`, `patch_icpp(j)%%pres`, and `patch_icpp(j)%%vel(i)` define for $j$-th patch the void fraction of `fluid(i)`, partial density of `fluid(i)`, the pressure, and the velocity in the $i$-th coordinate direction.
290290
These physical parameters must be consistent with fluid material's parameters defined in the next subsection.
291291

292292
- `model_filepath` defines the root directory of the STL or OBJ model file.
@@ -463,10 +463,10 @@ Boundary condition patches can be used with non-characteristic boundary conditio
463463
Their use is detailed in [Boundary Condition Patches](#boundary-condition-patches).
464464

465465
- `bc_[x,y,z]%%vb[1,2,3]` specifies the velocity in the (x,1), (y,2), (z,3) direction applied to `bc_[x,y,z]%%beg` when using `bc_[x,y,z]%%beg = -16`.
466-
Tangential velocities require viscosity, `weno_avg = T`, and `bc_[x,y,z]%%beg = -16` to work properly. Normal velocities require `bc_[x,y,z]%%end = -15` or `\bc_[x,y,z]%%end = -16` to work properly.
466+
Tangential velocities require viscosity, `weno_avg = T`, and `bc_[x,y,z]%%beg = -16` to work properly. Normal velocities require `bc_[x,y,z]%%end = -15` or `bc_[x,y,z]%%end = -16` to work properly.
467467

468468
- `bc_[x,y,z]%%ve[1,2,3]` specifies the velocity in the (x,1), (y,2), (z,3) direction applied to `bc_[x,y,z]%%beg` when using `bc_[x,y,z]%%end = -16`.
469-
Tangential velocities require viscosity, `weno_avg = T`, and `bc_[x,y,z]%%end = 16` to work properly. Normal velocities require `bc_[x,y,z]%%end = -15` or `\bc_[x,y,z]%%end = -16` to work properly.
469+
Tangential velocities require viscosity, `weno_avg = T`, and `bc_[x,y,z]%%end = 16` to work properly. Normal velocities require `bc_[x,y,z]%%end = -15` or `bc_[x,y,z]%%end = -16` to work properly.
470470

471471
- `model_eqns` specifies the choice of the multi-component model that is used to formulate the dynamics of the flow using integers from 1 through 3.
472472
`model_eqns = 1`, `2`, and `3` correspond to \f$\Gamma\f$-\f$\Pi_\infty\f$ model (\cite Johnsen08), 5-equation model (\cite Allaire02), and 6-equation model (\cite Saurel09), respectively.
@@ -531,7 +531,7 @@ If this option is false, velocity gradient is computed using finite difference s
531531
- `weno_avg` it activates the arithmetic average of the left and right, WENO-reconstructed, cell-boundary values.
532532
This option requires `weno_Re_flux` to be true because cell boundary values are only utilized when employing the scalar divergence method in the computation of velocity gradients.
533533

534-
- `surface_tension` activates surface tension when set to ``'T'``. Requires `sigma` to be set and `num_fluids`. The color function in each patch should be assigned such that `patch_icpp(i)%cf_val = 1` in patches where `patch_icpp(i)%alpha = 1 - eps` and `patch_icpp(i)%cf_val = 0` in patches where `patch_icpp(i)%alpha = eps`.
534+
- `surface_tension` activates surface tension when set to ``'T'``. Requires `sigma` to be set and `num_fluids`. The color function in each patch should be assigned such that `patch_icpp(i)%%cf_val = 1` in patches where `patch_icpp(i)%%alpha = 1 - eps` and `patch_icpp(i)%%cf_val = 0` in patches where `patch_icpp(i)%%alpha = eps`.
535535

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

toolchain/mfc/case_validator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2264,10 +2264,10 @@ def check_eos_parameter_sanity(self):
22642264
num_fluids = self.get('num_fluids')
22652265
model_eqns = self.get('model_eqns')
22662266

2267-
if num_fluids is None or model_eqns == 1:
2267+
if not self._is_numeric(num_fluids) or model_eqns == 1:
22682268
return
22692269

2270-
for i in range(1, num_fluids + 1):
2270+
for i in range(1, int(num_fluids) + 1):
22712271
gamma = self.get(f'fluid_pp({i})%gamma')
22722272
if gamma is None or not self._is_numeric(gamma) or gamma <= 0:
22732273
continue

toolchain/mfc/lint_docs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ def check_doxygen_percent(repo_root: Path) -> list[str]:
328328
return []
329329

330330
ignored = _gitignored_docs(repo_root)
331-
code_span_re = re.compile(r"`([^`\n]+)`")
331+
code_span_re = re.compile(r"``([^`\n]+)``|`([^`\n]+)`")
332332
bad_pct_re = re.compile(r"(?<!%)%(?=[a-zA-Z_])")
333333

334334
errors = []
@@ -345,7 +345,7 @@ def check_doxygen_percent(repo_root: Path) -> list[str]:
345345
if in_code:
346346
continue
347347
for m in code_span_re.finditer(line):
348-
span = m.group(1)
348+
span = m.group(1) or m.group(2)
349349
if bad_pct_re.search(span):
350350
fixed = bad_pct_re.sub("%%", span)
351351
errors.append(

0 commit comments

Comments
 (0)