Skip to content

Commit

Permalink
fix(prt): fix output record duplication (#2113)
Browse files Browse the repository at this point in the history
The PRT model could write duplicative output, in volumes increasing with the current time step, due to a bug in the output file management logic. This bug has been fixed.
  • Loading branch information
wpbonelli authored Dec 19, 2024
1 parent a23357b commit 3d35f18
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
1 change: 1 addition & 0 deletions doc/ReleaseNotes/develop.tex
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
\item With a flow model using the Newton formulation, the PRT model could enter an endless loop upon a particle's entry to a dry cell if that cell contains a boundary package (e.g. a pumping well). Where the particle should be captured and terminate, it would instead be passed back and forth between the cell bottom and the top of the cell below. To avoid this, particles are forbidden from backtracking (reentering the previous cell) within the same time step.
\item The PRT model now allows more control over vertical particle motion in dry conditions. In addition to the existing DRAPE option, which controls release-time behavior, the PRP package now provides a DRY\_TRACKING\_METHOD option which configures how dry particles (particles in dry cells, or above the water table in partially saturated cells) behave at tracking time. This option is relevant only when the Newton formulation is used, in which case dry cells remain active; otherwise, dry cells are inactive and particles will terminate. See the MF6IO document for a detailed explanation of DRY\_TRACKING\_METHOD.
\item The PRT model's Particle Release Point (PRP) package now provides an option EXIT\_SOLVE\_TOLERANCE which configures the tolerance to use when solving for a particle's exit location from a triangular subcell of an unstructured grid cell. This value is only used for the generalized (ternary) tracking method on vertex grids. A value of 0.00001 is set by default. This value works well for many problems, but the value that strikes the best balance between accuracy and runtime is problem-dependent.
\item The PRT model could write duplicative output, in volumes increasing with the current time step, due to a bug in the output file management logic. This bug has been fixed.
\end{itemize}

%\underline{INTERNAL FLOW PACKAGES}
Expand Down
26 changes: 14 additions & 12 deletions src/Model/ParticleTracking/prt.f90
Original file line number Diff line number Diff line change
Expand Up @@ -911,17 +911,19 @@ subroutine prt_solve(this)
! -- Update PRP index
iprp = iprp + 1

! -- Initialize PRP-specific track files, if enabled
if (packobj%itrkout > 0) then
call this%trackctl%init_track_file( &
packobj%itrkout, &
iprp=iprp)
end if
if (packobj%itrkcsv > 0) then
call this%trackctl%init_track_file( &
packobj%itrkcsv, &
csv=.true., &
iprp=iprp)
! -- Initialize PRP-specific track files
if (kper == 1 .and. kstp == 1) then
if (packobj%itrkout > 0) then
call this%trackctl%init_track_file( &
packobj%itrkout, &
iprp=iprp)
end if
if (packobj%itrkcsv > 0) then
call this%trackctl%init_track_file( &
packobj%itrkcsv, &
csv=.true., &
iprp=iprp)
end if
end if

! -- Loop over particles in package
Expand Down Expand Up @@ -957,7 +959,7 @@ subroutine prt_solve(this)
! Get and apply the tracking method
call this%method%apply(particle, tmax)

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

Expand Down

0 comments on commit 3d35f18

Please sign in to comment.