Skip to content

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

Description

@sbryngelson

Summary

For a plain 2D case (no bubbles, no hypoelasticity) s_write_probe_files in src/simulation/m_data_output.fpp writes only (t, rho, vel(1), pres) to D/probe<i>_prim.dat — the second velocity component is dropped — and it also prints a line to stdout on every time step:

                    else
                        write (i + 30, '(6X,F12.6,F24.8,F24.8,F24.8)') nondim_time, rho, vel(1), pres
                        print *, 'time =', nondim_time, 'rho =', rho, 'pres =', pres
                    end if

(master 33ad77a6, the p == 0 branch). The 3D branch writes vel(1), vel(2), vel(3), and the 2D bubble and hypoelastic branches write vel(2) too, so this is just the plain-2D branch being incomplete. The print floods the job log (one line per step per probe) and looks like leftover debugging.

Reproducer

Any 2D case with probe_wrt = "T", e.g. examples/2D_ibm_airfoil with a probe added: the probe file has 4 columns and stdout gets time = ... rho = ... pres = ... every step.

Suggested fix

                     else
-                        write (i + 30, '(6X,F12.6,F24.8,F24.8,F24.8)') nondim_time, rho, vel(1), pres
-                        print *, 'time =', nondim_time, 'rho =', rho, 'pres =', pres
+                        #:if not MFC_CASE_OPTIMIZATION or num_dims > 1
+                            write (i + 30, '(6X,F12.6,F24.8,F24.8,F24.8,F24.8)') nondim_time, rho, vel(1), vel(2), pres
+                        #:endif
                     end if

(the fypp guard mirrors the neighbouring bubble/hypoelastic branches, since vel(2) does not exist under 1D case optimization). This changes the 2D probe file layout from 4 to 5 columns, so any golden probe files for 2D probe tests would need regenerating. Happy to PR.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions