Skip to content

Fix bubbleColumn tutorial setup (initial bubble and closed box) - #4

Merged
cloner0110 merged 2 commits into
mainfrom
fix-bubble-tutorial
Oct 16, 2026
Merged

cloner0110 merged 2 commits into
mainfrom
fix-bubble-tutorial

Conversation

@cloner0110

Copy link
Copy Markdown
Owner

Fixes two setup errors in Tutorial/bubbleColumn that made it differ from test case 2 of Hysing et al. (2009). Every benchmark number reported before this PR came from the incorrect setup.

1. The initial bubble was not a circle at (0.5, 0.5)

setFieldsDict used cylinderToCell with p1 (0.25 0.5 -1) and p2 (0.75 0.5 1). That axis is tilted in the x-z plane, so its cut through the one-cell-thick mesh was an ellipse:

  • semi-axes 0.258 × 0.25, centred at x = 0.5125;
  • initial water fraction 0.898438 at 1/h = 80, against 0.901825 for the benchmark circle;
  • bubble area 3.45% too large.

The bubble is now set with setAlphaField (type cylinder, origin (0.5 0.5 0), direction (0 0 1), radius 0.25, invert true). It integrates the volume fraction exactly in each cut cell. The initial water fraction is now 0.901877, within 0.05% of the exact bubble area.

2. The box was not closed

  • The top patch was called outlet, with fixedValue p_rgh while U was fixed at zero. Flow could therefore pass through it.
  • The side walls and the bottom used zeroGradient p_rgh, which does not cancel the gravity and surface-tension flux on wall faces.

All three boundaries are now walls with fixedFluxPressure, as in the benchmark. The top patch is renamed top, and pRefCell/pRefValue are set in PIMPLE. The wall flux is now exactly zero.

Results with the corrected setup

Test case 2 on OpenFOAM v2606, compared with the reference codes from Hysing et al., Table XVI:

Run V_max,1 (t) V_max,2 (t) y_c(3)
TP2D, 1/h = 640 (reference) 0.2524 (0.733) 0.2434 (2.071) 1.1380
FreeLIFE / MooNMD 0.2514 / 0.2502 0.2440 / 0.2393 1.1249 / 1.1376
this solver, 1/h = 80 0.2491 (0.734) 0.2287 (1.913) 1.1140
this solver, 1/h = 160 0.2472 (0.738) 0.2315 (1.982) 1.1174
volume-fraction coupling, 1/h = 160 0.2471 (0.734) 0.2309 (2.001) 1.1140
  • With the old setup, the first maximum was 2.9–4.3% below TP2D. It is now 1.3% and 2.0% below.
  • With curvatureFrom/propertiesFrom volumeFraction, the solver reproduces stock interFoam to four digits on 1/h = 80. The level-set coupling stays closer to TP2D after the first maximum: the centre of mass at t = 3 is 20.6 mm below TP2D, against 24.0 mm.
  • The phase volume is conserved to all printed digits, and a 4-rank run matches the serial one to 3e-6 m in the centre of mass.

The README table is updated to these numbers, with a note that earlier results came from the incorrect setup.

@cloner0110 cloner0110 self-assigned this Oct 16, 2026
@cloner0110 cloner0110 added enhancement New feature or request bug Something isn't working labels Oct 16, 2026
@cloner0110
cloner0110 merged commit dd567dd into main Oct 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant