Giter VIP home page Giter VIP logo

skoltech-chr / deepfield Goto Github PK

View Code? Open in Web Editor NEW
106.0 4.0 34.0 17.11 MB

Machine learning framework for reservoir simulation

License: Apache License 2.0

Shell 0.01% Python 3.43% C++ 75.44% HTML 0.01% Dockerfile 0.01% Assembly 0.03% Pascal 0.01% Jupyter Notebook 20.14% POV-Ray SDL 0.93%
reservoir-simulation oil-and-gas reservoir-engineering machine-learning neural-network petroleum-engineering

deepfield's Introduction

Python Pytorch

DeepField

Machine learning framework for reservoir simulation.

img

Features

  • reservoir representation with Grid, Rock, States, Wells, Aquifer and PVT-tables components
  • interactive 3D visualization with some advanced options
  • common reservoir preprocessing tools
  • working with arbitrary large datasets of field simulations
  • constructor of neural network models
  • generative models for field augmentation
  • various model training scenarios for arbitrary long simulation periods
  • detailed documentation and step-by-step tutorials
  • complete pipelines of the reservoir simulation steps

img

Installation

Clone the repository:

git clone https://github.com/Skoltech-CHR/DeepField.git

Working with a remote server, it is recommended to install VNC for remote rendering of 3D graphics (follow this instruction)

Another option is to build the docker image with DeepField inside. Instructions and dockerfile are provided in the docker directory.

Note: the project is in developement. We welcome contributions and collaborations.

Quick start

Load a reservoir model from .DATA file:

  from deepfield import Field

  model = Field('model.data').load()

See the tutorials to explore the framework step-by-step and the documentation for more details.

Model formats

Initial reservoir model can be given in a mixture of ECLIPSE, MORE, PETREL, tNavigator formats. However, there is no guarantee that any mixture will be understood. Main file should be in .DATA file. Dependencies can be text and binary files including common formats:

  • .GRDECL
  • .INC
  • .RSM
  • .UNRST
  • .RSSPEC
  • .UNSMRY
  • .SMSPEC
  • .EGRID
  • .INIT

Within the DeepField framework it is recommended to use the HDF5 format to speed up data load and dump in Python-friendly data formats. In this case all data are contained in a single .HDF5 file. At any point the model can be exported back into .DATA text and binary files to ensure a compatibility with conventional software.

Citing

Plain text

E. Illarionov, P. Temirchev, D. Voloskov, R. Kostoev, M. Simonov, D. Pissarenko, D. Orlov, D. Koroteev, 2022. End-to-end neural network approach to 3D reservoir simulation and adaptation. J. Pet. Sci. Eng. 208, 109332. https://doi.org/10.1016/j.petrol.2021.109332

BibTex

@article{ILLARIONOV2022109332,
author = {E. Illarionov and P. Temirchev and D. Voloskov and R. Kostoev and M. Simonov and D. Pissarenko and D. Orlov and D. Koroteev},
title = {End-to-end neural network approach to 3D reservoir simulation and adaptation},
journal = {Journal of Petroleum Science and Engineering},
volume = {208},
pages = {109332},
year = {2022},
issn = {0920-4105},
doi = {https://doi.org/10.1016/j.petrol.2021.109332},
url = {https://www.sciencedirect.com/science/article/pii/S0920410521009827}
}

deepfield's People

Contributors

illarionovea avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

deepfield's Issues

dataset.calculate_statistics() error

Greetings,

Thanks for sharing this work!

I went through the tutorials but got stuck in the calculation of the statistics for the FieldDataset in Tutorial #8 (Dataset and Sample). The cell, and error message obtained are pasted below.

I should mention that the STATES shape from the previous cell yields a dimension of: [1, 248, 5, 46, 112, 22]. Is this what you expect?

Any comments on how to fix this will be much appreciated.

Thanks,
Femi


dataset = FieldDataset(src=field, sample_attrs=sample_attrs, allow_change_preloaded=True)
dataset.calculate_statistics()
sample = next(iter(dataset))



IndexError Traceback (most recent call last)
Input In [15], in <cell line: 2>()
1 dataset = FieldDataset(src=field, sample_attrs=sample_attrs, allow_change_preloaded=True)
----> 2 dataset.calculate_statistics()
3 sample = next(iter(dataset))

File ~/anaconda3/envs/py3p8/lib/python3.8/site-packages/DeepField-0.1.0-py3.8.egg/deepfield/datasets/datasets.py:610, in FieldDataset.calculate_statistics(self)
607 maxim[comp] = {attr: [] for attr in self.sample_attrs[comp]}
609 for i in range(len(self)):
--> 610 m, m_sq, mn, mx = self._get_model_statistics(i)
611 for comp in m:#pylint:disable=consider-using-dict-items
612 for attr in m[comp]:

File ~/anaconda3/envs/py3p8/lib/python3.8/site-packages/DeepField-0.1.0-py3.8.egg/deepfield/datasets/datasets.py:635, in FieldDataset._get_model_statistics(self, idx)
633 def _get_model_statistics(self, idx):
634 """Get mean and mean of squares for the attributes of the model."""
--> 635 sample = self._get_sample(idx)
636 mean, mean_of_squares, minim, maxim = {}, {}, {}, {}
637 for comp in sample.keys():

File ~/anaconda3/envs/py3p8/lib/python3.8/site-packages/DeepField-0.1.0-py3.8.egg/deepfield/datasets/datasets.py:180, in FieldDataset._get_sample(self, idx)
178 if isinstance(self.preloaded[idx], FieldSample):
179 return self.preloaded[idx]
--> 180 model = self._get_preloaded(idx)
182 sample = {}
183 getter_kwargs = dict(
184 sequence_subset=sequence_subset, fill_invalid_neighbours=INVALID_VALUE_FILLER, neighbouring_radius=1
185 )

File ~/anaconda3/envs/py3p8/lib/python3.8/site-packages/DeepField-0.1.0-py3.8.egg/deepfield/datasets/datasets.py:236, in FieldDataset._get_preloaded(self, idx)
234 model.wells.drop_outside()
235 if model.meta['MODEL_TYPE'] == 'ECL':
--> 236 model.wells.compute_events(grid=model.grid)
237 else:
238 assert model.state.spatial == self.unravel_model

File ~/anaconda3/envs/py3p8/lib/python3.8/site-packages/DeepField-0.1.0-py3.8.egg/deepfield/field/decorators.py:225, in instance_check..decorator..wrapper(self, *args, **kwargs)
222 if not valid(self):
223 raise ValueError('State of {} is not valid for applying {}.'
224 .format(self.class.name, method.name))
--> 225 return method(self, *args, **kwargs)

File ~/anaconda3/envs/py3p8/lib/python3.8/site-packages/DeepField-0.1.0-py3.8.egg/deepfield/field/decorators.py:120, in apply_to_each_segment..decorator(self, *args, **kwargs)
118 if not include_groups and segment.is_group:
119 continue
--> 120 res.append(method(self, segment, *args, **kwargs))
121 if isinstance(res[0], self.class):
122 return self

File ~/anaconda3/envs/py3p8/lib/python3.8/site-packages/DeepField-0.1.0-py3.8.egg/deepfield/field/wells.py:521, in Wells.compute_events(self, segment, grid, attr)
519 wcon = wcon.sort_values('DATE').reset_index(drop=True)
520 df['DATE'] = wcon['DATE']
--> 521 dref_index = np.argmin(segment.perforated_blocks()[:, 2])
522 dref_index = segment.perforated_blocks()[:, :3][dref_index]
523 df['DREF'] = grid.cell_centroids[dref_index[0], dref_index[1], dref_index[2]][2]

IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.