Skip to content

Commit

Permalink
more revisions
Browse files Browse the repository at this point in the history
  • Loading branch information
wpbonelli committed Dec 11, 2024
1 parent fd98950 commit 297b082
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 19 deletions.
20 changes: 11 additions & 9 deletions src/Solution/ParticleTracker/MethodDis.f90
Original file line number Diff line number Diff line change
Expand Up @@ -192,18 +192,22 @@ subroutine load_particle(this, cell, particle)

select type (dis => this%fmi%dis)
type is (DisType)
! compute and set reduced/user node numbers and layer
! compute reduced/user node numbers and layer
inface = particle%iboundary(2)
inbr = cell%defn%facenbr(inface)
idiag = this%fmi%dis%con%ia(cell%defn%icell)
ipos = idiag + inbr
ic = dis%con%ja(ipos)
icu = dis%get_nodeuser(ic)
call get_ijk(icu, dis%nrow, dis%ncol, dis%nlay, &
irow, icol, ilay)

! 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
! if returning to a cell through the bottom
! face after previously leaving it through
! that same face, we've entered a cycle
! as can occur e.g. in wells. terminate
! in the previous cell.
if (ic == particle%icp .and. inface == 7 .and. ilay < particle%ilay) then
particle%advancing = .false.
particle%idomain(2) = particle%icp
particle%istatus = 2
Expand All @@ -215,9 +219,7 @@ subroutine load_particle(this, cell, particle)
particle%izp = particle%izone
end if

icu = dis%get_nodeuser(ic)
call get_ijk(icu, dis%nrow, dis%ncol, dis%nlay, &
irow, icol, ilay)
! update node numbers and layer
particle%idomain(2) = ic
particle%icu = icu
particle%ilay = ilay
Expand Down
17 changes: 8 additions & 9 deletions src/Solution/ParticleTracker/MethodDisv.f90
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,15 @@ subroutine load_particle(this, cell, particle)
inbr = cell%defn%facenbr(inface)
ipos = idiag + inbr
ic = dis%con%ja(ipos)
icu = dis%get_nodeuser(ic)
call get_jk(icu, dis%ncpl, dis%nlay, icpl, ilay)

! 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
! if returning to a cell through the bottom
! face after previously leaving it through
! that same face, we've entered a cycle
! as can occur e.g. in wells. terminate
! in the previous cell.
if (ic == particle%icp .and. inface == 7 .and. ilay < particle%ilay) then
particle%advancing = .false.
particle%idomain(2) = particle%icp
particle%istatus = 2
Expand All @@ -172,10 +175,6 @@ subroutine load_particle(this, cell, particle)
particle%izp = particle%izone
end if

icu = dis%get_nodeuser(ic)

call get_jk(icu, dis%ncpl, dis%nlay, icpl, ilay)

particle%idomain(2) = ic
particle%icu = icu
particle%ilay = ilay
Expand Down
2 changes: 1 addition & 1 deletion src/Solution/ParticleTracker/vertical.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,4 @@ flowchart LR

In MF6.5, behavior was as described by `DROP`, with one major exception: lack of an exit face (i.e. any face with outgoing flow) took precedence over cell saturation; a particle finding itself in a dry cell with no outgoing flow would previously terminate, where if `DROP` is selected (or a dry tracking method unspecified) the pass-to-bottom method will now be applied instead.

With this change, it also becomes necessary to prohibit particle backtracking (i.e. re-entering the previous cell) within the same time step, in order to avoid the possibility of infinite loops. For instance, a particle might otherwise be passed endlessly between e.g. the bottom face of a cell containing a pumping well and the top face of the cell below.
With this change, it also becomes necessary to prohibit backtracking between vertically adjacent pairs of cells within the same time step, in order to avoid the possibility of infinite loops &mdash; a particle might otherwise be passed endlessly between e.g. the bottom face of a cell containing a pumping well and the top face of the cell below. Note that this limitation applies only to vertically adjacent cells, and only to the immediately previous cell &mdash; a particle may re-enter a cell after entering a third cell.

0 comments on commit 297b082

Please sign in to comment.