{"id":405,"date":"2015-11-04T14:32:15","date_gmt":"2015-11-04T14:32:15","guid":{"rendered":"http:\/\/95.85.43.55\/?page_id=405"},"modified":"2022-04-20T13:11:29","modified_gmt":"2022-04-20T13:11:29","slug":"permeability-upscaling-with-opm","status":"publish","type":"page","link":"https:\/\/opm-project.org\/?page_id=405","title":{"rendered":"Permeability upscaling with OPM"},"content":{"rendered":"<p>This tutorial will show you how to do flow-based permeability upscaling with OPM. We are going to use an example model\u00a0distributed as a test case with the opm-upscaling module:<\/p>\n<figure id=\"attachment_414\" aria-describedby=\"caption-attachment-414\" style=\"width: 1397px\" class=\"wp-caption alignnone\"><a href=\"\/\/opm-project.org\/wp-content\/uploads\/2015\/11\/hummocky_upscaling.png\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-414 size-full\" src=\"\/\/opm-project.org\/wp-content\/uploads\/2015\/11\/hummocky_upscaling.png\" alt=\"A model with eroded layers\" width=\"1397\" height=\"1034\" \/><\/a><figcaption id=\"caption-attachment-414\" class=\"wp-caption-text\">A model with eroded layers<\/figcaption><\/figure>\n<p>The tutorial assumes that you are familiar with Linux, have Ubuntu 14.04 installed, and are allowed to run the\u00a0<code>sudo<\/code>\u00a0command.<\/p>\n<p>We will explain the basics of upscaling, how to\u00a0install the required tools, download a test dataset, run the upscaling program, and understand the\u00a0results.<\/p>\n<p><!--nextpage--><\/p>\n<h4>What is flow-based permeability upscaling?<\/h4>\n<p>In reservoir simulation multiple scales are useful to consider: from pore-scale all the way up to full field scale. Often one may have some knowledge of the petrophysical properties (permeability, porosity) of a field\u00a0at a finer scale than one is able to use in a simulation, due to time or memory constraints.<\/p>\n<p>In such situations, it is useful to simulate on a coarser scale than that on which the properties are defined. However, properties appropriate to that larger scale are then needed,\u00a0and these properties must in a faithful way represent the fine-scale information.<\/p>\n<p>While porosity is simple to upscale, since it is just the ratio of pore volume to total volume, permeability is not so simple, since it should induce the same flow as the fine-scale permeability. While there are analytic solutions for simple cases (such as a layered structure with uniform layers), for more heterogenous cases such methods cannot produce coarse-scale permeabilities that preserve the major features of the fine-scale flow.<\/p>\n<p>Flow-based upscaling is one method that aims to solve this problem. It consists of solving several flow (pressure) problems on the fine scale, and computing coarse-scale permeability tensors to be consistent with the solutions to the fine-scale problems. There are two further variants: global upscaling, where the solutions of\u00a0a few global fine-scale problems are\u00a0used, and local upscaling, where the solutions of many local fine-scale problems are used.<\/p>\n<p>The OPM upscaling module implements local flow-based permeability upscaling.<\/p>\n<p><!--nextpage--><\/p>\n<h4>Installing\u00a0the required software<\/h4>\n<p>Details on installing OPM on different platforms is outside the scope of this tutorial.\u00a0Here we outline the few steps required to install the\u00a0<code>opm-upscaling<\/code>\u00a0module on Ubuntu 14.04 using the Personal Package Archive, or PPA. You may not need to do these steps if you already followed the <a href=\"\/\/opm-project.org\/?page_id=197\">Flow tutorial<\/a>, or are running in a virtual machine that has already been set up as in the <a href=\"\/\/opm-project.org\/?page_id=294\">virtual machine tutorial<\/a>.<\/p>\n<p>First, add\u00a0the PPA by using the following commands in a terminal:<\/p>\n<pre>sudo apt-get update\r\nsudo apt-get install software-properties-common\r\nsudo apt-add-repository ppa:opm\/ppa\r\nsudo apt-get update<\/pre>\n<p>You will be asked several questions if you want to do this, and you should answer yes.<\/p>\n<p>Once the PPA is added, you can install the binary OPM package for the upscaling tools\u00a0with the following command:<\/p>\n<pre>sudo apt-get install libopm-upscaling1-bin<\/pre>\n<p><!--nextpage--><\/p>\n<h4>Download the model<\/h4>\n<p>There are some models in the opm-upscaling module that are used for testing purposes. We will use one of those models as an example.<\/p>\n<p>The simplest way to obtain it\u00a0is to download it\u00a0from Github:<\/p>\n<pre>wget https:\/\/raw.githubusercontent.com\/OPM\/opm-upscaling\/master\/tests\/input_data\/grids\/Hummocky.grdecl<\/pre>\n<p>The file is 603 KB, and contains a corner-point grid model with porosity and permeability. You can use <a href=\"\/\/opm-project.org\/?page_id=117\">ResInsight<\/a>\u00a0to inspect the model and its properties.<\/p>\n<p>ParaView can also be used to view the model, but that requires first creating a VTU file for ParaView, this can be done using the grdecl2vtu program, if you want to do this perform the steps below:<\/p>\n<pre>sudo apt-get install libdune-cornerpoint1-bin\r\ngrdecl2vtu Hummocky.grdecl<\/pre>\n<p><!--nextpage--><\/p>\n<h4>Upscaling<\/h4>\n<p>Note: this page is outdated, the program upscale_perm should be used instead of upscale_singlephase. Usage and parameters is different!<\/p>\n<p>The upscale_singlephase program requires some parameters to choose what model to run, boundary condition types etc. While they can be specified on the command line, is is more convenient to put them in a file. Write the following three lines to a file, and call it <code>upscale.param<\/code>. (Note that it is important to have no extra spaces around the &#8220;=&#8221; signs.)<\/p>\n<pre>fileformat=eclipse\r\nfilename=Hummocky.grdecl\r\nboundary_condition_type=0<\/pre>\n<p>Then you run the case by entering the command:<\/p>\n<pre>upscale_singlephase upscale.param<\/pre>\n<p>That produces quite a bit of output (parameters used, some numerical diagnostics), but the important part is at the bottom:<\/p>\n<pre>Upscaled K in millidarcy:\r\n146.257140761845 0 0 \r\n0 149.445786241513 0 \r\n0 0 10.0629512956922<\/pre>\n<p>The permeability is output as a full tensor, and you can see that the Z-direction permeability is significantly lower than the X- and Y-directions, which is not surprising given that the model has many layers.<\/p>\n<p><!--nextpage--><\/p>\n<h4>Changing boundary conditions<\/h4>\n<p>You may notice that the actual upscaled permeability is diagonal. This is due to the boundary conditions used in solving the flow problems during the upscaling. The upscaling approach solves for the flow three times, one for each cardinal direction (X, Y, Z). There are three different options for the boundary conditions used:<\/p>\n<ul>\n<li><em>Fixed boundary conditions<\/em>. Pressure is set to 1 on the inflow and 0 on the outflow sides\u00a0(X- and X+ for the X direction), and no-flow Neumann conditions are used on the other sides. This corresponds to boundary_condition_type=0, and produces diagonal tensors.<\/li>\n<li><em>Linear\u00a0boundary conditions<\/em>. Pressure is set to 1 on the inflow and 0 on the outflow\u00a0sides, and linear (from 1 down to 0)\u00a0Dirichlet conditions are used on the other sides.\u00a0This corresponds to boundary_condition_type=1, and produces a full\u00a0tensor, which may not be symmetric however.<\/li>\n<li><em>Periodic\u00a0boundary conditions<\/em>. Modified periodic Dirichlet conditions are set on all sides. On the inflow side the pressure\u00a0is set to (1 + the outflow\u00a0side pressure), and on the other sides pressure is set to be everywhere equal to its periodic neighbour (on the opposite side).\u00a0This corresponds to boundary_condition_type=2, and produces\u00a0a full, symmetric tensor.<\/li>\n<\/ul>\n<p>We try this by running the same model again. Edit <code>upscale.param<\/code> to use <code>boundary_condition_type=2<\/code>, and you should get something like the following result (rounded to fit below):<\/p>\n<pre>Upscaled K in millidarcy:\r\n133.75528     -0.096041582  -2.381589\r\n-0.096040623  140.54103     -0.5536349\r\n-2.3816639    -0.55359244   10.1717546\r\n<\/pre>\n<p>You will notice that the result is now a full tensor, which is symmetric (within numerical precision). The results are not very far away from the <em>fixed<\/em> condition results, but for our next model that is not so.<\/p>\n<p><!--nextpage--><\/p>\n<h4>A tilted model<\/h4>\n<p>Download another model from github:<\/p>\n<pre>wget https:\/\/raw.githubusercontent.com\/OPM\/opm-upscaling\/master\/tests\/input_data\/grids\/PeriodicTilted.grdecl<\/pre>\n<p>The file is 658 KB, and as before contains a corner-point grid model with porosity and permeability:<\/p>\n<p><a href=\"\/\/opm-project.org\/wp-content\/uploads\/2015\/11\/tilted_upscaling.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-422 size-full\" src=\"\/\/opm-project.org\/wp-content\/uploads\/2015\/11\/tilted_upscaling.png\" alt=\"tilted_upscaling\" width=\"1520\" height=\"1064\" \/><\/a><\/p>\n<p>As you can see, the layers here are not more-or-less at the same depth, but tilted. Edit <code>upscale.param<\/code> to say <code>filename=PeriodicTilted.grdecl<\/code> and run again (remember, we are still using <em>periodic<\/em> boundary conditions). You will see something like the following (rounded):<\/p>\n<pre>472.99569      8.9836861e-06   -144.89391 \r\n1.0247864e-05  549.99607       0.00027845773\r\n-144.89414     -1.6279639e-06  254.09423\r\n<\/pre>\n<p>As you can see, there are now\u00a0large off-diagonal values corresponding to X-Z communication, as could be expected from looking at the model. Changing to <em>fixed<\/em> boundary conditions (boundary_condition_type=0) gives the result:<\/p>\n<pre>409.268455330211 0 0\r\n0 549.996060654282 0\r\n0 0 238.516324893972\r\n<\/pre>\n<p>The Y permeability is the same (approximately 550 mD), but the X, Z and off-diagonal elements are very different.<\/p>\n<p>For this case, only the results from periodic boundary values can be considered correct, and this will hold for any tilted model. We therefore recommend using periodic boundaries in general, unless you for some reason require diagonal tensors only. In that case you should take care to align the model grid with the layers to avoid making large errors.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial will show you how to do flow-based permeability upscaling with OPM. We are going to use an example model\u00a0distributed as a test case with the opm-upscaling module: The tutorial assumes that you are familiar with Linux, have Ubuntu 14.04 installed, and are allowed to run the\u00a0sudo\u00a0command. We will explain the basics of upscaling, &hellip; <a href=\"https:\/\/opm-project.org\/?page_id=405\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Permeability upscaling with OPM<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":5,"featured_media":0,"parent":43,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"_links":{"self":[{"href":"https:\/\/opm-project.org\/index.php?rest_route=\/wp\/v2\/pages\/405"}],"collection":[{"href":"https:\/\/opm-project.org\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/opm-project.org\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/opm-project.org\/index.php?rest_route=\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/opm-project.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=405"}],"version-history":[{"count":21,"href":"https:\/\/opm-project.org\/index.php?rest_route=\/wp\/v2\/pages\/405\/revisions"}],"predecessor-version":[{"id":1452,"href":"https:\/\/opm-project.org\/index.php?rest_route=\/wp\/v2\/pages\/405\/revisions\/1452"}],"up":[{"embeddable":true,"href":"https:\/\/opm-project.org\/index.php?rest_route=\/wp\/v2\/pages\/43"}],"wp:attachment":[{"href":"https:\/\/opm-project.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=405"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}