Skip to content

Commit

Permalink
revisions
Browse files Browse the repository at this point in the history
  • Loading branch information
wpbonelli committed Dec 11, 2024
1 parent abe8ad3 commit fd98950
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 29 deletions.
4 changes: 1 addition & 3 deletions autotest/test_prt_dry.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
"""
Tests particle tracking in "dry" conditions.
Particles should terminate in inactive cells.
The PRP package provides the `DRY` option
to specify how particles should behave in
dry conditions when the flow model enables
the Newton formulation.
This test case is adapted from the example
simulation provided by Javier Gonzalez in
simulation provided by @javgs-bd in
https://github.com/MODFLOW-USGS/modflow6/issues/2014.
"""

Expand Down
2 changes: 1 addition & 1 deletion doc/mf6io/mf6ivar/dfn/prt-prp.dfn
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ type string
valid drop stop stay
reader urword
optional true
longname what to do in active but dry cells
longname what to do in dry-but-active cells
description is a string indicating how particles should behave in dry-but-active cells (as can occur with the Newton formulation). The value can be ``DROP'', ``STOP'', or ``STAY''. The default is ``DROP'', which passes particles vertically and instantaneously to the water table. ``STOP'' causes particles to terminate. ``STAY'' causes particles to remain stationary but active.

block options
Expand Down
14 changes: 4 additions & 10 deletions doc/mf6io/prt/prt.tex
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,20 @@ \subsection{Vertical Tracking}

Normally, an inactive cell might be dry or explicitly disabled (idomain). With Newton, dry cells remain active.

Of the flow model, PRT knows only what the FMI or exchange tells it. This includes heads, flows and the active grid region, but not whether Newton is on, where boundary packages are, or even which boundary packages are present.

Tracking and termination decisions must be made, therefore, on the basis of available information like whether a cell is active, whether the cell is dry, and whether the particle is dry (above the water table).

Release-time and tracking-time considerations are described (and implemented) separately.

\subsubsection{Release}

At release time, PRT decides whether to release each particle or to terminate it unreleased.

If the release cell is active, the particle will be released at the specified coordinates.
If the release cell is active, the particle will be released at the user-specified location.

If the release cell is inactive, behavior is determined by the DRAPE option. If the DRAPE option is enabled, the particle will be released from the top-most active cell beneath it, if any. If there is no active cell underneath the particle in any layer, or if DRAPE is not enabled, the particle will terminate unreleased (with status code 8).

Since under the Newton formulation dry cells can remain active, the DRAPE option has no effect when Newton is on (assuming particles are not released into disabled grid regions). Vertical tracking behavior with Newton can be configured with tracking-time settings.
Since under the Newton formulation dry cells can remain active, the DRAPE option has no effect when Newton is on (assuming particles are not released into disabled grid regions). Vertical tracking behavior with Newton can be configured using the DRY\_TRACKING\_METHOD option discussed below.

\subsubsection{Tracking}

A particle might find itself above the water table for one of two reasons: it was released above the water table, or the water table has receded.

With the Newton formulation, particles can be released into dry-but-active cells.

Particle trajectories are solved over the same time discretization used by the flow model. A particle may be immersed in the flow field in one time step, and find that the water table has dropped below it in the next.
Expand All @@ -57,11 +51,11 @@ \subsubsection{Tracking}

A particle in a dry but active cell, or above the water table in a partially saturated cell, need not terminate. We call such a particle dry. The PRP package provides an option DRY\_TRACKING\_METHOD determining how dry particles should behave. Supported values are DROP (default), STOP, and STAY.

If DROP is selected, or if a DRY\_TRACKING\_METHOD is unspecified, a particle in a dry position is passed vertically and instantaneously to the water table (if the cell is partially saturated) or to the bottom of the cell (if the cell is dry). This repeats (i.e. the particle may drop through multiple cells) until it reaches the water table. Tracking then proceeds as usual. If the vertical column containing the particle is entirely dry, the particle will terminate upon reaching the bottom of the model grid.
If DROP is selected, or if a DRY\_TRACKING\_METHOD is unspecified, a dry particle is passed vertically and instantaneously to the water table (if the cell is partially saturated) or to the bottom of the cell (if the cell is dry). This repeats (i.e. the particle may drop through multiple cells) until it reaches the water table. Tracking then proceeds as usual. If the vertical column containing the particle is entirely dry, the particle will terminate upon reaching the bottom of the model grid.

If STOP is selected, dry particles will be terminated.

If STAY is selected, a dry particle will remain stationary until a) the water table rises and tracking can continue or b) the simulation ends.
If STAY is selected, a dry particle will remain stationary until a) the water table rises and tracking can continue, b) the particle terminates due to reaching its STOPTIME or STOPTRAVELTIME, or c) the simulation ends.

\subsection{Particle Track Output}

Expand Down
2 changes: 1 addition & 1 deletion src/Model/ParticleTracking/prt.f90
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,7 @@ subroutine prt_solve(this)
! Get and apply the tracking method
call this%method%apply(particle, tmax)

! Reset previous cell and zone numbers
! Reset previous cell, exit face, and zone numbers
particle%icp = 0
particle%izp = 0

Expand Down
10 changes: 5 additions & 5 deletions src/Solution/ParticleTracker/MethodDis.f90
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,11 @@ subroutine load_particle(this, cell, particle)
ipos = idiag + inbr
ic = dis%con%ja(ipos)

if (ic == particle%icp) then
! terminate in the previous cell.
! got here by falling through the
! bottom of a well.. TODO: check
! if entry/exit face is top/bot?
! if returning to immediately previous cell
! through its bottom, we've entered a cycle
! as can occur e.g. in the bottom of wells.
! terminate in the previous cell.
if (ic == particle%icp .and. inface == 7) then
particle%advancing = .false.
particle%idomain(2) = particle%icp
particle%istatus = 2
Expand Down
10 changes: 5 additions & 5 deletions src/Solution/ParticleTracker/MethodDisv.f90
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,11 @@ subroutine load_particle(this, cell, particle)
ipos = idiag + inbr
ic = dis%con%ja(ipos)

if (ic == particle%icp) then
! terminate in the previous cell.
! got here by falling through the
! bottom of a well.. TODO: check
! if entry/exit face is top/bot?
! if returning to immediately previous cell
! through its bottom, we've entered a cycle
! as can occur e.g. in the bottom of wells.
! terminate in the previous cell.
if (ic == particle%icp .and. inface == 7) then
particle%advancing = .false.
particle%idomain(2) = particle%icp
particle%istatus = 2
Expand Down
5 changes: 1 addition & 4 deletions src/Solution/ParticleTracker/Particle.f90
Original file line number Diff line number Diff line change
Expand Up @@ -311,10 +311,7 @@ end subroutine save_particle
!!
!! Apply a translation and/or rotation to particle coordinates.
!! No rescaling. It's also possible to invert a transformation.
!!
!! Upon inverting, be sure to untransform to eliminate roundoff
!! error accumulated in the particle origin/rotation variables,
!! and unsetting the transformed flag.
!! Be sure to reset the transformation after using it.
!<
subroutine transform_coords(this, xorigin, yorigin, zorigin, &
sinrot, cosrot, invert)
Expand Down

0 comments on commit fd98950

Please sign in to comment.