Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(PRT): introduce Particle Tracking (PRT) model #1389

Merged
merged 4 commits into from
Feb 23, 2024

Conversation

wpbonelli
Copy link
Contributor

@wpbonelli wpbonelli commented Oct 7, 2023

Status

At this time PRT supports particle tracking on all DIS and some but not all DISV grids

Outstanding issues include

  • DISV cells containing adjacent parallel faces are not properly handled and may cause crashes, this includes quad-refined grids as well as DISV grids generated by FloPy's voronoi module

Support is planned but not yet implemented for

  • configurable particle mass
  • local mass conservation — conserved between cells but not yet guaranteed at the subcell level
  • exchanging particles between models
  • DISU grids (longer term)
  • solving models in parallel (longer term)

Integration

When this merges a preliminary version of PRT will become available on the nightly build but will be excluded from official releases.

Miscellaneous info

Docs/dfns and tests make up about half the changeset, the rest is fortran source.

PRT's primary author is @aprovost-usgs. Some code is adapted from MODPATH and originally due to @dwpolloc-usgs.

@wpbonelli
Copy link
Contributor Author

wpbonelli commented Dec 22, 2023

Squashed the branch to make rebasing with IDM easier. Commit history is backed up on my fork if needed. Recent changes are mostly non-functional and include

  • refactor tracking method hierarchy
  • refactor cell/cell definition hierarchy, factor out base cell type
  • refactor prp: simplify time offset support, rename referencetime -> releasetime, check release coord/cell correspondence and elevation, cleanup particle init/release logic
  • refactor TrackModule to support arbitrary # of track files
  • remove trackingmodel, extend explicitmodel directly
  • don't set conc on gwfprt exchange until implemented/tested
  • deduplicate logic in Method types, use dis%get_polyverts()
  • move coord transform routines to GeomUtil, remove UtilMisc
  • use ExpandArray interface, remove allocate_as_needed utils
  • use arrays for canonical velocity components, vertices, etc
  • introduce mod_offset function, remove *_wrap routines
  • remove rotate function, replace rotate() with matmuls
  • remove some unused utility routines
  • minor cleanup in MIP pkg
  • ifort compatibility tweaks
  • add scipy to environment.yml
  • rebase with latest IDM changes
  • add unit tests for math/geom utils
  • add integration tests: drape, voronoi grid

@wpbonelli
Copy link
Contributor Author

wpbonelli commented Dec 28, 2023

outdated @mjr-deltares

Do you have any ideas on this? https://github.com/MODFLOW-USGS/modflow6/actions/runs/7343758410/job/19994783536?pr=1389#step:15:392

I'm stumped. PRT doesn't touch PETSc and it doesn't reproduce on ubuntu 22.04 locally. Tried clearing caches, no luck

resolved with meson update

@wpbonelli wpbonelli force-pushed the PRT branch 3 times, most recently from e5f9cb6 to 39fe521 Compare December 31, 2023 02:21
@wpbonelli wpbonelli added this to the 6.5.0 milestone Jan 10, 2024
@wpbonelli wpbonelli force-pushed the PRT branch 2 times, most recently from c10b0b8 to a221361 Compare January 24, 2024 21:58
@wpbonelli wpbonelli force-pushed the PRT branch 4 times, most recently from 54aa9bf to 5f5eb37 Compare January 31, 2024 02:01
@wpbonelli wpbonelli force-pushed the PRT branch 3 times, most recently from 1a2382e to b790db4 Compare February 9, 2024 03:24
@wpbonelli wpbonelli force-pushed the PRT branch 2 times, most recently from 133e313 to d01846c Compare February 10, 2024 00:46
@wpbonelli wpbonelli changed the title feat(PRT): add particle tracking model feat(PRT): introduce Particle Tracking (PRT) model Feb 19, 2024
@wpbonelli wpbonelli force-pushed the PRT branch 2 times, most recently from 92510ed to cc0a70f Compare February 19, 2024 19:44
@wpbonelli wpbonelli marked this pull request as ready for review February 19, 2024 23:18
@wpbonelli wpbonelli force-pushed the PRT branch 4 times, most recently from 0564733 to 259a6d0 Compare February 23, 2024 02:38
Copy link
Contributor

@langevin-usgs langevin-usgs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great.

@@ -0,0 +1,178 @@
# --------------------- sln pts options ---------------------
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might revisit these settings. Not sure all are needed for a particle solver.

@@ -0,0 +1,8 @@
BEGIN OPTIONS
FLOW_IMBALANCE_CORRECTION
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just an FYI that this option probably shouldn't apply to particle tracking models.

@@ -45,9 +45,9 @@

\item \textcolor{blue}{\texttt{elev}---is the elevation of the drain. If the Options block includes a TIMESERIESFILE entry (see the ``Time-Variable Input'' section), values can be obtained from a time series by entering the time-series name in place of a numeric value.}

\item \textcolor{blue}{\texttt{cond}---is the hydraulic conductance of the interface between the aquifer and the drain. If the Options block includes a TIMESERIESFILE entry (see the ``Time-Variable Input'' section), values can be obtained from a time series by entering the time-series name in place of a numeric value. COND values must be greater than or equal to zero. The program will terminate with an error if any COND value is less than zero.}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this change resulted from a merge (a recent change on develop). Not a problem since this file is generated from mf6ivar.py.

\item \textbf{Block: OPTIONS}

\begin{description}
\item \texttt{list}---is name of the listing file to create for this PRT model. If not specified, then the name of the list file will be the basename of the PRT model name file and the '.lst' extension. For example, if the PRT name file is called ``my.model.nam'' then the list file will be called ``my.model.lst''.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should be latex double quotes?

Copy link
Contributor Author

@wpbonelli wpbonelli Feb 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. Should we update this in *-nam.dfn for the other models too? Maybe in separate PR?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's like that elsewhere, then maybe we are okay for now.

@wpbonelli wpbonelli merged commit 61b0883 into MODFLOW-USGS:develop Feb 23, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants