-
Notifications
You must be signed in to change notification settings - Fork 2
/
upscaling.tex
405 lines (318 loc) · 10.5 KB
/
upscaling.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
\documentclass[UKenglish,10pt]{beamer}
\usepackage{amsmath, amsfonts, amssymb}
\usepackage{pgf, tikz, bbm, svn}
\usepackage[latin1]{inputenc}
\usepackage{listings}
\lstset{language=C++, basicstyle=\tiny}
\newcommand{\Code}[1]{\texttt{#1}}
\usefonttheme{professionalfonts}
\definecolor{sintefblue}{rgb}{0.0,0.2,0.4}
\definecolor{dr}{rgb}{0.6,0.0,0.0}
\definecolor{dg}{rgb}{0.0,0.3,0.0}
\definecolor{db}{rgb}{0.0,0.0,0.5}
\setbeamercolor{uppercol}{fg=white,bg=sintefblue!80}
\setbeamercolor{lowercol}{fg=orange,bg=black!15}
\newcommand{\COto}{CO\ensuremath{_\mathsf{2}}}
\newcommand{\Tensor}[1]{\ensuremath{\mathsf{#1}}}
\newcommand{\Vector}[1]{\ensuremath{\boldsymbol{#1}}}
\newcommand{\Matrix}[1]{\ensuremath{\boldsymbol{#1}}}
\newcommand{\T} {\ensuremath{\mathsf{T}}}
\newcommand{\Grad} {\ensuremath{\nabla}}
\newcommand{\dunemod}[1]{\textsl{dune-{#1}}}
\newcommand{\opmmod} [1]{\textsl{opm{#1}}}
\newcommand{\dumux} {DuMu\ensuremath{^{\mathrm X}}}
\def\bfK{{\bf K}}
\def\bfv{{\bf v}}
\def\bfn{{\bf n}}
\DeclareMathOperator{\Div}{div}
\usepackage{listings}
\usepackage{color}
\usepackage{textcomp}
\definecolor{listinggray}{gray}{0.9}
\definecolor{lbcolor}{rgb}{0.95,0.95,0.95}
\definecolor{lightgray}{gray}{0.3}
\lstset{%
xleftmargin= 4pt,
xrightmargin=4pt}
\lstdefinelanguage{MRST}{%
alsoletter={...},%
morekeywords={% % keywords
break,case,catch,continue,elseif,else,end,for,function,global,%
if,otherwise,persistent,return,switch,try,while,...},%
comment=[l]\%,% % comments
morecomment=[l]...,% % comments
morestring=[m]',% % strings
}[keywords,comments,strings]%
\lstset{
backgroundcolor=\color{lbcolor},
tabsize=4,
rulecolor=,
language=MRST,
basicstyle=\small,
upquote=true,
aboveskip={0.5\baselineskip},
columns=flexible,
showstringspaces=false,
extendedchars=true,
% breaklines=true,
prebreak = \raisebox{0ex}[0ex][0ex]{\ensuremath{\hookleftarrow}},
frame=single,
showtabs=false,
showspaces=false,
showstringspaces=false,
identifierstyle=\ttfamily,
keywordstyle=\color[rgb]{0,0,1},
commentstyle=\color[rgb]{0.133,0.545,0.133},
stringstyle=\color[rgb]{0.627,0.126,0.941},
}
\newcommand{\mcode}[1]{\lstinline|#1|}
\tikzset{Workflow Stage/.style=%
{rectangle, draw=blue!50, fill=blue!20, thick, %
text width=35mm}}
\title{Upscaling}
\author[Atgeirr F. Rasmussen]{Atgeirr Fl{\o} Rasmussen}
\institute[SINTEF]{SINTEF ICT, Dept. Applied Mathematics}
\date[2017--01--25]{25th January 2017}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
%============================================
\section{Upscaling}
%============================================
%--------------------
\begin{frame}
\frametitle{Upscaling, what and why?}
Upscaling means computing \emph{effective parameters} for a coarse
scale simulation from fine-scale properties.
\bigskip
Examples include porosity, permeability, relative permeability,
capillary pressure.
\bigskip
\includegraphics[width=\textwidth]{figs/OPM-Upscaling.png}
Upscaling is popular because:
\begin{enumerate}
\item Porous media flows are multi-scale phenomena.
\item Large number of grid cells are necessary for accuracy.
\item Complex physics make problems hard to compute with high
resolution in reasonable time.
\end{enumerate}
\end{frame}
%--------------------
% \begin{frame}
% \frametitle{Alternatives to upscaling}
% Recent \emph{multi-scale} methods can be viewed as an alternative to upscaling.
% \bigskip
% Example: Multiscale mixed FEM methods.
% \includegraphics[width=0.9\textwidth]{figs/nornePartitionWithCells}
% Compared to permeability upscaling:
% \begin{itemize}
% \item coarse scale basis functions resolve fine-grid effects better
% \item may recompute (some) basis functions when flow patterns change
% \item much greater coarse block flexibility
% \end{itemize}
% \end{frame}
%--------------------
\begin{frame}
\frametitle{Single-phase upscaling}
In single-phase upscaling we seek to compute \emph{effective
coarse-scale permeabilities} by solving fine-scale flow problems.
\begin{columns}[c]
\column{0.6\textwidth}
\includegraphics[width=\textwidth]{figs/wave_orig}
\column{0.4\textwidth}
Fine-scale permeability field.
\end{columns}
89791 cells, approximately $40 \times 40 \times 6$ cm, upscaled permeability
\[
\bfK_{eff} =
\begin{pmatrix}
156.11 & 0 & 0 \\
0 & 161.81 & 0 \\
0 & 0 & 31.25 \\
\end{pmatrix}
\]
\end{frame}
%--------------------
\begin{frame}
\frametitle{Flow-based upscaling approach}
For a unit-sqare fine-scale domain $[0,1]^2$, solve the
single-phase pressure equation with boundary conditions:
\begin{columns}
\column{0.3\textwidth}
\begin{tikzpicture}
\draw (0,0)
-- node[below]{$\bfv\cdot\bfn = 0$} (2,0)
-- node[right]{$p = 0$} (2,2)
-- node[above]{$\bfv\cdot\bfn = 0$} (0,2)
-- node[left]{$p = 1$} (0,0);
\end{tikzpicture}
\column{0.7\textwidth}
\begin{align*}
\nabla\cdot\bfv & = 0 \\
\bfv & = -\bfK\nabla p \\
\end{align*}
\end{columns}
\bigskip
From solution, compute average velocity over boundaries and estimate
$\bfK_{eff}$ for the block (x direction) from Darcy's law. Repeat for
other directions.
\bigskip
To apply this method, the domain must be reasonably close to a shoe-box.
\end{frame}
%--------------------
\begin{frame}
\frametitle{Other boundary conditions}
Alternative boundary conditions are possible:
\begin{columns}
\column{0.5\textwidth}
\begin{tikzpicture}
\draw (0,0)
-- node[below]{$p = 1 - x$} (2,0)
-- node[right]{$p = 0$} (2,2)
-- node[above]{$p = 1 - x$} (0,2)
-- node[left]{$p = 1$} (0,0);
\end{tikzpicture}
\column{0.5\textwidth}
\begin{tikzpicture}
\draw (0,0)
-- (2,0)
-- node[right]{$p(1,y) = p(0,y) + 1$} (2,2)
-- node[above]{$p(x,1) = p(x,0)$} (0,2)
-- (0,0);
\end{tikzpicture}
\end{columns}
\bigskip
For linear BCs (left) we get a full tensor, which may not be symmetric.
\bigskip
For periodic BCs (right) we get a full, symmetric tensor.
\end{frame}
%--------------------
% \begin{frame}[fragile]
% \frametitle{The class \Code{SinglePhaseUpscaler}}
% The class SinglePhaseUpscaler implements the method.
% \begin{lstlisting}
% ...
% /// Initializes the upscaler from parameters.
% void init(const parameter::ParameterGroup& param);
% /// Does a single-phase upscaling.
% /// @return an upscaled permeability tensor.
% permtensor_t upscaleSinglePhase();
% /// Compute upscaled porosity.
% /// @return total pore volume of all cells divided by total volume.
% double upscalePorosity() const;
% ...
% \end{lstlisting}
% \end{frame}
%--------------------
\begin{frame}
\frametitle{Steady-state upscaling}
We use steady-state upscaling to upscale relative permeabilities in
the presence of nonzero capillary pressure.
\bigskip
Idea: Simulate till steady state reached, use the steady saturation
distribution for upscaling computations.
\bigskip
To do this we simulate two-phase flow with:
\begin{itemize}
\item pressure BCs as for single-phase flow
\item either periodic BCs for saturation, or some given inflow saturation
\end{itemize}
The resulting properties depend on the pressure drop! \\
(transition from capillary limit to viscous limit)
\end{frame}
%--------------------
% \begin{frame}[fragile]
% \frametitle{The class \Code{SteadyStateUpscaler}}
% The template class \Code{SteadyStateUpscaler} implements the
% algorithm. The \Code{Traits} allow us (for example) to use either
% scalar and tensor relative permeabilities.
% \begin{lstlisting}
% template <class Traits>
% class SteadyStateUpscaler : public UpscalerBase<Traits>
% {
% std::pair<permtensor_t, permtensor_t>
% upscaleSteadyState(const int flow_direction,
% const std::vector<double>& initial_saturation,
% const double boundary_saturation,
% const double pressure_drop,
% const permtensor_t& upscaled_perm);
% const std::vector<double>& lastSaturationState() const;
% double lastSaturationUpscaled() const;
% ...
% };
% \end{lstlisting}
% \end{frame}
%--------------------
\begin{frame}
\frametitle{Upscaling}
\begin{itemize}
\item Permeability (single-phase)
\item Relative permeability (two-phase)
\end{itemize}
\bigskip
This line of work started before OPM (first delivery 2006)
\begin{columns}[c]
\column{0.5\textwidth}
\includegraphics[width=1.2\textwidth]{figs/wave_orig_angled}
\column{0.5\textwidth}
\small
\begin{equation*}
\overline{K} =
\left(
\begin{array}{ccc}
156.1 & 0 & 0 \\
0 & 161.8 & 0 \\
0 & 0 & 31.25
\end{array}
\right)
\end{equation*}
(using Fixed boundary conditions)
\begin{equation*}
\overline{K} =
\left(
\begin{array}{ccc}
155.3 & -0.0872 & 0.1651 \\
-0.0872 & 158.4 & 0.0052 \\
0.1652 & 0.0052 & 29.09
\end{array}
\right)
\end{equation*}
(using Periodic boundary conditions)
\end{columns}
\end{frame}
%--------------------
\begin{frame}
\frametitle{Upscaling: permeability}
\begin{itemize}
\item Flow-based: solve directional pressure problems
\item Much more accurate than harmonic averaging etc.
\item Mimetic discretization of pressure
\item Linear solver: dune-istl AMG (or FastAMG)
\item Fixed, Linear or Periodic boundaries
\item Produces symmetric tensor (with periodic bondaries)
\end{itemize}
\bigskip
In wide use in Statoil.
\end{frame}
%--------------------
\begin{frame}
\frametitle{Upscaling: relative permeability}
\begin{block}{Approach used: steady-state upscaling}
\begin{itemize}
\item Compute a steady-state for given configuration
\item Depends on flow direction, pressure drop, initial saturation
\item Compute upscaled perm based on phase mobilities
\item Produces full tensor relperm as output
\end{itemize}
\end{block}
\begin{block}{Computing steady states}
Simple for CL, VL. Between those, must simulate.
\begin{itemize}
\item Two-phase incompressible, immiscible flow
\item Include capillary pressure, gravity
\item Fixed, Linear or Periodic bondaries
\item Pressure: mimetic discretization, AMG
\item Saturation: TPFA discretization, explicit or implicit Euler
\end{itemize}
\end{block}
\end{frame}
\end{document}