Skip to content

Conversation

@wpbonelli
Copy link
Member

@wpbonelli wpbonelli commented Jan 10, 2026

PRT previously attempted to report events occurring exactly on a boundary between time steps as occurring during the preceding step, in order to properly 'credit' the flow conditions responsible for the particle's trajectory up to that time. This logic was implemented incorrectly and could cause stress period and time step to be assigned incorrectly for some events. Instead of altering stress period and time step post hoc, PRT will now report each event as occurring in the stress period and time step in which the reporting condition responsible for triggering it is recognized. By consequence, particle release events occurring exactly at a time step boundary may now be assigned to either side of the boundary, depending how the release is configured: if configured via explicit release time, it will fall on the preceding side, while if configured via stress period settings, it will be reported on the following side.

The changes mainly consist of tightening up the semantics and implementation of TimeSelectModule, which will now use slices (t0, t1], i.e exclusive lower bound and inclusive upper bound, and the advance routine was incorrect in several ways. Conditionals in the various tracking methods are also updated to implement the new approach, which can be summarized as "report events as soon as possible, without duplication".

test_prt_release_timing.py is updated here with 3 new cases. test_prt_watertable.py is also updated to reflect new, corrected results.

Checklist of items for pull request

  • Replaced section above with description of pull request
  • Added new test or modified an existing test
  • Ran ruff on new and modified python scripts in .doc, autotests, doc, distribution, pymake, and utils subdirectories.
  • Formatted new and modified Fortran source files with fprettify
  • Added doxygen comments to new and modified procedures
  • Updated develop.toml with a plain-language description of the bug fix, change, feature; required for changes that may affect users
  • Removed checklist items not relevant to this pull request

@wpbonelli wpbonelli added the bug label Jan 10, 2026
@wpbonelli wpbonelli added this to the 6.7.0 milestone Jan 10, 2026
@wpbonelli wpbonelli marked this pull request as ready for review January 12, 2026 14:43
wpbonelli added a commit to MODFLOW-ORG/modflow6-examples that referenced this pull request Jan 13, 2026
Accommodate MODFLOW-ORG/modflow6#2644 with snapshot updates

- ex-prt-mp7-p01: +189 USERTIME events at t=0.0, missing before, now reported
- ex-prt-mp7-p02: +432 USERTIME events at t=0.0, missing before, now reported
- ex-prt-mp7-p03: Row ordering changed (same events, different reporting order)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant