Skip to content

Write vel(2) to 2D probe files and drop the per-step stdout print - #1842

Closed
Mohit-Ak wants to merge 1 commit into
MFlowCode:masterfrom
Mohit-Ak:fix/2d-probe-vel2
Closed

Mohit-Ak wants to merge 1 commit into
MFlowCode:masterfrom
Mohit-Ak:fix/2d-probe-vel2

Conversation

@Mohit-Ak

Copy link
Copy Markdown
Contributor

For a plain 2D case (no bubbles, no hypoelasticity), s_write_probe_files wrote only (t, rho, vel(1), pres) to D/probe<i>_prim.dat and then printed time = ... rho = ... pres = ... to stdout on every step. The 3D branch and the 2D bubble/hypoelastic branches all include vel(2), so the plain-2D branch was just incomplete, and the print looks like leftover debugging — one line per probe per step in the job log.

This adds vel(2) to that branch and drops the print. The write is wrapped in the same #:if not MFC_CASE_OPTIMIZATION or num_dims > 1 guard the neighbouring bubble and hypoelastic branches use, since vel(2) does not exist under 1D case optimization. The 2D probe file now has 5 columns, (t, rho, vel(1), vel(2), pres).

Testing. There was no test covering the plain-2D probe path (the only 2D probe case is the hypoelastic one, which already writes vel(2)), so this adds 2D -> 1 Fluid(s) -> probe (tests/863E4401) with a probe at (0.5, 0.5) and a non-zero vel(2) on patch 2 so the new column is actually discriminating rather than a column of zeros. Generated on pristine master the golden shows 4 values per step; running the fixed binary against that golden fails with Variable count didn't match for D/probe1_prim.dat, and the committed golden (regenerated with the fix) has 5 values per step with the fourth being the 0.1 y-velocity.

$ ./mfc.sh test -o 863E4401 18DB27D5 --no-build      # new test + existing 2D hypoelastic probe test
2 passed
$ grep -c 'time =' <simulation stdout for tests/863E4401/case.py>
0
$ ./mfc.sh lint         # 669 passed
$ ./mfc.sh precheck -j 4    # 7/7 OK

Any external 2D golden probe files (outside this repo) will need regenerating for the extra column, as noted in the issue.

Fixes #1841

For a plain 2D case (no bubbles, no hypoelasticity) s_write_probe_files
wrote only (t, rho, vel(1), pres) to D/probe<i>_prim.dat and printed a
'time = ... rho = ... pres = ...' line to stdout every step. The 3D and
2D bubble/hypoelastic branches all write vel(2), so this was just the
plain-2D branch being incomplete. Add vel(2) under the same case-
optimization guard the neighbouring branches use, remove the print, and
add a '2D -> 1 Fluid(s) -> probe' test with a non-zero vel(2) so the
new column is exercised.

Fixes MFlowCode#1841
@github-actions

Copy link
Copy Markdown

Lines of Code

File Lines Diff
src/simulation/m_data_output.fpp 1403 +1
Directory Lines Diff
simulation 26387 +1
total 44075 +1

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.

2D probe output omits vel(2) and prints to stdout every step (s_write_probe_files)

2 participants