Skip to content

Add the thin-plate force case that measures issue 1849 - #1868

Open
sbryngelson wants to merge 2 commits into
masterfrom
example/ib-thin-plate-force
Open

Add the thin-plate force case that measures issue 1849#1868
sbryngelson wants to merge 2 commits into
masterfrom
example/ib-thin-plate-force

Conversation

@sbryngelson

Copy link
Copy Markdown
Member

Written with Claude Code. Relates to #1849. This measures the defect; it does not fix it.

A 2D flat plate pitching about its leading edge, 0 → 45° on an Eldredge smoothed ramp (a = 21), K = π/8 (case C1), Re_c = 300, Ma 0.2, thickness 2.5 % of chord — matching a published measurement:

Jantzen, Taira, Granlund & Ol, Phys. Fluids 26, 053606 (2014), Fig. 10, 2D panel, curve C1.

NCELL sets how many cells lie across the plate thickness. The physical problem is identical at every level — same chord, thickness, domain and times — so the sweep isolates the immersed-boundary resolution requirement from any change of geometry, which a thickness sweep would confound.

How the validation is obtained

NCELL=2  ./mfc.sh run examples/2D_ibm_thin_plate_force/case.py     # 0.22 M cells
NCELL=4  ./mfc.sh run examples/2D_ibm_thin_plate_force/case.py     # 0.90 M cells
NCELL=8  ./mfc.sh run examples/2D_ibm_thin_plate_force/case.py     # 3.58 M cells
NCELL=16 ./mfc.sh run examples/2D_ibm_thin_plate_force/case.py     # 14.3 M cells
cells across the thickness peak C_L C_L at t = 4 rms difference from the reference
2 6.413 1.209 20.9 %
4 4.682 1.271 33.5 %
8 4.458 1.111 27.9 %
16 4.833 1.005 26.9 %
reference 6.998 1.521

The disagreement does not shrink with refinement. The last column sits at 27–34 % across a factor of eight in resolution with no trend. That is the reading that matters for #1849: it rules out under-resolution as the explanation and leaves the force computation itself.

A second, independent reading falls out of the same sweep. The peak converges from four cells up — 4.682, 4.458, 4.833, a spread of 8 % across a fourfold refinement — while two cells is 35 % out. So a thin body does not need ten or more cells before the immersed boundary resolves it. That is worth having on the record separately, because it is the difference between an affordable cost model and an impossible one: at ten cells across a 3 % section, the flapping-wing ensemble this came from would cost 62 M GPU-hours against an allocation of 200 k.

Why not a zero-reference test

The cheap, exact style of check — a symmetric body whose true force is zero — does not apply to a pitching plate, whose lift is large and unknown. That style is covered by examples/2D_ibm_force_decomposition (#1859) and examples/3D_ibm_neighborhood_radius (#1866). This case trades the exact reference for a published one, which is what makes it usable as a target for a fix.

Scope

Example case and README only; no source changes and no golden files. ./mfc.sh validate passes and precheck is clean.

A 2D plate pitching about its leading edge against Jantzen et al. (2014)
Fig. 10 curve C1, with the number of cells across the 2.5 percent thickness
set by NCELL so the physical problem is fixed and only the resolution moves.

This measures the defect rather than fixing it. The reading that matters is
that the disagreement with the reference does not shrink with refinement:
20.9, 33.5, 27.9 and 26.9 percent rms at 2, 4, 8 and 16 cells across. That
rules out under-resolution and points at the force computation.

A second reading falls out of the same sweep: the peak converges from four
cells up (4.682, 4.458, 4.833 across a fourfold refinement), while two cells
is 35 percent out. A thin body does not need ten or more cells for the
immersed boundary to resolve it, which matters for cost estimates.
Copilot AI lite review requested due to automatic review settings September 12, 2026 18:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Pull request overview

Adds a new validation example to measure (not fix) the thin-plate immersed-boundary force defect reported in #1849, including a resolution sweep via NCELL and documentation of observed non-convergence vs a published reference.

Changes:

  • Added a new 2D IBM thin-plate pitching case generator (case.py) parameterized by NCELL.
  • Added a README documenting the setup, how to run the sweep, and the measured discrepancy vs reference data.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
examples/2D_ibm_thin_plate_force/case.py New case generator that emits an MFC input JSON for the pitching thin-plate IBM force measurement.
examples/2D_ibm_thin_plate_force/README.md Documents the purpose, sweep procedure, and measured outcomes supporting #1849 investigation.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +127 to +132
tau = f"(t - {t0})"
th = f"(0.5*{th_max}*(1.0 + (log(cosh({a_smooth}*{tau})) - log(cosh({a_smooth}*({tau} - {t_p}))))/{a_smooth * t_p}))"
thd = f"(0.5*{Omega}*(tanh({a_smooth}*{tau}) - tanh({a_smooth}*({tau} - {t_p}))))"
case["patch_ib(1)%angular_vel(3)"] = thd
case["patch_ib(1)%vel(1)"] = f"-0.5*{thd}*sin({th})"
case["patch_ib(1)%vel(2)"] = f"0.5*{thd}*cos({th})"
Comment on lines +36 to +41
# L4 added after the first three failed to converge: refining 2 -> 4 -> 8 cells across the thickness moved
# the peak lift 6.41 -> 4.68 -> 4.46 against a reference of 7.00, i.e. away from it and then stalling.
# Two under-resolved answers landing near each other is not convergence. If a few cells across a thin
# body is simply too few for the immersed boundary, 16 should move back toward the reference; if the
# finite thickness is genuinely the difference, it should stay near 4.5.
LEVELS = {"L1": 0.0125, "L2": 0.00625, "L3": 0.003125, "L4": 0.0015625}
@codecov

codecov Bot commented Sep 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.25%. Comparing base (dc0aec1) to head (617b7f1).
⚠️ Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1868      +/-   ##
==========================================
- Coverage   61.26%   61.25%   -0.02%     
==========================================
  Files          84       84              
  Lines       22330    22336       +6     
  Branches     3265     3266       +1     
==========================================
+ Hits        13680    13681       +1     
- Misses       6207     6211       +4     
- Partials     2443     2444       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants