From ca7840d3fa7341cb35417b5ddf826754fcbb4162 Mon Sep 17 00:00:00 2001 From: Spencer Bryngelson Date: Sun, 9 Aug 2026 11:11:08 -0400 Subject: [PATCH 1/3] Remove integral output Integral output (integral_wrt, num_integrals, integral(i)%{x,y,z}{min,max}) writes region-integrated pressure to D/integral_prim.dat for Euler-Euler bubble runs. Nothing exercises it: no example, test or benchmark sets integral_wrt, and it has had no coverage since it was added. Confirmed with the maintainer that it has no users. Removed everywhere: - the 118-line output block in s_write_probe_files and the file-open block in s_open_probe_files - type integral_parameters in m_derived_types - the fypp MPI broadcast loop over integral(j)%{xmin..zmax} - the default assignments in simulation/m_global_parameters - the registry entries, constraints and descriptions for integral_wrt, num_integrals and the 30 integral(i)%* parameters - check_probe_integral_output, which becomes check_probe_output and keeps only the probe fd_order rule - the case.md entries Locals that die with it: int_pres and max_pres (used only in the removed block), and rad, thickness, trigger, whose declarations were annotated "For integral quantities". Unlike the four-equation removal this touches no hot path -- the output was cold-guarded behind if (integral_wrt) -- so the value is in removed surface area rather than simplified code. Verified: build clean; full suite 627 passed, 0 failed, no golden regenerated; toolchain unit tests 170 passed. --- docs/documentation/case.md | 2 - src/common/m_derived_types.fpp | 10 -- src/simulation/m_data_output.fpp | 130 ------------------------- src/simulation/m_global_parameters.fpp | 8 -- src/simulation/m_mpi_proxy.fpp | 4 - toolchain/mfc/case_validator.py | 10 +- toolchain/mfc/lint_docs.py | 2 +- toolchain/mfc/params/definitions.py | 19 +--- toolchain/mfc/params/descriptions.py | 2 - 9 files changed, 5 insertions(+), 182 deletions(-) diff --git a/docs/documentation/case.md b/docs/documentation/case.md index 6b7274f24..8475524a2 100644 --- a/docs/documentation/case.md +++ b/docs/documentation/case.md @@ -717,8 +717,6 @@ To restart the simulation from $k$-th time step, see @ref running "Restarting Ca | `chem_wrt_T` | Logical | Write temperature field for chemistry output | | `fft_wrt` | Logical | Enable FFT output | | `sim_data` | Logical | Write interface and energy data files (post_process) | -| `integral_wrt` | Logical | Write integral data | -| `num_integrals` | Integer | Number of integral regions | | `down_sample` | Logical | Enable output downsampling | | `fd_order` | Integer | Order of finite differences for computing the vorticity and the numerical Schlieren function [1,2,4] | | `schlieren_alpha(i)` | Real | Intensity of the numerical Schlieren computed via `alpha(i)` | diff --git a/src/common/m_derived_types.fpp b/src/common/m_derived_types.fpp index 872c04b39..6958aa004 100644 --- a/src/common/m_derived_types.fpp +++ b/src/common/m_derived_types.fpp @@ -428,16 +428,6 @@ module m_derived_types type(vec3_dt), allocatable, dimension(:) :: var end type mpi_io_airfoil_ib_var - !> Derived type annexing integral regions - type integral_parameters - real(wp) :: xmin !< Min. boundary first coordinate direction - real(wp) :: xmax !< Max. boundary first coordinate direction - real(wp) :: ymin !< Min. boundary second coordinate direction - real(wp) :: ymax !< Max. boundary second coordinate direction - real(wp) :: zmin !< Min. boundary third coordinate direction - real(wp) :: zmax !< Max. boundary third coordinate direction - end type integral_parameters - !> Parameters for body force with spatial support type spbf_parameters real(wp) :: amp diff --git a/src/simulation/m_data_output.fpp b/src/simulation/m_data_output.fpp index e4c32e2c9..879eda719 100644 --- a/src/simulation/m_data_output.fpp +++ b/src/simulation/m_data_output.fpp @@ -149,15 +149,6 @@ contains end if end do - if (integral_wrt) then - do i = 1, num_integrals - write (file_path, '(A,I0,A)') '/D/integral', i, '_prim.dat' - file_path = trim(case_dir) // trim(file_path) - - open (i + 70, FILE=trim(file_path), form='formatted', POSITION='append', STATUS='unknown') - end do - end if - end subroutine s_open_probe_files !> Write stability criteria extrema to the run-time information file at the given time step @@ -1155,8 +1146,6 @@ contains real(wp) :: nondim_time !< Non-dimensional time real(wp) :: tmp !< Temporary variable to store quantity for mpi_allreduce integer :: npts !< Number of included integral points - real(wp) :: rad, thickness !< For integral quantities - logical :: trigger !< For integral quantities real(wp) :: rhoYks(1:num_species) T = dflt_T_guess @@ -1525,125 +1514,6 @@ contains end if end do - if (integral_wrt .and. bubbles_euler) then - if (n == 0) then - do i = 1, num_integrals - int_pres = 0._wp - max_pres = 0._wp - k = 0; l = 0 - npts = 0 - do j = 1, m - pres = 0._wp - do s = 1, num_vels - vel(s) = 0._wp - end do - rho = 0._wp - pres = 0._wp - gamma = 0._wp - pi_inf = 0._wp - qv = 0._wp - - if ((integral(i)%xmin <= x_cb(j)) .and. (integral(i)%xmax >= x_cb(j))) then - npts = npts + 1 - call s_convert_to_mixture_variables(q_cons_vf, j, k, l, rho, gamma, pi_inf, qv, Re) - do s = 1, num_vels - vel(s) = q_cons_vf(eqn_idx%cont%end + s)%sf(j, k, l)/rho - end do - - pres = ((q_cons_vf(eqn_idx%E)%sf(j, k, l) - 0.5_wp*(q_cons_vf(eqn_idx%mom%beg)%sf(j, k, & - & l)**2._wp)/rho)/(1._wp - q_cons_vf(eqn_idx%alf)%sf(j, k, l)) - pi_inf - qv)/gamma - int_pres = int_pres + (pres - 1._wp)**2._wp - end if - end do - int_pres = sqrt(int_pres/(1._wp*npts)) - - if (num_procs > 1) then - tmp = int_pres - call s_mpi_allreduce_sum(tmp, int_pres) - end if - - if (proc_rank == 0) then - if (bubbles_euler .and. (num_fluids <= 2)) then - write (i + 70, '(6x,f12.6,f24.8)') nondim_time, int_pres - end if - end if - end do - else if (p == 0) then - if (num_integrals /= 3) then - call s_mpi_abort('Incorrect number of integrals') - end if - - rad = integral(1)%xmax - thickness = integral(1)%xmin - - do i = 1, num_integrals - int_pres = 0._wp - max_pres = 0._wp - l = 0 - npts = 0 - do j = 1, m - do k = 1, n - trigger = .false. - if (i == 1) then - ! inner portion - if (sqrt(x_cb(j)**2._wp + y_cb(k)**2._wp) < (rad - 0.5_wp*thickness)) trigger = .true. - else if (i == 2) then - ! net region - if (sqrt(x_cb(j)**2._wp + y_cb(k)**2._wp) > (rad - 0.5_wp*thickness) .and. sqrt(x_cb(j)**2._wp & - & + y_cb(k)**2._wp) < (rad + 0.5_wp*thickness)) trigger = .true. - else if (i == 3) then - ! everything else - if (sqrt(x_cb(j)**2._wp + y_cb(k)**2._wp) > (rad + 0.5_wp*thickness)) trigger = .true. - end if - - pres = 0._wp - do s = 1, num_vels - vel(s) = 0._wp - end do - rho = 0._wp - pres = 0._wp - gamma = 0._wp - pi_inf = 0._wp - qv = 0._wp - - if (trigger) then - npts = npts + 1 - call s_convert_to_mixture_variables(q_cons_vf, j, k, l, rho, gamma, pi_inf, qv, Re) - do s = 1, num_vels - vel(s) = q_cons_vf(eqn_idx%cont%end + s)%sf(j, k, l)/rho - end do - - pres = ((q_cons_vf(eqn_idx%E)%sf(j, k, l) - 0.5_wp*(q_cons_vf(eqn_idx%mom%beg)%sf(j, k, & - & l)**2._wp)/rho)/(1._wp - q_cons_vf(eqn_idx%alf)%sf(j, k, l)) - pi_inf - qv)/gamma - int_pres = int_pres + abs(pres - 1._wp) - max_pres = max(max_pres, abs(pres - 1._wp)) - end if - end do - end do - - if (npts > 0) then - int_pres = int_pres/(1._wp*npts) - else - int_pres = 0._wp - end if - - if (num_procs > 1) then - tmp = int_pres - call s_mpi_allreduce_sum(tmp, int_pres) - - tmp = max_pres - call s_mpi_allreduce_max(tmp, max_pres) - end if - - if (proc_rank == 0) then - if (bubbles_euler .and. (num_fluids <= 2)) then - write (i + 70, '(6x,f12.6,f24.8,f24.8)') nondim_time, int_pres, max_pres - end if - end if - end do - end if - end if - end subroutine s_write_probe_files !> Write footer with stability criteria extrema and run-time to the information file, then close it diff --git a/src/simulation/m_global_parameters.fpp b/src/simulation/m_global_parameters.fpp index 4af35c426..7bdcff965 100644 --- a/src/simulation/m_global_parameters.fpp +++ b/src/simulation/m_global_parameters.fpp @@ -548,9 +548,7 @@ contains fd_order = dflt_int probe_wrt = .false. - integral_wrt = .false. num_probes = dflt_int - num_integrals = dflt_int do i = 1, num_probes_max probe(i)%x = dflt_real @@ -559,12 +557,6 @@ contains end do do i = 1, num_probes_max - integral(i)%xmin = dflt_real - integral(i)%xmax = dflt_real - integral(i)%ymin = dflt_real - integral(i)%ymax = dflt_real - integral(i)%zmin = dflt_real - integral(i)%zmax = dflt_real end do ! GRCBC flags diff --git a/src/simulation/m_mpi_proxy.fpp b/src/simulation/m_mpi_proxy.fpp index ed2be4e78..6a0fab64b 100644 --- a/src/simulation/m_mpi_proxy.fpp +++ b/src/simulation/m_mpi_proxy.fpp @@ -232,10 +232,6 @@ contains #:for VAR in [ 'x','y','z' ] call MPI_BCAST(probe(j)%${VAR}$, 1, mpi_p, 0, MPI_COMM_WORLD, ierr) #:endfor - - #:for VAR in [ 'xmin', 'xmax', 'ymin', 'ymax', 'zmin', 'zmax' ] - call MPI_BCAST(integral(j)%${VAR}$, 1, mpi_p, 0, MPI_COMM_WORLD, ierr) - #:endfor end do ! manual: spatial-support body-force derived-type members (the bf_spatial_support toggle is broadcast by diff --git a/toolchain/mfc/case_validator.py b/toolchain/mfc/case_validator.py index e85336a9f..d9b838213 100644 --- a/toolchain/mfc/case_validator.py +++ b/toolchain/mfc/case_validator.py @@ -1366,16 +1366,12 @@ def check_grcbc(self): if grcbc_vel_out: self.prohibit(bc_beg != -8 and bc_end != -8, f"Subsonic Outflow Velocity (grcbc_vel_out) requires bc_{dir}%beg = -8 or bc_{dir}%end = -8") - def check_probe_integral_output(self): - """Checks probe and integral output requirements (simulation)""" + def check_probe_output(self): + """Checks probe output requirements (simulation)""" probe_wrt = self.get("probe_wrt", "F") == "T" - integral_wrt = self.get("integral_wrt", "F") == "T" fd_order = self.get("fd_order") - bubbles_euler = self.get("bubbles_euler", "F") == "T" self.prohibit(probe_wrt and fd_order is None, "fd_order must be specified for probe_wrt") - self.prohibit(integral_wrt and fd_order is None, "fd_order must be specified for integral_wrt") - self.prohibit(integral_wrt and not bubbles_euler, "integral_wrt requires bubbles_euler to be enabled") # Pre-Process Specific Checks @@ -2329,7 +2325,7 @@ def validate_simulation(self): self.check_bubbles_lagrange() self.check_continuum_damage() self.check_grcbc() - self.check_probe_integral_output() + self.check_probe_output() def validate_pre_process(self): """Validate pre-process-specific parameters""" diff --git a/toolchain/mfc/lint_docs.py b/toolchain/mfc/lint_docs.py index 64d9ea4d6..e4752932b 100644 --- a/toolchain/mfc/lint_docs.py +++ b/toolchain/mfc/lint_docs.py @@ -433,7 +433,7 @@ def check_physics_docs_coverage(repo_root: Path) -> list[str]: "check_bc_patches", # boundary patch geometry "check_grid_stretching", # grid stretching parameters "check_qbmm_pre_process", # QBMM pre-process settings - "check_probe_integral_output", # probe/integral output settings + "check_probe_output", # probe output settings "check_finite_difference", # fd_order value validation "check_flux_limiter", # output dimension requirements "check_liutex_post", # output dimension requirements diff --git a/toolchain/mfc/params/definitions.py b/toolchain/mfc/params/definitions.py index f5daed04b..773bdd4be 100644 --- a/toolchain/mfc/params/definitions.py +++ b/toolchain/mfc/params/definitions.py @@ -379,7 +379,6 @@ def get_value_label(param_name: str, value: int) -> str: "ib_neighborhood_radius": {"min": 1}, "num_source": {"min": 1}, "num_probes": {"min": 1}, - "num_integrals": {"min": 1}, "nb": {"min": 1}, "m": {"min": 0}, "n": {"min": 0}, @@ -509,11 +508,6 @@ def get_value_label(param_name: str, value: int) -> str: "recommends": ["cfl_target"], } }, - "integral_wrt": { - "when_true": { - "requires": ["fd_order"], - } - }, } @@ -649,10 +643,8 @@ def _load(): _r("many_ib_patch_parallelism", LOG, {"ib"}) # Probes - for n in ["num_probes", "num_integrals"]: - _r(n, INT, {"probes"}) + _r("num_probes", INT, {"probes"}) _r("probe_wrt", LOG, {"output", "probes"}) - _r("integral_wrt", LOG, {"output", "probes"}) # Output _r("precision", INT, {"output"}) @@ -1033,12 +1025,6 @@ def _load(): for d in ["x", "y", "z"]: _r(f"probe({i})%{d}", REAL, {"probes"}) - # integrals (5 integral regions) - for i in range(1, 6): - for d in ["x", "y", "z"]: - _r(f"integral({i})%{d}min", REAL, {"probes"}) - _r(f"integral({i})%{d}max", REAL, {"probes"}) - # Extended BC for d in ["x", "y", "z"]: px = f"bc_{d}%" @@ -1334,9 +1320,6 @@ def _decl(targets: set, *names: str) -> None: "probe_wrt", "num_probes", "probe", - "integral_wrt", - "num_integrals", - "integral", "acoustic_source", "num_source", "acoustic", diff --git a/toolchain/mfc/params/descriptions.py b/toolchain/mfc/params/descriptions.py index 020b2160b..b628aaf03 100644 --- a/toolchain/mfc/params/descriptions.py +++ b/toolchain/mfc/params/descriptions.py @@ -114,7 +114,6 @@ "prim_vars_wrt": "Write primitive variables", "cons_vars_wrt": "Write conservative variables", "probe_wrt": "Write probe data", - "integral_wrt": "Write integral data", "parallel_io": "Enable parallel I/O", "file_per_process": "Write separate file per MPI process", "format": "Output format", @@ -142,7 +141,6 @@ "num_source": "Number of acoustic sources", # Probes and integrals "num_probes": "Number of probe points", - "num_integrals": "Number of integral regions", # MPI/GPU "rdma_mpi": "Enable RDMA for MPI communication (GPUs)", # Misc From 7e30e9a46f4907da33491cfff60a4bf5970f6b19 Mon Sep 17 00:00:00 2001 From: Spencer Bryngelson Date: Sun, 9 Aug 2026 11:22:25 -0400 Subject: [PATCH 2/3] Remove the stale integral TYPED_DECLS entry Found while reviewing this PR. TYPED_DECLS still carried "integral": ("type(integral_parameters)", "num_probes_max", False, None), which is the recipe for generating the Fortran declaration of the integral array. type(integral_parameters) no longer exists. It did not break the build because deregistering integral_wrt, num_integrals and the integral(i)%* parameters also removed integral from every target's namelist variables, so generate_decls_fpp never emitted it -- confirmed by grepping the generated generated_decls.fpp. The entry was inert, but it named a deleted type and would have produced an uncompilable declaration for anyone who re-registered the parameters. Re-verified: build clean, full suite 627 passed 0 failed, toolchain unit tests 170 passed. --- toolchain/mfc/params/definitions.py | 1 - 1 file changed, 1 deletion(-) diff --git a/toolchain/mfc/params/definitions.py b/toolchain/mfc/params/definitions.py index 773bdd4be..2206122a8 100644 --- a/toolchain/mfc/params/definitions.py +++ b/toolchain/mfc/params/definitions.py @@ -1176,7 +1176,6 @@ def _init_registry(): "ib_airfoil": ("type(ib_airfoil_parameters)", "num_ib_airfoils_max", True, "Per-airfoil NACA user inputs"), "stl_models": ("type(ib_stl_parameters)", "num_stl_models_max", True, "Per-STL model parameters"), "probe": ("type(vec3_dt)", "num_probes_max", False, None), - "integral": ("type(integral_parameters)", "num_probes_max", False, None), "acoustic": ("type(acoustic_parameters)", "num_probes_max", True, "Acoustic source parameters"), "chem_params": ("type(chemistry_parameters)", None, True, None), "rburn": ("type(reactive_burn_parameters)", None, True, "Condensed-phase reactive-burn (programmed detonation) parameters"), From 2b618b2ad91c23f927bfa7e5fa6c88817a17d173 Mon Sep 17 00:00:00 2001 From: Spencer Bryngelson Date: Sun, 9 Aug 2026 10:58:46 -0500 Subject: [PATCH 3/3] Remove the remaining integral-output residue --- src/simulation/m_data_output.fpp | 1 - src/simulation/m_global_parameters.fpp | 5 +---- src/simulation/m_mpi_proxy.fpp | 2 +- toolchain/mfc/params/definitions.py | 4 ++-- toolchain/mfc/params/descriptions.py | 11 ++--------- toolchain/mfc/params/generators/docs_gen.py | 1 - 6 files changed, 6 insertions(+), 18 deletions(-) diff --git a/src/simulation/m_data_output.fpp b/src/simulation/m_data_output.fpp index 879eda719..2f774d9dc 100644 --- a/src/simulation/m_data_output.fpp +++ b/src/simulation/m_data_output.fpp @@ -1145,7 +1145,6 @@ contains integer :: i, j, k, l, s, d !< Generic loop iterator real(wp) :: nondim_time !< Non-dimensional time real(wp) :: tmp !< Temporary variable to store quantity for mpi_allreduce - integer :: npts !< Number of included integral points real(wp) :: rhoYks(1:num_species) T = dflt_T_guess diff --git a/src/simulation/m_global_parameters.fpp b/src/simulation/m_global_parameters.fpp index 7bdcff965..756e24987 100644 --- a/src/simulation/m_global_parameters.fpp +++ b/src/simulation/m_global_parameters.fpp @@ -198,7 +198,7 @@ module m_global_parameters !> @} $:GPU_DECLARE(create='[fd_coeff_x, fd_coeff_y, fd_coeff_z]') - ! probe, integral: auto-generated in generated_decls.fpp + ! probe: auto-generated in generated_decls.fpp !> @name Reference density and pressure for Tait EOS !> @{ @@ -556,9 +556,6 @@ contains probe(i)%z = dflt_real end do - do i = 1, num_probes_max - end do - ! GRCBC flags #:for dir in ['x', 'y', 'z'] bc_${dir}$%grcbc_in = .false. diff --git a/src/simulation/m_mpi_proxy.fpp b/src/simulation/m_mpi_proxy.fpp index 6a0fab64b..dacc3a464 100644 --- a/src/simulation/m_mpi_proxy.fpp +++ b/src/simulation/m_mpi_proxy.fpp @@ -209,7 +209,7 @@ contains call MPI_BCAST(particle_cloud(i)%packing_method, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr) end do - ! manual: acoustic/probe/integral (combined loop; complex acoustic member set) + ! manual: acoustic/probe (combined loop; complex acoustic member set) do j = 1, num_probes_max do i = 1, 3 call MPI_BCAST(acoustic(j)%loc(i), 1, mpi_p, 0, MPI_COMM_WORLD, ierr) diff --git a/toolchain/mfc/params/definitions.py b/toolchain/mfc/params/definitions.py index 2206122a8..c87f37091 100644 --- a/toolchain/mfc/params/definitions.py +++ b/toolchain/mfc/params/definitions.py @@ -27,7 +27,7 @@ def _fc(name: str, default: int) -> int: NF = _fc("num_fluids_max", 10) # fluid_pp -NPR = _fc("num_probes_max", 10) # probe, acoustic, integral +NPR = _fc("num_probes_max", 10) # probe, acoustic NB = _fc("num_bc_patches_max", 10) # patch_bc NUM_PATCHES_MAX = _fc("num_patches_max", 10) # patch_icpp (Fortran array bound) NIB = _fc("num_ib_patches_max_namelist", 54000) # patch_ib namelist array bound @@ -129,7 +129,7 @@ def _fc(name: str, default: int) -> int: "acoustic": "Acoustic", "ib": "Immersed boundary", "reactive_burn": "Reactive burn", - "probes": "Probe/integral", + "probes": "Probe", "riemann": "Riemann solver", "relativity": "Relativity", "output": "Output", diff --git a/toolchain/mfc/params/descriptions.py b/toolchain/mfc/params/descriptions.py index b628aaf03..664789161 100644 --- a/toolchain/mfc/params/descriptions.py +++ b/toolchain/mfc/params/descriptions.py @@ -139,7 +139,7 @@ # Acoustic sources "acoustic_source": "Enable acoustic source terms", "num_source": "Number of acoustic sources", - # Probes and integrals + # Probes "num_probes": "Number of probe points", # MPI/GPU "rdma_mpi": "Enable RDMA for MPI communication (GPUs)", @@ -427,13 +427,6 @@ (r"probe\((\d+)\)%x", "X-coordinate of probe {0}"), (r"probe\((\d+)\)%y", "Y-coordinate of probe {0}"), (r"probe\((\d+)\)%z", "Z-coordinate of probe {0}"), - # integral patterns - (r"integral\((\d+)\)%xmin", "X-min of integral region {0}"), - (r"integral\((\d+)\)%xmax", "X-max of integral region {0}"), - (r"integral\((\d+)\)%ymin", "Y-min of integral region {0}"), - (r"integral\((\d+)\)%ymax", "Y-max of integral region {0}"), - (r"integral\((\d+)\)%zmin", "Z-min of integral region {0}"), - (r"integral\((\d+)\)%zmax", "Z-max of integral region {0}"), # bub_pp patterns (r"bub_pp%R0ref", "Reference bubble radius"), (r"bub_pp%p0ref", "Reference pressure for bubbles"), @@ -700,7 +693,7 @@ def get_math_symbol(param_name: str) -> str: "grid": "Computational grid and domain", "bc": "Boundary conditions", "riemann": "Riemann solver settings", - "probes": "Probe points and integral regions", + "probes": "Probe points", "surface_tension": "Surface tension and interface", "relativity": "Special relativity", } diff --git a/toolchain/mfc/params/generators/docs_gen.py b/toolchain/mfc/params/generators/docs_gen.py index 130dbc161..f57abcd1d 100644 --- a/toolchain/mfc/params/generators/docs_gen.py +++ b/toolchain/mfc/params/generators/docs_gen.py @@ -406,7 +406,6 @@ def generate_parameter_docs() -> str: "bc_y": "Y-direction boundary conditions", "bc_z": "Z-direction boundary conditions", "probe": "Probe/monitoring point parameters", - "integral": "Integral region parameters", "simplex_params": "Simplex noise perturbation parameters", "chem_wrt_Y": "Chemistry species output parameters", "bub_pp": "Bubble property parameters",