Fast Approximate Hydrodynamic Simulation with Deep Neural Networks


Pavel Temirchev

Scientific advisor:

Dmitry Koroteev

Individual Doctoral Committee:

Dmitry Koroteev

Evgeny Burnaev

Ivan Oseledets

Our team:
Pavel Temirchev, Ruslan Kostoev, Egor Illarionov, Dmitry Voloskov, Anna Gubanova

Motivation

  • Petroleum Engineers are interested in modeling liquid flow inside oil reservoirs
     
  • They solve the system of PDEs for multiphase flow in a porous medium
     
  • Finite Differences and Finite Volumes are in use
     
  • The modelling is slow!
     
  • Multivariate simulation is also required:
    • production optimization
    • inverse problems

Hydrodynamical Reservoir Simulation

Finite-Differences modelling

The standard approach (ECLIPSE, TNAVIGATOR, OPM-FLOW)

\sim O(n^\alpha), \;\;\;\; \alpha=2\div3
\text{PDE\_solver}(s_0, \theta, u)

Time

initial conditions

PDE coefficients

boundary conditions

The computational complexity depends on the number of computational cells (the complexity of matrix inversion)

\theta
u_0
s_0
\frac{\partial s_0}{\partial t}
\frac{\partial s_1}{\partial t}
\frac{\partial s_2}{\partial t}
u_1
u_2
u_3

Prior art

ROMs:

  • Dynamic Mode Decomposition
    P.J. Schmid (2010). “Dynamic mode decomposition of numerical and experimental data”
    J.L. Proctor, S.L. Brunton, J.N. Kutz (2014). “Dynamic mode decomposition with control”
  • Galerkin-POD projection
    T. Lassila, A. Manzoni, A. Quarteroni, G. Rozza (2014). “Model order reduction in fluid dynamics: challenges and perspectives”
    S. Chaturantabut, D.C. Sorensen (2010). “Nonlinear model reduction via discrete empirical interpolation”
  • Deep Residual Recurrent Neural Networks
     J.N. Kani, A.H. Elsheikh (2018). “Reduced order modeling of subsur-face multiphase flow models using deep residual recurrent neural networks”
  • Embed to Control
    M. Watter, J. Springenberg, J. Boedecker, M. Riedmiller (2015). “Embed to control: A locally linear latent dynamics model for control from raw images”
    Z.L Jin, Y. Liu, L.J. Durlofsky (2020). “Deep-learning-based surrogate model for reservoir simulation with time-varying well controls”
  • LSTM + Variational Autoencoder model
    P. Temirchev, M. Simonov, R. Kostoev, E. Burnaev, I. Oseledets, A. Akhmetov, A. Margarit, A. Sit- nikov, D. Koroteev (2020). “Deep neural networks predicting oil movement in a development unit”

Supervised Machine Learning

"Cat"

"Cat"

"Dog"

"Giraffe"

Object
Target variable

The training set of reservoirs

Object - a reservoir
Target - the solution

How to find the target variable for an object?

  • initial conditions
  • PDE coefficients
  • boundary conditions
Commercial Simulator
  • solution for all \(t\)

NDE-b-ROM model:

Neural Differential Equations based Reduced Order Model

Time

\theta
u_{0:T}
s_0
\frac{\text{d}z_1}{\text{d}t}
\frac{\text{d}z_2}{\text{d}t}
z_1
z_2
z_3

ENCODER

\tilde\theta
\tilde{u}_{0:T}
z_0
\frac{\text{d}z_0}{\text{d}t}

DECODER

DECODING

ENCODING

DERIVATIVES

Conv3d_3x3, 8ch

Conv3d_3x3, 16ch, str=2

Conv3d_3x3, 32ch

Conv3d_3x3, 32ch,

str=2

Conv3d_3x3, 64ch

Conv3d_3x3, 64ch

(s_0, \theta, u_{0:T})
(z_0,\tilde \theta, \tilde u_{0:T})

Transp3d_3x3, 16ch

Transp3d_3x3, 8ch

Transp3d_3x3, 32ch, str=2

Transp3d_3x3, 32ch

Transp3d_3x3 64ch, str=2

Transp3d_3x3 64ch

(s_t)
(z_t)

VGG-like autoencoder, LINK

(z_t,\tilde \theta, \tilde u_t)

ReLU

Conv3d_3x3, 32ch

ReLU

Conv3d_3x3, 4ch

(\frac{dz_t}{dt})

Neural Ordinary Differential Equations, LINK

Neural Networks training

Minimisation problem

\mathbb{E}_{s_0, \theta, u} \sum_t ||s_t - \hat s_t||^2_2 \rightarrow \min_\phi
z_0 = E_s(s_0)
z_{t} = z_{t-1} + \frac{dz}{dt}(z_{t-1}, \tilde\theta, \tilde u_{t-1})\Delta t
\hat s_t = D(z_t)
\tilde\theta = E_\theta(\theta)
\tilde u = E_u(u)

\(\phi\) - a vector of neural network parameters

\(\hat{s}_{0:T}\) - the solution obtained as follows:

1. encoding:

2. latent space forecast:

3. decoding:

\frac{dz}{dt}(z_{t-1}, \tilde\theta, \tilde u_{t-1})
z_{t} = z_{t-1} + \frac{dz}{dt}(z_{t-1}, \tilde\theta, \tilde u_{t-1})\Delta t

stochastic optimization

backpropagation + ADAM

a neural network

  • As fast as the standard convolutional layer
  • Only active cells are stored in the memory
  • Can take distances into account

Convolutions on regular graphs

x_0^{l+1} = \sigma \Big([ x_0^l, x_1^l, x_2^l, x_3^l, \text{na}^l] \cdot w^l +bias^l\Big)
\text{na}^l - \text{filler for non-active cell 4}
0
1
2
3
4

view from above

Average on the Z axis:

x_{ij} = \frac{1}{n_z}\sum_k x_{ijk}

wells

Experimental results (on toy example)

tNavigator

NDE-b-ROM

Pressure

Oil saturation

Tightly approximates
commercial solutions

oil field Х

Computational time results

Compared with commercial simulator tNavigator

 
Time, sec
​Model
​NDE-b-ROM
tNavigator
1 GPU
20 sec
40 CPU
2400 sec

Tested on:

  • large real oil reservoir
    with more than 6.000.000 of active cells
  • non-linear well trajectories, fish-bones
  • 40 years of simulation

Technical details

Open-source repository DeepField

​           formatted files created either by hand or in model designer

RUNSPEC

GRID

PROPS

SOLUTION

SCHEDULE

​.DATA

​Can be used as:

  • ​python library
  • separate software with GUI

Supports CUDA and Pytorch computations 

Provides output within diverse formats:

  • ECLIPSE binary
  • Pytorch \ numpy
  • other...

 

 

1

Publications

 

Publications

 

Conclusions

Positive:

  • The speed up is around 100x times
  • Open-source library was developed
  • Good approximation on fixed oil field

Negative:

  • Dataset generation - is an extremely complex task!
  • Have made experiments on huge oil fields
  • Hard to extend the model

A gridless approximate solution for a PDE

An example

The diffusivity equation:
 

$$ \nabla \cdot \nabla p(t, x) + q(t, x) = \alpha \frac{\partial p}{\partial t} \;\;\; \forall t, x \in \mathcal{X} \times \mathcal{T}$$

$$ s.t. \;\; \nabla p(t, x) = 0 \;\;\; \forall t, x \in \mathcal{B} \times \mathcal{T}$$

$$ s.t \;\; p(0, x) = p_0(x) \;\;\; \forall x \in \mathcal{X}. $$
 

The set of proper points: \( \mathcal{X} = (0, x_{max}) \).

The set of boundary points: \( \mathcal{B} = \{0, x_{max} \} \).

The set of source points: \( \mathcal{S} = [x_{s0}, x_{s1}] \).

A gridless approximate solution for a PDE

An example

Let \( f_\theta(t, x) \) be a NN with parameters \(\theta\).

The NN will converge to a true PDE solution if the loss is zero:

$$ \mathcal{L}(\theta) = \mathbb{E}_{(t, x) \sim (\mathcal{T} \times \mathcal{X})} \left[ \left( \nabla \cdot \nabla f_\theta(t, x) + q(t, x) \right) - \alpha \frac{\partial f_\theta}{\partial t}(t, x) \right]^2 + $$

$$ + \mathbb{E}_{x \sim \mathcal{X}} \left[ f_\theta(0, x) - p_0(x) \right]^2 + $$

$$ + \mathbb{E}_{(t, x) \sim (\mathcal{T} \times \mathcal{B})} \left[ \nabla f_\theta(t, x) \right]^2 $$

Non-linearity matters!

Results

For 1d and 2d non-linear diffusivity PDE

Thank you!
 

Questions?

Made with Slides.com