Skip to content

Commit 297b082

Browse files
committed
more revisions
1 parent fd98950 commit 297b082

File tree

3 files changed

+20
-19
lines changed

3 files changed

+20
-19
lines changed

src/Solution/ParticleTracker/MethodDis.f90

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -192,18 +192,22 @@ subroutine load_particle(this, cell, particle)
192192

193193
select type (dis => this%fmi%dis)
194194
type is (DisType)
195-
! compute and set reduced/user node numbers and layer
195+
! compute reduced/user node numbers and layer
196196
inface = particle%iboundary(2)
197197
inbr = cell%defn%facenbr(inface)
198198
idiag = this%fmi%dis%con%ia(cell%defn%icell)
199199
ipos = idiag + inbr
200200
ic = dis%con%ja(ipos)
201+
icu = dis%get_nodeuser(ic)
202+
call get_ijk(icu, dis%nrow, dis%ncol, dis%nlay, &
203+
irow, icol, ilay)
201204

202-
! if returning to immediately previous cell
203-
! through its bottom, we've entered a cycle
204-
! as can occur e.g. in the bottom of wells.
205-
! terminate in the previous cell.
206-
if (ic == particle%icp .and. inface == 7) then
205+
! if returning to a cell through the bottom
206+
! face after previously leaving it through
207+
! that same face, we've entered a cycle
208+
! as can occur e.g. in wells. terminate
209+
! in the previous cell.
210+
if (ic == particle%icp .and. inface == 7 .and. ilay < particle%ilay) then
207211
particle%advancing = .false.
208212
particle%idomain(2) = particle%icp
209213
particle%istatus = 2
@@ -215,9 +219,7 @@ subroutine load_particle(this, cell, particle)
215219
particle%izp = particle%izone
216220
end if
217221

218-
icu = dis%get_nodeuser(ic)
219-
call get_ijk(icu, dis%nrow, dis%ncol, dis%nlay, &
220-
irow, icol, ilay)
222+
! update node numbers and layer
221223
particle%idomain(2) = ic
222224
particle%icu = icu
223225
particle%ilay = ilay

src/Solution/ParticleTracker/MethodDisv.f90

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,15 @@ subroutine load_particle(this, cell, particle)
155155
inbr = cell%defn%facenbr(inface)
156156
ipos = idiag + inbr
157157
ic = dis%con%ja(ipos)
158+
icu = dis%get_nodeuser(ic)
159+
call get_jk(icu, dis%ncpl, dis%nlay, icpl, ilay)
158160

159-
! if returning to immediately previous cell
160-
! through its bottom, we've entered a cycle
161-
! as can occur e.g. in the bottom of wells.
162-
! terminate in the previous cell.
163-
if (ic == particle%icp .and. inface == 7) then
161+
! if returning to a cell through the bottom
162+
! face after previously leaving it through
163+
! that same face, we've entered a cycle
164+
! as can occur e.g. in wells. terminate
165+
! in the previous cell.
166+
if (ic == particle%icp .and. inface == 7 .and. ilay < particle%ilay) then
164167
particle%advancing = .false.
165168
particle%idomain(2) = particle%icp
166169
particle%istatus = 2
@@ -172,10 +175,6 @@ subroutine load_particle(this, cell, particle)
172175
particle%izp = particle%izone
173176
end if
174177

175-
icu = dis%get_nodeuser(ic)
176-
177-
call get_jk(icu, dis%ncpl, dis%nlay, icpl, ilay)
178-
179178
particle%idomain(2) = ic
180179
particle%icu = icu
181180
particle%ilay = ilay

src/Solution/ParticleTracker/vertical.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,4 +130,4 @@ flowchart LR
130130

131131
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.
132132

133-
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.
133+
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 commit comments

Comments
 (0)