Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make_ijk_from_grid method does not work as expected #1292

Open
oreiiikin opened this issue Jan 15, 2025 · 2 comments
Open

make_ijk_from_grid method does not work as expected #1292

oreiiikin opened this issue Jan 15, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@oreiiikin
Copy link

oreiiikin commented Jan 15, 2025

I was trying to match measurements from wells (stored in a dataframe) with grid cells in grdecl format. However, the make_ijk_from_grid method does not seem to work quite correctly, for some reason it does not find the cell, although the measurement from the well gets there absolutely accurately, indexing simply stops at some point for some unknown reason. I'm attaching an example and a code snippet.

for well in tqdm(pd.unique(wells_df['well'])):
    wells_dict[well]["df"] = copy(wells_df[wells_df['well'] == well])
    wells_dict[well]["df"] = wells_dict[well]["df"][["X", "Y", "TVDSS"]]
    wells_dict[well]["df"].columns = ["X_UTME", "Y_UTMN", "Z_TVDSS"]
    wells_dict[well]["xtgeo_well"] = xtgeo.Well(df=wells_dict[well]["df"])
    wells_dict[well]["xtgeo_well"].make_ijk_from_grid(
        grid=grid,
        activeonly=False
    )

Image

@mferrera mferrera added the bug Something isn't working label Jan 16, 2025
@mferrera
Copy link
Collaborator

mferrera commented Jan 16, 2025

Thanks very much for reporting, we'll take a look into this. In the mean time, you could give

wells_dict[well]["xtgeo_well"].make_ijk_from_grid(
    grid=grid,
    activeonly=False,
    algorithm=2
)

a try, but it is possible the bug exists there too :-)

@oreiiikin
Copy link
Author

Thank you very much for a quick answer! "algorithm=2" is default parameter, so it probably won't give any positive result. It seems like the problem is occurred in C routine function "grd3d_points_ijk_cells.c".

I also get warning "splits or overlaps between vertical neighbouring cells is detected." when reading grid with "grid_from_file", likely because it has faults and so on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants