Skip to content

Commit 04f57ed

Browse files
sbryngelsonclaude
andcommitted
Fix low_Mach index swap, int_comp param name, and reviewer feedback
Swap low_Mach = 1 (Chen pressure correction) and low_Mach = 2 (Thornber velocity correction) to match source code and case.md. Fix interface_compression → int_comp (actual parameter name). Remove empty mhd dependency dict. Fix type annotations and unused variable in postprocess_citations.py. Extend PARAM_RE to catch comparison operators (>, <) in addition to assignment (=). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 793fa7a commit 04f57ed

4 files changed

Lines changed: 13 additions & 14 deletions

File tree

docs/documentation/equations.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ Primitive variable reconstruction is used to avoid spurious oscillations at inte
637637

638638
where \f$a\f$ and \f$b\f$ are the left and right slope differences.
639639

640-
**THINC interface compression** (`interface_compression > 0`): applies hyperbolic tangent compression near material interfaces:
640+
**THINC interface compression** (`int_comp = .true.`): applies hyperbolic tangent compression near material interfaces:
641641

642642
\f[q_\text{THINC} = q_\min + \frac{q_\max}{2}\left(1 + \text{sign}(s)\,\frac{\tanh(\beta) + A}{1 + A\,\tanh(\beta)}\right)\f]
643643

@@ -817,21 +817,21 @@ Supports STL/OBJ geometry import with ray tracing for inside/outside determinati
817817

818818
## 17. Low Mach Number Corrections (\cite Wilfong26 Sec. 4.2.4)
819819

820-
**Thornber correction** (`low_Mach = 1`, \cite Thornber08): modifies the reconstructed velocities at cell interfaces:
820+
**Chen correction** (`low_Mach = 1`, \cite Chen22): anti-dissipation pressure correction (APC) added to the HLLC flux:
821821

822-
\f[u'_L = \frac{u_L + u_R}{2} + z\,\frac{u_L - u_R}{2}, \qquad u'_R = \frac{u_L + u_R}{2} - z\,\frac{u_L - u_R}{2}\f]
822+
\f[p_d = \frac{\rho_L\,\rho_R\,(S_R - u_R)(S_L - u_L)}{\rho_R(S_R - u_R) - \rho_L(S_L - u_L)}\f]
823823

824-
\f[z = \min\!\left(\max\!\left(\frac{|u_L|}{c_L},\;\frac{|u_R|}{c_R}\right),\;1\right)\f]
824+
\f[\text{APC}_{p\mathbf{u}} = (z - 1)\,p_d\,\hat{\mathbf{n}}, \qquad \text{APC}_{pE} = (z - 1)\,p_d\,S_*\f]
825825

826-
This reduces numerical dissipation at low Mach numbers while recovering the standard scheme at high Mach numbers.
826+
The corrected HLLC flux in the star region becomes \f$\mathbf{F}^{*} + \text{APC}\f$.
827827

828-
**Chen correction** (`low_Mach = 2`, \cite Chen22): anti-dissipation pressure correction (APC) added to the HLLC flux:
828+
**Thornber correction** (`low_Mach = 2`, \cite Thornber08): modifies the reconstructed velocities at cell interfaces:
829829

830-
\f[p_d = \frac{\rho_L\,\rho_R\,(S_R - u_R)(S_L - u_L)}{\rho_R(S_R - u_R) - \rho_L(S_L - u_L)}\f]
830+
\f[u'_L = \frac{u_L + u_R}{2} + z\,\frac{u_L - u_R}{2}, \qquad u'_R = \frac{u_L + u_R}{2} - z\,\frac{u_L - u_R}{2}\f]
831831

832-
\f[\text{APC}_{p\mathbf{u}} = (z - 1)\,p_d\,\hat{\mathbf{n}}, \qquad \text{APC}_{pE} = (z - 1)\,p_d\,S_*\f]
832+
\f[z = \min\!\left(\max\!\left(\frac{|u_L|}{c_L},\;\frac{|u_R|}{c_R}\right),\;1\right)\f]
833833

834-
The corrected HLLC flux in the star region becomes \f$\mathbf{F}^{*} + \text{APC}\f$.
834+
This reduces numerical dissipation at low Mach numbers while recovering the standard scheme at high Mach numbers.
835835

836836
Additionally, the **artificial Mach number** technique (`pi_fac`) modifies \f$\pi_\infty\f$ to artificially increase the local Mach number.
837837

docs/postprocess_citations.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def parse_bib_authors(bib_path: Path) -> dict[str, tuple[str, int, str | None]]:
2020
(first_author_surname, author_count, second_author_surname | None)
2121
"""
2222
text = bib_path.read_text(encoding="utf-8")
23-
entries: dict[str, tuple[str, int]] = {}
23+
entries: dict[str, tuple[str, int, str | None]] = {}
2424

2525
# Find all bib entries: @type{Key,
2626
for m in re.finditer(r"@\w+\{(\w+),", text):
@@ -154,7 +154,7 @@ def check_bare_citations(html_dir: Path, authors: dict) -> list[str]:
154154
continue
155155
# Check if an author name precedes the link
156156
before = text[max(0, m.start() - 60):m.start()].rstrip()
157-
surname, count, second_surname = authors[key]
157+
surname, _count, second_surname = authors[key]
158158
has_prefix = (
159159
before.endswith(surname) or
160160
"et al." in before[-20:] or

toolchain/mfc/lint_docs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
# Match \cite Key references in markdown (Doxygen-style)
2424
CITE_RE = re.compile(r"\\cite\s+(\w+)")
2525

26-
# Match backtick-quoted parameter assignments like `param = value` or `param`
27-
PARAM_RE = re.compile(r"`([a-z_][a-z0-9_%]*?)(?:\s*=\s*[^`]*)?\s*`")
26+
# Match backtick-quoted parameter names like `param = value`, `param > 0`, or `param`
27+
PARAM_RE = re.compile(r"`([a-z_][a-z0-9_%]*)(?:\s*[=><][^`]*)?\s*`")
2828

2929
# Parameter-like names to skip (not actual MFC parameters)
3030
PARAM_SKIP = re.compile(

toolchain/mfc/params/definitions.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,6 @@ def get_value_label(param_name: str, value: int) -> str:
781781
"requires": ["sigma"],
782782
}
783783
},
784-
"mhd": {},
785784
"relativity": {
786785
"when_true": {
787786
"requires": ["mhd"],

0 commit comments

Comments
 (0)