diff --git a/.gitignore b/.gitignore index e7eb795..a719593 100644 --- a/.gitignore +++ b/.gitignore @@ -164,8 +164,17 @@ cython_debug/ # Tests tests/configs/ert/ -tests/configs/output/ tests/generic_deck +tests/configs/ert +tests/configs/jobs +tests/configs/logs +tests/configs/observations +tests/configs/parameters +tests/configs/output +tests/configs/postprocessing +tests/configs/preprocessing +tests/configs/.ert_runpath_list +tests/configs/ert.ert # Python environment vpycopm/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bdb4093..8bcf557 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ # Contributing -Hola hola :). +Hola hola πŸ™‚. The following is a set of guidelines for contributing to pycopm. ## Ground Rules diff --git a/README.md b/README.md index 62a0a2b..c21449f 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ See the [_installation_](https://cssr-tools.github.io/pycopm/installation.html) ## Running pycopm You can run _pycopm_ as a single command line: ``` -pycopm -i some_input -o some_output_folder +pycopm -i name_of_input_file ``` Run `pycopm --help` to see all possible command line argument options. diff --git a/docs/_images/drogon_generic.png b/docs/_images/drogon_generic.png new file mode 100644 index 0000000..709e175 Binary files /dev/null and b/docs/_images/drogon_generic.png differ diff --git a/docs/_images/plopm.png b/docs/_images/plopm.png index b7b084f..434af77 100644 Binary files a/docs/_images/plopm.png and b/docs/_images/plopm.png differ diff --git a/docs/_images/pyopmspe11.gif b/docs/_images/pyopmspe11.gif index e0a88a5..969ba51 100644 Binary files a/docs/_images/pyopmspe11.gif and b/docs/_images/pyopmspe11.gif differ diff --git a/docs/_sources/examples.rst.txt b/docs/_sources/examples.rst.txt index 9f4fbd8..bf1edd5 100644 --- a/docs/_sources/examples.rst.txt +++ b/docs/_sources/examples.rst.txt @@ -48,11 +48,10 @@ then: .. code-block:: bash - pycopm -i Statoil_Feasibility_sim_model_with_depletion_KROSS_INJ_SECTOR_20.DATA -o . -c 5,4,3 -a mode -j 1000 + pycopm -i Statoil_Feasibility_sim_model_with_depletion_KROSS_INJ_SECTOR_20.DATA -o . -c 5,4,3 -a mode will generate a coarser model 5 times in the x direction, 4 in the y direction, and 3 in the z direction, where the mode is -used to decide if a coarser cell should be active or inactive. The jump (-j) is set to a higher value (1000) to avoid removal -of grid connections (this is a tunning value to remove generated connections between neighbours in the coarse model). +used to decide if a coarser cell should be active or inactive. We can execute a dry run of OPM Flow to generate the grid and static variables of the coarser model: @@ -76,4 +75,28 @@ We use our `plopm `_ friend to generate PNG .. note:: In the current implementation of the **pycopm** tool, the handling of properties that require definitions of i,j,k indices (e.g., FAULTS, WELLSPECS) are assumed to be define in the main .DATA deck. Then, in order to use **pycopm** for simulation models - where these properties are define via include files, replace those includes in the .DATA deck with the actual content of the include files. \ No newline at end of file + where these properties are define via include files, replace those includes in the .DATA deck with the actual content of the include files. + +Generic Drogon +-------------- +Following the note above, then by downloading the `DROGON model `_, replacing the lines in +`DROGON_HIST.DATA `_ for the FAULTS (L127-128) and SCHEDULE (L242-243) with +the actual content of those include files, then by executing: + +.. code-block:: bash + + pycopm -i DROGON_HIST.DATA -o . -c 1,1,3 -a min -n max -p 1 + pycopm -i DROGON_HIST_PYCOPM.DATA -o . -c 1,3,1 -a mode -n mode -p 1 -j 1.9 + +this would generate the following coarse model: + +.. figure:: figs/drogon_generic.png + + Note that the total pore volume is conserved for the coarse model. + +Here, we first coarse in the z direction, which reduces the number of cells from 31 to 11, and after we coarse in the y direction. +After trial and error, the jump (-j) is set to 1.9 to avoid generated connections across the faults. + +.. note:: + After genereting the first coarser deck (DROGON_HIST_PYCOPM.DATA), change the path '../include/props/drogon.swatinit' to 'SWATINIT.INC', + which contains the right number of values for the coarse model. \ No newline at end of file diff --git a/docs/_sources/installation.rst.txt b/docs/_sources/installation.rst.txt index 82165e2..8697a84 100644 --- a/docs/_sources/installation.rst.txt +++ b/docs/_sources/installation.rst.txt @@ -51,25 +51,25 @@ in the terminal the following lines (which in turn should build flow in the fold CURRENT_DIRECTORY="$PWD" - for repo in common grid models simulators + for repo in common grid simulators do git clone https://github.com/OPM/opm-$repo.git done mkdir build - for repo in common grid models + for repo in common grid do mkdir build/opm-$repo cd build/opm-$repo - cmake -DUSE_MPI=1 -DWITH_NDEBUG=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$CURRENT_DIRECTORY/build/opm-common;$CURRENT_DIRECTORY/build/opm-grid" $CURRENT_DIRECTORY/opm-$repo + cmake -DUSE_MPI=1 -DWITH_NDEBUG=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$CURRENT_DIRECTORY/build/opm-common" $CURRENT_DIRECTORY/opm-$repo make -j5 opm$repo cd ../.. done mkdir build/opm-simulators cd build/opm-simulators - cmake -DUSE_MPI=1 -DWITH_NDEBUG=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$CURRENT_DIRECTORY/build/opm-common;$CURRENT_DIRECTORY/build/opm-grid;$CURRENT_DIRECTORY/build/opm-models" $CURRENT_DIRECTORY/opm-simulators + cmake -DUSE_MPI=1 -DWITH_NDEBUG=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$CURRENT_DIRECTORY/build/opm-common;$CURRENT_DIRECTORY/build/opm-grid" $CURRENT_DIRECTORY/opm-simulators make -j5 flow cd ../.. @@ -95,25 +95,25 @@ For macOS, there are no available binary packages, so OPM Flow needs to be built ./dune-common/bin/dunecontrol --only=dune-$module make -j5 done - for repo in common grid models simulators + for repo in common grid simulators do git clone https://github.com/OPM/opm-$repo.git done mkdir build - for repo in common grid models + for repo in common grid do mkdir build/opm-$repo cd build/opm-$repo - cmake -DUSE_MPI=0 -DWITH_NDEBUG=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$CURRENT_DIRECTORY/dune-common/build-cmake;$CURRENT_DIRECTORY/dune-grid/build-cmake;$CURRENT_DIRECTORY/dune-geometry/build-cmake;$CURRENT_DIRECTORY/dune-istl/build-cmake;$CURRENT_DIRECTORY/build/opm-common;$CURRENT_DIRECTORY/build/opm-grid" $CURRENT_DIRECTORY/opm-$repo + cmake -DPYTHON_EXECUTABLE=$(which python) -DWITH_NDEBUG=1 -DUSE_MPI=0 -DOPM_ENABLE_PYTHON=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$CURRENT_DIRECTORY/dune-common/build-cmake;$CURRENT_DIRECTORY/dune-grid/build-cmake;$CURRENT_DIRECTORY/dune-geometry/build-cmake;$CURRENT_DIRECTORY/dune-istl/build-cmake;$CURRENT_DIRECTORY/build/opm-common" $CURRENT_DIRECTORY/opm-$repo make -j5 opm$repo cd ../.. done mkdir build/opm-simulators cd build/opm-simulators - cmake -DUSE_MPI=0 -DWITH_NDEBUG=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$CURRENT_DIRECTORY/dune-common/build-cmake;$CURRENT_DIRECTORY/dune-grid/build-cmake;$CURRENT_DIRECTORY/dune-geometry/build-cmake;$CURRENT_DIRECTORY/dune-istl/build-cmake;$CURRENT_DIRECTORY/build/opm-common;$CURRENT_DIRECTORY/build/opm-grid;$CURRENT_DIRECTORY/build/opm-models" $CURRENT_DIRECTORY/opm-simulators + cmake -DUSE_MPI=0 -DWITH_NDEBUG=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$CURRENT_DIRECTORY/dune-common/build-cmake;$CURRENT_DIRECTORY/dune-grid/build-cmake;$CURRENT_DIRECTORY/dune-geometry/build-cmake;$CURRENT_DIRECTORY/dune-istl/build-cmake;$CURRENT_DIRECTORY/build/opm-common;$CURRENT_DIRECTORY/build/opm-grid" $CURRENT_DIRECTORY/opm-simulators make -j5 flow cd ../.. diff --git a/docs/_sources/introduction.rst.txt b/docs/_sources/introduction.rst.txt index 47d838d..b68ab76 100644 --- a/docs/_sources/introduction.rst.txt +++ b/docs/_sources/introduction.rst.txt @@ -4,7 +4,7 @@ Introduction .. image:: ./figs/pycopm.gif -This documentation describes the content of the **pycopm** package. +This documentation describes the **pycopm** tool hosted in `https://github.com/cssr-tools/pycopm `_. Concept ------- @@ -28,17 +28,20 @@ The current implementation supports the following executable with the argument o .. code-block:: bash - pycopm -i some_input -o some_output_folder + pycopm -i name_of_input_file where -- \-i: The base name of the :doc:`configuration file <./configuration_file>` or the name of the deck (`input.txt` by default). -- \-o: The base name of the :doc:`output folder <./output_folder>` (`output` by default). -- \-f: OPM Flow full path to executable or just `flow` (`flow` by default). -- \-c: Level of coarsening in the x, y, and z dir (`2,2,2` by default). -- \-a: Use min, max, or mode to scale the actnum (`min` by default). -- \-j: Tunning parameter to avoid creation of nnc on the structural faults (`2.` by default). -- \-x: Vector of x-coarsening (`` by default). -- \-y: Vector of y-coarsening (`` by default). -- \-z: Vector of z-coarsening (`` by default). -- \-e: Use `utf8` or `ISO-8859-1` encoding to read the deck (`ISO-8859-1` by default). +-i The base name of the :doc:`configuration file <./configuration_file>` or the name of the deck, e.g., `DROGON.DATA`, (`input.txt` by default). +-o The base name of the :doc:`output folder <./output_folder>` ('.'' by default, i.e., the folder where pycopm is executed). +-f OPM Flow full path to executable or just `flow` (`flow` by default). +-c Level of coarsening in the x, y, and z dir (`2,2,2` by default). +-a Use `min`, `max`, or `mode` to scale the actnum, e.g., min makes the new coarser cell inactive it at least one cell is inactive, while max makes it active it at least one cell is active (`max` by default). +-j Tuning parameter to avoid creation of neighbouring connections in the coarser model where there are discontinuities between cells along the z direction, e.g., around faults ('' by default, i.e., nothing corrected; if need it, try with values of the order of 1). +-x Vector of x-coarsening, e.g., if the grid has 6 cells in the x direction, then `0,2,0,2,0,2,0` would generate a coarser model with 3 cells, while `0,2,2,2,2,2,0` would generate a coarser model with 1 cell, i.e., 0 keeps the pilars while 2 removes them ('' by default), +-y Vector of y-coarsening, see the description for -x ('' by default). +-z Vector of z-coarsening, see the description for -x ('' by default). +-e Use `utf8` or `ISO-8859-1` encoding to read the deck (`ISO-8859-1` by default). +-p Add the removed pore volume to the closest coarser cells (`0` by default, `1` to enable). +-n Use `min`, `max`, or `mode` to scale satnum, fipnum, pvtnum, eqlnum, imbnum, and multnum (`mode` by default). +-s Use `min`, `max`, or `mean` to scale permx, permy, permz, and poro ('' by default, i.e., using the arithmetic average for permx/permy, harmonic average for permz, and the mean for the porosity). \ No newline at end of file diff --git a/docs/_sources/related.rst.txt b/docs/_sources/related.rst.txt index f3a0fcf..a35bb61 100644 --- a/docs/_sources/related.rst.txt +++ b/docs/_sources/related.rst.txt @@ -28,7 +28,7 @@ plopm .. image:: ./figs/plopm.png -`Quick generation of PNG figures from a simulation model given any 2D slide `_. +`Quick generation of PNGs, GIFs, and VTKs from a OPM Flow type model `_. ******** expreccs diff --git a/docs/_static/basic.css b/docs/_static/basic.css index f316efc..30fee9d 100644 --- a/docs/_static/basic.css +++ b/docs/_static/basic.css @@ -4,7 +4,7 @@ * * Sphinx stylesheet -- basic theme. * - * :copyright: Copyright 2007-2024 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ diff --git a/docs/_static/doctools.js b/docs/_static/doctools.js index 4d67807..d06a71d 100644 --- a/docs/_static/doctools.js +++ b/docs/_static/doctools.js @@ -4,7 +4,7 @@ * * Base JavaScript utilities for all Sphinx HTML documentation. * - * :copyright: Copyright 2007-2024 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ diff --git a/docs/_static/language_data.js b/docs/_static/language_data.js index 367b8ed..250f566 100644 --- a/docs/_static/language_data.js +++ b/docs/_static/language_data.js @@ -5,7 +5,7 @@ * This script contains the language-specific data used by searchtools.js, * namely the list of stopwords, stemmer, scorer and splitter. * - * :copyright: Copyright 2007-2024 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ @@ -13,7 +13,7 @@ var stopwords = ["a", "and", "are", "as", "at", "be", "but", "by", "for", "if", "in", "into", "is", "it", "near", "no", "not", "of", "on", "or", "such", "that", "the", "their", "then", "there", "these", "they", "this", "to", "was", "will", "with"]; -/* Non-minified version is copied as a separate JS file, if available */ +/* Non-minified version is copied as a separate JS file, is available */ /** * Porter Stemmer diff --git a/docs/_static/searchtools.js b/docs/_static/searchtools.js index b08d58c..7918c3f 100644 --- a/docs/_static/searchtools.js +++ b/docs/_static/searchtools.js @@ -4,7 +4,7 @@ * * Sphinx JavaScript utilities for the full-text search. * - * :copyright: Copyright 2007-2024 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ @@ -99,7 +99,7 @@ const _displayItem = (item, searchTerms, highlightTerms) => { .then((data) => { if (data) listItem.appendChild( - Search.makeSearchSummary(data, searchTerms, anchor) + Search.makeSearchSummary(data, searchTerms) ); // highlight search terms in the summary if (SPHINX_HIGHLIGHT_ENABLED) // set in sphinx_highlight.js @@ -116,8 +116,8 @@ const _finishSearch = (resultCount) => { ); else Search.status.innerText = _( - "Search finished, found ${resultCount} page(s) matching the search query." - ).replace('${resultCount}', resultCount); + `Search finished, found ${resultCount} page(s) matching the search query.` + ); }; const _displayNextItem = ( results, @@ -137,22 +137,6 @@ const _displayNextItem = ( // search finished, update title and status message else _finishSearch(resultCount); }; -// Helper function used by query() to order search results. -// Each input is an array of [docname, title, anchor, descr, score, filename]. -// Order the results by score (in opposite order of appearance, since the -// `_displayNextItem` function uses pop() to retrieve items) and then alphabetically. -const _orderResultsByScoreThenName = (a, b) => { - const leftScore = a[4]; - const rightScore = b[4]; - if (leftScore === rightScore) { - // same score: sort alphabetically - const leftTitle = a[1].toLowerCase(); - const rightTitle = b[1].toLowerCase(); - if (leftTitle === rightTitle) return 0; - return leftTitle > rightTitle ? -1 : 1; // inverted is intentional - } - return leftScore > rightScore ? 1 : -1; -}; /** * Default splitQuery function. Can be overridden in ``sphinx.search`` with a @@ -176,26 +160,13 @@ const Search = { _queued_query: null, _pulse_status: -1, - htmlToText: (htmlString, anchor) => { + htmlToText: (htmlString) => { const htmlElement = new DOMParser().parseFromString(htmlString, 'text/html'); - for (const removalQuery of [".headerlink", "script", "style"]) { - htmlElement.querySelectorAll(removalQuery).forEach((el) => { el.remove() }); - } - if (anchor) { - const anchorContent = htmlElement.querySelector(`[role="main"] ${anchor}`); - if (anchorContent) return anchorContent.textContent; - - console.warn( - `Anchored content block not found. Sphinx search tries to obtain it via DOM query '[role=main] ${anchor}'. Check your theme or template.` - ); - } - - // if anchor not specified or not found, fall back to main content + htmlElement.querySelectorAll(".headerlink").forEach((el) => { el.remove() }); const docContent = htmlElement.querySelector('[role="main"]'); - if (docContent) return docContent.textContent; - + if (docContent !== undefined) return docContent.textContent; console.warn( - "Content block not found. Sphinx search tries to obtain it via DOM query '[role=main]'. Check your theme or template." + "Content block not found. Sphinx search tries to obtain it via '[role=main]'. Could you check your theme or template." ); return ""; }, @@ -268,7 +239,16 @@ const Search = { else Search.deferQuery(query); }, - _parseQuery: (query) => { + /** + * execute search (requires search index to be loaded) + */ + query: (query) => { + const filenames = Search._index.filenames; + const docNames = Search._index.docnames; + const titles = Search._index.titles; + const allTitles = Search._index.alltitles; + const indexEntries = Search._index.indexentries; + // stem the search terms and add them to the correct list const stemmer = new Stemmer(); const searchTerms = new Set(); @@ -304,38 +284,21 @@ const Search = { // console.info("required: ", [...searchTerms]); // console.info("excluded: ", [...excludedTerms]); - return [query, searchTerms, excludedTerms, highlightTerms, objectTerms]; - }, - - /** - * execute search (requires search index to be loaded) - */ - _performSearch: (query, searchTerms, excludedTerms, highlightTerms, objectTerms) => { - const filenames = Search._index.filenames; - const docNames = Search._index.docnames; - const titles = Search._index.titles; - const allTitles = Search._index.alltitles; - const indexEntries = Search._index.indexentries; - - // Collect multiple result groups to be sorted separately and then ordered. - // Each is an array of [docname, title, anchor, descr, score, filename]. - const normalResults = []; - const nonMainIndexResults = []; - + // array of [docname, title, anchor, descr, score, filename] + let results = []; _removeChildren(document.getElementById("search-progress")); - const queryLower = query.toLowerCase().trim(); + const queryLower = query.toLowerCase(); for (const [title, foundTitles] of Object.entries(allTitles)) { - if (title.toLowerCase().trim().includes(queryLower) && (queryLower.length >= title.length/2)) { + if (title.toLowerCase().includes(queryLower) && (queryLower.length >= title.length/2)) { for (const [file, id] of foundTitles) { - const score = Math.round(Scorer.title * queryLower.length / title.length); - const boost = titles[file] === title ? 1 : 0; // add a boost for document titles - normalResults.push([ + let score = Math.round(100 * queryLower.length / title.length) + results.push([ docNames[file], titles[file] !== title ? `${titles[file]} > ${title}` : title, id !== null ? "#" + id : "", null, - score + boost, + score, filenames[file], ]); } @@ -345,47 +308,46 @@ const Search = { // search for explicit entries in index directives for (const [entry, foundEntries] of Object.entries(indexEntries)) { if (entry.includes(queryLower) && (queryLower.length >= entry.length/2)) { - for (const [file, id, isMain] of foundEntries) { - const score = Math.round(100 * queryLower.length / entry.length); - const result = [ + for (const [file, id] of foundEntries) { + let score = Math.round(100 * queryLower.length / entry.length) + results.push([ docNames[file], titles[file], id ? "#" + id : "", null, score, filenames[file], - ]; - if (isMain) { - normalResults.push(result); - } else { - nonMainIndexResults.push(result); - } + ]); } } } // lookup as object objectTerms.forEach((term) => - normalResults.push(...Search.performObjectSearch(term, objectTerms)) + results.push(...Search.performObjectSearch(term, objectTerms)) ); // lookup as search terms in fulltext - normalResults.push(...Search.performTermsSearch(searchTerms, excludedTerms)); + results.push(...Search.performTermsSearch(searchTerms, excludedTerms)); // let the scorer override scores with a custom scoring function - if (Scorer.score) { - normalResults.forEach((item) => (item[4] = Scorer.score(item))); - nonMainIndexResults.forEach((item) => (item[4] = Scorer.score(item))); - } - - // Sort each group of results by score and then alphabetically by name. - normalResults.sort(_orderResultsByScoreThenName); - nonMainIndexResults.sort(_orderResultsByScoreThenName); - - // Combine the result groups in (reverse) order. - // Non-main index entries are typically arbitrary cross-references, - // so display them after other results. - let results = [...nonMainIndexResults, ...normalResults]; + if (Scorer.score) results.forEach((item) => (item[4] = Scorer.score(item))); + + // now sort the results by score (in opposite order of appearance, since the + // display function below uses pop() to retrieve items) and then + // alphabetically + results.sort((a, b) => { + const leftScore = a[4]; + const rightScore = b[4]; + if (leftScore === rightScore) { + // same score: sort alphabetically + const leftTitle = a[1].toLowerCase(); + const rightTitle = b[1].toLowerCase(); + if (leftTitle === rightTitle) return 0; + return leftTitle > rightTitle ? -1 : 1; // inverted is intentional + } + return leftScore > rightScore ? 1 : -1; + }); // remove duplicate search results // note the reversing of results, so that in the case of duplicates, the highest-scoring entry is kept @@ -399,12 +361,7 @@ const Search = { return acc; }, []); - return results.reverse(); - }, - - query: (query) => { - const [searchQuery, searchTerms, excludedTerms, highlightTerms, objectTerms] = Search._parseQuery(query); - const results = Search._performSearch(searchQuery, searchTerms, excludedTerms, highlightTerms, objectTerms); + results = results.reverse(); // for debugging //Search.lastresults = results.slice(); // a copy @@ -509,18 +466,14 @@ const Search = { // add support for partial matches if (word.length > 2) { const escapedWord = _escapeRegExp(word); - if (!terms.hasOwnProperty(word)) { - Object.keys(terms).forEach((term) => { - if (term.match(escapedWord)) - arr.push({ files: terms[term], score: Scorer.partialTerm }); - }); - } - if (!titleTerms.hasOwnProperty(word)) { - Object.keys(titleTerms).forEach((term) => { - if (term.match(escapedWord)) - arr.push({ files: titleTerms[term], score: Scorer.partialTitle }); - }); - } + Object.keys(terms).forEach((term) => { + if (term.match(escapedWord) && !terms[word]) + arr.push({ files: terms[term], score: Scorer.partialTerm }); + }); + Object.keys(titleTerms).forEach((term) => { + if (term.match(escapedWord) && !titleTerms[word]) + arr.push({ files: titleTerms[word], score: Scorer.partialTitle }); + }); } // no match but word was a required one @@ -543,8 +496,9 @@ const Search = { // create the mapping files.forEach((file) => { - if (!fileMap.has(file)) fileMap.set(file, [word]); - else if (fileMap.get(file).indexOf(word) === -1) fileMap.get(file).push(word); + if (fileMap.has(file) && fileMap.get(file).indexOf(word) === -1) + fileMap.get(file).push(word); + else fileMap.set(file, [word]); }); }); @@ -595,8 +549,8 @@ const Search = { * search summary for a given text. keywords is a list * of stemmed words. */ - makeSearchSummary: (htmlText, keywords, anchor) => { - const text = Search.htmlToText(htmlText, anchor); + makeSearchSummary: (htmlText, keywords) => { + const text = Search.htmlToText(htmlText); if (text === "") return null; const textLower = text.toLowerCase(); diff --git a/docs/about.html b/docs/about.html index 45659f1..a4336c7 100644 --- a/docs/about.html +++ b/docs/about.html @@ -16,7 +16,7 @@ - + diff --git a/docs/api.html b/docs/api.html index b12ef55..cef6b5d 100644 --- a/docs/api.html +++ b/docs/api.html @@ -16,7 +16,7 @@ - + diff --git a/docs/configuration_file.html b/docs/configuration_file.html index 3c21695..d383e64 100644 --- a/docs/configuration_file.html +++ b/docs/configuration_file.html @@ -16,7 +16,7 @@ - + diff --git a/docs/examples.html b/docs/examples.html index 6c89c0d..b98f74a 100644 --- a/docs/examples.html +++ b/docs/examples.html @@ -16,7 +16,7 @@ - + @@ -58,6 +58,7 @@
  • Via OPM Flow decks
  • @@ -130,12 +131,11 @@

    SPE10Smeaheia

    By downloading the Smeaheia simulation model, then:

    -
    pycopm -i Statoil_Feasibility_sim_model_with_depletion_KROSS_INJ_SECTOR_20.DATA -o . -c 5,4,3 -a mode -j 1000
    +
    pycopm -i Statoil_Feasibility_sim_model_with_depletion_KROSS_INJ_SECTOR_20.DATA -o . -c 5,4,3 -a mode
     

    will generate a coarser model 5 times in the x direction, 4 in the y direction, and 3 in the z direction, where the mode is -used to decide if a coarser cell should be active or inactive. The jump (-j) is set to a higher value (1000) to avoid removal -of grid connections (this is a tunning value to remove generated connections between neighbours in the coarse model).

    +used to decide if a coarser cell should be active or inactive.

    We can execute a dry run of OPM Flow to generate the grid and static variables of the coarser model:

    flow STATOIL_FEASIBILITY_SIM_MODEL_WITH_DEPLETION_KROSS_INJ_SECTOR_20_PYCOPM.DATA --enable-dry-run=true
     
    @@ -161,6 +161,30 @@

    Smeaheia where these properties are define via include files, replace those includes in the .DATA deck with the actual content of the include files.

    +
    +

    Generic Drogon

    +

    Following the note above, then by downloading the DROGON model, replacing the lines in +DROGON_HIST.DATA for the FAULTS (L127-128) and SCHEDULE (L242-243) with +the actual content of those include files, then by executing:

    +
    pycopm -i DROGON_HIST.DATA -o . -c 1,1,3 -a min -n max -p 1
    +pycopm -i DROGON_HIST_PYCOPM.DATA -o . -c 1,3,1 -a mode -n mode -p 1 -j 1.9
    +
    +
    +

    this would generate the following coarse model:

    +
    +_images/drogon_generic.png +
    +

    Note that the total pore volume is conserved for the coarse model.

    +
    +
    +

    Here, we first coarse in the z direction, which reduces the number of cells from 31 to 11, and after we coarse in the y direction. +After trial and error, the jump (-j) is set to 1.9 to avoid generated connections across the faults.

    +
    +

    Note

    +

    After genereting the first coarser deck (DROGON_HIST_PYCOPM.DATA), change the path β€˜../include/props/drogon.swatinit’ to β€˜SWATINIT.INC’, +which contains the right number of values for the coarse model.

    +
    +
    diff --git a/docs/genindex.html b/docs/genindex.html index eb489aa..ca1cca7 100644 --- a/docs/genindex.html +++ b/docs/genindex.html @@ -15,7 +15,7 @@ - + diff --git a/docs/index.html b/docs/index.html index 9e61f28..a4b0abc 100644 --- a/docs/index.html +++ b/docs/index.html @@ -16,7 +16,7 @@ - + @@ -108,6 +108,7 @@

    Welcome to pycopm’s documentation!Via OPM Flow decks diff --git a/docs/installation.html b/docs/installation.html index bc693e9..972d34d 100644 --- a/docs/installation.html +++ b/docs/installation.html @@ -16,7 +16,7 @@ - + @@ -133,25 +133,25 @@

    Source build in Linux/Windows
    CURRENT_DIRECTORY="$PWD"
     
    -for repo in common grid models simulators
    +for repo in common grid simulators
     do
         git clone https://github.com/OPM/opm-$repo.git
     done
     
     mkdir build
     
    -for repo in common grid models
    +for repo in common grid
     do
         mkdir build/opm-$repo
         cd build/opm-$repo
    -    cmake -DUSE_MPI=1 -DWITH_NDEBUG=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$CURRENT_DIRECTORY/build/opm-common;$CURRENT_DIRECTORY/build/opm-grid" $CURRENT_DIRECTORY/opm-$repo
    +    cmake -DUSE_MPI=1 -DWITH_NDEBUG=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$CURRENT_DIRECTORY/build/opm-common" $CURRENT_DIRECTORY/opm-$repo
         make -j5 opm$repo
         cd ../..
     done
     
     mkdir build/opm-simulators
     cd build/opm-simulators
    -cmake -DUSE_MPI=1 -DWITH_NDEBUG=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$CURRENT_DIRECTORY/build/opm-common;$CURRENT_DIRECTORY/build/opm-grid;$CURRENT_DIRECTORY/build/opm-models" $CURRENT_DIRECTORY/opm-simulators
    +cmake -DUSE_MPI=1 -DWITH_NDEBUG=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$CURRENT_DIRECTORY/build/opm-common;$CURRENT_DIRECTORY/build/opm-grid" $CURRENT_DIRECTORY/opm-simulators
     make -j5 flow
     cd ../..
     
    @@ -175,25 +175,25 @@

    Source build in macOS ./dune-common/bin/dunecontrol --only=dune-$module make -j5 done -for repo in common grid models simulators +for repo in common grid simulators do git clone https://github.com/OPM/opm-$repo.git done mkdir build -for repo in common grid models +for repo in common grid do mkdir build/opm-$repo cd build/opm-$repo - cmake -DUSE_MPI=0 -DWITH_NDEBUG=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$CURRENT_DIRECTORY/dune-common/build-cmake;$CURRENT_DIRECTORY/dune-grid/build-cmake;$CURRENT_DIRECTORY/dune-geometry/build-cmake;$CURRENT_DIRECTORY/dune-istl/build-cmake;$CURRENT_DIRECTORY/build/opm-common;$CURRENT_DIRECTORY/build/opm-grid" $CURRENT_DIRECTORY/opm-$repo + cmake -DPYTHON_EXECUTABLE=$(which python) -DWITH_NDEBUG=1 -DUSE_MPI=0 -DOPM_ENABLE_PYTHON=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$CURRENT_DIRECTORY/dune-common/build-cmake;$CURRENT_DIRECTORY/dune-grid/build-cmake;$CURRENT_DIRECTORY/dune-geometry/build-cmake;$CURRENT_DIRECTORY/dune-istl/build-cmake;$CURRENT_DIRECTORY/build/opm-common" $CURRENT_DIRECTORY/opm-$repo make -j5 opm$repo cd ../.. done mkdir build/opm-simulators cd build/opm-simulators -cmake -DUSE_MPI=0 -DWITH_NDEBUG=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$CURRENT_DIRECTORY/dune-common/build-cmake;$CURRENT_DIRECTORY/dune-grid/build-cmake;$CURRENT_DIRECTORY/dune-geometry/build-cmake;$CURRENT_DIRECTORY/dune-istl/build-cmake;$CURRENT_DIRECTORY/build/opm-common;$CURRENT_DIRECTORY/build/opm-grid;$CURRENT_DIRECTORY/build/opm-models" $CURRENT_DIRECTORY/opm-simulators +cmake -DUSE_MPI=0 -DWITH_NDEBUG=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$CURRENT_DIRECTORY/dune-common/build-cmake;$CURRENT_DIRECTORY/dune-grid/build-cmake;$CURRENT_DIRECTORY/dune-geometry/build-cmake;$CURRENT_DIRECTORY/dune-istl/build-cmake;$CURRENT_DIRECTORY/build/opm-common;$CURRENT_DIRECTORY/build/opm-grid" $CURRENT_DIRECTORY/opm-simulators make -j5 flow cd ../..

    diff --git a/docs/introduction.html b/docs/introduction.html index 83f47ee..9e5e5ed 100644 --- a/docs/introduction.html +++ b/docs/introduction.html @@ -16,7 +16,7 @@ - + @@ -89,7 +89,7 @@

    Introduction

    _images/pycopm.gif -

    This documentation describes the content of the pycopm package.

    +

    This documentation describes the pycopm tool hosted in https://github.com/cssr-tools/pycopm.

    Concept

    Simplified and flexible framework to create coarser OPM Flow geological models.

    @@ -106,22 +106,51 @@

    Roadmap

    Overview

    The current implementation supports the following executable with the argument options:

    -
    pycopm -i some_input -o some_output_folder
    +
    pycopm -i name_of_input_file
     

    where

    -
      -
    • -i: The base name of the configuration file or the name of the deck (input.txt by default).

    • -
    • -o: The base name of the output folder (output by default).

    • -
    • -f: OPM Flow full path to executable or just flow (flow by default).

    • -
    • -c: Level of coarsening in the x, y, and z dir (2,2,2 by default).

    • -
    • -a: Use min, max, or mode to scale the actnum (min by default).

    • -
    • -j: Tunning parameter to avoid creation of nnc on the structural faults (2. by default).

    • -
    • -x: Vector of x-coarsening (`` by default).

    • -
    • -y: Vector of y-coarsening (`` by default).

    • -
    • -z: Vector of z-coarsening (`` by default).

    • -
    • -e: Use utf8 or ISO-8859-1 encoding to read the deck (ISO-8859-1 by default).

    • -
    +
    +
    -i
    +

    The base name of the configuration file or the name of the deck, e.g., DROGON.DATA, (input.txt by default).

    +
    +
    -o
    +

    The base name of the output folder (β€˜.’’ by default, i.e., the folder where pycopm is executed).

    +
    +
    -f
    +

    OPM Flow full path to executable or just flow (flow by default).

    +
    +
    -c
    +

    Level of coarsening in the x, y, and z dir (2,2,2 by default).

    +
    +
    -a
    +

    Use min, max, or mode to scale the actnum, e.g., min makes the new coarser cell inactive it at least one cell is inactive, while max makes it active it at least one cell is active (max by default).

    +
    +
    -j
    +

    Tuning parameter to avoid creation of neighbouring connections in the coarser model where there are discontinuities between cells along the z direction, e.g., around faults (’’ by default, i.e., nothing corrected; if need it, try with values of the order of 1).

    +
    +
    -x
    +

    Vector of x-coarsening, e.g., if the grid has 6 cells in the x direction, then 0,2,0,2,0,2,0 would generate a coarser model with 3 cells, while 0,2,2,2,2,2,0 would generate a coarser model with 1 cell, i.e., 0 keeps the pilars while 2 removes them (’’ by default),

    +
    +
    -y
    +

    Vector of y-coarsening, see the description for -x (’’ by default).

    +
    +
    -z
    +

    Vector of z-coarsening, see the description for -x (’’ by default).

    +
    +
    -e
    +

    Use utf8 or ISO-8859-1 encoding to read the deck (ISO-8859-1 by default).

    +
    +
    -p
    +

    Add the removed pore volume to the closest coarser cells (0 by default, 1 to enable).

    +
    +
    -n
    +

    Use min, max, or mode to scale satnum, fipnum, pvtnum, eqlnum, imbnum, and multnum (mode by default).

    +
    +
    -s
    +

    Use min, max, or mean to scale permx, permy, permz, and poro (’’ by default, i.e., using the arithmetic average for permx/permy, harmonic average for permz, and the mean for the porosity).

    +
    +

    diff --git a/docs/modules.html b/docs/modules.html index 73c752f..100e7e9 100644 --- a/docs/modules.html +++ b/docs/modules.html @@ -16,7 +16,7 @@ - + diff --git a/docs/output_folder.html b/docs/output_folder.html index eb00538..81b7066 100644 --- a/docs/output_folder.html +++ b/docs/output_folder.html @@ -16,7 +16,7 @@ - + diff --git a/docs/py-modindex.html b/docs/py-modindex.html index 890347c..6dea9eb 100644 --- a/docs/py-modindex.html +++ b/docs/py-modindex.html @@ -15,7 +15,7 @@ - + diff --git a/docs/pycopm.core.html b/docs/pycopm.core.html index ab72271..6fef77c 100644 --- a/docs/pycopm.core.html +++ b/docs/pycopm.core.html @@ -16,7 +16,7 @@ - + diff --git a/docs/pycopm.core.pycopm.html b/docs/pycopm.core.pycopm.html index b3777c9..fe5d64b 100644 --- a/docs/pycopm.core.pycopm.html +++ b/docs/pycopm.core.pycopm.html @@ -16,7 +16,7 @@ - + diff --git a/docs/pycopm.html b/docs/pycopm.html index eaa96af..3162b03 100644 --- a/docs/pycopm.html +++ b/docs/pycopm.html @@ -16,7 +16,7 @@ - + diff --git a/docs/pycopm.utils.files_writer.html b/docs/pycopm.utils.files_writer.html index 4e9b68f..df6fecf 100644 --- a/docs/pycopm.utils.files_writer.html +++ b/docs/pycopm.utils.files_writer.html @@ -16,7 +16,7 @@ - + diff --git a/docs/pycopm.utils.generate_coarser_files.html b/docs/pycopm.utils.generate_coarser_files.html index 6ecaed8..c94ed30 100644 --- a/docs/pycopm.utils.generate_coarser_files.html +++ b/docs/pycopm.utils.generate_coarser_files.html @@ -16,7 +16,7 @@ - + @@ -273,13 +273,14 @@
    -pycopm.utils.generate_coarser_files.map_properties(dic, actnum, d_z, z_z)
    +pycopm.utils.generate_coarser_files.map_properties(dic, actnum, d_z, z_t, z_b, z_b_t)

    Mapping to the coarse properties

    Args:

    dic (dict): Global dictionary

    actnum (array): Integers with the active cells

    d_z (array): Floats with the corresponding grid DZ

    -

    z_z (array): Floats with the cell z-center position

    +

    z_t (array): Floats with the top cell z-center position

    +

    z_b (array): Floats with the bottom cell z-center position

    Returns:

    dic (dict): Modified global dictionary

    diff --git a/docs/pycopm.utils.grid_builder.html b/docs/pycopm.utils.grid_builder.html index 02e1123..3665e16 100644 --- a/docs/pycopm.utils.grid_builder.html +++ b/docs/pycopm.utils.grid_builder.html @@ -16,7 +16,7 @@ - + diff --git a/docs/pycopm.utils.html b/docs/pycopm.utils.html index 8ae6999..190b915 100644 --- a/docs/pycopm.utils.html +++ b/docs/pycopm.utils.html @@ -16,7 +16,7 @@ - + diff --git a/docs/pycopm.utils.input_values.html b/docs/pycopm.utils.input_values.html index 1960165..293d472 100644 --- a/docs/pycopm.utils.input_values.html +++ b/docs/pycopm.utils.input_values.html @@ -16,7 +16,7 @@ - + diff --git a/docs/pycopm.utils.properties_builder.html b/docs/pycopm.utils.properties_builder.html index a3e0783..b47de14 100644 --- a/docs/pycopm.utils.properties_builder.html +++ b/docs/pycopm.utils.properties_builder.html @@ -16,7 +16,7 @@ - + diff --git a/docs/pycopm.utils.runs_executer.html b/docs/pycopm.utils.runs_executer.html index dd00454..5a14139 100644 --- a/docs/pycopm.utils.runs_executer.html +++ b/docs/pycopm.utils.runs_executer.html @@ -16,7 +16,7 @@ - + diff --git a/docs/related.html b/docs/related.html index ef6c48c..9515e03 100644 --- a/docs/related.html +++ b/docs/related.html @@ -16,7 +16,7 @@ - + @@ -94,7 +94,7 @@

    Related

    Below are some tools that might be of interest; check them out πŸ™‚.

    pyopmspe11

    -_images/pyopmspe11.gif +_images/pyopmspe11.gif

    A Python framework using OPM Flow for the CSP SPE11 benchmark project.

    @@ -105,7 +105,7 @@

    pyopmnearwell

    plopm

    _images/plopm.png -

    Quick generation of PNG figures from a simulation model given any 2D slide.

    +

    Quick generation of PNGs, GIFs, and VTKs from a OPM Flow type model.

    expreccs

    diff --git a/docs/search.html b/docs/search.html index 43dd616..d0e73c9 100644 --- a/docs/search.html +++ b/docs/search.html @@ -16,7 +16,7 @@ - + diff --git a/docs/searchindex.js b/docs/searchindex.js index ea0b7e0..25b7be0 100644 --- a/docs/searchindex.js +++ b/docs/searchindex.js @@ -1 +1 @@ -Search.setIndex({"alltitles": {"About pycopm": [[0, null]], "Concept": [[6, "concept"]], "Configuration file": [[2, null]], "Drogon": [[3, "drogon"]], "Examples": [[3, null]], "Indices and tables": [[4, "indices-and-tables"]], "Installation": [[5, null]], "Introduction": [[6, null]], "Module contents": [[9, "module-pycopm"], [10, "module-pycopm.core"], [12, "module-pycopm.utils"]], "OPM Flow": [[5, "opm-flow"]], "Output folder": [[8, null]], "Overview": [[6, "overview"]], "Python package": [[5, "python-package"]], "Related": [[19, null]], "Roadmap": [[6, "roadmap"]], "SPE10": [[3, "spe10"]], "Smeaheia": [[3, "smeaheia"]], "Source build in Linux/Windows": [[5, "source-build-in-linux-windows"]], "Source build in macOS": [[5, "source-build-in-macos"]], "Submodules": [[10, "submodules"], [12, "submodules"]], "Subpackages": [[9, "subpackages"]], "Via OPM Flow decks": [[3, "via-opm-flow-decks"]], "Via an OPM Flow input deck": [[8, "via-an-opm-flow-input-deck"]], "Via configuration files": [[3, "via-configuration-files"], [8, "via-configuration-files"]], "Welcome to pycopm\u2019s documentation!": [[4, null]], "ad-micp": [[19, "ad-micp"]], "expreccs": [[19, "expreccs"]], "plopm": [[19, "plopm"]], "pycopm": [[1, "pycopm"], [7, null]], "pycopm Python API": [[1, null]], "pycopm package": [[9, null]], "pycopm.core package": [[10, null]], "pycopm.core.pycopm module": [[11, null]], "pycopm.utils package": [[12, null]], "pycopm.utils.files_writer module": [[13, null]], "pycopm.utils.generate_coarser_files module": [[14, null]], "pycopm.utils.grid_builder module": [[15, null]], "pycopm.utils.input_values module": [[16, null]], "pycopm.utils.properties_builder module": [[17, null]], "pycopm.utils.runs_executer module": [[18, null]], "pymm": [[19, "pymm"]], "pyopmnearwell": [[19, "pyopmnearwell"]], "pyopmspe11": [[19, "pyopmspe11"]]}, "docnames": ["about", "api", "configuration_file", "examples", "index", "installation", "introduction", "modules", "output_folder", "pycopm", "pycopm.core", "pycopm.core.pycopm", "pycopm.utils", "pycopm.utils.files_writer", "pycopm.utils.generate_coarser_files", "pycopm.utils.grid_builder", "pycopm.utils.input_values", "pycopm.utils.properties_builder", "pycopm.utils.runs_executer", "related"], "envversion": {"sphinx": 62, "sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2}, "filenames": ["about.rst", "api.rst", "configuration_file.rst", "examples.rst", "index.rst", "installation.rst", "introduction.rst", "modules.rst", "output_folder.rst", "pycopm.rst", "pycopm.core.rst", "pycopm.core.pycopm.rst", "pycopm.utils.rst", "pycopm.utils.files_writer.rst", "pycopm.utils.generate_coarser_files.rst", "pycopm.utils.grid_builder.rst", "pycopm.utils.input_values.rst", "pycopm.utils.properties_builder.rst", "pycopm.utils.runs_executer.rst", "related.rst"], "indexentries": {"add_lost_pv_to_all_cells() (in module pycopm.utils.properties_builder)": [[17, "pycopm.utils.properties_builder.add_lost_pv_to_all_cells", false]], "add_lost_pv_to_all_eq_cells() (in module pycopm.utils.properties_builder)": [[17, "pycopm.utils.properties_builder.add_lost_pv_to_all_eq_cells", false]], "add_lost_pv_to_all_fip_cells() (in module pycopm.utils.properties_builder)": [[17, "pycopm.utils.properties_builder.add_lost_pv_to_all_fip_cells", false]], "add_lost_pv_to_boundary_cells() (in module pycopm.utils.properties_builder)": [[17, "pycopm.utils.properties_builder.add_lost_pv_to_boundary_cells", false]], "assign_hm_parameters() (in module pycopm.utils.input_values)": [[16, "pycopm.utils.input_values.assign_hm_parameters", false]], "assign_standard_values() (in module pycopm.utils.input_values)": [[16, "pycopm.utils.input_values.assign_standard_values", false]], "coarser_files() (in module pycopm.utils.files_writer)": [[13, "pycopm.utils.files_writer.coarser_files", false]], "coarser_grid() (in module pycopm.utils.grid_builder)": [[15, "pycopm.utils.grid_builder.coarser_grid", false]], "coarser_properties() (in module pycopm.utils.properties_builder)": [[17, "pycopm.utils.properties_builder.coarser_properties", false]], "create_deck() (in module pycopm.utils.generate_coarser_files)": [[14, "pycopm.utils.generate_coarser_files.create_deck", false]], "ert_files() (in module pycopm.utils.files_writer)": [[13, "pycopm.utils.files_writer.ert_files", false]], "find_neighbors() (in module pycopm.utils.generate_coarser_files)": [[14, "pycopm.utils.generate_coarser_files.find_neighbors", false]], "get_ijk() (in module pycopm.utils.generate_coarser_files)": [[14, "pycopm.utils.generate_coarser_files.get_ijk", false]], "get_number_of_lines() (in module pycopm.utils.input_values)": [[16, "pycopm.utils.input_values.get_number_of_lines", false]], "grid_features() (in module pycopm.utils.files_writer)": [[13, "pycopm.utils.files_writer.grid_features", false]], "handle_clusters() (in module pycopm.utils.generate_coarser_files)": [[14, "pycopm.utils.generate_coarser_files.handle_clusters", false]], "handle_cp_grid() (in module pycopm.utils.generate_coarser_files)": [[14, "pycopm.utils.generate_coarser_files.handle_cp_grid", false]], "handle_face_dir_im() (in module pycopm.utils.grid_builder)": [[15, "pycopm.utils.grid_builder.handle_face_dir_im", false]], "handle_face_dir_ip() (in module pycopm.utils.grid_builder)": [[15, "pycopm.utils.grid_builder.handle_face_dir_ip", false]], "handle_face_dir_jm() (in module pycopm.utils.grid_builder)": [[15, "pycopm.utils.grid_builder.handle_face_dir_jm", false]], "handle_face_dir_jp() (in module pycopm.utils.grid_builder)": [[15, "pycopm.utils.grid_builder.handle_face_dir_jp", false]], "handle_fault() (in module pycopm.utils.generate_coarser_files)": [[14, "pycopm.utils.generate_coarser_files.handle_fault", false]], "handle_faults() (in module pycopm.utils.grid_builder)": [[15, "pycopm.utils.grid_builder.handle_faults", false]], "handle_grid_props() (in module pycopm.utils.generate_coarser_files)": [[14, "pycopm.utils.generate_coarser_files.handle_grid_props", false]], "handle_mapaxes() (in module pycopm.utils.generate_coarser_files)": [[14, "pycopm.utils.generate_coarser_files.handle_mapaxes", false]], "handle_pv() (in module pycopm.utils.generate_coarser_files)": [[14, "pycopm.utils.generate_coarser_files.handle_pv", false]], "handle_regions() (in module pycopm.utils.generate_coarser_files)": [[14, "pycopm.utils.generate_coarser_files.handle_regions", false]], "handle_segmented_wells() (in module pycopm.utils.generate_coarser_files)": [[14, "pycopm.utils.generate_coarser_files.handle_segmented_wells", false]], "handle_wells() (in module pycopm.utils.generate_coarser_files)": [[14, "pycopm.utils.generate_coarser_files.handle_wells", false]], "handle_zcorn() (in module pycopm.utils.generate_coarser_files)": [[14, "pycopm.utils.generate_coarser_files.handle_zcorn", false]], "identify_removed_pilars() (in module pycopm.utils.properties_builder)": [[17, "pycopm.utils.properties_builder.identify_removed_pilars", false]], "identify_removed_pilars_zdir() (in module pycopm.utils.properties_builder)": [[17, "pycopm.utils.properties_builder.identify_removed_pilars_zdir", false]], "initialize_properties() (in module pycopm.utils.properties_builder)": [[17, "pycopm.utils.properties_builder.initialize_properties", false]], "initialize_values() (in module pycopm.utils.input_values)": [[16, "pycopm.utils.input_values.initialize_values", false]], "load_parser() (in module pycopm.core.pycopm)": [[11, "pycopm.core.pycopm.load_parser", false]], "main() (in module pycopm.core.pycopm)": [[11, "pycopm.core.pycopm.main", false]], "map_ijk() (in module pycopm.utils.generate_coarser_files)": [[14, "pycopm.utils.generate_coarser_files.map_ijk", false]], "map_properties() (in module pycopm.utils.generate_coarser_files)": [[14, "pycopm.utils.generate_coarser_files.map_properties", false]], "module": [[9, "module-pycopm", false], [10, "module-pycopm.core", false], [11, "module-pycopm.core.pycopm", false], [12, "module-pycopm.utils", false], [13, "module-pycopm.utils.files_writer", false], [14, "module-pycopm.utils.generate_coarser_files", false], [15, "module-pycopm.utils.grid_builder", false], [16, "module-pycopm.utils.input_values", false], [17, "module-pycopm.utils.properties_builder", false], [18, "module-pycopm.utils.runs_executer", false]], "opm_properties() (in module pycopm.utils.files_writer)": [[13, "pycopm.utils.files_writer.opm_properties", false]], "plotting() (in module pycopm.utils.runs_executer)": [[18, "pycopm.utils.runs_executer.plotting", false]], "process_input() (in module pycopm.utils.input_values)": [[16, "pycopm.utils.input_values.process_input", false]], "process_the_deck() (in module pycopm.utils.generate_coarser_files)": [[14, "pycopm.utils.generate_coarser_files.process_the_deck", false]], "pycopm": [[9, "module-pycopm", false]], "pycopm() (in module pycopm.core.pycopm)": [[11, "pycopm.core.pycopm.pycopm", false]], "pycopm.core": [[10, "module-pycopm.core", false]], "pycopm.core.pycopm": [[11, "module-pycopm.core.pycopm", false]], "pycopm.utils": [[12, "module-pycopm.utils", false]], "pycopm.utils.files_writer": [[13, "module-pycopm.utils.files_writer", false]], "pycopm.utils.generate_coarser_files": [[14, "module-pycopm.utils.generate_coarser_files", false]], "pycopm.utils.grid_builder": [[15, "module-pycopm.utils.grid_builder", false]], "pycopm.utils.input_values": [[16, "module-pycopm.utils.input_values", false]], "pycopm.utils.properties_builder": [[17, "module-pycopm.utils.properties_builder", false]], "pycopm.utils.runs_executer": [[18, "module-pycopm.utils.runs_executer", false]], "read_reference() (in module pycopm.utils.input_values)": [[16, "pycopm.utils.input_values.read_reference", false]], "read_the_first_part() (in module pycopm.utils.input_values)": [[16, "pycopm.utils.input_values.read_the_first_part", false]], "simulations() (in module pycopm.utils.runs_executer)": [[18, "pycopm.utils.runs_executer.simulations", false]], "write_grid() (in module pycopm.utils.generate_coarser_files)": [[14, "pycopm.utils.generate_coarser_files.write_grid", false]], "write_let_tables() (in module pycopm.utils.files_writer)": [[13, "pycopm.utils.files_writer.write_let_tables", false]], "write_props() (in module pycopm.utils.generate_coarser_files)": [[14, "pycopm.utils.generate_coarser_files.write_props", false]]}, "objects": {"": [[9, 0, 0, "-", "pycopm"]], "pycopm": [[10, 0, 0, "-", "core"], [12, 0, 0, "-", "utils"]], "pycopm.core": [[11, 0, 0, "-", "pycopm"]], "pycopm.core.pycopm": [[11, 1, 1, "", "load_parser"], [11, 1, 1, "", "main"], [11, 1, 1, "", "pycopm"]], "pycopm.utils": [[13, 0, 0, "-", "files_writer"], [14, 0, 0, "-", "generate_coarser_files"], [15, 0, 0, "-", "grid_builder"], [16, 0, 0, "-", "input_values"], [17, 0, 0, "-", "properties_builder"], [18, 0, 0, "-", "runs_executer"]], "pycopm.utils.files_writer": [[13, 1, 1, "", "coarser_files"], [13, 1, 1, "", "ert_files"], [13, 1, 1, "", "grid_features"], [13, 1, 1, "", "opm_properties"], [13, 1, 1, "", "write_let_tables"]], "pycopm.utils.generate_coarser_files": [[14, 1, 1, "", "create_deck"], [14, 1, 1, "", "find_neighbors"], [14, 1, 1, "", "get_ijk"], [14, 1, 1, "", "handle_clusters"], [14, 1, 1, "", "handle_cp_grid"], [14, 1, 1, "", "handle_fault"], [14, 1, 1, "", "handle_grid_props"], [14, 1, 1, "", "handle_mapaxes"], [14, 1, 1, "", "handle_pv"], [14, 1, 1, "", "handle_regions"], [14, 1, 1, "", "handle_segmented_wells"], [14, 1, 1, "", "handle_wells"], [14, 1, 1, "", "handle_zcorn"], [14, 1, 1, "", "map_ijk"], [14, 1, 1, "", "map_properties"], [14, 1, 1, "", "process_the_deck"], [14, 1, 1, "", "write_grid"], [14, 1, 1, "", "write_props"]], "pycopm.utils.grid_builder": [[15, 1, 1, "", "coarser_grid"], [15, 1, 1, "", "handle_face_dir_im"], [15, 1, 1, "", "handle_face_dir_ip"], [15, 1, 1, "", "handle_face_dir_jm"], [15, 1, 1, "", "handle_face_dir_jp"], [15, 1, 1, "", "handle_faults"]], "pycopm.utils.input_values": [[16, 1, 1, "", "assign_hm_parameters"], [16, 1, 1, "", "assign_standard_values"], [16, 1, 1, "", "get_number_of_lines"], [16, 1, 1, "", "initialize_values"], [16, 1, 1, "", "process_input"], [16, 1, 1, "", "read_reference"], [16, 1, 1, "", "read_the_first_part"]], "pycopm.utils.properties_builder": [[17, 1, 1, "", "add_lost_pv_to_all_cells"], [17, 1, 1, "", "add_lost_pv_to_all_eq_cells"], [17, 1, 1, "", "add_lost_pv_to_all_fip_cells"], [17, 1, 1, "", "add_lost_pv_to_boundary_cells"], [17, 1, 1, "", "coarser_properties"], [17, 1, 1, "", "identify_removed_pilars"], [17, 1, 1, "", "identify_removed_pilars_zdir"], [17, 1, 1, "", "initialize_properties"]], "pycopm.utils.runs_executer": [[18, 1, 1, "", "plotting"], [18, 1, 1, "", "simulations"]]}, "objnames": {"0": ["py", "module", "Python module"], "1": ["py", "function", "Python function"]}, "objtypes": {"0": "py:module", "1": "py:function"}, "terms": {"": [2, 3, 14], "0": [2, 3, 5], "01": 2, "03": 2, "04": 5, "1": [2, 5, 6], "10": 5, "100": 2, "1000": 3, "100000": 2, "2": [2, 3, 6], "2005": 2, "2022": 2, "2024": 5, "29": 16, "2d": 19, "3": [2, 3, 5], "331841": 0, "4": [2, 3], "5": [2, 3], "600": 2, "7": 2, "8": 3, "8859": 6, "9": [2, 5], "A": [2, 19], "As": 8, "By": 3, "For": [2, 3, 5], "If": [2, 5], "In": [3, 5, 6], "The": [1, 2, 3, 6, 8], "Then": [2, 3, 8], "To": [2, 5], "about": 4, "account": 2, "achiev": [2, 5], "activ": [2, 3, 5, 14, 17], "actnum": [6, 14], "actual": 3, "ad": 4, "adapt": [6, 8], "add": [2, 14], "add_lost_pv_to_all_cel": [9, 12, 17], "add_lost_pv_to_all_eq_cel": [9, 12, 17], "add_lost_pv_to_all_fip_cel": [9, 12, 17], "add_lost_pv_to_boundary_cel": [9, 12, 17], "addit": 5, "after": [1, 2, 5, 8], "al": 2, "all": [2, 6, 8, 14, 17], "allow": [2, 6], "also": [5, 14], "an": [2, 3, 4, 5, 19], "ani": [2, 19], "api": 4, "approach": [0, 2], "ar": [0, 1, 2, 3, 5, 6, 8, 19], "arg": [13, 14, 15, 16, 17, 18], "argument": [2, 6, 11, 14], "arrai": [14, 17], "assign_hm_paramet": [9, 12, 16], "assign_standard_valu": [9, 12, 16], "assum": 3, "avail": [2, 5, 6], "avoid": [3, 6], "back": 2, "base": [1, 6, 19], "befor": 16, "being": 0, "below": 19, "benchmark": 19, "between": [2, 3], "bin": [2, 5], "binari": 5, "block": [2, 17], "boundari": [2, 17], "branch": 5, "brew": 5, "build": [2, 4], "build_opm_mpi": 5, "built": 5, "c": [3, 6], "calcit": 19, "call": [1, 2, 8, 14], "can": [2, 3, 5, 8], "case": 1, "cd": 5, "cell": [2, 3, 14, 15, 16, 17], "cell_index": 15, "center": [0, 14], "cfd": 19, "chang": 2, "check": 19, "ci": 5, "clone": 5, "clusmax": 14, "clusmin": 14, "cluster": 14, "cmake": 5, "co2": 19, "coars": [2, 3, 14, 15, 17], "coarsen": [0, 1, 2, 6], "coarser": [2, 3, 6, 8, 14, 17], "coarser_fil": [9, 12, 13], "coarser_grid": [9, 12, 15], "coarser_properti": [9, 12, 17], "code": 5, "coers": 2, "com": [3, 5], "command": [2, 5], "common": 5, "complet": 2, "comput": 2, "concept": 4, "confer": 2, "configur": [4, 6], "connect": 3, "consid": 2, "contain": [1, 3], "content": [1, 3, 4, 6, 7], "contribut": [0, 5], "coordin": 14, "copi": 5, "core": [1, 5, 7, 9], "corner": [14, 15], "correct": [2, 17], "correspond": [2, 14], "could": [5, 8], "creat": [5, 6, 8, 14], "create_deck": [9, 12, 14], "creation": 6, "csp": 19, "cssr": [0, 3, 5], "current": [2, 3, 5, 6, 8, 14, 18], "current_directori": 5, "d_z": 14, "data": [2, 3], "datafram": 14, "date": 2, "dbg": 2, "dcmake_build_typ": 5, "dcmake_disable_find_package_mpi": 5, "dcmake_prefix_path": 5, "decid": 3, "deck": [1, 2, 4, 6, 13, 14, 17], "default": [2, 6], "defin": [2, 3, 17], "definit": [2, 3], "delet": 2, "describ": [6, 8], "descript": 2, "destroi": 14, "dev": 5, "develop": [6, 8], "dic": [13, 14, 15, 16, 17, 18], "dic1": 16, "dict": [13, 14, 15, 16, 17, 18], "dictionari": [13, 14, 15, 16, 17, 18], "diffeent": 14, "differ": [1, 2], "dir": [6, 15], "direct": [2, 3, 17], "directli": 8, "discuss": 2, "dist": 2, "distpara": 2, "distribut": [2, 14, 17], "dmar": 2, "do": [2, 5], "document": [2, 6], "done": [5, 6], "download": 3, "drogon": [1, 2, 4, 6, 8], "drogon_coars": 3, "dry": 3, "due": 5, "dune": 5, "dunecontrol": 5, "duse_mpi": 5, "dwith_ndebug": 5, "dynam": 19, "dz": 14, "e": [2, 3, 5, 6, 8], "each": 2, "earli": 8, "eg": 2, "egrid": 2, "emltg": 2, "emlto": 2, "enabl": [2, 3], "encod": 6, "ensembl": [2, 6], "ensemble_experi": 2, "ensemble_smooth": 2, "entri": 2, "environ": 5, "eo": 2, "eog": 2, "eqlnum": 17, "equil": 2, "error": 2, "ert": [1, 2, 6, 8, 13, 16, 18], "ert_fil": [9, 12, 13], "es_mda": 2, "et": 2, "everest": [6, 8], "ew": 2, "exampl": [2, 4, 8], "execut": [1, 2, 3, 5, 6, 8, 11, 18], "exist": 5, "expans": 19, "exprecc": 4, "f": 6, "face": 15, "fault": [3, 6, 14, 15], "favourit": [6, 8], "figur": [3, 8, 19], "file": [1, 4, 5, 6, 13, 14, 16, 18], "files_writ": [9, 12], "final": [1, 2], "find": 14, "find_neighbor": [9, 12, 14], "fine": 2, "fipnum": 17, "first": [2, 16], "flag": [2, 14, 16], "flexibl": 6, "float": [14, 18], "flow": [0, 1, 2, 4, 6, 13, 18, 19], "focu": [6, 8], "focuc": 8, "focus": 6, "folder": [1, 3, 4, 5, 6], "follow": [2, 3, 5, 6, 8], "fork": 0, "framework": [1, 6, 19], "friend": 3, "from": [1, 2, 3, 5, 14, 15, 16, 19], "full": [2, 6], "function": [1, 2, 11, 13, 15, 16, 17, 18], "fund": 0, "further": 8, "g": [2, 3, 5, 6, 8], "gener": [1, 2, 3, 6, 8, 14, 15, 17, 18, 19], "generate_coarser_fil": [9, 12], "geolog": [0, 2, 6, 8], "geometri": 5, "get": 5, "get_ijk": [9, 12, 14], "get_number_of_lin": [9, 12, 16], "git": [3, 5], "github": [2, 3, 5], "gitlab": 5, "give": [6, 8], "given": [2, 19], "global": [13, 14, 15, 16, 17, 18], "grdecl": 2, "grid": [3, 5, 13, 14, 15, 17], "grid_build": [9, 12], "grid_featur": [9, 12, 13], "gui": 2, "h": 2, "handl": [3, 14], "handle_clust": [9, 12, 14], "handle_cp_grid": [9, 12, 14], "handle_face_dir_im": [9, 12, 15], "handle_face_dir_ip": [9, 12, 15], "handle_face_dir_jm": [9, 12, 15], "handle_face_dir_jp": [9, 12, 15], "handle_fault": [9, 12, 14, 15], "handle_grid_prop": [9, 12, 14], "handle_mapax": [9, 12, 14], "handle_pv": [9, 12, 14], "handle_region": [9, 12, 14], "handle_segmented_wel": [9, 12, 14], "handle_wel": [9, 12, 14], "handle_zcorn": [9, 12, 14], "have": [2, 14], "here": 2, "higher": 3, "histori": [2, 6, 8], "hm": [2, 3], "honor": 2, "horda": 19, "http": [3, 5], "i": [0, 1, 2, 3, 6, 8, 14, 15], "i_d": 14, "identifi": [14, 17], "identify_removed_pilar": [9, 12, 17], "identify_removed_pilars_zdir": [9, 12, 17], "imag": 19, "implement": [2, 3, 6], "in_fil": 16, "inact": 3, "inc": [2, 16], "includ": [3, 5], "increas": 14, "ind": [14, 16], "index": [2, 4, 14, 15, 17], "indic": [3, 14], "induc": 19, "inform": 2, "infostep": 2, "init": 2, "initi": [2, 6, 16, 17], "initialize_properti": [9, 12, 17], "initialize_valu": [9, 12, 16], "inject": 16, "input": [2, 4, 6, 14, 16, 17], "input_valu": [9, 12], "insid": [3, 5], "instal": [3, 4], "instead": 2, "int": [14, 15, 16, 17], "integ": 14, "integr": 2, "interest": [5, 19], "interv": 2, "introduct": [4, 8], "inx": 17, "ir": 14, "iso": 6, "istl": 5, "iter": 2, "iterative_ensemble_smooth": 2, "its": 14, "j": [2, 3, 6, 14, 15], "j5": 5, "job": 1, "jump": [2, 3, 14], "just": 6, "k": [2, 3, 14, 15], "keep": [2, 14], "keyword": 14, "last": [2, 16], "later": 2, "leakag": 19, "least": [5, 14], "left": [3, 8], "let": [2, 13], "level": 6, "lg": 2, "librari": 5, "line": [2, 5, 16], "lint": 5, "linux": 4, "list": [14, 16], "lmltg": 2, "lmlto": 2, "lo": 2, "load_pars": [9, 10, 11], "local": 16, "locat": 1, "log": 2, "lol": 16, "lost": [2, 17], "lw": 2, "m": 5, "maco": 4, "macport": 5, "main": [1, 2, 3, 9, 10, 11, 14], "make": [5, 14], "mako": [1, 13], "manual": 6, "map": [14, 15], "map_ijk": [9, 12, 14], "map_properti": [9, 12, 14], "mask": 14, "master": 5, "match": [2, 6, 8], "max": [2, 6], "maximum": 2, "mean": 2, "memori": 2, "method": [13, 14, 15, 17], "micp": 4, "microbi": 19, "microsystem": 19, "might": 19, "min": [2, 6], "minimum": 2, "mkdir": 5, "mode": [3, 6], "model": [0, 2, 3, 5, 6, 8, 19], "modifi": [2, 5, 13, 14, 15, 16, 17, 18], "modul": [1, 4, 5, 7, 19], "more": 0, "mpi": [2, 5], "mpirun": 2, "must": 2, "n": 14, "name": [2, 6, 16], "necessari": [13, 14], "need": [2, 5, 6, 8], "neighbour": [3, 14], "new": 14, "newton": 2, "next": 2, "nnc": 6, "none": [13, 14, 18], "nor": 14, "norn": [1, 2, 3, 6, 8], "nrwo": 14, "ntg": 2, "num": 17, "num_lin": 16, "number": [2, 16], "o": [3, 6, 14], "observ": 2, "observations_complet": 2, "observations_test": 2, "observations_train": 2, "obtain": 16, "one": [2, 8, 14], "onli": [2, 5, 6, 8, 14], "open": 19, "opm": [0, 1, 2, 4, 6, 13, 16, 18, 19], "opm_properti": [9, 12, 13], "optim": [6, 8], "option": [2, 6, 11], "order": [2, 3], "org": 5, "origin": [1, 3], "our": 3, "out": 19, "output": [4, 6, 16], "overview": [2, 4], "packag": [1, 4, 6, 7], "page": 4, "panda": 14, "parallel": 2, "paramet": [2, 6, 16, 17], "path": [2, 6], "perform": [3, 6], "perm_max": 2, "perm_min": 2, "permeabl": 2, "permi": 2, "permx": 2, "permz": 2, "pet": [6, 8], "pilar": [2, 17], "pillar": [2, 14], "pip": [3, 5], "platform": 19, "plopm": [3, 4], "plot": [8, 9, 12, 18], "png": [3, 19], "point": [14, 15], "pore": [14, 17], "poro": 2, "poros": [2, 3], "posit": [14, 15], "postprocess": 8, "precipit": 19, "prerequisit": 5, "previou": 5, "process": [2, 14, 16], "process_input": [9, 12, 16], "process_the_deck": [9, 12, 14], "progress": 0, "project": [0, 5, 19], "prop": 14, "properti": [2, 3, 13, 14, 17], "properties_build": [9, 12], "provid": 2, "prt": 2, "pull": 0, "pv": 2, "pwd": 5, "py": [3, 8, 18], "pycopm": [2, 3, 5, 6, 8], "pymm": 4, "pyocpm": 1, "pyopmnearwel": 4, "pyopmspe11": 4, "python": [4, 19], "python3": 5, "quantiti": 16, "quick": 19, "r": 5, "random": 2, "read": [2, 6, 16], "read_refer": [9, 12, 16], "read_the_first_part": [9, 12, 16], "realiz": 2, "refer": [15, 17], "reference_simul": 1, "regard": 2, "region": [2, 14], "relat": [4, 13], "releas": 5, "remain": 2, "remedi": 19, "remov": [2, 3, 14, 17], "replac": 3, "repo": 5, "repositori": 5, "reproduc": 2, "request": 0, "requir": [3, 5, 14, 16, 17], "requiri": 16, "resdata": 5, "reservoir": 6, "resinsight": 8, "resourc": [0, 19], "respect": 2, "result": [2, 8], "return": [13, 14, 15, 16, 17, 18], "right": [3, 8, 14], "rmv": 14, "roadmap": 4, "rock": 2, "row": 14, "rst": 2, "run": [1, 2, 3, 5, 6, 8, 13, 18], "runs_execut": [9, 12], "runtim": 2, "same": [2, 14, 17], "sandv": 2, "sat": 2, "satnum": 2, "satur": [2, 13, 16], "save": 2, "scale": [2, 6], "screenshot": 8, "scrip": 14, "script": [1, 5, 11], "search": [4, 14], "second": 2, "section": 14, "see": [2, 3, 5, 8], "seed": 2, "segment": 14, "select": [2, 8, 18], "set": [2, 3, 16], "setuptool": 5, "sh": 5, "shape": 2, "shift": 14, "should": [3, 5], "show": 8, "shown": 2, "simplifi": 6, "simul": [2, 3, 5, 8, 9, 12, 16, 18, 19], "sinc": 2, "singl": 2, "slide": 19, "smeaheia": 4, "smspec": 2, "so": [5, 14], "some": [8, 19], "some_input": 6, "some_output_fold": 6, "sourc": [4, 19], "space": 2, "spe10": [4, 8], "spe10_model2": 3, "spe11": 19, "specif": 2, "splite": 14, "standard": 2, "static": 3, "statoil_feasibility_sim_model_with_depletion_kross_inj_sector_20": 3, "statoil_feasibility_sim_model_with_depletion_kross_inj_sector_20_pycopm": 3, "stop": 2, "storag": [2, 19], "str": 16, "structur": 6, "studi": [2, 3, 6, 8, 18, 19], "submodul": [1, 7, 9], "subpackag": [1, 4, 7], "subsurfac": 0, "subsystem": 5, "succeed": 2, "success": 2, "suffix": 2, "support": [2, 5, 6, 14], "sure": 14, "sustain": 0, "tabl": 13, "templat": [6, 13], "template_script": 1, "termin": [2, 3, 5], "test": [1, 2, 3, 5, 6], "test_generic_deck": [3, 8], "test_run": 2, "text": 16, "tg": 2, "than": 0, "them": 19, "thi": [0, 2, 3, 5, 6, 8], "those": 3, "three": 2, "time": [2, 3, 18], "tmltg": 2, "tmlto": 2, "tog": 2, "tool": [0, 3, 5, 6, 8, 19], "true": [2, 3], "try": 5, "tun": [3, 6], "turn": 5, "tw": 2, "two": 6, "txt": [2, 3, 5, 6], "type": 2, "uncoars": 16, "uniform": 2, "unlimit": 2, "unrst": 2, "unsmri": 2, "upgrad": 5, "us": [0, 1, 2, 3, 5, 6, 8, 17, 19], "user": [2, 5], "utf8": 6, "util": [1, 7, 9], "utilii": [13, 14, 15, 16, 17, 18], "v2": 5, "valu": [2, 3, 16], "variabl": [3, 13, 16], "vector": [2, 6], "venv": 5, "version": 5, "via": [2, 4, 6], "view": 14, "virtual": 5, "visual": 8, "volum": [14, 17], "vpycopm": 5, "wa": [6, 8], "we": [2, 3, 14], "weight": 2, "welcom": 0, "well": [14, 19], "wellspec": 3, "wgpr": 2, "wheel": 5, "where": [3, 6], "which": [2, 5], "white": 2, "window": 4, "without": 2, "wopr": 2, "work": [0, 6], "write": [2, 13, 14, 17], "write_grid": [9, 12, 14], "write_let_t": [9, 12, 13], "write_prop": [9, 12, 14], "wwpr": 2, "x": [2, 3, 6], "y": [2, 3, 6], "yml": 5, "you": [2, 3, 5], "your": [2, 6, 8], "z": [2, 3, 6, 14, 17], "z_z": 14, "zcord": 14, "zcorn": 14}, "titles": ["About pycopm", "pycopm Python API", "Configuration file", "Examples", "Welcome to pycopm\u2019s documentation!", "Installation", "Introduction", "pycopm", "Output folder", "pycopm package", "pycopm.core package", "pycopm.core.pycopm module", "pycopm.utils package", "pycopm.utils.files_writer module", "pycopm.utils.generate_coarser_files module", "pycopm.utils.grid_builder module", "pycopm.utils.input_values module", "pycopm.utils.properties_builder module", "pycopm.utils.runs_executer module", "Related"], "titleterms": {"": 4, "about": 0, "ad": 19, "an": 8, "api": 1, "build": 5, "concept": 6, "configur": [2, 3, 8], "content": [9, 10, 12], "core": [10, 11], "deck": [3, 8], "document": 4, "drogon": 3, "exampl": 3, "exprecc": 19, "file": [2, 3, 8], "files_writ": 13, "flow": [3, 5, 8], "folder": 8, "generate_coarser_fil": 14, "grid_build": 15, "indic": 4, "input": 8, "input_valu": 16, "instal": 5, "introduct": 6, "linux": 5, "maco": 5, "micp": 19, "modul": [9, 10, 11, 12, 13, 14, 15, 16, 17, 18], "opm": [3, 5, 8], "output": 8, "overview": 6, "packag": [5, 9, 10, 12], "plopm": 19, "properties_build": 17, "pycopm": [0, 1, 4, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18], "pymm": 19, "pyopmnearwel": 19, "pyopmspe11": 19, "python": [1, 5], "relat": 19, "roadmap": 6, "runs_execut": 18, "smeaheia": 3, "sourc": 5, "spe10": 3, "submodul": [10, 12], "subpackag": 9, "tabl": 4, "util": [12, 13, 14, 15, 16, 17, 18], "via": [3, 8], "welcom": 4, "window": 5}}) \ No newline at end of file +Search.setIndex({"docnames": ["about", "api", "configuration_file", "examples", "index", "installation", "introduction", "modules", "output_folder", "pycopm", "pycopm.core", "pycopm.core.pycopm", "pycopm.utils", "pycopm.utils.files_writer", "pycopm.utils.generate_coarser_files", "pycopm.utils.grid_builder", "pycopm.utils.input_values", "pycopm.utils.properties_builder", "pycopm.utils.runs_executer", "related"], "filenames": ["about.rst", "api.rst", "configuration_file.rst", "examples.rst", "index.rst", "installation.rst", "introduction.rst", "modules.rst", "output_folder.rst", "pycopm.rst", "pycopm.core.rst", "pycopm.core.pycopm.rst", "pycopm.utils.rst", "pycopm.utils.files_writer.rst", "pycopm.utils.generate_coarser_files.rst", "pycopm.utils.grid_builder.rst", "pycopm.utils.input_values.rst", "pycopm.utils.properties_builder.rst", "pycopm.utils.runs_executer.rst", "related.rst"], "titles": ["About pycopm", "pycopm Python API", "Configuration file", "Examples", "Welcome to pycopm\u2019s documentation!", "Installation", "Introduction", "pycopm", "Output folder", "pycopm package", "pycopm.core package", "pycopm.core.pycopm module", "pycopm.utils package", "pycopm.utils.files_writer module", "pycopm.utils.generate_coarser_files module", "pycopm.utils.grid_builder module", "pycopm.utils.input_values module", "pycopm.utils.properties_builder module", "pycopm.utils.runs_executer module", "Related"], "terms": {"tool": [0, 3, 5, 6, 8, 19], "coarsen": [0, 1, 2, 6], "opm": [0, 1, 2, 4, 6, 13, 16, 18, 19], "flow": [0, 1, 2, 4, 6, 13, 18, 19], "geolog": [0, 2, 6, 8], "model": [0, 2, 3, 6, 8, 19], "i": [0, 1, 2, 3, 6, 8, 14, 15], "being": 0, "fund": 0, "center": [0, 14], "sustain": 0, "subsurfac": 0, "resourc": [0, 19], "cssr": [0, 3, 5, 6], "project": [0, 5, 19], "331841": 0, "thi": [0, 2, 3, 5, 6, 8], "work": [0, 6], "progress": 0, "contribut": [0, 5], "ar": [0, 1, 2, 3, 5, 6, 8, 19], "more": 0, "than": 0, "welcom": 0, "us": [0, 1, 2, 3, 5, 6, 8, 17, 19], "fork": 0, "pull": 0, "request": 0, "approach": [0, 2], "The": [1, 2, 3, 6, 8], "main": [1, 2, 3, 9, 10, 11, 14], "script": [1, 5, 11], "execut": [1, 2, 3, 5, 6, 8, 11, 18], "locat": 1, "core": [1, 5, 7, 9], "folder": [1, 3, 4, 5, 6], "differ": [1, 2], "job": 1, "call": [1, 2, 8, 14], "ert": [1, 2, 6, 8, 13, 16, 18], "reference_simul": 1, "contain": [1, 3], "gener": [1, 2, 4, 6, 8, 14, 15, 17, 18, 19], "file": [1, 4, 5, 6, 13, 14, 16, 18], "after": [1, 2, 3, 5, 8], "run": [1, 2, 3, 5, 6, 8, 13, 18], "norn": [1, 2, 3, 6, 8], "drogon": [1, 2, 4, 6, 8], "case": 1, "test": [1, 2, 3, 5, 6], "template_script": 1, "mako": [1, 13], "base": [1, 6, 19], "from": [1, 2, 3, 5, 14, 15, 16, 19], "origin": [1, 3], "deck": [1, 2, 4, 6, 13, 14, 17], "final": [1, 2], "util": [1, 7, 9], "function": [1, 2, 11, 13, 15, 16, 17, 18], "framework": [1, 6, 19], "pyocpm": 1, "packag": [1, 4, 7], "subpackag": [1, 4, 7], "submodul": [1, 7, 9], "modul": [1, 4, 5, 7, 19], "content": [1, 3, 4, 7], "allow": [2, 6], "set": [2, 3, 16], "integr": 2, "studi": [2, 3, 6, 8, 18, 19], "histori": [2, 6, 8], "match": [2, 6, 8], "onli": [2, 5, 6, 8, 14], "To": [2, 5], "pycopm": [2, 3, 5, 6, 8], "ani": 2, "given": 2, "coarser": [2, 3, 6, 8, 14, 17], "can": [2, 3, 5, 8], "achiev": [2, 5], "without": 2, "paramet": [2, 6, 16, 17], "via": [2, 4, 6], "command": [2, 5], "line": [2, 3, 5, 16], "see": [2, 3, 5, 6, 8], "overview": [2, 4], "h": 2, "definit": [2, 3], "argument": [2, 6, 11, 14], "option": [2, 6, 11], "exampl": [2, 4, 8], "here": [2, 3], "we": [2, 3, 14], "an": [2, 3, 4, 5, 19], "one": [2, 6, 8, 14], "txt": [2, 3, 5, 6], "first": [2, 3, 16], "input": [2, 4, 6, 14, 16, 17], "full": [2, 6], "path": [2, 3, 6], "If": [2, 5], "your": [2, 6, 8], "write": [2, 13, 14, 17], "e": [2, 3, 5, 6, 8], "g": [2, 3, 5, 6, 8], "user": [2, 5], "dmar": 2, "github": [2, 3, 5, 6], "build": [2, 4], "simul": [2, 3, 5, 8, 9, 12, 16, 18, 19], "bin": [2, 5], "follow": [2, 3, 5, 6, 8], "delet": 2, "suffix": 2, "save": 2, "storag": [2, 19], "egrid": 2, "dbg": 2, "grdecl": 2, "unrst": 2, "unsmri": 2, "prt": 2, "inc": [2, 3, 16], "infostep": 2, "smspec": 2, "init": 2, "you": [2, 3, 5], "type": [2, 19], "each": 2, "realiz": 2, "complet": 2, "order": [2, 3, 6], "memori": 2, "number": [2, 3, 16], "jump": [2, 3, 14], "2": [2, 3, 6], "4": [2, 3], "sinc": 2, "implement": [2, 3, 6], "white": 2, "space": 2, "between": [2, 6], "block": [2, 17], "need": [2, 5, 6, 8], "next": 2, "entri": 2, "defin": [2, 3, 17], "singl": 2, "0": [2, 3, 5, 6], "1": [2, 3, 5, 6], "vector": [2, 6], "x": [2, 3, 6], "coers": 2, "y": [2, 3, 6], "z": [2, 3, 6, 14, 17], "ensembl": [2, 6], "maximum": 2, "parallel": 2, "mpi": [2, 5], "process": [2, 14, 16], "600": 2, "runtim": 2, "second": 2, "A": [2, 19], "valu": [2, 3, 6, 16], "mean": [2, 6], "unlimit": 2, "minimum": 2, "must": 2, "have": [2, 14], "succeed": 2, "regard": 2, "success": 2, "7": 2, "specif": 2, "seed": 2, "reproduc": 2, "observations_train": 2, "name": [2, 6, 16], "observ": 2, "hm": [2, 3], "observations_test": 2, "observations_complet": 2, "select": [2, 8, 18], "which": [2, 3, 5], "default": [2, 6], "let": [2, 13], "sat": 2, "For": [2, 3, 5], "satnum": [2, 6], "comput": 2, "sandv": 2, "et": 2, "al": 2, "2022": 2, "cell": [2, 3, 6, 14, 15, 16, 17], "correct": [2, 6, 17], "lost": [2, 17], "pv": 2, "boundari": [2, 17], "account": 2, "poros": [2, 3, 6], "all": [2, 6, 8, 14, 17], "initi": [2, 6, 16, 17], "equil": 2, "fine": 2, "scale": [2, 6], "error": [2, 3], "wwpr": 2, "wopr": 2, "wgpr": 2, "100": 2, "100000": 2, "2005": 2, "03": 2, "01": 2, "last": [2, 16], "date": 2, "do": [2, 5], "remov": [2, 6, 14, 17], "current": [2, 3, 5, 6, 8, 14, 18], "read": [2, 6, 16], "result": [2, 8], "inform": 2, "shown": 2, "termin": [2, 3, 5], "instead": 2, "same": [2, 14, 17], "discuss": 2, "later": 2, "three": 2, "pillar": [2, 14], "direct": [2, 3, 6, 17], "respect": 2, "j": [2, 3, 6, 14, 15], "k": [2, 3, 14, 15], "index": [2, 4, 14, 15, 17], "standard": 2, "data": [2, 3, 6], "pilar": [2, 6, 17], "keep": [2, 6, 14], "honor": 2, "shape": 2, "Then": [2, 3, 8], "provid": 2, "chang": [2, 3], "": [2, 3, 6, 14], "add": [2, 6, 14], "back": 2, "remain": 2, "mpirun": 2, "avail": [2, 5, 6], "stop": 2, "time": [2, 3, 18], "random": 2, "satur": [2, 13, 16], "consid": 2, "region": [2, 14], "ntg": 2, "poro": [2, 6], "properti": [2, 3, 13, 14, 17], "modifi": [2, 5, 13, 14, 15, 16, 17, 18], "activ": [2, 3, 5, 6, 14, 17], "gui": 2, "test_run": 2, "ensemble_experi": 2, "ensemble_smooth": 2, "iterative_ensemble_smooth": 2, "es_mda": 2, "weight": 2, "flag": [2, 14, 16], "support": [2, 5, 6, 14], "confer": 2, "document": [2, 6], "descript": [2, 6], "enabl": [2, 3, 6], "rst": 2, "true": [2, 3], "newton": 2, "min": [2, 3, 6], "iter": 2, "dist": 2, "distpara": 2, "lw": 2, "3": [2, 3, 5, 6], "uniform": 2, "5": [2, 3], "ew": 2, "tw": 2, "lo": 2, "eo": 2, "lg": 2, "eg": 2, "tg": 2, "log": 2, "eog": 2, "tog": 2, "lmlto": 2, "emlto": 2, "9": [2, 3, 5], "tmlto": 2, "lmltg": 2, "emltg": 2, "tmltg": 2, "permeabl": 2, "rock": 2, "coars": [2, 3, 14, 15, 17], "max": [2, 3, 6], "permx": [2, 6], "permi": [2, 6], "permz": [2, 6], "distribut": [2, 14, 17], "interv": 2, "perm_min": 2, "perm_max": 2, "correspond": [2, 14], "perform": [3, 6], "insid": [3, 5], "o": [3, 6, 14], "drogon_coars": 3, "test_generic_deck": [3, 8], "py": [3, 8, 18], "where": [3, 6], "spe10_model2": 3, "download": 3, "c": [3, 6], "8": 3, "left": [3, 8], "right": [3, 8, 14], "By": 3, "statoil_feasibility_sim_model_with_depletion_kross_inj_sector_20": 3, "mode": [3, 6], "1000": [], "decid": 3, "should": [3, 5], "inact": [3, 6], "higher": [], "avoid": [3, 6], "grid": [3, 5, 6, 13, 14, 15, 17], "connect": [3, 6], "tun": [], "neighbour": [6, 14], "dry": 3, "static": 3, "variabl": [3, 13, 16], "statoil_feasibility_sim_model_with_depletion_kross_inj_sector_20_pycopm": 3, "our": 3, "plopm": [3, 4], "friend": 3, "png": [3, 19], "figur": [3, 8], "instal": [3, 4], "pip": [3, 5], "git": [3, 5], "http": [3, 5, 6], "com": [3, 5, 6], "In": [3, 5, 6], "handl": [3, 14], "requir": [3, 5, 14, 16, 17], "indic": [3, 14], "fault": [3, 6, 14, 15], "wellspec": 3, "assum": 3, "includ": [3, 5], "replac": 3, "those": 3, "actual": 3, "introduct": [4, 8], "concept": 4, "roadmap": 4, "python": [4, 19], "sourc": [4, 19], "linux": 4, "window": 4, "maco": 4, "configur": [4, 6], "spe10": [4, 8], "smeaheia": 4, "api": 4, "output": [4, 6, 16], "relat": [4, 13], "pyopmspe11": 4, "pyopmnearwel": 4, "exprecc": 4, "ad": 4, "micp": 4, "pymm": 4, "about": 4, "search": [4, 14], "page": 4, "exist": 5, "environ": 5, "interest": [5, 19], "code": 5, "clone": 5, "repositori": 5, "virtual": 5, "repo": 5, "get": 5, "cd": 5, "creat": [5, 6, 8, 14], "python3": 5, "m": 5, "venv": 5, "vpycopm": 5, "upgrad": 5, "setuptool": 5, "wheel": 5, "lint": 5, "dev": 5, "r": 5, "also": [5, 14], "org": 5, "releas": 5, "2024": 5, "04": 5, "master": 5, "branch": 5, "ci": 5, "yml": 5, "binari": 5, "subsystem": 5, "could": [5, 8], "try": [5, 6], "prerequisit": 5, "turn": 5, "current_directori": 5, "pwd": 5, "common": 5, "done": [5, 6], "mkdir": 5, "cmake": 5, "duse_mpi": 5, "dwith_ndebug": 5, "dcmake_build_typ": 5, "dcmake_prefix_path": 5, "make": [5, 6, 14], "j5": 5, "sh": 5, "build_opm_mpi": 5, "copi": 5, "previou": 5, "so": [5, 14], "built": 5, "addit": 5, "dune": 5, "librari": 5, "macport": 5, "brew": 5, "geometri": 5, "istl": 5, "gitlab": 5, "v2": 5, "dunecontrol": 5, "dcmake_disable_find_package_mpi": 5, "dpython_execut": 5, "dopm_enable_python": 5, "ON": 5, "least": [5, 6, 14], "version": 5, "10": 5, "due": 5, "resdata": 5, "describ": [6, 8], "host": 6, "simplifi": 6, "flexibl": 6, "develop": [6, 8], "focu": [6, 8], "wa": [6, 8], "two": 6, "reservoir": 6, "focus": 6, "give": [6, 8], "manual": 6, "templat": [6, 13], "adapt": [6, 8], "favourit": [6, 8], "optim": [6, 8], "pet": [6, 8], "everest": [6, 8], "name_of_input_fil": 6, "f": 6, "just": 6, "level": 6, "dir": [6, 15], "actnum": [6, 14], "new": [6, 14], "while": 6, "tune": 6, "creation": 6, "discontinu": 6, "along": 6, "around": 6, "noth": 6, "ha": 6, "6": 6, "would": [3, 6], "them": [6, 19], "utf8": 6, "iso": 6, "8859": 6, "encod": 6, "p": [3, 6], "pore": [3, 6, 14, 17], "volum": [3, 6, 14, 17], "closest": 6, "n": [3, 6, 14], "fipnum": [6, 17], "pvtnum": 6, "eqlnum": [6, 17], "imbnum": 6, "multnum": 6, "arithmet": 6, "averag": 6, "harmon": 6, "As": 8, "earli": 8, "screenshot": 8, "show": 8, "some": [8, 19], "postprocess": 8, "directli": 8, "further": 8, "plot": [8, 9, 12, 18], "visual": 8, "resinsight": 8, "focuc": 8, "load_pars": [9, 10, 11], "files_writ": [9, 12], "coarser_fil": [9, 12, 13], "ert_fil": [9, 12, 13], "grid_featur": [9, 12, 13], "opm_properti": [9, 12, 13], "write_let_t": [9, 12, 13], "generate_coarser_fil": [9, 12], "create_deck": [9, 12, 14], "find_neighbor": [9, 12, 14], "get_ijk": [9, 12, 14], "handle_clust": [9, 12, 14], "handle_cp_grid": [9, 12, 14], "handle_fault": [9, 12, 14, 15], "handle_grid_prop": [9, 12, 14], "handle_mapax": [9, 12, 14], "handle_pv": [9, 12, 14], "handle_region": [9, 12, 14], "handle_segmented_wel": [9, 12, 14], "handle_wel": [9, 12, 14], "handle_zcorn": [9, 12, 14], "map_ijk": [9, 12, 14], "map_properti": [9, 12, 14], "process_the_deck": [9, 12, 14], "write_grid": [9, 12, 14], "write_prop": [9, 12, 14], "grid_build": [9, 12], "coarser_grid": [9, 12, 15], "handle_face_dir_im": [9, 12, 15], "handle_face_dir_ip": [9, 12, 15], "handle_face_dir_jm": [9, 12, 15], "handle_face_dir_jp": [9, 12, 15], "input_valu": [9, 12], "assign_hm_paramet": [9, 12, 16], "assign_standard_valu": [9, 12, 16], "get_number_of_lin": [9, 12, 16], "initialize_valu": [9, 12, 16], "process_input": [9, 12, 16], "read_refer": [9, 12, 16], "read_the_first_part": [9, 12, 16], "properties_build": [9, 12], "add_lost_pv_to_all_cel": [9, 12, 17], "add_lost_pv_to_all_eq_cel": [9, 12, 17], "add_lost_pv_to_all_fip_cel": [9, 12, 17], "add_lost_pv_to_boundary_cel": [9, 12, 17], "coarser_properti": [9, 12, 17], "identify_removed_pilar": [9, 12, 17], "identify_removed_pilars_zdir": [9, 12, 17], "initialize_properti": [9, 12, 17], "runs_execut": [9, 12], "utilii": [13, 14, 15, 16, 17, 18], "necessari": [13, 14], "dic": [13, 14, 15, 16, 17, 18], "method": [13, 14, 15, 17], "arg": [13, 14, 15, 16, 17, 18], "dict": [13, 14, 15, 16, 17, 18], "global": [13, 14, 15, 16, 17, 18], "dictionari": [13, 14, 15, 16, 17, 18], "return": [13, 14, 15, 16, 17, 18], "none": [13, 14, 18], "tabl": 13, "scrip": 14, "diffeent": 14, "ind": [14, 16], "i_d": 14, "find": 14, "list": [14, 16], "int": [14, 15, 16, 17], "its": 14, "increas": 14, "shift": 14, "cluster": 14, "zcord": 14, "nrwo": 14, "splite": 14, "row": 14, "prop": [3, 14], "section": 14, "map": [14, 15], "view": 14, "clusmin": 14, "clusmax": 14, "rmv": 14, "sure": 14, "nor": 14, "destroi": 14, "panda": 14, "datafram": 14, "mask": 14, "segment": 14, "well": [14, 19], "keyword": 14, "ir": 14, "zcorn": 14, "coordin": 14, "corner": [14, 15], "d_z": 14, "z_t": 14, "z_b": 14, "z_b_t": 14, "arrai": [14, 17], "integ": 14, "float": [14, 18], "dz": 14, "top": 14, "posit": [14, 15], "bottom": 14, "identifi": [14, 17], "point": [14, 15], "cell_index": 15, "face": 15, "refer": [15, 17], "requiri": 16, "lol": 16, "num_lin": 16, "befor": 16, "inject": 16, "obtain": 16, "dic1": 16, "local": 16, "in_fil": 16, "str": 16, "text": 16, "quantiti": 16, "uncoars": 16, "29": 16, "inx": 17, "num": 17, "below": 19, "might": 19, "check": 19, "out": 19, "csp": 19, "spe11": 19, "benchmark": 19, "dynam": 19, "quick": 19, "gif": 19, "vtk": 19, "expans": 19, "co2": 19, "horda": 19, "platform": 19, "leakag": 19, "remedi": 19, "microbi": 19, "induc": 19, "calcit": 19, "precipit": 19, "open": 19, "imag": 19, "cfd": 19, "microsystem": 19, "trial": 3, "note": 3, "abov": 3, "drogon_hist": 3, "l127": 3, "128": 3, "schedul": 3, "l242": 3, "243": 3, "total": 3, "conserv": 3, "drogon_hist_pycopm": 3, "reduc": 3, "31": 3, "11": 3, "across": 3, "generet": 3, "swatinit": 3}, "objects": {"": [[9, 0, 0, "-", "pycopm"]], "pycopm": [[10, 0, 0, "-", "core"], [12, 0, 0, "-", "utils"]], "pycopm.core": [[11, 0, 0, "-", "pycopm"]], "pycopm.core.pycopm": [[11, 1, 1, "", "load_parser"], [11, 1, 1, "", "main"], [11, 1, 1, "", "pycopm"]], "pycopm.utils": [[13, 0, 0, "-", "files_writer"], [14, 0, 0, "-", "generate_coarser_files"], [15, 0, 0, "-", "grid_builder"], [16, 0, 0, "-", "input_values"], [17, 0, 0, "-", "properties_builder"], [18, 0, 0, "-", "runs_executer"]], "pycopm.utils.files_writer": [[13, 1, 1, "", "coarser_files"], [13, 1, 1, "", "ert_files"], [13, 1, 1, "", "grid_features"], [13, 1, 1, "", "opm_properties"], [13, 1, 1, "", "write_let_tables"]], "pycopm.utils.generate_coarser_files": [[14, 1, 1, "", "create_deck"], [14, 1, 1, "", "find_neighbors"], [14, 1, 1, "", "get_ijk"], [14, 1, 1, "", "handle_clusters"], [14, 1, 1, "", "handle_cp_grid"], [14, 1, 1, "", "handle_fault"], [14, 1, 1, "", "handle_grid_props"], [14, 1, 1, "", "handle_mapaxes"], [14, 1, 1, "", "handle_pv"], [14, 1, 1, "", "handle_regions"], [14, 1, 1, "", "handle_segmented_wells"], [14, 1, 1, "", "handle_wells"], [14, 1, 1, "", "handle_zcorn"], [14, 1, 1, "", "map_ijk"], [14, 1, 1, "", "map_properties"], [14, 1, 1, "", "process_the_deck"], [14, 1, 1, "", "write_grid"], [14, 1, 1, "", "write_props"]], "pycopm.utils.grid_builder": [[15, 1, 1, "", "coarser_grid"], [15, 1, 1, "", "handle_face_dir_im"], [15, 1, 1, "", "handle_face_dir_ip"], [15, 1, 1, "", "handle_face_dir_jm"], [15, 1, 1, "", "handle_face_dir_jp"], [15, 1, 1, "", "handle_faults"]], "pycopm.utils.input_values": [[16, 1, 1, "", "assign_hm_parameters"], [16, 1, 1, "", "assign_standard_values"], [16, 1, 1, "", "get_number_of_lines"], [16, 1, 1, "", "initialize_values"], [16, 1, 1, "", "process_input"], [16, 1, 1, "", "read_reference"], [16, 1, 1, "", "read_the_first_part"]], "pycopm.utils.properties_builder": [[17, 1, 1, "", "add_lost_pv_to_all_cells"], [17, 1, 1, "", "add_lost_pv_to_all_eq_cells"], [17, 1, 1, "", "add_lost_pv_to_all_fip_cells"], [17, 1, 1, "", "add_lost_pv_to_boundary_cells"], [17, 1, 1, "", "coarser_properties"], [17, 1, 1, "", "identify_removed_pilars"], [17, 1, 1, "", "identify_removed_pilars_zdir"], [17, 1, 1, "", "initialize_properties"]], "pycopm.utils.runs_executer": [[18, 1, 1, "", "plotting"], [18, 1, 1, "", "simulations"]]}, "objtypes": {"0": "py:module", "1": "py:function"}, "objnames": {"0": ["py", "module", "Python module"], "1": ["py", "function", "Python function"]}, "titleterms": {"about": 0, "pycopm": [0, 1, 4, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18], "python": [1, 5], "api": 1, "configur": [2, 3, 8], "file": [2, 3, 8], "exampl": 3, "via": [3, 8], "drogon": 3, "opm": [3, 5, 8], "flow": [3, 5, 8], "deck": [3, 8], "spe10": 3, "smeaheia": 3, "welcom": 4, "": 4, "document": 4, "indic": 4, "tabl": 4, "instal": 5, "packag": [5, 9, 10, 12], "sourc": 5, "build": 5, "linux": 5, "window": 5, "maco": 5, "introduct": 6, "concept": 6, "roadmap": 6, "overview": 6, "output": 8, "folder": 8, "an": 8, "input": 8, "subpackag": 9, "modul": [9, 10, 11, 12, 13, 14, 15, 16, 17, 18], "content": [9, 10, 12], "core": [10, 11], "submodul": [10, 12], "util": [12, 13, 14, 15, 16, 17, 18], "files_writ": 13, "generate_coarser_fil": 14, "grid_build": 15, "input_valu": 16, "properties_build": 17, "runs_execut": 18, "relat": 19, "pyopmspe11": 19, "pyopmnearwel": 19, "plopm": 19, "exprecc": 19, "ad": 19, "micp": 19, "pymm": 19, "gener": 3}, "envversion": {"sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx": 60}, "alltitles": {"About pycopm": [[0, "about-pycopm"]], "pycopm Python API": [[1, "pycopm-python-api"]], "pycopm": [[1, "pycopm"], [7, "pycopm"]], "Configuration file": [[2, "configuration-file"]], "Welcome to pycopm\u2019s documentation!": [[4, "welcome-to-pycopm-s-documentation"]], "Indices and tables": [[4, "indices-and-tables"]], "Installation": [[5, "installation"]], "Python package": [[5, "python-package"]], "OPM Flow": [[5, "opm-flow"]], "Source build in Linux/Windows": [[5, "source-build-in-linux-windows"]], "Source build in macOS": [[5, "source-build-in-macos"]], "Via configuration files": [[8, "via-configuration-files"], [3, "via-configuration-files"]], "Output folder": [[8, "output-folder"]], "Via an OPM Flow input deck": [[8, "via-an-opm-flow-input-deck"]], "pycopm package": [[9, "pycopm-package"]], "Subpackages": [[9, "subpackages"]], "Module contents": [[9, "module-pycopm"], [10, "module-pycopm.core"], [12, "module-pycopm.utils"]], "pycopm.core package": [[10, "pycopm-core-package"]], "Submodules": [[10, "submodules"], [12, "submodules"]], "pycopm.core.pycopm module": [[11, "module-pycopm.core.pycopm"]], "pycopm.utils package": [[12, "pycopm-utils-package"]], "pycopm.utils.files_writer module": [[13, "module-pycopm.utils.files_writer"]], "pycopm.utils.generate_coarser_files module": [[14, "module-pycopm.utils.generate_coarser_files"]], "pycopm.utils.grid_builder module": [[15, "module-pycopm.utils.grid_builder"]], "pycopm.utils.input_values module": [[16, "module-pycopm.utils.input_values"]], "pycopm.utils.properties_builder module": [[17, "module-pycopm.utils.properties_builder"]], "pycopm.utils.runs_executer module": [[18, "module-pycopm.utils.runs_executer"]], "Related": [[19, "related"]], "pyopmspe11": [[19, "pyopmspe11"]], "pyopmnearwell": [[19, "pyopmnearwell"]], "plopm": [[19, "plopm"]], "expreccs": [[19, "expreccs"]], "ad-micp": [[19, "ad-micp"]], "pymm": [[19, "pymm"]], "Introduction": [[6, "introduction"]], "Concept": [[6, "concept"]], "Roadmap": [[6, "roadmap"]], "Overview": [[6, "overview"]], "Examples": [[3, "examples"]], "Drogon": [[3, "drogon"]], "Via OPM Flow decks": [[3, "via-opm-flow-decks"]], "SPE10": [[3, "spe10"]], "Smeaheia": [[3, "smeaheia"]], "Generic Drogon": [[3, "generic-drogon"]]}, "indexentries": {}}) \ No newline at end of file diff --git a/docs/text/examples.rst b/docs/text/examples.rst index 9f4fbd8..bf1edd5 100644 --- a/docs/text/examples.rst +++ b/docs/text/examples.rst @@ -48,11 +48,10 @@ then: .. code-block:: bash - pycopm -i Statoil_Feasibility_sim_model_with_depletion_KROSS_INJ_SECTOR_20.DATA -o . -c 5,4,3 -a mode -j 1000 + pycopm -i Statoil_Feasibility_sim_model_with_depletion_KROSS_INJ_SECTOR_20.DATA -o . -c 5,4,3 -a mode will generate a coarser model 5 times in the x direction, 4 in the y direction, and 3 in the z direction, where the mode is -used to decide if a coarser cell should be active or inactive. The jump (-j) is set to a higher value (1000) to avoid removal -of grid connections (this is a tunning value to remove generated connections between neighbours in the coarse model). +used to decide if a coarser cell should be active or inactive. We can execute a dry run of OPM Flow to generate the grid and static variables of the coarser model: @@ -76,4 +75,28 @@ We use our `plopm `_ friend to generate PNG .. note:: In the current implementation of the **pycopm** tool, the handling of properties that require definitions of i,j,k indices (e.g., FAULTS, WELLSPECS) are assumed to be define in the main .DATA deck. Then, in order to use **pycopm** for simulation models - where these properties are define via include files, replace those includes in the .DATA deck with the actual content of the include files. \ No newline at end of file + where these properties are define via include files, replace those includes in the .DATA deck with the actual content of the include files. + +Generic Drogon +-------------- +Following the note above, then by downloading the `DROGON model `_, replacing the lines in +`DROGON_HIST.DATA `_ for the FAULTS (L127-128) and SCHEDULE (L242-243) with +the actual content of those include files, then by executing: + +.. code-block:: bash + + pycopm -i DROGON_HIST.DATA -o . -c 1,1,3 -a min -n max -p 1 + pycopm -i DROGON_HIST_PYCOPM.DATA -o . -c 1,3,1 -a mode -n mode -p 1 -j 1.9 + +this would generate the following coarse model: + +.. figure:: figs/drogon_generic.png + + Note that the total pore volume is conserved for the coarse model. + +Here, we first coarse in the z direction, which reduces the number of cells from 31 to 11, and after we coarse in the y direction. +After trial and error, the jump (-j) is set to 1.9 to avoid generated connections across the faults. + +.. note:: + After genereting the first coarser deck (DROGON_HIST_PYCOPM.DATA), change the path '../include/props/drogon.swatinit' to 'SWATINIT.INC', + which contains the right number of values for the coarse model. \ No newline at end of file diff --git a/docs/text/figs/drogon_generic.png b/docs/text/figs/drogon_generic.png new file mode 100644 index 0000000..709e175 Binary files /dev/null and b/docs/text/figs/drogon_generic.png differ diff --git a/docs/text/figs/plopm.png b/docs/text/figs/plopm.png index b7b084f..434af77 100644 Binary files a/docs/text/figs/plopm.png and b/docs/text/figs/plopm.png differ diff --git a/docs/text/figs/pyopmspe11.gif b/docs/text/figs/pyopmspe11.gif index e0a88a5..969ba51 100644 Binary files a/docs/text/figs/pyopmspe11.gif and b/docs/text/figs/pyopmspe11.gif differ diff --git a/docs/text/installation.rst b/docs/text/installation.rst index 82165e2..8697a84 100644 --- a/docs/text/installation.rst +++ b/docs/text/installation.rst @@ -51,25 +51,25 @@ in the terminal the following lines (which in turn should build flow in the fold CURRENT_DIRECTORY="$PWD" - for repo in common grid models simulators + for repo in common grid simulators do git clone https://github.com/OPM/opm-$repo.git done mkdir build - for repo in common grid models + for repo in common grid do mkdir build/opm-$repo cd build/opm-$repo - cmake -DUSE_MPI=1 -DWITH_NDEBUG=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$CURRENT_DIRECTORY/build/opm-common;$CURRENT_DIRECTORY/build/opm-grid" $CURRENT_DIRECTORY/opm-$repo + cmake -DUSE_MPI=1 -DWITH_NDEBUG=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$CURRENT_DIRECTORY/build/opm-common" $CURRENT_DIRECTORY/opm-$repo make -j5 opm$repo cd ../.. done mkdir build/opm-simulators cd build/opm-simulators - cmake -DUSE_MPI=1 -DWITH_NDEBUG=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$CURRENT_DIRECTORY/build/opm-common;$CURRENT_DIRECTORY/build/opm-grid;$CURRENT_DIRECTORY/build/opm-models" $CURRENT_DIRECTORY/opm-simulators + cmake -DUSE_MPI=1 -DWITH_NDEBUG=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$CURRENT_DIRECTORY/build/opm-common;$CURRENT_DIRECTORY/build/opm-grid" $CURRENT_DIRECTORY/opm-simulators make -j5 flow cd ../.. @@ -95,25 +95,25 @@ For macOS, there are no available binary packages, so OPM Flow needs to be built ./dune-common/bin/dunecontrol --only=dune-$module make -j5 done - for repo in common grid models simulators + for repo in common grid simulators do git clone https://github.com/OPM/opm-$repo.git done mkdir build - for repo in common grid models + for repo in common grid do mkdir build/opm-$repo cd build/opm-$repo - cmake -DUSE_MPI=0 -DWITH_NDEBUG=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$CURRENT_DIRECTORY/dune-common/build-cmake;$CURRENT_DIRECTORY/dune-grid/build-cmake;$CURRENT_DIRECTORY/dune-geometry/build-cmake;$CURRENT_DIRECTORY/dune-istl/build-cmake;$CURRENT_DIRECTORY/build/opm-common;$CURRENT_DIRECTORY/build/opm-grid" $CURRENT_DIRECTORY/opm-$repo + cmake -DPYTHON_EXECUTABLE=$(which python) -DWITH_NDEBUG=1 -DUSE_MPI=0 -DOPM_ENABLE_PYTHON=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$CURRENT_DIRECTORY/dune-common/build-cmake;$CURRENT_DIRECTORY/dune-grid/build-cmake;$CURRENT_DIRECTORY/dune-geometry/build-cmake;$CURRENT_DIRECTORY/dune-istl/build-cmake;$CURRENT_DIRECTORY/build/opm-common" $CURRENT_DIRECTORY/opm-$repo make -j5 opm$repo cd ../.. done mkdir build/opm-simulators cd build/opm-simulators - cmake -DUSE_MPI=0 -DWITH_NDEBUG=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$CURRENT_DIRECTORY/dune-common/build-cmake;$CURRENT_DIRECTORY/dune-grid/build-cmake;$CURRENT_DIRECTORY/dune-geometry/build-cmake;$CURRENT_DIRECTORY/dune-istl/build-cmake;$CURRENT_DIRECTORY/build/opm-common;$CURRENT_DIRECTORY/build/opm-grid;$CURRENT_DIRECTORY/build/opm-models" $CURRENT_DIRECTORY/opm-simulators + cmake -DUSE_MPI=0 -DWITH_NDEBUG=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$CURRENT_DIRECTORY/dune-common/build-cmake;$CURRENT_DIRECTORY/dune-grid/build-cmake;$CURRENT_DIRECTORY/dune-geometry/build-cmake;$CURRENT_DIRECTORY/dune-istl/build-cmake;$CURRENT_DIRECTORY/build/opm-common;$CURRENT_DIRECTORY/build/opm-grid" $CURRENT_DIRECTORY/opm-simulators make -j5 flow cd ../.. diff --git a/docs/text/introduction.rst b/docs/text/introduction.rst index 47d838d..b68ab76 100644 --- a/docs/text/introduction.rst +++ b/docs/text/introduction.rst @@ -4,7 +4,7 @@ Introduction .. image:: ./figs/pycopm.gif -This documentation describes the content of the **pycopm** package. +This documentation describes the **pycopm** tool hosted in `https://github.com/cssr-tools/pycopm `_. Concept ------- @@ -28,17 +28,20 @@ The current implementation supports the following executable with the argument o .. code-block:: bash - pycopm -i some_input -o some_output_folder + pycopm -i name_of_input_file where -- \-i: The base name of the :doc:`configuration file <./configuration_file>` or the name of the deck (`input.txt` by default). -- \-o: The base name of the :doc:`output folder <./output_folder>` (`output` by default). -- \-f: OPM Flow full path to executable or just `flow` (`flow` by default). -- \-c: Level of coarsening in the x, y, and z dir (`2,2,2` by default). -- \-a: Use min, max, or mode to scale the actnum (`min` by default). -- \-j: Tunning parameter to avoid creation of nnc on the structural faults (`2.` by default). -- \-x: Vector of x-coarsening (`` by default). -- \-y: Vector of y-coarsening (`` by default). -- \-z: Vector of z-coarsening (`` by default). -- \-e: Use `utf8` or `ISO-8859-1` encoding to read the deck (`ISO-8859-1` by default). +-i The base name of the :doc:`configuration file <./configuration_file>` or the name of the deck, e.g., `DROGON.DATA`, (`input.txt` by default). +-o The base name of the :doc:`output folder <./output_folder>` ('.'' by default, i.e., the folder where pycopm is executed). +-f OPM Flow full path to executable or just `flow` (`flow` by default). +-c Level of coarsening in the x, y, and z dir (`2,2,2` by default). +-a Use `min`, `max`, or `mode` to scale the actnum, e.g., min makes the new coarser cell inactive it at least one cell is inactive, while max makes it active it at least one cell is active (`max` by default). +-j Tuning parameter to avoid creation of neighbouring connections in the coarser model where there are discontinuities between cells along the z direction, e.g., around faults ('' by default, i.e., nothing corrected; if need it, try with values of the order of 1). +-x Vector of x-coarsening, e.g., if the grid has 6 cells in the x direction, then `0,2,0,2,0,2,0` would generate a coarser model with 3 cells, while `0,2,2,2,2,2,0` would generate a coarser model with 1 cell, i.e., 0 keeps the pilars while 2 removes them ('' by default), +-y Vector of y-coarsening, see the description for -x ('' by default). +-z Vector of z-coarsening, see the description for -x ('' by default). +-e Use `utf8` or `ISO-8859-1` encoding to read the deck (`ISO-8859-1` by default). +-p Add the removed pore volume to the closest coarser cells (`0` by default, `1` to enable). +-n Use `min`, `max`, or `mode` to scale satnum, fipnum, pvtnum, eqlnum, imbnum, and multnum (`mode` by default). +-s Use `min`, `max`, or `mean` to scale permx, permy, permz, and poro ('' by default, i.e., using the arithmetic average for permx/permy, harmonic average for permz, and the mean for the porosity). \ No newline at end of file diff --git a/docs/text/related.rst b/docs/text/related.rst index f3a0fcf..a35bb61 100644 --- a/docs/text/related.rst +++ b/docs/text/related.rst @@ -28,7 +28,7 @@ plopm .. image:: ./figs/plopm.png -`Quick generation of PNG figures from a simulation model given any 2D slide `_. +`Quick generation of PNGs, GIFs, and VTKs from a OPM Flow type model `_. ******** expreccs diff --git a/src/pycopm/core/pycopm.py b/src/pycopm/core/pycopm.py index 611f42e..90ac289 100644 --- a/src/pycopm/core/pycopm.py +++ b/src/pycopm/core/pycopm.py @@ -25,9 +25,12 @@ def pycopm(): dic["pat"] = os.path.dirname(__file__)[:-5] # Path to the pycopm folder dic["exe"] = os.getcwd() # Path to the folder of the input.txt file dic["flow"] = cmdargs["flow"].strip() # Path to flow - dic["how"] = cmdargs["approach"].strip() # Max, min, or mode - dic["jump"] = float(cmdargs["jump"]) # Tunning parameter + dic["how"] = cmdargs["how"].strip() # Max, min, or mode for satnum + dic["nhow"] = cmdargs["nhow"].strip() # Max, min, or mode for other nums + dic["show"] = cmdargs["show"].strip() # Max, min, or mean for static props + dic["jump"] = cmdargs["jump"].strip() # Tuning parameter to remove nnc dic["encoding"] = cmdargs["encoding"].strip() + dic["pvcorr"] = int(cmdargs["pvcorr"]) dic["cijk"] = "yes" for i in ["x", "y", "z"]: dic[f"{i}coar"] = [] @@ -105,20 +108,21 @@ def load_parser(): "-i", "--input", default="input.txt", - help="The base name of the input file or the name of the deck " - "('input.txt' by default).", + help="The base name of the input file or the name of the deck, " + "e.g., DROGON.DATA ('input.txt' by default).", ) parser.add_argument( "-o", "--output", - default="output", - help="The base name of the output folder ('output' by default).", + default=".", + help="The base name of the output folder ('.' by " + "default, i.e., the folder where pycopm is executed).", ) parser.add_argument( "-f", "--flow", default="flow", - help="OPM Flow full path to executable or just ('flow' by default)", + help="OPM Flow path to executable or just 'flow' ('flow' by default)", ) parser.add_argument( "-c", @@ -128,34 +132,41 @@ def load_parser(): ) parser.add_argument( "-a", - "--approach", + "--how", default="max", - help="Use min, max, or mode to scale the actnum ('min' by default)", + help="Use 'min', 'max', or 'mode' to scale the actnum, e.g., min makes " + "the new coarser cell inactive it at least one cell is inactive, while " + " max makes it active it at least one cell is active ('max' by default)", ) parser.add_argument( "-j", "--jump", - default=2.0, - help="Tunning parameter to avoid creation of nnc on the structural faults " - "('2.' by default)", + default="", + help="Tuning parameter to avoid creation of neighbouring connections in " + "the coarser model where there are discontinuities between cells along " + "the z direction, e.g., around faults ('' by default, i.e., nothing " + "corrected; if need it, try with values of the order of 1)", ) parser.add_argument( "-x", "--xcoar", default="", - help="Vector of x-coarsening ('' by default)", + help="Vector of x-coarsening, e.g., if the grid has 6 cells in the x " + "direction, then 0,2,0,2,0,2,0 would generate a coarser model with 3 " + "cells, while 0,2,2,2,2,2,0 would generate a coarser model with 1 cell, " + "i.e., 0 keeps the pilars while 2 removes them ('' by default)", ) parser.add_argument( "-y", "--ycoar", default="", - help="Vector of y-coarsening ('' by default)", + help="Vector of y-coarsening, see the description for -x ('' by default)", ) parser.add_argument( "-z", "--zcoar", default="", - help="Vector of z-coarsening ('' by default)", + help="Vector of z-coarsening, see the description for -x ('' by default)", ) parser.add_argument( "-e", @@ -163,6 +174,27 @@ def load_parser(): default="ISO-8859-1", help="Use 'utf8' or 'ISO-8859-1' encoding to read the deck ('ISO-8859-1' by default)", ) + parser.add_argument( + "-p", + "--pvcorr", + default=0, + help="Add the removed pore volume to the closest coarser cells ('0' by default)", + ) + parser.add_argument( + "-n", + "--nhow", + default="mode", + help="Use 'min', 'max', or 'mode' to scale satnum, fipnum, pvtnum, eqlnum, imbnum, and " + "multnum ('mode' by default)", + ) + parser.add_argument( + "-s", + "--show", + default="", + help="Use 'min', 'max', or 'mean' to scale permx, permy, permz, and poro ('' by default," + " i.e., using the arithmetic average for permx/permy, harmonic average for permz, and " + "the mean for the porosity).", + ) return vars(parser.parse_known_args()[0]) diff --git a/src/pycopm/utils/generate_coarser_files.py b/src/pycopm/utils/generate_coarser_files.py index e189df3..c1c5e08 100644 --- a/src/pycopm/utils/generate_coarser_files.py +++ b/src/pycopm/utils/generate_coarser_files.py @@ -1,5 +1,6 @@ # SPDX-FileCopyrightText: 2024 NORCE # SPDX-License-Identifier: GPL-3.0 +# pylint: disable=R0912,R0913,R0914,R0915 """ Utiliy methods to only create the coarser files by pycopm. @@ -39,34 +40,53 @@ def create_deck(dic): dic["props"] += ["swatinit"] if dic["ini"].has_kw("MULTNUM"): dic["grids"] += ["multnum"] - for name in ["satnum", "eqlnum", "fipnum", "pvtnum"]: - if max(dic["ini"].iget_kw(name.upper())[0]) > 1: - dic["regions"] += [name] + for name in ["satnum", "eqlnum", "fipnum", "pvtnum", "imbnum"]: + if dic["ini"].has_kw(name.upper()): + if max(dic["ini"].iget_kw(name.upper())[0]) > 1: + dic["regions"] += [name] nc = dic["grid"].nx * dic["grid"].ny * dic["grid"].nz dic["con"] = np.array([0 for _ in range(nc)]) dic["porv"] = np.array(dic["ini"].iget_kw("PORV")[0]) actnum = np.array([0 for _ in range(nc)]) - d_z = np.array([0.0 for _ in range(nc)]) - z_z = np.array([0.0 for _ in range(nc)]) - for name in dic["props"]: - dic[name] = np.array([0.0 for _ in range(nc)]) - for name in dic["regions"] + dic["grids"]: - dic[name] = np.ones(nc) + d_z = np.array([np.nan for _ in range(nc)]) + z_t = np.array([np.nan for _ in range(nc)]) + z_b = np.array([np.nan for _ in range(nc)]) + z_b_t = np.array([np.nan for _ in range(nc)]) + for name in dic["props"] + dic["regions"] + dic["grids"]: + dic[name] = 1.0 * np.ones(nc) * np.nan n = 0 + zti = [2, 5, 8, 11] + zbi = [14, 17, 20, 23] + cxyz = dic["grid"].export_corners(dic["grid"].export_index()) for cell in dic["grid"].cells(): actnum[cell.global_index] = cell.active - d_z[cell.global_index] = dic["grid"].cell_dz(ijk=(cell.i, cell.j, 0)) - z_z[cell.global_index] = dic["grid"].get_xyz(ijk=(cell.i, cell.j, 0))[2] + z_t[cell.global_index] = min(cxyz[cell.global_index][i] for i in zti) + z_b[cell.global_index] = max(cxyz[cell.global_index][i] for i in zti) + tmp = max(cxyz[cell.global_index][i] for i in zbi) + z_b_t[cell.global_index] = tmp - z_t[cell.global_index] if cell.active == 1: + d_z[cell.global_index] = dic["grid"].cell_dz(ijk=(cell.i, cell.j, cell.k)) for name in dic["props"] + dic["regions"] + dic["grids"]: dic[name][cell.global_index] = dic["ini"].iget_kw(name.upper())[0][n] + if not dic["show"]: + dic["permx"][cell.global_index] = ( + dic["ini"].iget_kw("PERMX")[0][n] * d_z[cell.global_index] + ) + dic["permy"][cell.global_index] = ( + dic["ini"].iget_kw("PERMY")[0][n] * d_z[cell.global_index] + ) + if dic["ini"].iget_kw("PERMZ")[0][n] != 0: + dic["permz"][cell.global_index] = ( + d_z[cell.global_index] / dic["ini"].iget_kw("PERMZ")[0][n] + ) n += 1 # Coarsening handle_clusters(dic) map_ijk(dic) - clusmin, clusmax, rmv = map_properties(dic, actnum, d_z, z_z) - handle_pv(dic, clusmin, clusmax, rmv) + clusmin, clusmax, rmv = map_properties(dic, actnum, d_z, z_t, z_b, z_b_t) + if dic["pvcorr"] == 1: + handle_pv(dic, clusmin, clusmax, rmv) handle_cp_grid(dic) write_grid(dic) write_props(dic) @@ -78,12 +98,13 @@ def create_deck(dic): ) as file: for row in dic["lol"]: file.write(row + "\n") - # os.system( - # f"{dic['flow']} {dic['deck'].upper()}_PYCOPM.DATA {dic['flags']} & wait\n" - # ) + os.chdir(dic["fol"]) + os.system( + f"{dic['flow']} {dic['deck'].upper()}_PYCOPM.DATA --enable-dry-run=1 & wait\n" + ) -def map_properties(dic, actnum, d_z, z_z): +def map_properties(dic, actnum, d_z, z_t, z_b, z_b_t): """ Mapping to the coarse properties @@ -91,7 +112,8 @@ def map_properties(dic, actnum, d_z, z_z): dic (dict): Global dictionary\n actnum (array): Integers with the active cells\n d_z (array): Floats with the corresponding grid DZ\n - z_z (array): Floats with the cell z-center position + z_t (array): Floats with the top cell z-center position\n + z_b (array): Floats with the bottom cell z-center position Returns: dic (dict): Modified global dictionary @@ -99,39 +121,84 @@ def map_properties(dic, actnum, d_z, z_z): """ clusmax = pd.Series(actnum).groupby(dic["con"]).max() freq = pd.Series(actnum).groupby(dic["con"]).sum() - dz_c = pd.Series(d_z).groupby(dic["con"]).mean() + dz_c = pd.Series(z_b_t).groupby(dic["con"]).max() + h_tot = pd.Series(d_z).groupby(dic["con"]).sum() if dic["how"] == "min": clusmin = pd.Series(actnum).groupby(dic["con"]).min() clust = clusmin elif dic["how"] == "mode": - clusmin = pd.Series(actnum).groupby(dic["con"]).agg(pd.Series.mode) - for i, val in enumerate(clusmin): - if not np.isscalar(val): - clusmin[i + 1] = clusmin[i + 1][0] + clusmin = ( + pd.Series(actnum) + .groupby(dic["con"]) + .agg(lambda x: pd.Series.mode(x).iat[0]) + ) clust = clusmin else: clusmin = clusmax clust = clusmax - rmv = 1 * ( - ( - pd.Series(z_z).groupby(dic["con"]).max() - - pd.Series(z_z).groupby(dic["con"]).min() + if dic["jump"]: + rmv = 1 * ( + ( + pd.Series(z_b).groupby(dic["con"]).max() + - pd.Series(z_t).groupby(dic["con"]).min() + ) + < float(dic["jump"]) * dz_c ) - < dic["jump"] * dz_c - ) - dic["actnum_c"] = [int(val * r_m) for val, r_m in zip(clust, rmv)] + dic["actnum_c"] = [int(val * r_m) for val, r_m in zip(clust, rmv)] + else: + rmv = 0 * dz_c + 1 + dic["actnum_c"] = [int(val) for val in clust] c_c = pd.Series(dic["porv"]).groupby(dic["con"]).sum() dic["porv_c"] = [f"{val}" for val in c_c] for name in dic["props"]: - c_c = pd.Series(dic[name]).groupby(dic["con"]).sum() - dic[f"{name}_c"] = [ - f"{val/fre}" if fre > 0 else "0" for val, fre in zip(c_c, freq) - ] + if not dic["show"]: + if name in ["permx", "permy"]: + c_c = pd.Series(dic[name]).groupby(dic["con"]).sum() + dic[f"{name}_c"] = [ + f"{val/h_t}" if h_t * val > 0 else "0" + for val, h_t in zip(c_c, h_tot) + ] + elif name == "permz": + c_c = pd.Series(dic[name]).groupby(dic["con"]).sum() + dic["permz_c"] = [ + f"{h_t/val}" if h_t * val > 0 else "0" + for val, h_t in zip(c_c, h_tot) + ] + else: + c_c = pd.Series(dic[name]).groupby(dic["con"]).sum() + dic[f"{name}_c"] = [ + f"{val/fre}" if fre > 0 else "0" for val, fre in zip(c_c, freq) + ] + else: + if dic["show"] == "min": + c_c = pd.Series(dic[name]).groupby(dic["con"]).min() + dic[f"{name}_c"] = [f"{val}" for val in c_c] + elif dic["show"] == "max": + c_c = pd.Series(dic[name]).groupby(dic["con"]).max() + dic[f"{name}_c"] = [f"{val}" for val in c_c] + else: + c_c = pd.Series(dic[name]).groupby(dic["con"]).sum() + dic[f"{name}_c"] = [ + f"{val/fre}" if fre > 0 else "0" for val, fre in zip(c_c, freq) + ] for name in dic["regions"] + dic["grids"]: - c_c = pd.Series(dic[name]).groupby(dic["con"]).agg(pd.Series.mode) - dic[f"{name}_c"] = [ - f"{int(val)}" if np.isscalar(val) else f"{int(val[-1])}" for val in c_c - ] + if dic["nhow"] == "min": + c_c = pd.Series(dic[name]).groupby(dic["con"]).min() + elif dic["nhow"] == "max": + c_c = pd.Series(dic[name]).groupby(dic["con"]).max() + else: + c_c = ( + pd.Series(dic[name]) + .groupby(dic["con"]) + .agg( + lambda x: ( + pd.Series.mode(x).iat[0] + if len(pd.Series.mode(x)) > 1 + else pd.Series.mode(x) + ) + ) + ) + dic[f"{name}_c"] = [f"{int(val)}" if np.isscalar(val) else "0" for val in c_c] return clusmin, clusmax, rmv diff --git a/tests/test_single_run.py b/tests/test_single_run.py index 7914268..91662d7 100644 --- a/tests/test_single_run.py +++ b/tests/test_single_run.py @@ -13,6 +13,6 @@ def test_single_run(): os.chdir(f"{cwd}/tests/configs") main() assert os.path.exists( - f"{cwd}/tests/configs/output/postprocessing/wells/HISTO_DATA_WWPR_A4.png" + f"{cwd}/tests/configs/postprocessing/wells/HISTO_DATA_WWPR_A4.png" ) os.chdir(cwd)