Comments (4)
Looking at the source code of the function I think the problem is in this snippet:
# fill flow terms
vmult = [-1.0, -1.0, -1.0]
flows = [frf, fff, flf]
for n in range(grb.nodes):
i0, i1 = ia[n] + 1, ia[n + 1]
for j in range(i0, i1):
jcol = ja[j]
if jcol > n:
if jcol == n + 1:
ipos = 0
elif jcol == n + grb.ncol: # <======HERE
ipos = 1
else:
ipos = 2
flows[ipos][n] = vmult[ipos] * flowja[j]
return frf.reshape(shape), fff.reshape(shape), flf.reshape(shape)
It seems like it already assumes that jcol == n+grb.ncol means it is in the next row, but in this case it should jump straight to the next layer.
from flopy.
Thanks for picking this up @w-bonelli. I looked at this a bit and it should be easy to fix, but it is trickier than it seems. Curious to see what you come up with.
from flopy.
@w-bonelli we have run into edge case issues with function before. It seems we should have better testing for this. Probably need cases (1, nrow, 1)
, (1, 1, ncol)
, (1, nrow, ncol)
, (2, nrow, 1)
, (2, 1, ncol)
, (2, nrow, ncol)
, (3, nrow, 1)
, (3, 1, ncol)
, and (3, nrow, ncol)
to cover all bases.
from flopy.
Changes were needed to the way we determine which face each flow belongs to, while iterating through the intercell flow matrix to build right/front/lower face arrays.
In the given model, flows with m - n == ncol
go to lower face as noted by @vcantarella. Previously the logic was
- 0 (right) if
m - n == 1
- 1 (front) if
m - n == ncol
- 2 (lower) otherwise
With #1968 it becomes
- 0 (right) if
m - n == 1
- 2 (lower) if
m - n == ncpl
- 1 (front) otherwise
But this is not generic, it only works if the grid is extended (has multiple cells) in all 3 dimensions. Special treatment is added for "degenerate" cases among those listed above by @jdhughes-usgs
from flopy.
Related Issues (20)
- VoronoiGrid creates "polygons" with less than 3 vertex pairs HOT 3
- bug: LGR utility CDIST is 2D, MF6 GWFGWF expects 3D HOT 2
- bug: `np.alltrue` will be deprecated in numpy 2.0 HOT 1
- bug: Budget from transport model listing file is not returned
- PlotMapView resets limits of existing axes to entire model domain HOT 10
- bug: gridintersect does not work for rotated vertex grids
- bug: Stack trace terminated abnormally. HOT 2
- bug: MF6 does not recognize the option name "BUDGETCSV" in LAK package written by FloPy (odd whitespace characters?) HOT 4
- bug: gwf.modeltime.steady_state inconsistent with input/output HOT 2
- bug: mf6 package name alters behavior with flopy HOT 1
- feat: support kper column in stress period recarray/dataframe input data
- bug: irch for rch and evt packages HOT 1
- bug: possible error detected in cvfd_utils cell centroids function shapefile_to_xcyc HOT 7
- bug: Grid intersect taking excessively long on simple voronoi grid HOT 6
- NumPy 2.0 compatibility HOT 2
- feat: list all simulation files
- feature: flopy.discretization.unstructuredgrid.intersect...but in 3D!? HOT 4
- bug: Plotting water table for Unstructured Grid HOT 3
- bug: check.py inconsistancies/errors
- feature: speed-up resample_to_grid HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flopy.