diff --git a/docs/_sources/about.rst.txt b/docs/_sources/about.rst.txt index 21c8219..ca75d25 100644 --- a/docs/_sources/about.rst.txt +++ b/docs/_sources/about.rst.txt @@ -9,4 +9,4 @@ and by `Expansion of Resources for CO2 Storage on the Horda Platform (ExpReCCS) Contributions are more than welcome using the fork and pull request approach. -For a new feature, please request this raising an issue. \ No newline at end of file +For a new feature, please request this raising an issue. diff --git a/docs/_sources/api.rst.txt b/docs/_sources/api.rst.txt index 7c3eab1..9840f1f 100644 --- a/docs/_sources/api.rst.txt +++ b/docs/_sources/api.rst.txt @@ -13,4 +13,4 @@ grid refinement, grid coarsening, submodels, and transformations. Files in the pyocpm package. -.. include:: modules.rst \ No newline at end of file +.. include:: modules.rst diff --git a/docs/_sources/installation.rst.txt b/docs/_sources/installation.rst.txt index eb0c01e..4d8f5e3 100644 --- a/docs/_sources/installation.rst.txt +++ b/docs/_sources/installation.rst.txt @@ -5,7 +5,7 @@ Installation The following steps work installing the dependencies in Ubuntu via apt-get or in macOS using brew or macports. While using package managers such as Anaconda, Miniforge, or Mamba might work, these are not tested. The supported Python versions are 3.11 to 3.13. We will update the documentation when Python3.14 is supported -(e.g., the resdata Python package is not yet available via pip install in Python 3.14). +(e.g., the ert Python package is not yet available via pip install in Python 3.14). .. _vpycopm: diff --git a/docs/_sources/introduction.rst.txt b/docs/_sources/introduction.rst.txt index 7098424..39e39de 100644 --- a/docs/_sources/introduction.rst.txt +++ b/docs/_sources/introduction.rst.txt @@ -59,6 +59,5 @@ where -e Use 'utf8' or 'ISO-8859-1' encoding to read the deck ('ISO-8859-1' by default). -ijk Given i,j,k indices in the input model, return the modified i,j,k corresponding positions ('' by default; if not empty, e.g., '1,2,3', then there will not be generation of modified files, only the i,j,k mapped indices in the terminal). -d Options to transform the x,y,z coordinates: 'translate [10,-5,4]' adds the values in meters to the coordinates, 'scale [1,2,3]' multiplies the coordinates by the given values respectively, and 'rotatexy 45' applies a rotation in degrees in the xy plane (rotatexz and rotateyz applies a rotation around the y and x axis respectively) ('' by default). --u Use the resdata or opm Python libraries ('opm' by default). -explicit Set to 1 to explicitly write the cell values in the SOLUTION section in the deck ('0' by default). --warnings Set to 1 to show Python warnings ('0' by default). \ No newline at end of file +-warnings Set to 1 to show Python warnings ('0' by default). diff --git a/docs/_sources/output_folder.rst.txt b/docs/_sources/output_folder.rst.txt index 0bf1146..1c06710 100644 --- a/docs/_sources/output_folder.rst.txt +++ b/docs/_sources/output_folder.rst.txt @@ -35,4 +35,4 @@ favourite history matching/optimization tool (e.g., `ERT `_. \ No newline at end of file +`An open-source image-based framework for CFD in microsystems `_. diff --git a/docs/installation.html b/docs/installation.html index a6dd279..1a82861 100644 --- a/docs/installation.html +++ b/docs/installation.html @@ -94,7 +94,7 @@

Installation

Python package

To install the pycopm executable from the development version:

diff --git a/docs/introduction.html b/docs/introduction.html index a4a48a7..b6f01ef 100644 --- a/docs/introduction.html +++ b/docs/introduction.html @@ -190,9 +190,6 @@

Roadmap
-d

Options to transform the x,y,z coordinates: ‘translate [10,-5,4]’ adds the values in meters to the coordinates, ‘scale [1,2,3]’ multiplies the coordinates by the given values respectively, and ‘rotatexy 45’ applies a rotation in degrees in the xy plane (rotatexz and rotateyz applies a rotation around the y and x axis respectively) (’’ by default).

-
-u
-

Use the resdata or opm Python libraries (‘opm’ by default).

-
-explicit

Set to 1 to explicitly write the cell values in the SOLUTION section in the deck (‘0’ by default).

diff --git a/docs/pycopm.utils.generate_files.html b/docs/pycopm.utils.generate_files.html index b1c0b4d..b4523c3 100644 --- a/docs/pycopm.utils.generate_files.html +++ b/docs/pycopm.utils.generate_files.html @@ -126,7 +126,7 @@
pycopm.utils.generate_files.initialize_variables(dic)
-

Use resdata or opm to read the dry run

+

Use opm to read the dry run

Args:

dic (dict): Global dictionary

diff --git a/docs/searchindex.js b/docs/searchindex.js index db9c1cf..5050c8c 100644 --- a/docs/searchindex.js +++ b/docs/searchindex.js @@ -1 +1 @@ -Search.setIndex({"alltitles":{"About pycopm":[[0,null]],"Concept":[[7,"concept"]],"Configuration file":[[2,null]],"Contribute to the software":[[3,"contribute-to-the-software"]],"Contributing":[[3,null]],"Drogon":[[4,"drogon"]],"Examples":[[4,null]],"Graphical abstract":[[4,"graphical-abstract"]],"Grid coarsening":[[23,"grid-coarsening"]],"Grid refinement":[[23,"grid-refinement"]],"Ground Rules":[[3,"ground-rules"]],"Hello world":[[4,"hello-world"]],"Indices and tables":[[5,"indices-and-tables"]],"Installation":[[6,null]],"Introduction":[[7,null]],"Module contents":[[10,"module-pycopm"],[11,"module-pycopm.core"],[13,"module-pycopm.utils"]],"Norne":[[4,"norne"]],"OPM Flow":[[6,"opm-flow"]],"Output folder":[[9,null]],"Overview":[[7,"overview"]],"Python package":[[6,"python-package"]],"Related":[[22,null]],"Report issues or problems":[[3,"report-issues-or-problems"]],"Roadmap":[[7,"roadmap"]],"SPE10":[[4,"spe10"]],"Seek support":[[3,"seek-support"]],"Smeaheia":[[4,"smeaheia"]],"Source build in Linux/Windows":[[6,"source-build-in-linux-windows"]],"Source build in macOS":[[6,"source-build-in-macos"]],"Submodels":[[23,"submodels"]],"Submodules":[[11,"submodules"],[13,"submodules"]],"Subpackages":[[10,"subpackages"]],"Theory":[[23,null]],"Transformations":[[23,"transformations"]],"Via OPM Flow decks":[[4,"via-opm-flow-decks"]],"Via an OPM Flow input deck":[[9,"via-an-opm-flow-input-deck"]],"Via configuration files":[[4,"via-configuration-files"],[9,"via-configuration-files"]],"Welcome to pycopm\u2019s documentation!":[[5,null]],"ad-micp":[[22,"ad-micp"]],"expreccs":[[22,"expreccs"]],"plopm":[[22,"plopm"]],"pofff":[[22,"pofff"]],"pycopm":[[1,"pycopm"],[8,null]],"pycopm Python API":[[1,null]],"pycopm package":[[10,null]],"pycopm.core package":[[11,null]],"pycopm.core.pycopm module":[[12,null]],"pycopm.utils package":[[13,null]],"pycopm.utils.files_writer module":[[14,null]],"pycopm.utils.generate_files module":[[15,null]],"pycopm.utils.grid_builder module":[[16,null]],"pycopm.utils.input_values module":[[17,null]],"pycopm.utils.mapping_methods module":[[18,null]],"pycopm.utils.parser_deck module":[[19,null]],"pycopm.utils.properties_builder module":[[20,null]],"pycopm.utils.runs_executer module":[[21,null]],"pymm":[[22,"pymm"]],"pyopmnearwell":[[22,"pyopmnearwell"]],"pyopmspe11":[[22,"pyopmspe11"]]},"docnames":["about","api","configuration_file","contributing","examples","index","installation","introduction","modules","output_folder","pycopm","pycopm.core","pycopm.core.pycopm","pycopm.utils","pycopm.utils.files_writer","pycopm.utils.generate_files","pycopm.utils.grid_builder","pycopm.utils.input_values","pycopm.utils.mapping_methods","pycopm.utils.parser_deck","pycopm.utils.properties_builder","pycopm.utils.runs_executer","related","theory"],"envversion":{"sphinx":65,"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","contributing.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_files.rst","pycopm.utils.grid_builder.rst","pycopm.utils.input_values.rst","pycopm.utils.mapping_methods.rst","pycopm.utils.parser_deck.rst","pycopm.utils.properties_builder.rst","pycopm.utils.runs_executer.rst","related.rst","theory.rst"],"indexentries":{},"objects":{"":[[10,0,0,"-","pycopm"]],"pycopm":[[11,0,0,"-","core"],[13,0,0,"-","utils"]],"pycopm.core":[[12,0,0,"-","pycopm"]],"pycopm.core.pycopm":[[12,1,1,"","check_cmdargs"],[12,1,1,"","load_parser"],[12,1,1,"","main"],[12,1,1,"","pycopm"]],"pycopm.utils":[[14,0,0,"-","files_writer"],[15,0,0,"-","generate_files"],[16,0,0,"-","grid_builder"],[17,0,0,"-","input_values"],[18,0,0,"-","mapping_methods"],[19,0,0,"-","parser_deck"],[20,0,0,"-","properties_builder"],[21,0,0,"-","runs_executer"]],"pycopm.utils.files_writer":[[14,1,1,"","coarser_files"],[14,1,1,"","ert_files"],[14,1,1,"","grid_features"],[14,1,1,"","opm_properties"],[14,1,1,"","write_let_tables"]],"pycopm.utils.generate_files":[[15,1,1,"","compact_format"],[15,1,1,"","create_deck"],[15,1,1,"","handle_nnc_trans"],[15,1,1,"","initialize_variables"],[15,1,1,"","write_grid"],[15,1,1,"","write_props"]],"pycopm.utils.grid_builder":[[16,1,1,"","coarser_grid"],[16,1,1,"","handle_face_dir_im"],[16,1,1,"","handle_face_dir_ip"],[16,1,1,"","handle_face_dir_jm"],[16,1,1,"","handle_face_dir_jp"],[16,1,1,"","handle_faults"]],"pycopm.utils.input_values":[[17,1,1,"","check_flow"],[17,1,1,"","initialize_values"],[17,1,1,"","process_input"],[17,1,1,"","read_reference"]],"pycopm.utils.mapping_methods":[[18,1,1,"","add_pv_bc"],[18,1,1,"","chop_grid"],[18,1,1,"","coarsening_dir"],[18,1,1,"","find_neighbors"],[18,1,1,"","get_ijk"],[18,1,1,"","handle_clusters"],[18,1,1,"","handle_cp_grid"],[18,1,1,"","handle_pv"],[18,1,1,"","handle_refinement"],[18,1,1,"","handle_vicinity"],[18,1,1,"","handle_zcorn"],[18,1,1,"","map_ijk"],[18,1,1,"","map_properties"],[18,1,1,"","map_vicinity"],[18,1,1,"","refine_grid"],[18,1,1,"","transform_grid"]],"pycopm.utils.parser_deck":[[19,1,1,"","get_wells_for_vicinity"],[19,1,1,"","handle_aquancon"],[19,1,1,"","handle_aqucon"],[19,1,1,"","handle_aqunum"],[19,1,1,"","handle_bccon"],[19,1,1,"","handle_bwpr"],[19,1,1,"","handle_compsegs"],[19,1,1,"","handle_dimens"],[19,1,1,"","handle_editnnc"],[19,1,1,"","handle_equil"],[19,1,1,"","handle_fault"],[19,1,1,"","handle_grid_props"],[19,1,1,"","handle_mapaxes"],[19,1,1,"","handle_multflt"],[19,1,1,"","handle_multiply"],[19,1,1,"","handle_multregt"],[19,1,1,"","handle_oper"],[19,1,1,"","handle_pinch"],[19,1,1,"","handle_props"],[19,1,1,"","handle_regions"],[19,1,1,"","handle_schedule"],[19,1,1,"","handle_schedulekw"],[19,1,1,"","handle_segmented_wells"],[19,1,1,"","handle_source"],[19,1,1,"","handle_welldims"],[19,1,1,"","handle_wells"],[19,1,1,"","handle_welsegs"],[19,1,1,"","names_segwells"],[19,1,1,"","names_wells"],[19,1,1,"","process_the_deck"],[19,1,1,"","write_explicit"]],"pycopm.utils.properties_builder":[[20,1,1,"","add_lost_pv_to_all_cells"],[20,1,1,"","add_lost_pv_to_all_eq_cells"],[20,1,1,"","add_lost_pv_to_all_fip_cells"],[20,1,1,"","add_lost_pv_to_boundary_cells"],[20,1,1,"","coarser_properties"],[20,1,1,"","identify_removed_pilars"],[20,1,1,"","identify_removed_pilars_zdir"],[20,1,1,"","initialize_properties"]],"pycopm.utils.runs_executer":[[21,1,1,"","plotting"],[21,1,1,"","simulations"]]},"objnames":{"0":["py","module","Python module"],"1":["py","function","Python function"]},"objtypes":{"0":"py:module","1":"py:function"},"terms":{"":[2,3,4,7,18,23],"0":[2,4,6,7,23],"01":[2,4],"02":4,"03":2,"04":[3,6],"0f":4,"1":[2,3,4,6,7,23],"10":[4,7,23],"100":2,"100000":2,"11":[3,4,6,23],"12":6,"128":4,"13":[3,6,7],"14":[4,6],"16":4,"17":6,"18":23,"1f":4,"2":[2,4,7,23],"20":4,"2000":4,"2005":2,"2019":23,"2022":2,"2025":6,"24":3,"243":4,"25":[4,23],"26":[3,6],"2d":23,"2e":4,"2f":4,"2xyz":4,"3":[2,3,4,6,7,23],"30":[4,7,23],"300":4,"31":4,"331841":0,"336294":0,"35":[4,23],"351":4,"3h":23,"3xz":4,"4":[4,7,23],"40":23,"41":4,"45":[4,7,23],"463284":4,"463739":4,"464401":4,"464872":4,"5":[2,3,4,7,23],"50":23,"58":4,"5931508":4,"5932123":4,"5932209":4,"5932862":4,"6":[4,7],"60":23,"600":2,"65":23,"7":[2,7],"75":23,"8":[2,4],"8859":7,"9":[2,6],"90":23,"95":4,"A":[2,22,23],"As":[4,7,9,23],"By":[2,4],"For":[0,2,3,4,6,9,23],"If":[2,4,6,23],"In":[3,4,6,7,23],"It":4,"One":23,"The":[0,1,2,3,4,6,7,9,23],"Then":[2,4,9,23],"These":[4,23],"To":[2,4,6,23],"_":23,"_build":3,"_pycopm":7,"about":[3,4,5,23],"abov":[4,23],"abstract":5,"accept":3,"accordingli":23,"account":2,"accuraci":23,"achiev":[2,4,6,23],"across":[4,23],"action":[3,6],"activ":[2,4,6,7,18,20,23],"actnum":[7,18],"actual":4,"ad":[2,4,5,7,23],"adapt":[7,9],"add":[2,3,4,7,18,19],"add_lost_pv_to_all_cel":[10,13,20],"add_lost_pv_to_all_eq_cel":[10,13,20],"add_lost_pv_to_all_fip_cel":[10,13,20],"add_lost_pv_to_boundary_cel":[10,13,20],"add_pv_bc":[10,13,18],"addiiton":23,"addit":[2,4,6,23],"adjust":7,"adopt":23,"affin":23,"after":[1,2,4,6,9,23],"al":2,"align":23,"all":[2,3,4,6,7,9,18,20,23],"allow":[2,4,7,23],"along":[7,23],"also":[3,4,6,7,19,23],"altern":[3,7],"among":23,"an":[0,2,3,4,5,6,7,22,23],"anaconda":6,"analys":3,"ani":[2,3,23],"answer":3,"api":5,"appear":9,"appl":6,"appli":[4,7,23],"applic":[4,7,9,23],"apporach":4,"approach":[0,2,3,4,7,9,23],"appropri":23,"aproach":4,"apt":6,"aquancon":19,"aquif":19,"ar":[0,1,2,3,4,6,7,9,22,23],"area":23,"arg":[12,14,15,16,17,18,19,20,21],"argument":[2,7,12,18],"arithmet":[7,23],"armon":[7,23],"arn":7,"around":[4,7,23],"arrai":[2,7,18,20,23],"assign":[7,23],"assum":4,"assur":23,"avail":[4,6,7],"averag":[7,23],"avoid":[4,7],"axi":7,"azurewebsit":4,"back":2,"base":[1,7,22,23],"bash":6,"bc0407_hist01122006":4,"bccon":19,"been":[7,23],"befor":[2,3,7],"being":0,"below":[7,22,23],"benchmark":22,"better":[4,23],"between":[4,7,23],"bin":[2,3,6,7],"binari":[3,6,7],"black":3,"block":[19,20],"boost":6,"both":23,"bottom":[4,18],"boundari":[2,4,7,20,23],"box":[7,23],"branch":6,"break":23,"brew":6,"build":[2,3,5,7],"build_opm_mpi":6,"built":[4,6,7],"c":[3,4,7,23],"c1":4,"c2":4,"ca":4,"calcit":22,"call":[1,2,9,15],"can":[2,3,4,6,7,9,23],"cannot":23,"capillari":23,"care":23,"cartesian":23,"case":[1,4,23],"cbsfax":4,"cd":[4,6],"cell":[2,4,7,16,17,18,20,23],"cell_index":16,"center":[0,4,18],"certain":4,"cet_rainbow_bgyrm_35_85_c69":4,"cfd":22,"cformat":4,"chang":[2,3],"character":23,"check":[12,17,22],"check_cmdarg":[10,11,12],"check_flow":[10,13,17],"checker":3,"checkout":6,"chop_grid":[10,13,18],"ci_pycopm_maco":3,"ci_pycopm_ubuntu":[3,6],"clang":6,"clone":[4,6],"closest":[4,7],"clusmax":18,"clusmin":18,"cluster":[18,23],"cmake":6,"cmdarg":12,"co2":[0,22],"coars":[2,4,7,16,20,23],"coarsen":[1,2,4,5,7,9,16,18],"coarsening_dir":[10,13,18],"coarser":[2,4,7,9,15,18,20,23],"coarser_fil":[10,13,14],"coarser_grid":[10,13,16],"coarser_properti":[10,13,20],"coarsern":4,"code":[3,6,10],"collabor":3,"com":[4,6,7],"combin":[4,12],"comma":7,"command":[2,4,6,12],"comment":4,"commit":3,"common":[6,23],"commonli":23,"commun":23,"compact":15,"compact_format":[10,13,15],"compar":4,"comparison":23,"compdat":7,"complet":2,"complex":23,"compseg":19,"comput":[2,7,23],"concept":5,"condit":23,"confact":7,"confer":2,"configur":[5,7,16,17,20,21],"conform":7,"connect":[4,7,15,23],"conquer":4,"conserv":4,"consid":[2,7],"contain":[1,3,4],"content":[1,3,4,5,8],"contribut":[0,5,6],"coordin":[7,18],"copi":[3,4,6,9,19],"core":[1,6,8,10],"corner":[7,15,16,18,23],"correct":[2,7,9,20,23],"correl":23,"correspond":[2,4,7,18,23],"could":[4,6,9,23],"cov":3,"cporv":2,"creat":[3,4,6,7,9,15,18,23],"create_deck":[10,13,15],"creation":7,"csp":22,"cssr":[0,4,6,7],"current":[2,4,6,7,9,18,21],"current_directori":6,"d":[4,7,23],"dai":4,"data":[2,3,4,7,23],"datafram":18,"dataset":4,"date":2,"dcmake_build_typ":6,"dcmake_disable_find_package_mpi":6,"dcmake_prefix_path":6,"deactiv":6,"deck":[1,2,3,5,7,14,19,20,23],"deck_dri":7,"dedic":6,"default":[2,4,7,9,23],"defin":[2,4,9,20,23],"definit":[2,4,23],"degre":[4,7],"delax":4,"delet":2,"demonstr":4,"depend":[3,6,23],"depth":23,"describ":[3,4,7,9],"descript":[2,7],"destroi":18,"dev":[3,6],"develop":[4,6,7,9,23],"diamond":[7,23],"diamondxi":[4,7,23],"dic":[14,15,16,17,18,19,20,21],"dic1":17,"dict":[12,14,15,16,17,18,19,20,21],"dictionari":[14,15,16,17,18,19,20,21],"diffeent":15,"differ":[1,2,4,7,18,23],"differenti":4,"dimens":19,"dir":[2,7,16],"direct":[2,4,7,18,20,23],"directli":[2,9],"directori":3,"discontinu":7,"discret":23,"discuss":2,"disperc":7,"dist":2,"distpara":2,"distribut":[2,7,18,20,23],"divers":[7,23],"divid":4,"dmar":2,"do":[2,3,4,6,7,23],"doc":3,"document":[2,3,6,7],"done":[6,7],"download":4,"dpi":4,"drawback":23,"drogon":[1,2,5,7,9],"drogon_2times_coars":4,"drogon_coars":4,"drogon_hist":4,"drogon_hist_prep_pycopm_dryrun":4,"drogon_hist_pycopm":4,"drogon_hist_pycopm_pycopm":4,"drogon_pycopm_comparison":4,"dry":[4,7,15],"due":[4,23],"dune":6,"dunecontrol":6,"dure":23,"duse_mpi":6,"dwith_ndebug":6,"dynam":22,"e":[2,3,4,6,7,9,23],"each":[2,7,23],"earli":9,"eas":23,"echo":6,"edg":6,"effect":23,"eg":2,"egrid":3,"either":7,"els":6,"em":22,"email":[3,6],"emltg":2,"emlto":2,"emphas":23,"empti":[4,7],"enabl":[4,7],"encod":7,"end":[4,23],"endnum":7,"ensembl":[2,4,7],"ensemble_experi":2,"ensemble_smooth":2,"entri":[2,7,23],"environ":[3,6],"eo":2,"eog":2,"eqlnum":[7,20],"equal":[4,7,23],"equil":[2,4],"error":[2,4,9],"ert":[1,2,4,7,9,14,21],"ert_fil":[10,13,14],"es_mda":2,"et":2,"etc":7,"ew":2,"exampl":[2,3,5,6,9,23],"excel":23,"except":2,"exectut":7,"execut":[1,2,3,4,6,7,9,12,21,23],"expans":0,"explicit":[4,19],"explicitli":7,"export":[3,6],"exprecc":[0,5],"extend":3,"extract":[4,7,18,23],"f":[3,4,7],"face":[6,7,16,23],"familiar":[2,3],"faster":23,"fault":[4,7,16,19,23],"favourit":[7,9],"featur":[0,4,23],"fewer":23,"fgip":7,"fi":6,"field":[2,4,23],"figur":[4,9,23],"file":[1,3,5,6,7,14,15,16,17,18,20,21,23],"files_writ":[10,13],"final":[1,2,4],"find":[9,18],"find_neighbor":[10,13,18],"fine":2,"finner":[15,18,23],"fipnum":[7,20,23],"first":[2,4,7],"five":4,"fix":3,"flag":[2,3,4,7,12,18],"flexibl":[7,23],"float":[18,21],"flow":[1,2,3,5,7,14,17,21,22,23],"flow_maco":3,"fluid":23,"fluidflow":22,"fluxnum":7,"focu":[4,7,9,23],"focus":[4,7,9],"foip":[4,7],"folder":[1,3,4,5,6,7],"follow":[2,4,6,7,9,23],"fopr":4,"fork":[0,3],"format":[2,3,4,23],"former":23,"found":17,"four":[4,23],"frac":23,"framework":[1,4,22],"frequent":23,"friend":4,"friendli":7,"from":[1,2,3,4,6,7,15,16,17,18,19,20,21,22,23],"full":[2,4,9],"function":[1,2,4,12,14,16,17,20,21,23],"fund":0,"further":9,"g":[2,3,4,6,7,9,23],"ga":[4,7],"gener":[1,2,3,4,7,9,15,20,21,22,23],"generate_fil":[10,13],"geolog":[2,4,7,9,23],"geometr":23,"geometri":[6,23],"geophys":23,"get":[3,6,18,19],"get_ijk":[10,13,18],"get_wells_for_vicin":[10,13,19],"gif":[4,22],"git":[4,6],"github":[2,3,4,6,7],"gitlab":6,"give":[4,9,23],"given":[2,4,7,23],"global":[14,15,16,17,18,19,20,21,23],"go":4,"good":4,"graphic":5,"grid":[1,4,5,6,7,9,14,15,16,18,19,20],"grid_build":[10,13],"grid_featur":[10,13,14],"ground":5,"group":23,"gui":2,"h":2,"ha":[7,23],"handi":23,"handl":[4,18,19,23],"handle_aquancon":[10,13,19],"handle_aqucon":[10,13,19],"handle_aqunum":[10,13,19],"handle_bccon":[10,13,19],"handle_bwpr":[10,13,19],"handle_clust":[10,13,18],"handle_compseg":[10,13,19],"handle_cp_grid":[10,13,18],"handle_dimen":[10,13,19],"handle_editnnc":[10,13,19],"handle_equil":[10,13,19],"handle_face_dir_im":[10,13,16],"handle_face_dir_ip":[10,13,16],"handle_face_dir_jm":[10,13,16],"handle_face_dir_jp":[10,13,16],"handle_fault":[10,13,16,19],"handle_grid_prop":[10,13,19],"handle_mapax":[10,13,19],"handle_multflt":[10,13,19],"handle_multipli":[10,13,19],"handle_multregt":[10,13,19],"handle_nnc_tran":[10,13,15],"handle_op":[10,13,19],"handle_pinch":[10,13,19],"handle_prop":[10,13,19],"handle_pv":[10,13,18],"handle_refin":[10,13,18],"handle_region":[10,13,19],"handle_schedul":[10,13,19],"handle_schedulekw":[10,13,19],"handle_segmented_wel":[10,13,19],"handle_sourc":[10,13,19],"handle_vicin":[10,13,18],"handle_wel":[10,13,19],"handle_welldim":[10,13,19],"handle_welseg":[10,13,19],"handle_zcorn":[10,13,18],"harmon":[7,23],"have":[2,4,6,19,23],"hello":[3,5],"hello_world":[3,4],"hello_world_pycopm":[3,4],"hello_world_pycopm_pycopm":4,"help":3,"here":[2,4,23],"hexahedron":23,"higher":4,"highlight":4,"histori":[2,4,7,9,22,23],"hm":[2,4],"home":7,"honor":[2,23],"horda":0,"horizont":23,"host":7,"how":[4,23],"howev":4,"html":3,"http":[4,6,7],"i":[0,1,2,3,4,6,7,9,16,17,18,19,23],"i_d":18,"identifi":[4,19,20],"identify_removed_pilar":[10,13,20],"identify_removed_pilars_zdir":[10,13,20],"ignor":3,"ilustr":4,"imag":22,"imbnum":7,"impact":23,"implement":[4,7,23],"import":[3,23],"in_fil":17,"inact":[4,7,18,23],"inc":[4,7],"includ":[4,6,7,9],"increas":[4,18,23],"ind":18,"index":[2,5,16,18,20],"indic":[4,7,18,19,23],"induc":22,"industri":23,"inform":[2,23],"init":[2,4],"initi":[2,4,7,17,20,23],"initialize_properti":[10,13,20],"initialize_valu":[10,13,17],"initialize_vari":[10,13,15],"inj":4,"injector":4,"input":[2,4,5,7,17,19,20,23],"input_valu":[10,13],"insid":[4,6,23],"insight":23,"inspect":2,"instal":[3,4,5,7],"instead":[2,4,23],"int":[16,18,20],"integ":[4,18],"integr":2,"interest":[6,22,23],"intern":7,"interv":[2,4,7,23],"introduct":[5,9,23],"invalid":12,"involv":[4,23],"inx":20,"ir":18,"iso":7,"isol":4,"issu":[0,4,5,6],"istl":6,"item":7,"iter":[2,4],"iterative_ensemble_smooth":2,"its":[18,23],"j":[2,4,7,16,18,19,23],"j5":6,"jk":7,"job":1,"jump":[4,18],"just":7,"k":[2,4,7,16,18,19,23],"keep":[2,4,7,19],"kei":23,"keyword":[4,19],"kh":7,"kilomet":23,"km":4,"l":[4,6,7],"l127":4,"l242":4,"label":4,"larg":23,"last":[2,7],"later":2,"latest":6,"latter":4,"layer":23,"leakag":22,"least":[4,7,18],"left":[4,9,23],"legend":4,"less":4,"let":[2,14],"letsatn":2,"level":7,"lg":2,"librari":[6,7],"lie":23,"like":[4,23],"line":[2,3,4,6,23],"link":6,"lint":6,"linux":5,"list":[15,18,19],"lmltg":2,"lmlto":2,"lo":2,"load_pars":[10,11,12],"loc":4,"local":[3,17,23],"locat":[1,4,7,9,23],"log":2,"look":3,"loop":4,"lost":[2,20],"lot":[4,23],"lower":[4,23],"lw":2,"m":[3,4,6,7],"machin":2,"maco":[3,4,5],"macport":6,"made":[4,23],"main":[1,2,3,4,10,11,12,15],"maintain":[3,6],"make":[3,4,6,7,18,23],"mako":[1,14],"mamba":6,"manag":[6,23],"mantain":3,"manual":7,"map":[7,15,16,18,19,23],"map_ijk":[10,13,18],"map_properti":[10,13,18],"map_vicin":[10,13,18],"mapax":4,"mapping_method":[10,13],"mask":18,"master":6,"match":[2,4,7,9,22,23],"mathbb":23,"max":[2,4,7,23],"maximum":[2,4,18],"maxpermz":4,"mean":[2,4,7,23],"measur":23,"member":4,"memori":2,"mention":[4,23],"mep":2,"merg":3,"meter":[7,23],"method":[14,15,16,18,19,20,23],"micp":5,"microbi":22,"microsystem":22,"middl":4,"might":[3,4,6,9,22,23],"million":4,"min":[2,4,7,23],"minerror":2,"mini":7,"miniforg":6,"minimum":2,"minj":7,"miscnum":7,"miss":3,"missmatch":23,"mkdir":6,"mode":[2,4,7,23],"model":[2,4,7,9,19,20,22,23],"model3":23,"modif":2,"modifi":[2,4,6,7,9,14,15,16,17,18,19,20,21],"modul":[1,5,6,8,22],"more":[0,3,4],"most":23,"mpi":[4,6],"mpirun":2,"mrn":2,"mrt":2,"mult":7,"multi":4,"multipli":[4,7,19,23],"multnum":7,"multregt":[4,19],"multx":4,"multz":4,"must":[2,4,23],"mypi":3,"n":[4,7,15,18],"name":[2,4,7,17,19],"name_of_input_fil":7,"names_segwel":[10,13,19],"names_wel":[10,13,19],"natur":23,"necessari":[14,19],"need":[2,3,4,6,7,9],"neighbor":23,"neighbour":[4,7,15,18,23],"neighbourhood":[7,23],"net":[2,4],"new":[0,3,4,7,18,23],"newton":2,"next":2,"nice":[3,4,6],"nnc":[19,23],"non":[7,15,23],"none":[12,14,15,21],"nor":18,"norn":[1,2,5,7,9,23],"norne_atw2013":4,"notat":[15,23],"note":[3,4],"noth":7,"now":4,"np":2,"nrwo":19,"ntg":[2,4],"num":20,"number":[2,4,7,19,23],"o":[3,4,7,9,18],"ob":2,"object":18,"observ":[2,4],"observations_complet":2,"observations_test":2,"observations_train":2,"often":23,"oil":[4,7],"ok":4,"old":4,"omega":23,"onc":23,"one":[2,4,7,9,18,23],"ones":[4,7],"onli":[2,4,6,7,18,23],"open":[22,23],"openbla":6,"oper":[4,19,23],"opernum":7,"opm":[1,2,3,5,7,14,15,18,19,21,22,23],"opm_properti":[10,13,14],"optim":[7,9],"option":[2,4,7,12,23],"order":[2,4,7,23],"org":6,"origin":[1,4],"other":[4,9],"otherwis":9,"our":[3,4],"out":22,"outisd":23,"output":[2,3,4,5,7,17],"outsid":[4,7,18,23],"over":23,"overlap":23,"overview":[2,5],"own":[3,9],"p":[4,7,23],"packag":[1,3,5,8],"page":[3,5],"panda":18,"parallel":2,"paramet":[2,4,7,17,20,23],"paraview":4,"parser":19,"parser_deck":[10,13],"part":[4,23],"pass":[3,4],"path":[2,3,4,6,7,9],"peqvr":7,"per":4,"perform":[4,7,23],"perm":4,"perm_max":2,"perm_min":2,"permeabl":[2,4,23],"permi":[2,4,7],"permx":[2,4,7],"permz":[2,4,7],"pet":[7,9],"phi_":23,"pilar":[2,4,7,20],"pillar":[2,18,23],"pinch":19,"pip":[3,4,6],"place":[4,23],"plane":[7,23],"platform":0,"pleas":[0,3],"plopm":[4,5],"plot":[9,10,13,21],"plu":7,"pm":7,"png":[4,22],"pofff":5,"point":[15,16,23],"polygon":[7,23],"pore":[4,7,18,20,23],"poro":[2,4,7],"poros":[2,4,23],"porv":[2,4,7],"posit":[7,16,18],"possibl":[3,23],"postprocess":9,"pr":3,"practic":4,"precipit":22,"prefer":3,"prep":7,"prep_deck":7,"prerequisit":6,"preserv":23,"pressur":[19,23],"previou":[3,4,6],"print":4,"problem":[5,6],"process":[17,18],"process_input":[10,13,17],"process_the_deck":[10,13,19],"product":[4,23],"project":[0,4,6,22,23],"prop":[4,19],"properti":[2,4,7,14,15,18,20,23],"properties_build":[10,13],"provid":[2,7,23],"proxi":7,"proyect":4,"prt":2,"pull":[0,3],"push":3,"pushd":3,"pv":[2,4,7,23],"pvmean":[4,7,23],"pvtnum":7,"pvweightedperm":4,"pwd":6,"py":21,"pycopm":[2,3,4,6,7,9,23],"pycopm_":7,"pycopm_porv":7,"pylint":3,"pymm":5,"pyocpm":1,"pyopmnearwel":5,"pyopmspe11":5,"pytest":3,"python":[3,5,7,22],"python3":[3,6],"q":[4,7],"quantiti":[17,23],"question":23,"quick":22,"r":[3,4,6,7],"rais":[0,3,6],"random":2,"rang":[7,23],"rate":[4,23],"ratio":23,"rd":2,"read":[4,7,15,17],"read_refer":[10,13,17],"realiz":2,"recommend":[4,6,9],"redistribut":4,"reduc":4,"refer":[4,16,20,23],"reference_simul":1,"refin":[1,2,4,5,7,9,18],"refine_grid":[10,13,18],"regard":[2,23],"region":[2,4,7,19,22,23],"regular":23,"rel":23,"relat":[4,5,14],"releas":6,"relev":4,"remain":2,"remedi":22,"remov":[2,4,7,18,20,23],"renam":4,"repit":15,"replac":[3,4],"repo":[3,6],"report":5,"repositori":[3,6,7],"reproduc":2,"request":[0,3],"requir":[3,4,6,17,19,20],"resdata":[6,7,15],"reservoir":[7,18,22,23],"resinsight":[4,9],"resourc":0,"respect":[2,7,23],"rest":[4,7],"restrict":7,"result":[2,4,7,9,23],"return":[7,12,14,15,16,17,18,19,20,21],"review":3,"right":[4,9,23],"rightarrow":23,"rise":3,"rmv":18,"roadmap":5,"rock":[2,23],"rocknum":7,"rotat":[4,7,9,23],"rotatexi":[4,7,23],"rotatexz":7,"rotateyz":7,"row":19,"rule":5,"run":[1,2,3,4,6,7,9,14,15,21],"runs_execut":[10,13],"runtim":2,"rx":[4,7],"ry":4,"same":[2,4,9,19,20,23],"sandv":2,"sat":2,"satnum":[2,7,23],"satur":[2,4,14,23],"save":[2,4,7,15],"scale":[2,7,9,23],"sch":4,"schedul":[4,19],"score":4,"screenshot":9,"script":[1,3,6,12,15],"scriptsiz":23,"search":[5,18],"second":[2,4,23],"section":[4,7,19],"see":[2,3,4,6,7,23],"seed":2,"seek":5,"seem":4,"segment":19,"seismic":23,"select":[2,9,21,23],"send":[3,6],"separ":7,"set":[2,4,6,7,9,17,23],"setuptool":6,"seven":3,"sever":23,"sga":4,"sh":6,"shape":[2,23],"shift":[18,23],"should":6,"show":[4,7,9,23],"shown":2,"side":23,"similar":23,"simpl":23,"simpli":23,"simul":[2,3,4,6,7,9,10,13,17,21,22,23],"simulation_model":4,"sinc":[4,23],"singl":[2,3,4],"site":22,"six":23,"size":23,"skip":6,"sm":4,"smaller":23,"smeaheia":[5,7],"so":[6,19],"softwar":5,"solut":[4,7,19,23],"some":[4,9,22],"soon":3,"sourc":[3,4,5,19,22],"spars":6,"spatial":23,"spe10":5,"spe10_model2":4,"spe10_model2_pycopm":4,"spe11":22,"special":[4,19,23],"specif":[2,4,6],"speed":23,"splite":19,"squash":3,"src":3,"standard":[2,4,23],"static":[3,4,7],"statoil_feasibility_sim_model_with_depletion_kross_inj_sector_20":4,"statoil_feasibility_sim_model_with_depletion_kross_inj_sector_20_prep_pycopm_dryrun":4,"statoil_feasibility_sim_model_with_depletion_kross_inj_sector_20_pycopm":4,"step":[3,6],"still":[4,6],"stop":2,"storag":[0,2,15,22],"str":17,"straight":23,"studi":[2,4,7,9,21,22,23],"sub":[4,7],"subfig":4,"subgrid":18,"submodel":[1,2,4,5,7,9,15,18,19],"submodul":[1,8,10],"subpackag":[1,5,8],"substract":4,"subsurfac":[0,4,23],"subsystem":6,"succe":3,"succeed":2,"success":2,"sudmodel":23,"suffix":2,"suit":6,"sum":[7,23],"sum_":23,"summari":[4,9],"support":[2,5,6,7,19],"suptitl":4,"sure":18,"surfac":23,"sustain":0,"swatinit":[4,7],"system":[3,7],"t":[4,7,23],"t_":23,"tabl":[14,23],"tag":6,"taho":6,"tailor":4,"taken":23,"tcpu":4,"techniqu":[7,23],"templat":[7,14],"template_script":1,"term":3,"termin":[2,4,6,7],"test":[1,2,3,4,6,7],"test_run":2,"text":[4,7,17],"textbook":23,"tg":2,"than":[0,3,23],"thconr":7,"thei":23,"them":[4,7],"theori":[4,5],"thi":[0,2,3,4,6,7,9,23],"thick":23,"those":[2,4],"thousand":4,"three":[4,7,23],"time":[2,4,21,23],"tmltg":2,"tmlto":2,"tog":2,"toml":[2,4,7,16,17,20,21],"tool":[0,4,6,7,9,22,23],"top":[4,18],"total":4,"trade":23,"tran":15,"transform":[1,2,4,5,7,9,15,18],"transform_grid":[10,13,18],"translat":[7,9,23],"transmis":[7,23],"transmiss":[7,23],"transmissibili":7,"transsmiss":23,"trial":4,"trim":23,"true":[4,18],"try":[3,4,6,7],"tune":7,"tunit":4,"turn":6,"tutori":[3,6],"tw":2,"two":[4,7,23],"txt":[3,6],"type":[2,6,22],"typic":23,"u":7,"ubuntu":[3,6],"uncertainti":23,"uncoarsen":17,"uniform":2,"uniformli":7,"unlimit":2,"unrefin":23,"up":23,"updat":6,"upgrad":6,"uprad":6,"upscal":[7,23],"us":[0,1,2,3,4,6,7,9,15,20,22,23],"user":[2,3,4,6,7],"utf8":7,"util":[1,8,10],"utilii":[14,16,17,20,21],"v":[4,7,23],"v2":6,"v2025":6,"v_c":18,"valu":[2,4,7,15,17,23],"variabl":[3,14,15,17],"vector":4,"venv":6,"version":[6,10],"vertic":23,"via":[2,5,6,7],"vicin":[4,7,18],"view":[4,19],"vile":4,"virtual":6,"visaluaz":4,"visit":[2,3],"visual":[4,9],"volum":[4,7,18,20,23],"vpycopm":6,"vpyocpm":6,"vtk":[4,22],"w":[4,7],"wa":[7,9],"warn":7,"water":[4,7],"we":[2,3,4,6,9,19,23],"webviz":4,"weight":[2,4,7,23],"welcom":[0,3],"well":[2,3,4,7,19,22,23],"welln":7,"wellspec":4,"welseg":19,"were":7,"wgpr":2,"wheel":6,"when":[6,23],"where":[4,7,23],"which":[2,3,4,6,7,23],"while":[4,6,7,23],"whole":7,"wide":23,"window":5,"without":[2,4,9],"wopr":2,"work":[3,6,7],"workflow":23,"world":[3,5],"would":[4,7,9],"write":[2,4,6,7,14,15,19,20],"write_explicit":[10,13,19],"write_grid":[10,13,15],"write_let_t":[10,13,14],"write_prop":[10,13,15],"written":23,"wsl":6,"wwpr":2,"x":[2,4,7,15,23],"xformat":4,"xi_":23,"xlnum":4,"xplicit":7,"xunit":4,"xy":[7,18,23],"xypolygon":[4,7,23],"xyz":[7,23],"y":[2,4,7,23],"yet":6,"yformat":4,"ylabel":4,"yml":[3,6],"you":[2,3,4,6,9],"your":[2,3,4,6,7,9],"yournam":3,"yunit":4,"z":[2,4,7,18,20,23],"z_b":18,"z_b_t":18,"z_t":18,"zcord":18,"zcorn":18,"zero":23},"titles":["About pycopm","pycopm Python API","Configuration file","Contributing","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_files module","pycopm.utils.grid_builder module","pycopm.utils.input_values module","pycopm.utils.mapping_methods module","pycopm.utils.parser_deck module","pycopm.utils.properties_builder module","pycopm.utils.runs_executer module","Related","Theory"],"titleterms":{"":5,"about":0,"abstract":4,"ad":22,"an":9,"api":1,"build":6,"coarsen":23,"concept":7,"configur":[2,4,9],"content":[10,11,13],"contribut":3,"core":[11,12],"deck":[4,9],"document":5,"drogon":4,"exampl":4,"exprecc":22,"file":[2,4,9],"files_writ":14,"flow":[4,6,9],"folder":9,"generate_fil":15,"graphic":4,"grid":23,"grid_build":16,"ground":3,"hello":4,"indic":5,"input":9,"input_valu":17,"instal":6,"introduct":7,"issu":3,"linux":6,"maco":6,"mapping_method":18,"micp":22,"modul":[10,11,12,13,14,15,16,17,18,19,20,21],"norn":4,"opm":[4,6,9],"output":9,"overview":7,"packag":[6,10,11,13],"parser_deck":19,"plopm":22,"pofff":22,"problem":3,"properties_build":20,"pycopm":[0,1,5,8,10,11,12,13,14,15,16,17,18,19,20,21],"pymm":22,"pyopmnearwel":22,"pyopmspe11":22,"python":[1,6],"refin":23,"relat":22,"report":3,"roadmap":7,"rule":3,"runs_execut":21,"seek":3,"smeaheia":4,"softwar":3,"sourc":6,"spe10":4,"submodel":23,"submodul":[11,13],"subpackag":10,"support":3,"tabl":5,"theori":23,"transform":23,"util":[13,14,15,16,17,18,19,20,21],"via":[4,9],"welcom":5,"window":6,"world":4}}) \ No newline at end of file +Search.setIndex({"alltitles":{"About pycopm":[[0,null]],"Concept":[[7,"concept"]],"Configuration file":[[2,null]],"Contribute to the software":[[3,"contribute-to-the-software"]],"Contributing":[[3,null]],"Drogon":[[4,"drogon"]],"Examples":[[4,null]],"Graphical abstract":[[4,"graphical-abstract"]],"Grid coarsening":[[23,"grid-coarsening"]],"Grid refinement":[[23,"grid-refinement"]],"Ground Rules":[[3,"ground-rules"]],"Hello world":[[4,"hello-world"]],"Indices and tables":[[5,"indices-and-tables"]],"Installation":[[6,null]],"Introduction":[[7,null]],"Module contents":[[10,"module-pycopm"],[11,"module-pycopm.core"],[13,"module-pycopm.utils"]],"Norne":[[4,"norne"]],"OPM Flow":[[6,"opm-flow"]],"Output folder":[[9,null]],"Overview":[[7,"overview"]],"Python package":[[6,"python-package"]],"Related":[[22,null]],"Report issues or problems":[[3,"report-issues-or-problems"]],"Roadmap":[[7,"roadmap"]],"SPE10":[[4,"spe10"]],"Seek support":[[3,"seek-support"]],"Smeaheia":[[4,"smeaheia"]],"Source build in Linux/Windows":[[6,"source-build-in-linux-windows"]],"Source build in macOS":[[6,"source-build-in-macos"]],"Submodels":[[23,"submodels"]],"Submodules":[[11,"submodules"],[13,"submodules"]],"Subpackages":[[10,"subpackages"]],"Theory":[[23,null]],"Transformations":[[23,"transformations"]],"Via OPM Flow decks":[[4,"via-opm-flow-decks"]],"Via an OPM Flow input deck":[[9,"via-an-opm-flow-input-deck"]],"Via configuration files":[[4,"via-configuration-files"],[9,"via-configuration-files"]],"Welcome to pycopm\u2019s documentation!":[[5,null]],"ad-micp":[[22,"ad-micp"]],"expreccs":[[22,"expreccs"]],"plopm":[[22,"plopm"]],"pofff":[[22,"pofff"]],"pycopm":[[1,"pycopm"],[8,null]],"pycopm Python API":[[1,null]],"pycopm package":[[10,null]],"pycopm.core package":[[11,null]],"pycopm.core.pycopm module":[[12,null]],"pycopm.utils package":[[13,null]],"pycopm.utils.files_writer module":[[14,null]],"pycopm.utils.generate_files module":[[15,null]],"pycopm.utils.grid_builder module":[[16,null]],"pycopm.utils.input_values module":[[17,null]],"pycopm.utils.mapping_methods module":[[18,null]],"pycopm.utils.parser_deck module":[[19,null]],"pycopm.utils.properties_builder module":[[20,null]],"pycopm.utils.runs_executer module":[[21,null]],"pymm":[[22,"pymm"]],"pyopmnearwell":[[22,"pyopmnearwell"]],"pyopmspe11":[[22,"pyopmspe11"]]},"docnames":["about","api","configuration_file","contributing","examples","index","installation","introduction","modules","output_folder","pycopm","pycopm.core","pycopm.core.pycopm","pycopm.utils","pycopm.utils.files_writer","pycopm.utils.generate_files","pycopm.utils.grid_builder","pycopm.utils.input_values","pycopm.utils.mapping_methods","pycopm.utils.parser_deck","pycopm.utils.properties_builder","pycopm.utils.runs_executer","related","theory"],"envversion":{"sphinx":65,"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","contributing.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_files.rst","pycopm.utils.grid_builder.rst","pycopm.utils.input_values.rst","pycopm.utils.mapping_methods.rst","pycopm.utils.parser_deck.rst","pycopm.utils.properties_builder.rst","pycopm.utils.runs_executer.rst","related.rst","theory.rst"],"indexentries":{},"objects":{"":[[10,0,0,"-","pycopm"]],"pycopm":[[11,0,0,"-","core"],[13,0,0,"-","utils"]],"pycopm.core":[[12,0,0,"-","pycopm"]],"pycopm.core.pycopm":[[12,1,1,"","check_cmdargs"],[12,1,1,"","load_parser"],[12,1,1,"","main"],[12,1,1,"","pycopm"]],"pycopm.utils":[[14,0,0,"-","files_writer"],[15,0,0,"-","generate_files"],[16,0,0,"-","grid_builder"],[17,0,0,"-","input_values"],[18,0,0,"-","mapping_methods"],[19,0,0,"-","parser_deck"],[20,0,0,"-","properties_builder"],[21,0,0,"-","runs_executer"]],"pycopm.utils.files_writer":[[14,1,1,"","coarser_files"],[14,1,1,"","ert_files"],[14,1,1,"","grid_features"],[14,1,1,"","opm_properties"],[14,1,1,"","write_let_tables"]],"pycopm.utils.generate_files":[[15,1,1,"","compact_format"],[15,1,1,"","create_deck"],[15,1,1,"","handle_nnc_trans"],[15,1,1,"","initialize_variables"],[15,1,1,"","write_grid"],[15,1,1,"","write_props"]],"pycopm.utils.grid_builder":[[16,1,1,"","coarser_grid"],[16,1,1,"","handle_face_dir_im"],[16,1,1,"","handle_face_dir_ip"],[16,1,1,"","handle_face_dir_jm"],[16,1,1,"","handle_face_dir_jp"],[16,1,1,"","handle_faults"]],"pycopm.utils.input_values":[[17,1,1,"","check_flow"],[17,1,1,"","initialize_values"],[17,1,1,"","process_input"],[17,1,1,"","read_reference"]],"pycopm.utils.mapping_methods":[[18,1,1,"","add_pv_bc"],[18,1,1,"","chop_grid"],[18,1,1,"","coarsening_dir"],[18,1,1,"","find_neighbors"],[18,1,1,"","get_ijk"],[18,1,1,"","handle_clusters"],[18,1,1,"","handle_cp_grid"],[18,1,1,"","handle_pv"],[18,1,1,"","handle_refinement"],[18,1,1,"","handle_vicinity"],[18,1,1,"","handle_zcorn"],[18,1,1,"","map_ijk"],[18,1,1,"","map_properties"],[18,1,1,"","map_vicinity"],[18,1,1,"","refine_grid"],[18,1,1,"","transform_grid"]],"pycopm.utils.parser_deck":[[19,1,1,"","get_wells_for_vicinity"],[19,1,1,"","handle_aquancon"],[19,1,1,"","handle_aqucon"],[19,1,1,"","handle_aqunum"],[19,1,1,"","handle_bccon"],[19,1,1,"","handle_bwpr"],[19,1,1,"","handle_compsegs"],[19,1,1,"","handle_dimens"],[19,1,1,"","handle_editnnc"],[19,1,1,"","handle_equil"],[19,1,1,"","handle_fault"],[19,1,1,"","handle_grid_props"],[19,1,1,"","handle_mapaxes"],[19,1,1,"","handle_multflt"],[19,1,1,"","handle_multiply"],[19,1,1,"","handle_multregt"],[19,1,1,"","handle_oper"],[19,1,1,"","handle_pinch"],[19,1,1,"","handle_props"],[19,1,1,"","handle_regions"],[19,1,1,"","handle_schedule"],[19,1,1,"","handle_schedulekw"],[19,1,1,"","handle_segmented_wells"],[19,1,1,"","handle_source"],[19,1,1,"","handle_welldims"],[19,1,1,"","handle_wells"],[19,1,1,"","handle_welsegs"],[19,1,1,"","names_segwells"],[19,1,1,"","names_wells"],[19,1,1,"","process_the_deck"],[19,1,1,"","write_explicit"]],"pycopm.utils.properties_builder":[[20,1,1,"","add_lost_pv_to_all_cells"],[20,1,1,"","add_lost_pv_to_all_eq_cells"],[20,1,1,"","add_lost_pv_to_all_fip_cells"],[20,1,1,"","add_lost_pv_to_boundary_cells"],[20,1,1,"","coarser_properties"],[20,1,1,"","identify_removed_pilars"],[20,1,1,"","identify_removed_pilars_zdir"],[20,1,1,"","initialize_properties"]],"pycopm.utils.runs_executer":[[21,1,1,"","plotting"],[21,1,1,"","simulations"]]},"objnames":{"0":["py","module","Python module"],"1":["py","function","Python function"]},"objtypes":{"0":"py:module","1":"py:function"},"terms":{"":[2,3,4,7,18,23],"0":[2,4,6,7,23],"01":[2,4],"02":4,"03":2,"04":[3,6],"0f":4,"1":[2,3,4,6,7,23],"10":[4,6,7,23],"100":2,"100000":2,"11":[3,4,6,23],"12":6,"128":4,"13":[3,6,7],"14":[4,6],"16":4,"17":6,"18":23,"1f":4,"2":[2,4,7,23],"20":4,"2000":4,"2005":2,"2019":23,"2022":2,"2025":6,"24":3,"243":4,"25":[4,23],"26":[3,6],"2d":23,"2e":4,"2f":4,"2xyz":4,"3":[2,3,4,6,7,23],"30":[4,7,23],"300":4,"31":4,"331841":0,"336294":0,"35":[4,23],"351":4,"3h":23,"3xz":4,"4":[4,7,23],"40":23,"41":4,"45":[4,7,23],"463284":4,"463739":4,"464401":4,"464872":4,"5":[2,3,4,7,23],"50":23,"58":4,"5931508":4,"5932123":4,"5932209":4,"5932862":4,"6":[4,7],"60":23,"600":2,"65":23,"7":[2,7],"75":23,"8":[2,4],"8859":7,"9":[2,6],"90":23,"95":4,"A":[2,22,23],"As":[4,7,9,23],"By":[2,4],"For":[0,2,3,4,6,9,23],"If":[2,4,6,23],"In":[3,4,6,7,23],"It":4,"One":23,"The":[0,1,2,3,4,6,7,9,23],"Then":[2,4,9,23],"These":[4,23],"To":[2,4,6,23],"_":23,"_build":3,"_pycopm":7,"about":[3,4,5,23],"abov":[4,23],"abstract":5,"accept":3,"accordingli":23,"account":2,"accuraci":23,"achiev":[2,4,6,23],"across":[4,23],"action":[3,6],"activ":[2,4,6,7,18,20,23],"actnum":[7,18],"actual":4,"ad":[2,4,5,7,23],"adapt":[7,9],"add":[2,3,4,7,18,19],"add_lost_pv_to_all_cel":[10,13,20],"add_lost_pv_to_all_eq_cel":[10,13,20],"add_lost_pv_to_all_fip_cel":[10,13,20],"add_lost_pv_to_boundary_cel":[10,13,20],"add_pv_bc":[10,13,18],"addiiton":23,"addit":[2,4,6,23],"adjust":7,"adopt":23,"affin":23,"after":[1,2,4,6,9,23],"al":2,"align":23,"all":[2,3,4,6,7,9,18,20,23],"allow":[2,4,7,23],"along":[7,23],"also":[3,4,6,7,19,23],"altern":[3,7],"among":23,"an":[0,2,3,4,5,6,7,22,23],"anaconda":6,"analys":3,"ani":[2,3,23],"answer":3,"api":5,"appear":9,"appl":6,"appli":[4,7,23],"applic":[4,7,9,23],"apporach":4,"approach":[0,2,3,4,7,9,23],"appropri":23,"aproach":4,"apt":6,"aquancon":19,"aquif":19,"ar":[0,1,2,3,4,6,7,9,22,23],"area":23,"arg":[12,14,15,16,17,18,19,20,21],"argument":[2,7,12,18],"arithmet":[7,23],"armon":[7,23],"arn":7,"around":[4,7,23],"arrai":[2,7,18,20,23],"assign":[7,23],"assum":4,"assur":23,"avail":[4,6,7],"averag":[7,23],"avoid":[4,7],"axi":7,"azurewebsit":4,"back":2,"base":[1,7,22,23],"bash":6,"bc0407_hist01122006":4,"bccon":19,"been":[7,23],"befor":[2,3,7],"being":0,"below":[7,22,23],"benchmark":22,"better":[4,23],"between":[4,7,23],"bin":[2,3,6,7],"binari":[3,6,7],"black":3,"block":[19,20],"boost":6,"both":23,"bottom":[4,18],"boundari":[2,4,7,20,23],"box":[7,23],"branch":6,"break":23,"brew":6,"build":[2,3,5,7],"build_opm_mpi":6,"built":[4,6,7],"c":[3,4,7,23],"c1":4,"c2":4,"ca":4,"calcit":22,"call":[1,2,9,15],"can":[2,3,4,6,7,9,23],"cannot":23,"capillari":23,"care":23,"cartesian":23,"case":[1,4,23],"cbsfax":4,"cd":[4,6],"cell":[2,4,7,16,17,18,20,23],"cell_index":16,"center":[0,4,18],"certain":4,"cet_rainbow_bgyrm_35_85_c69":4,"cfd":22,"cformat":4,"chang":[2,3],"character":23,"check":[12,17,22],"check_cmdarg":[10,11,12],"check_flow":[10,13,17],"checker":3,"checkout":6,"chop_grid":[10,13,18],"ci_pycopm_maco":3,"ci_pycopm_ubuntu":[3,6],"clang":6,"clone":[4,6],"closest":[4,7],"clusmax":18,"clusmin":18,"cluster":[18,23],"cmake":6,"cmdarg":12,"co2":[0,22],"coars":[2,4,7,16,20,23],"coarsen":[1,2,4,5,7,9,16,18],"coarsening_dir":[10,13,18],"coarser":[2,4,7,9,15,18,20,23],"coarser_fil":[10,13,14],"coarser_grid":[10,13,16],"coarser_properti":[10,13,20],"coarsern":4,"code":[3,6,10],"collabor":3,"com":[4,6,7],"combin":[4,12],"comma":7,"command":[2,4,6,12],"comment":4,"commit":3,"common":[6,23],"commonli":23,"commun":23,"compact":15,"compact_format":[10,13,15],"compar":4,"comparison":23,"compdat":7,"complet":2,"complex":23,"compseg":19,"comput":[2,7,23],"concept":5,"condit":23,"confact":7,"confer":2,"configur":[5,7,16,17,20,21],"conform":7,"connect":[4,7,15,23],"conquer":4,"conserv":4,"consid":[2,7],"contain":[1,3,4],"content":[1,3,4,5,8],"contribut":[0,5,6],"coordin":[7,18],"copi":[3,4,6,9,19],"core":[1,6,8,10],"corner":[7,15,16,18,23],"correct":[2,7,9,20,23],"correl":23,"correspond":[2,4,7,18,23],"could":[4,6,9,23],"cov":3,"cporv":2,"creat":[3,4,6,7,9,15,18,23],"create_deck":[10,13,15],"creation":7,"csp":22,"cssr":[0,4,6,7],"current":[2,4,6,7,9,18,21],"current_directori":6,"d":[4,7,23],"dai":4,"data":[2,3,4,7,23],"datafram":18,"dataset":4,"date":2,"dcmake_build_typ":6,"dcmake_disable_find_package_mpi":6,"dcmake_prefix_path":6,"deactiv":6,"deck":[1,2,3,5,7,14,19,20,23],"deck_dri":7,"dedic":6,"default":[2,4,7,9,23],"defin":[2,4,9,20,23],"definit":[2,4,23],"degre":[4,7],"delax":4,"delet":2,"demonstr":4,"depend":[3,6,23],"depth":23,"describ":[3,4,7,9],"descript":[2,7],"destroi":18,"dev":[3,6],"develop":[4,6,7,9,23],"diamond":[7,23],"diamondxi":[4,7,23],"dic":[14,15,16,17,18,19,20,21],"dic1":17,"dict":[12,14,15,16,17,18,19,20,21],"dictionari":[14,15,16,17,18,19,20,21],"diffeent":15,"differ":[1,2,4,7,18,23],"differenti":4,"dimens":19,"dir":[2,7,16],"direct":[2,4,7,18,20,23],"directli":[2,9],"directori":3,"discontinu":7,"discret":23,"discuss":2,"disperc":7,"dist":2,"distpara":2,"distribut":[2,7,18,20,23],"divers":[7,23],"divid":4,"dmar":2,"do":[2,3,4,6,7,23],"doc":3,"document":[2,3,6,7],"done":[6,7],"download":4,"dpi":4,"drawback":23,"drogon":[1,2,5,7,9],"drogon_2times_coars":4,"drogon_coars":4,"drogon_hist":4,"drogon_hist_prep_pycopm_dryrun":4,"drogon_hist_pycopm":4,"drogon_hist_pycopm_pycopm":4,"drogon_pycopm_comparison":4,"dry":[4,7,15],"due":[4,23],"dune":6,"dunecontrol":6,"dure":23,"duse_mpi":6,"dwith_ndebug":6,"dynam":22,"e":[2,3,4,6,7,9,23],"each":[2,7,23],"earli":9,"eas":23,"echo":6,"edg":6,"effect":23,"eg":2,"egrid":3,"either":7,"els":6,"em":22,"email":[3,6],"emltg":2,"emlto":2,"emphas":23,"empti":[4,7],"enabl":[4,7],"encod":7,"end":[4,23],"endnum":7,"ensembl":[2,4,7],"ensemble_experi":2,"ensemble_smooth":2,"entri":[2,7,23],"environ":[3,6],"eo":2,"eog":2,"eqlnum":[7,20],"equal":[4,7,23],"equil":[2,4],"error":[2,4,9],"ert":[1,2,4,6,7,9,14,21],"ert_fil":[10,13,14],"es_mda":2,"et":2,"etc":7,"ew":2,"exampl":[2,3,5,6,9,23],"excel":23,"except":2,"exectut":7,"execut":[1,2,3,4,6,7,9,12,21,23],"expans":0,"explicit":[4,19],"explicitli":7,"export":[3,6],"exprecc":[0,5],"extend":3,"extract":[4,7,18,23],"f":[3,4,7],"face":[6,7,16,23],"familiar":[2,3],"faster":23,"fault":[4,7,16,19,23],"favourit":[7,9],"featur":[0,4,23],"fewer":23,"fgip":7,"fi":6,"field":[2,4,23],"figur":[4,9,23],"file":[1,3,5,6,7,14,15,16,17,18,20,21,23],"files_writ":[10,13],"final":[1,2,4],"find":[9,18],"find_neighbor":[10,13,18],"fine":2,"finner":[15,18,23],"fipnum":[7,20,23],"first":[2,4,7],"five":4,"fix":3,"flag":[2,3,4,7,12,18],"flexibl":[7,23],"float":[18,21],"flow":[1,2,3,5,7,14,17,21,22,23],"flow_maco":3,"fluid":23,"fluidflow":22,"fluxnum":7,"focu":[4,7,9,23],"focus":[4,7,9],"foip":[4,7],"folder":[1,3,4,5,6,7],"follow":[2,4,6,7,9,23],"fopr":4,"fork":[0,3],"format":[2,3,4,23],"former":23,"found":17,"four":[4,23],"frac":23,"framework":[1,4,22],"frequent":23,"friend":4,"friendli":7,"from":[1,2,3,4,6,7,15,16,17,18,19,20,21,22,23],"full":[2,4,9],"function":[1,2,4,12,14,16,17,20,21,23],"fund":0,"further":9,"g":[2,3,4,6,7,9,23],"ga":[4,7],"gener":[1,2,3,4,7,9,15,20,21,22,23],"generate_fil":[10,13],"geolog":[2,4,7,9,23],"geometr":23,"geometri":[6,23],"geophys":23,"get":[3,6,18,19],"get_ijk":[10,13,18],"get_wells_for_vicin":[10,13,19],"gif":[4,22],"git":[4,6],"github":[2,3,4,6,7],"gitlab":6,"give":[4,9,23],"given":[2,4,7,23],"global":[14,15,16,17,18,19,20,21,23],"go":4,"good":4,"graphic":5,"grid":[1,4,5,6,7,9,14,15,16,18,19,20],"grid_build":[10,13],"grid_featur":[10,13,14],"ground":5,"group":23,"gui":2,"h":2,"ha":[7,23],"handi":23,"handl":[4,18,19,23],"handle_aquancon":[10,13,19],"handle_aqucon":[10,13,19],"handle_aqunum":[10,13,19],"handle_bccon":[10,13,19],"handle_bwpr":[10,13,19],"handle_clust":[10,13,18],"handle_compseg":[10,13,19],"handle_cp_grid":[10,13,18],"handle_dimen":[10,13,19],"handle_editnnc":[10,13,19],"handle_equil":[10,13,19],"handle_face_dir_im":[10,13,16],"handle_face_dir_ip":[10,13,16],"handle_face_dir_jm":[10,13,16],"handle_face_dir_jp":[10,13,16],"handle_fault":[10,13,16,19],"handle_grid_prop":[10,13,19],"handle_mapax":[10,13,19],"handle_multflt":[10,13,19],"handle_multipli":[10,13,19],"handle_multregt":[10,13,19],"handle_nnc_tran":[10,13,15],"handle_op":[10,13,19],"handle_pinch":[10,13,19],"handle_prop":[10,13,19],"handle_pv":[10,13,18],"handle_refin":[10,13,18],"handle_region":[10,13,19],"handle_schedul":[10,13,19],"handle_schedulekw":[10,13,19],"handle_segmented_wel":[10,13,19],"handle_sourc":[10,13,19],"handle_vicin":[10,13,18],"handle_wel":[10,13,19],"handle_welldim":[10,13,19],"handle_welseg":[10,13,19],"handle_zcorn":[10,13,18],"harmon":[7,23],"have":[2,4,6,19,23],"hello":[3,5],"hello_world":[3,4],"hello_world_pycopm":[3,4],"hello_world_pycopm_pycopm":4,"help":3,"here":[2,4,23],"hexahedron":23,"higher":4,"highlight":4,"histori":[2,4,7,9,22,23],"hm":[2,4],"home":7,"honor":[2,23],"horda":0,"horizont":23,"host":7,"how":[4,23],"howev":4,"html":3,"http":[4,6,7],"i":[0,1,2,3,4,6,7,9,16,17,18,19,23],"i_d":18,"identifi":[4,19,20],"identify_removed_pilar":[10,13,20],"identify_removed_pilars_zdir":[10,13,20],"ignor":3,"ilustr":4,"imag":22,"imbnum":7,"impact":23,"implement":[4,7,23],"import":[3,23],"in_fil":17,"inact":[4,7,18,23],"inc":[4,7],"includ":[4,6,7,9],"increas":[4,18,23],"ind":18,"index":[2,5,16,18,20],"indic":[4,7,18,19,23],"induc":22,"industri":23,"inform":[2,23],"init":[2,4],"initi":[2,4,7,17,20,23],"initialize_properti":[10,13,20],"initialize_valu":[10,13,17],"initialize_vari":[10,13,15],"inj":4,"injector":4,"input":[2,4,5,7,17,19,20,23],"input_valu":[10,13],"insid":[4,6,23],"insight":23,"inspect":2,"instal":[3,4,5,7],"instead":[2,4,23],"int":[16,18,20],"integ":[4,18],"integr":2,"interest":[6,22,23],"intern":7,"interv":[2,4,7,23],"introduct":[5,9,23],"invalid":12,"involv":[4,23],"inx":20,"ir":18,"iso":7,"isol":4,"issu":[0,4,5,6],"istl":6,"item":7,"iter":[2,4],"iterative_ensemble_smooth":2,"its":[18,23],"j":[2,4,7,16,18,19,23],"j5":6,"jk":7,"job":1,"jump":[4,18],"just":7,"k":[2,4,7,16,18,19,23],"keep":[2,4,7,19],"kei":23,"keyword":[4,19],"kh":7,"kilomet":23,"km":4,"l":[4,6,7],"l127":4,"l242":4,"label":4,"larg":23,"last":[2,7],"later":2,"latest":6,"latter":4,"layer":23,"leakag":22,"least":[4,7,18],"left":[4,9,23],"legend":4,"less":4,"let":[2,14],"letsatn":2,"level":7,"lg":2,"librari":6,"lie":23,"like":[4,23],"line":[2,3,4,6,23],"link":6,"lint":6,"linux":5,"list":[15,18,19],"lmltg":2,"lmlto":2,"lo":2,"load_pars":[10,11,12],"loc":4,"local":[3,17,23],"locat":[1,4,7,9,23],"log":2,"look":3,"loop":4,"lost":[2,20],"lot":[4,23],"lower":[4,23],"lw":2,"m":[3,4,6,7],"machin":2,"maco":[3,4,5],"macport":6,"made":[4,23],"main":[1,2,3,4,10,11,12,15],"maintain":[3,6],"make":[3,4,6,7,18,23],"mako":[1,14],"mamba":6,"manag":[6,23],"mantain":3,"manual":7,"map":[7,15,16,18,19,23],"map_ijk":[10,13,18],"map_properti":[10,13,18],"map_vicin":[10,13,18],"mapax":4,"mapping_method":[10,13],"mask":18,"master":6,"match":[2,4,7,9,22,23],"mathbb":23,"max":[2,4,7,23],"maximum":[2,4,18],"maxpermz":4,"mean":[2,4,7,23],"measur":23,"member":4,"memori":2,"mention":[4,23],"mep":2,"merg":3,"meter":[7,23],"method":[14,15,16,18,19,20,23],"micp":5,"microbi":22,"microsystem":22,"middl":4,"might":[3,4,6,9,22,23],"million":4,"min":[2,4,7,23],"minerror":2,"mini":7,"miniforg":6,"minimum":2,"minj":7,"miscnum":7,"miss":3,"missmatch":23,"mkdir":6,"mode":[2,4,7,23],"model":[2,4,7,9,19,20,22,23],"model3":23,"modif":2,"modifi":[2,4,6,7,9,14,15,16,17,18,19,20,21],"modul":[1,5,6,8,22],"more":[0,3,4],"most":23,"mpi":[4,6],"mpirun":2,"mrn":2,"mrt":2,"mult":7,"multi":4,"multipli":[4,7,19,23],"multnum":7,"multregt":[4,19],"multx":4,"multz":4,"must":[2,4,23],"mypi":3,"n":[4,7,15,18],"name":[2,4,7,17,19],"name_of_input_fil":7,"names_segwel":[10,13,19],"names_wel":[10,13,19],"natur":23,"necessari":[14,19],"need":[2,3,4,6,7,9],"neighbor":23,"neighbour":[4,7,15,18,23],"neighbourhood":[7,23],"net":[2,4],"new":[0,3,4,7,18,23],"newton":2,"next":2,"nice":[3,4,6],"nnc":[19,23],"non":[7,15,23],"none":[12,14,15,21],"nor":18,"norn":[1,2,5,7,9,23],"norne_atw2013":4,"notat":[15,23],"note":[3,4],"noth":7,"now":4,"np":2,"nrwo":19,"ntg":[2,4],"num":20,"number":[2,4,7,19,23],"o":[3,4,7,9,18],"ob":2,"object":18,"observ":[2,4],"observations_complet":2,"observations_test":2,"observations_train":2,"often":23,"oil":[4,7],"ok":4,"old":4,"omega":23,"onc":23,"one":[2,4,7,9,18,23],"ones":[4,7],"onli":[2,4,6,7,18,23],"open":[22,23],"openbla":6,"oper":[4,19,23],"opernum":7,"opm":[1,2,3,5,7,14,15,18,19,21,22,23],"opm_properti":[10,13,14],"optim":[7,9],"option":[2,4,7,12,23],"order":[2,4,7,23],"org":6,"origin":[1,4],"other":[4,9],"otherwis":9,"our":[3,4],"out":22,"outisd":23,"output":[2,3,4,5,7,17],"outsid":[4,7,18,23],"over":23,"overlap":23,"overview":[2,5],"own":[3,9],"p":[4,7,23],"packag":[1,3,5,8],"page":[3,5],"panda":18,"parallel":2,"paramet":[2,4,7,17,20,23],"paraview":4,"parser":19,"parser_deck":[10,13],"part":[4,23],"pass":[3,4],"path":[2,3,4,6,7,9],"peqvr":7,"per":4,"perform":[4,7,23],"perm":4,"perm_max":2,"perm_min":2,"permeabl":[2,4,23],"permi":[2,4,7],"permx":[2,4,7],"permz":[2,4,7],"pet":[7,9],"phi_":23,"pilar":[2,4,7,20],"pillar":[2,18,23],"pinch":19,"pip":[3,4,6],"place":[4,23],"plane":[7,23],"platform":0,"pleas":[0,3],"plopm":[4,5],"plot":[9,10,13,21],"plu":7,"pm":7,"png":[4,22],"pofff":5,"point":[15,16,23],"polygon":[7,23],"pore":[4,7,18,20,23],"poro":[2,4,7],"poros":[2,4,23],"porv":[2,4,7],"posit":[7,16,18],"possibl":[3,23],"postprocess":9,"pr":3,"practic":4,"precipit":22,"prefer":3,"prep":7,"prep_deck":7,"prerequisit":6,"preserv":23,"pressur":[19,23],"previou":[3,4,6],"print":4,"problem":[5,6],"process":[17,18],"process_input":[10,13,17],"process_the_deck":[10,13,19],"product":[4,23],"project":[0,4,6,22,23],"prop":[4,19],"properti":[2,4,7,14,15,18,20,23],"properties_build":[10,13],"provid":[2,7,23],"proxi":7,"proyect":4,"prt":2,"pull":[0,3],"push":3,"pushd":3,"pv":[2,4,7,23],"pvmean":[4,7,23],"pvtnum":7,"pvweightedperm":4,"pwd":6,"py":21,"pycopm":[2,3,4,6,7,9,23],"pycopm_":7,"pycopm_porv":7,"pylint":3,"pymm":5,"pyocpm":1,"pyopmnearwel":5,"pyopmspe11":5,"pytest":3,"python":[3,5,7,22],"python3":[3,6],"q":[4,7],"quantiti":[17,23],"question":23,"quick":22,"r":[3,4,6,7],"rais":[0,3,6],"random":2,"rang":[7,23],"rate":[4,23],"ratio":23,"rd":2,"read":[4,7,15,17],"read_refer":[10,13,17],"realiz":2,"recommend":[4,6,9],"redistribut":4,"reduc":4,"refer":[4,16,20,23],"reference_simul":1,"refin":[1,2,4,5,7,9,18],"refine_grid":[10,13,18],"regard":[2,23],"region":[2,4,7,19,22,23],"regular":23,"rel":23,"relat":[4,5,14],"releas":6,"relev":4,"remain":2,"remedi":22,"remov":[2,4,7,18,20,23],"renam":4,"repit":15,"replac":[3,4],"repo":[3,6],"report":5,"repositori":[3,6,7],"reproduc":2,"request":[0,3],"requir":[3,4,6,17,19,20],"reservoir":[7,18,22,23],"resinsight":[4,9],"resourc":0,"respect":[2,7,23],"rest":[4,7],"restrict":7,"result":[2,4,7,9,23],"return":[7,12,14,15,16,17,18,19,20,21],"review":3,"right":[4,9,23],"rightarrow":23,"rise":3,"rmv":18,"roadmap":5,"rock":[2,23],"rocknum":7,"rotat":[4,7,9,23],"rotatexi":[4,7,23],"rotatexz":7,"rotateyz":7,"row":19,"rule":5,"run":[1,2,3,4,6,7,9,14,15,21],"runs_execut":[10,13],"runtim":2,"rx":[4,7],"ry":4,"same":[2,4,9,19,20,23],"sandv":2,"sat":2,"satnum":[2,7,23],"satur":[2,4,14,23],"save":[2,4,7,15],"scale":[2,7,9,23],"sch":4,"schedul":[4,19],"score":4,"screenshot":9,"script":[1,3,6,12,15],"scriptsiz":23,"search":[5,18],"second":[2,4,23],"section":[4,7,19],"see":[2,3,4,6,7,23],"seed":2,"seek":5,"seem":4,"segment":19,"seismic":23,"select":[2,9,21,23],"send":[3,6],"separ":7,"set":[2,4,6,7,9,17,23],"setuptool":6,"seven":3,"sever":23,"sga":4,"sh":6,"shape":[2,23],"shift":[18,23],"should":6,"show":[4,7,9,23],"shown":2,"side":23,"similar":23,"simpl":23,"simpli":23,"simul":[2,3,4,6,7,9,10,13,17,21,22,23],"simulation_model":4,"sinc":[4,23],"singl":[2,3,4],"site":22,"six":23,"size":23,"skip":6,"sm":4,"smaller":23,"smeaheia":[5,7],"so":[6,19],"softwar":5,"solut":[4,7,19,23],"some":[4,9,22],"soon":3,"sourc":[3,4,5,19,22],"spars":6,"spatial":23,"spe10":5,"spe10_model2":4,"spe10_model2_pycopm":4,"spe11":22,"special":[4,19,23],"specif":[2,4,6],"speed":23,"splite":19,"squash":3,"src":3,"standard":[2,4,23],"static":[3,4,7],"statoil_feasibility_sim_model_with_depletion_kross_inj_sector_20":4,"statoil_feasibility_sim_model_with_depletion_kross_inj_sector_20_prep_pycopm_dryrun":4,"statoil_feasibility_sim_model_with_depletion_kross_inj_sector_20_pycopm":4,"step":[3,6],"still":[4,6],"stop":2,"storag":[0,2,15,22],"str":17,"straight":23,"studi":[2,4,7,9,21,22,23],"sub":[4,7],"subfig":4,"subgrid":18,"submodel":[1,2,4,5,7,9,15,18,19],"submodul":[1,8,10],"subpackag":[1,5,8],"substract":4,"subsurfac":[0,4,23],"subsystem":6,"succe":3,"succeed":2,"success":2,"sudmodel":23,"suffix":2,"suit":6,"sum":[7,23],"sum_":23,"summari":[4,9],"support":[2,5,6,7,19],"suptitl":4,"sure":18,"surfac":23,"sustain":0,"swatinit":[4,7],"system":[3,7],"t":[4,7,23],"t_":23,"tabl":[14,23],"tag":6,"taho":6,"tailor":4,"taken":23,"tcpu":4,"techniqu":[7,23],"templat":[7,14],"template_script":1,"term":3,"termin":[2,4,6,7],"test":[1,2,3,4,6,7],"test_run":2,"text":[4,7,17],"textbook":23,"tg":2,"than":[0,3,23],"thconr":7,"thei":23,"them":[4,7],"theori":[4,5],"thi":[0,2,3,4,6,7,9,23],"thick":23,"those":[2,4],"thousand":4,"three":[4,7,23],"time":[2,4,21,23],"tmltg":2,"tmlto":2,"tog":2,"toml":[2,4,7,16,17,20,21],"tool":[0,4,6,7,9,22,23],"top":[4,18],"total":4,"trade":23,"tran":15,"transform":[1,2,4,5,7,9,15,18],"transform_grid":[10,13,18],"translat":[7,9,23],"transmis":[7,23],"transmiss":[7,23],"transmissibili":7,"transsmiss":23,"trial":4,"trim":23,"true":[4,18],"try":[3,4,6,7],"tune":7,"tunit":4,"turn":6,"tutori":[3,6],"tw":2,"two":[4,7,23],"txt":[3,6],"type":[2,6,22],"typic":23,"ubuntu":[3,6],"uncertainti":23,"uncoarsen":17,"uniform":2,"uniformli":7,"unlimit":2,"unrefin":23,"up":23,"updat":6,"upgrad":6,"uprad":6,"upscal":[7,23],"us":[0,1,2,3,4,6,7,9,15,20,22,23],"user":[2,3,4,6,7],"utf8":7,"util":[1,8,10],"utilii":[14,16,17,20,21],"v":[4,7,23],"v2":6,"v2025":6,"v_c":18,"valu":[2,4,7,15,17,23],"variabl":[3,14,15,17],"vector":4,"venv":6,"version":[6,10],"vertic":23,"via":[2,5,6,7],"vicin":[4,7,18],"view":[4,19],"vile":4,"virtual":6,"visaluaz":4,"visit":[2,3],"visual":[4,9],"volum":[4,7,18,20,23],"vpycopm":6,"vpyocpm":6,"vtk":[4,22],"w":[4,7],"wa":[7,9],"warn":7,"water":[4,7],"we":[2,3,4,6,9,19,23],"webviz":4,"weight":[2,4,7,23],"welcom":[0,3],"well":[2,3,4,7,19,22,23],"welln":7,"wellspec":4,"welseg":19,"were":7,"wgpr":2,"wheel":6,"when":[6,23],"where":[4,7,23],"which":[2,3,4,6,7,23],"while":[4,6,7,23],"whole":7,"wide":23,"window":5,"without":[2,4,9],"wopr":2,"work":[3,6,7],"workflow":23,"world":[3,5],"would":[4,7,9],"write":[2,4,6,7,14,15,19,20],"write_explicit":[10,13,19],"write_grid":[10,13,15],"write_let_t":[10,13,14],"write_prop":[10,13,15],"written":23,"wsl":6,"wwpr":2,"x":[2,4,7,15,23],"xformat":4,"xi_":23,"xlnum":4,"xplicit":7,"xunit":4,"xy":[7,18,23],"xypolygon":[4,7,23],"xyz":[7,23],"y":[2,4,7,23],"yet":6,"yformat":4,"ylabel":4,"yml":[3,6],"you":[2,3,4,6,9],"your":[2,3,4,6,7,9],"yournam":3,"yunit":4,"z":[2,4,7,18,20,23],"z_b":18,"z_b_t":18,"z_t":18,"zcord":18,"zcorn":18,"zero":23},"titles":["About pycopm","pycopm Python API","Configuration file","Contributing","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_files module","pycopm.utils.grid_builder module","pycopm.utils.input_values module","pycopm.utils.mapping_methods module","pycopm.utils.parser_deck module","pycopm.utils.properties_builder module","pycopm.utils.runs_executer module","Related","Theory"],"titleterms":{"":5,"about":0,"abstract":4,"ad":22,"an":9,"api":1,"build":6,"coarsen":23,"concept":7,"configur":[2,4,9],"content":[10,11,13],"contribut":3,"core":[11,12],"deck":[4,9],"document":5,"drogon":4,"exampl":4,"exprecc":22,"file":[2,4,9],"files_writ":14,"flow":[4,6,9],"folder":9,"generate_fil":15,"graphic":4,"grid":23,"grid_build":16,"ground":3,"hello":4,"indic":5,"input":9,"input_valu":17,"instal":6,"introduct":7,"issu":3,"linux":6,"maco":6,"mapping_method":18,"micp":22,"modul":[10,11,12,13,14,15,16,17,18,19,20,21],"norn":4,"opm":[4,6,9],"output":9,"overview":7,"packag":[6,10,11,13],"parser_deck":19,"plopm":22,"pofff":22,"problem":3,"properties_build":20,"pycopm":[0,1,5,8,10,11,12,13,14,15,16,17,18,19,20,21],"pymm":22,"pyopmnearwel":22,"pyopmspe11":22,"python":[1,6],"refin":23,"relat":22,"report":3,"roadmap":7,"rule":3,"runs_execut":21,"seek":3,"smeaheia":4,"softwar":3,"sourc":6,"spe10":4,"submodel":23,"submodul":[11,13],"subpackag":10,"support":3,"tabl":5,"theori":23,"transform":23,"util":[13,14,15,16,17,18,19,20,21],"via":[4,9],"welcom":5,"window":6,"world":4}}) \ No newline at end of file diff --git a/docs/text/about.rst b/docs/text/about.rst index 21c8219..ca75d25 100644 --- a/docs/text/about.rst +++ b/docs/text/about.rst @@ -9,4 +9,4 @@ and by `Expansion of Resources for CO2 Storage on the Horda Platform (ExpReCCS) Contributions are more than welcome using the fork and pull request approach. -For a new feature, please request this raising an issue. \ No newline at end of file +For a new feature, please request this raising an issue. diff --git a/docs/text/api.rst b/docs/text/api.rst index 7c3eab1..9840f1f 100644 --- a/docs/text/api.rst +++ b/docs/text/api.rst @@ -13,4 +13,4 @@ grid refinement, grid coarsening, submodels, and transformations. Files in the pyocpm package. -.. include:: modules.rst \ No newline at end of file +.. include:: modules.rst diff --git a/docs/text/installation.rst b/docs/text/installation.rst index eb0c01e..4d8f5e3 100644 --- a/docs/text/installation.rst +++ b/docs/text/installation.rst @@ -5,7 +5,7 @@ Installation The following steps work installing the dependencies in Ubuntu via apt-get or in macOS using brew or macports. While using package managers such as Anaconda, Miniforge, or Mamba might work, these are not tested. The supported Python versions are 3.11 to 3.13. We will update the documentation when Python3.14 is supported -(e.g., the resdata Python package is not yet available via pip install in Python 3.14). +(e.g., the ert Python package is not yet available via pip install in Python 3.14). .. _vpycopm: diff --git a/docs/text/introduction.rst b/docs/text/introduction.rst index 7098424..39e39de 100644 --- a/docs/text/introduction.rst +++ b/docs/text/introduction.rst @@ -59,6 +59,5 @@ where -e Use 'utf8' or 'ISO-8859-1' encoding to read the deck ('ISO-8859-1' by default). -ijk Given i,j,k indices in the input model, return the modified i,j,k corresponding positions ('' by default; if not empty, e.g., '1,2,3', then there will not be generation of modified files, only the i,j,k mapped indices in the terminal). -d Options to transform the x,y,z coordinates: 'translate [10,-5,4]' adds the values in meters to the coordinates, 'scale [1,2,3]' multiplies the coordinates by the given values respectively, and 'rotatexy 45' applies a rotation in degrees in the xy plane (rotatexz and rotateyz applies a rotation around the y and x axis respectively) ('' by default). --u Use the resdata or opm Python libraries ('opm' by default). -explicit Set to 1 to explicitly write the cell values in the SOLUTION section in the deck ('0' by default). --warnings Set to 1 to show Python warnings ('0' by default). \ No newline at end of file +-warnings Set to 1 to show Python warnings ('0' by default). diff --git a/docs/text/output_folder.rst b/docs/text/output_folder.rst index 0bf1146..1c06710 100644 --- a/docs/text/output_folder.rst +++ b/docs/text/output_folder.rst @@ -35,4 +35,4 @@ favourite history matching/optimization tool (e.g., `ERT `_. \ No newline at end of file +`An open-source image-based framework for CFD in microsystems `_. diff --git a/pyproject.toml b/pyproject.toml index eddc825..7c37bb3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,7 +27,6 @@ dependencies = [ "ert==13.0.4", "h5py<=3.14.0", "mako<=1.3.10", - "resdata<=6.0.1", "opm<=2025.10" ] requires-python = ">=3.11" diff --git a/src/pycopm/core/pycopm.py b/src/pycopm/core/pycopm.py index 44bc1f5..5dd1939 100644 --- a/src/pycopm/core/pycopm.py +++ b/src/pycopm/core/pycopm.py @@ -19,12 +19,6 @@ from pycopm.utils.runs_executer import simulations, plotting from pycopm.utils.generate_files import create_deck -has_opm = False -try: - has_opm = bool(__import__("opm")) -except ImportError: - pass - def pycopm(): """Main function for the pycopm executable""" @@ -44,7 +38,6 @@ def pycopm(): dic["label"] = cmdargs["label"].strip() # Prefix to the generted inc files dic["ijk"] = cmdargs["ijk"].strip() # ijk indices to map to the modified model dic["remove"] = int(cmdargs["remove"].strip()) # Remove CONFACT and KH - dic["resdata"] = (cmdargs["use"].strip()).lower() == "resdata" # Use resdata or opm dic["encoding"] = cmdargs["encoding"].strip() # Use utf8 or ISO-8859-1 dic["pvcorr"] = int(cmdargs["pvcorr"]) # Correct for removed pore volume dic["fipcorr"] = int(cmdargs["fipcorr"]) # Correct for total mass of fluids @@ -97,7 +90,7 @@ def pycopm(): if not os.path.exists(f"{dic['fol']}"): os.system(f"mkdir {dic['fol']}") - # When a deck, only coarser/refined/submodel/transformed files are generated + # When a deck, only coarsened/refined/submodel/transformed files are generated if "DATA" in file: # if "/" in file: dic["deck"] = file.split("/")[-1][:-5] @@ -371,12 +364,6 @@ def load_parser(): "(rotatexz and rotateyz applies a rotation around the y and x axis respectively) " "('' by default).", ) - parser.add_argument( - "-u", - "--use", - default="opm", - help="Use the resdata or opm Python libraries ('opm' by default).", - ) parser.add_argument( "-explicit", "--explicit", @@ -410,12 +397,6 @@ def check_cmdargs(cmdargs): "valid extensions are .DATA or .toml\n" ) sys.exit() - if (cmdargs["use"].strip()).lower() == "opm" and not has_opm: - print( - "\nThe Python package opm cannot be import. Either try to install it " - "following the pycopm documentation, or remove the flag '-u opm'.\n" - ) - sys.exit() if (cmdargs["input"].strip()).endswith(".DATA"): if ( subprocess.call( diff --git a/src/pycopm/template_scripts/common/plot_post.mako b/src/pycopm/template_scripts/common/plot_post.mako index 8f2432d..dacabc3 100644 --- a/src/pycopm/template_scripts/common/plot_post.mako +++ b/src/pycopm/template_scripts/common/plot_post.mako @@ -11,13 +11,12 @@ import os import csv import numpy as np import warnings -from datetime import datetime -from resdata.summary import Summary -from resdata.grid import Grid -from resdata.resfile import ResdataFile +import datetime +from opm.io.ecl import EGrid as OpmGrid +from opm.io.ecl import EclFile as OpmFile +from opm.io.ecl import ESmry as OpmSummary import matplotlib import matplotlib.pyplot as plt -from datetime import timedelta def visualizeData(): """Visualize time series""" @@ -48,7 +47,7 @@ def visualizeData(): N = ${dic['net']} I = ${dic['Ni']} - training=datetime.fromisoformat("${dic['date']}") + training = datetime.datetime.fromisoformat("${dic['date']}") wtab_sgof = [[],[]] wtab_swof = [[],[]] @@ -56,27 +55,27 @@ def visualizeData(): for r in range(N): ok_file = f"{output_folder}/output/simulations/realisation-{r}/iter-{i}/OK" if os.path.exists(ok_file) == 1: - ini = ResdataFile(f'{output_folder}/output/simulations/realisation-{r}/iter-{i}/${dic['name']}_COARSER.INIT') - tabdim = ini.iget_kw("TABDIMS") - iswof = tabdim[0][20] - nswe = tabdim[0][21] - nsatnum = tabdim[0][22] - isgof = tabdim[0][23] - isgofn = tabdim[0][26] + 2*nswe*nsatnum + (nsatnum-1)*(2*nswe) + (2*nswe) + 2 - iswofn = tabdim[0][26] + 2*nswe*nsatnum - table = np.array(ini.iget_kw("TAB")) - tab_sgof = np.array(table[0][isgof-1:isgof+(3*nsatnum)*(nswe-1)+(3*nsatnum-1)]) - tab_swof = np.array(table[0][iswof-1:iswof+(3*nsatnum)*(nswe-1)+(3*nsatnum-1)]) + ini = OpmFile(f'{output_folder}/output/simulations/realisation-{r}/iter-{i}/${dic['name']}_COARSER.INIT') + tabdim = ini["TABDIMS"] + iswof = tabdim[20] + nswe = tabdim[21] + nsatnum = tabdim[22] + isgof = tabdim[23] + isgofn = tabdim[26] + 2*nswe*nsatnum + (nsatnum-1)*(2*nswe) + (2*nswe) + 2 + iswofn = tabdim[26] + 2*nswe*nsatnum + table = np.array(ini["TAB"]) + tab_sgof = np.array(table[isgof-1:isgof+(3*nsatnum)*(nswe-1)+(3*nsatnum-1)]) + tab_swof = np.array(table[iswof-1:iswof+(3*nsatnum)*(nswe-1)+(3*nsatnum-1)]) tab_sgof_kn = [] tab_swof_kn = [] for n in range(nsatnum): - avg_arr = np.mean(np.array(table[0][isgofn-1+2*n*nswe-2:isgofn+2*nswe-3+2*n*nswe]).reshape(-1,2), axis = 1) - avg_arr[0] = table[0][isgofn-1+2*n*nswe-2:isgofn+2*nswe-3+2*n*nswe][0] - avg_arr[-1] = table[0][isgofn-1+2*n*nswe-2:isgofn+2*nswe-3+2*n*nswe][-1] + avg_arr = np.mean(np.array(table[isgofn-1+2*n*nswe-2:isgofn+2*nswe-3+2*n*nswe]).reshape(-1,2), axis = 1) + avg_arr[0] = table[isgofn-1+2*n*nswe-2:isgofn+2*nswe-3+2*n*nswe][0] + avg_arr[-1] = table[isgofn-1+2*n*nswe-2:isgofn+2*nswe-3+2*n*nswe][-1] tab_sgof_kn.append(avg_arr) - avg_arr = np.mean(np.array(table[0][iswofn-1+2*n*nswe:iswofn+2*nswe-1+2*n*nswe]).reshape(-1,2), axis = 1) - avg_arr[0] = table[0][iswofn-1+2*n*nswe:iswofn+2*nswe-1+2*n*nswe][0] - avg_arr[-1] = table[0][iswofn-1+2*n*nswe:iswofn+2*nswe-1+2*n*nswe][-1] + avg_arr = np.mean(np.array(table[iswofn-1+2*n*nswe:iswofn+2*nswe-1+2*n*nswe]).reshape(-1,2), axis = 1) + avg_arr[0] = table[iswofn-1+2*n*nswe:iswofn+2*nswe-1+2*n*nswe][0] + avg_arr[-1] = table[iswofn-1+2*n*nswe:iswofn+2*nswe-1+2*n*nswe][-1] tab_swof_kn.append(avg_arr) wtab_sgof[ind].append(np.append(tab_sgof, np.array(tab_sgof_kn).flatten()).reshape(4,nsatnum,nswe)) wtab_swof[ind].append(np.append(tab_swof, np.array(tab_swof_kn).flatten()).reshape(4,nsatnum,nswe)) @@ -171,16 +170,8 @@ def visualizeData(): error_ens.append([0 for _ in range(N)]) error_hist.append([]) time_ens.append([]) - numCellsDefault = 0 - numCellsHm = 0 - grid = Grid(f"{pycopm_path}/reference_simulation/${dic['field']}/${dic['name']}.EGRID") - for cell in grid.cells(): - if cell.active == 1: - numCellsDefault += 1 - grid = Grid(f"{output_folder}/output/simulations/realisation-0/iter-0/${dic['name']}_COARSER.EGRID") - for cell in grid.cells(): - if cell.active == 1: - numCellsHm += 1 + numCellsDefault = OpmGrid(f"{pycopm_path}/reference_simulation/${dic['field']}/${dic['name']}.EGRID").active_cells + numCellsHm = OpmGrid(f"{output_folder}/output/simulations/realisation-0/iter-0/${dic['name']}_COARSER.EGRID").active_cells smspecName = f"{pycopm_path}/reference_simulation/${dic['field']}/${dic['name']}.SMSPEC" dbg = f"{pycopm_path}/reference_simulation/${dic['field']}/${dic['name']}.DBG" with open(dbg, "r", encoding="utf8") as file: @@ -188,20 +179,29 @@ def visualizeData(): for row in csv.reader(file, delimiter=":"): sol.append(row) time_standard = float(sol[-23][-1]) - smspec = Summary(smspecName) + smspec = OpmSummary(smspecName) j = 0 + nwells = [] + for key in smspec.keys(): + if key[0]=="W" and ":" in key and key.split(":")[-1] not in nwells: + nwells.append(key.split(":")[-1]) for type, ftype, dens in zip(["WWPR","WOPR","WGPR"],["FWPT","FOPT","FGPT"],[999.04100, 852.95669, 0.90358]): - fmass[ftype] = dens*smspec[ftype+"H"].values[-1] - for well in smspec.wells(): - if sum(smspec[type+"H:"+well].values)>0: + fmass[ftype] = dens*smspec[ftype+"H"][-1] + for well in nwells: + if sum(smspec[type+"H:"+well])>0: wells[type].append(type+":"+well) j += 1 linei = [[ ] for _ in range(j)] linef = [[ ] for _ in range(j)] meant = 0 n_e = [0 for _ in range(I)] - for i in range(len(smspec.dates)): - if smspec.dates[i] > training: + smsp_dates = 86400.0 * smspec["TIME"] + smsp_dates = [ + smspec.start_date + datetime.timedelta(seconds=float(seconds)) + for seconds in smsp_dates + ] + for i in range(len(smsp_dates)): + if smsp_dates[i] > training: n_t = i break %if dic['field']=='drogon': @@ -209,12 +209,12 @@ def visualizeData(): %endif for type, ftype, dens in zip(["WWPR","WOPR","WGPR"],["FWPT","FOPT","FGPT"],[999.04100, 852.95669, 0.90358]): - rfcum[ftype].append(dens*abs(smspec[ftype].values[-1]-smspec[ftype+"H"].values[-1])) + rfcum[ftype].append(dens*abs(smspec[ftype][-1]-smspec[ftype+"H"][-1])) rcum[type].append(0) for i in range(len(wells[type])): data = smspec[wells[type][i]] datah = smspec[wells[type][i][:4]+"H"+wells[type][i][4:]] - for d_1, d_2 in zip(data.values[n_t:], datah.values[n_t:]): + for d_1, d_2 in zip(data[n_t:], datah[n_t:]): rcum[type][-1] += dens*abs(d_1-d_2) fig, ax = plt.subplots() @@ -227,7 +227,7 @@ def visualizeData(): axs.append(ax) figs.append(fig) figs[j], axs[j] = plt.subplots() - for d_1, d_2 in zip(data.values[n_t:], datah.values[n_t:]): + for d_1, d_2 in zip(data[n_t:], datah[n_t:]): error_standard += ((d_1-d_2)/max(minerr[type],var[type]*d_2))**2 k += 1 j += 1 @@ -238,22 +238,27 @@ def visualizeData(): if os.path.exists(ok_file) == 1: n_e[0] += 1 smspecName = f"{output_folder}/output/simulations/realisation-{r}/iter-0/${dic['name']}_COARSER.SMSPEC" - smspec = Summary(smspecName) - for i in range(len(smspec.dates)): - if smspec.dates[i] > training: + smspec = OpmSummary(smspecName) + smsp_dates = 86400.0 * smspec["TIME"] + smsp_dates = [ + smspec.start_date + datetime.timedelta(seconds=float(seconds)) + for seconds in smsp_dates + ] + for i in range(len(smsp_dates)): + if smsp_dates[i] > training: n_t = i break j = 0 k = 0 error_hist[0].append(0) for type, ftype, dens in zip(["WWPR","WOPR","WGPR"],["FWPT","FOPT","FGPT"],[999.04100, 852.95669, 0.90358]): - fcum[ftype][0].append(dens*abs(smspec[ftype].values[-1]-smspec[ftype+"H"].values[-1])) + fcum[ftype][0].append(dens*abs(smspec[ftype][-1]-smspec[ftype+"H"][-1])) cum[type][0].append(0) for i in range(len(wells[type])): data = smspec[wells[type][i]] - linei[j], = axs[j].plot(data.dates, data.values, color=[51 / 255.0, 153 / 255.0, 255 / 255.0]) + linei[j], = axs[j].plot(smsp_dates, data, color=[51 / 255.0, 153 / 255.0, 255 / 255.0]) datah = smspec[wells[type][i][:4]+"H"+wells[type][i][4:]] - for d_1, d_2 in zip(data.values[n_t:], datah.values[n_t:]): + for d_1, d_2 in zip(data[n_t:], datah[n_t:]): error_ens[0][r] += ((d_1-d_2)/max(minerr[type],var[type]*d_2))**2 error_hist[0][-1] += ((d_1-d_2)/max(minerr[type],var[type]*d_2))**2 cum[type][0][-1] += dens*abs(d_1-d_2) @@ -287,9 +292,14 @@ def visualizeData(): if os.path.exists(ok_file) == 1: n_e[ite+1] += 1 smspecName = f"{output_folder}/output/simulations/realisation-{r}/iter-{ite+1}/${dic['name']}_COARSER.SMSPEC" - smspec = Summary(smspecName) - for i in range(len(smspec.dates)): - if smspec.dates[i] > training: + smspec = OpmSummary(smspecName) + smsp_dates = 86400.0 * smspec["TIME"] + smsp_dates = [ + smspec.start_date + datetime.timedelta(seconds=float(seconds)) + for seconds in smsp_dates + ] + for i in range(len(smsp_dates)): + if smsp_dates[i] > training: n_t = i break k = 0 @@ -298,7 +308,7 @@ def visualizeData(): for i in range(len(wells[type])): data = smspec[wells[type][i]] datah = smspec[wells[type][i][:4]+"H"+wells[type][i][4:]] - for d_1, d_2 in zip(data.values[n_t:], datah.values[n_t:]): + for d_1, d_2 in zip(data[n_t:], datah[n_t:]): error_ens[ite+1][r] += ((d_1-d_2)/max(minerr[type],var[type]*d_2))**2 error_hist[ite+1][-1] += ((d_1-d_2)/max(minerr[type],var[type]*d_2))**2 k += 1 @@ -318,27 +328,32 @@ def visualizeData(): if os.path.exists(ok_file) == 1: n_e[I-1] += 1 smspecName = f"{output_folder}/output/simulations/realisation-{r}/iter-{I-1}/${dic['name']}_COARSER.SMSPEC" - smspec = Summary(smspecName) - for i in range(len(smspec.dates)): - if smspec.dates[i] > training: + smspec = OpmSummary(smspecName) + smsp_dates = 86400.0 * smspec["TIME"] + smsp_dates = [ + smspec.start_date + datetime.timedelta(seconds=float(seconds)) + for seconds in smsp_dates + ] + for i in range(len(smsp_dates)): + if smsp_dates[i] > training: n_t = i break j = 0 k = 0 error_hist[-1].append(0) for type, ftype, dens in zip(["WWPR","WOPR","WGPR"],["FWPT","FOPT","FGPT"],[999.04100, 852.95669, 0.90358]): - fcum[ftype][-1].append(dens*abs(smspec[ftype].values[-1]-smspec[ftype+"H"].values[-1])) + fcum[ftype][-1].append(dens*abs(smspec[ftype][-1]-smspec[ftype+"H"][-1])) cum[type][-1].append(0) for i in range(len(wells[type])): data = smspec[wells[type][i]] - linef[j], = axs[j].plot(data.dates, data.values, color=[0 / 255.0, 204 / 255.0, 0 / 255.0]) + linef[j], = axs[j].plot(smsp_dates, data, color=[0 / 255.0, 204 / 255.0, 0 / 255.0]) datah = smspec[wells[type][i][:4]+"H"+wells[type][i][4:]] - for d_1, d_2 in zip(data.values[n_t:], datah.values[n_t:]): + for d_1, d_2 in zip(data[n_t:], datah[n_t:]): error_ens[-1][r] += ((d_1-d_2)/max(minerr[type],var[type]*d_2))**2 error_hist[-1][-1] += ((d_1-d_2)/max(minerr[type],var[type]*d_2))**2 cum[type][-1][-1] += dens*abs(d_1-d_2) k += 1 - FO[r].append([data.dates,data.values]) + FO[r].append([smsp_dates,data]) j += 1 error_ens[-1][r] /= (2.*k) error_hist[-1][-1] /= (2.*k) @@ -365,7 +380,7 @@ def visualizeData(): else: for type in ["WOPR","WGPR","WWPR"]: for i in range(len(wells[type])): - FO[r].append([data.dates,0*data.values]) + FO[r].append([smsp_dates,0*data]) error_ens[-1][r] += 1e10 if n_e[I-1] > 0: @@ -380,7 +395,12 @@ def visualizeData(): csvData = [] smspecName = f"{pycopm_path}/reference_simulation/${dic['field']}/${dic['name']}.SMSPEC" - smspec = Summary(smspecName) + smspec = OpmSummary(smspecName) + smsp_dates = 86400.0 * smspec["TIME"] + smsp_dates = [ + smspec.start_date + datetime.timedelta(seconds=float(seconds)) + for seconds in smsp_dates + ] j = 0 for type in ["WWPR","WOPR","WGPR"]: for i in range(len(wells[type])): @@ -396,15 +416,15 @@ def visualizeData(): linef[j].set_label('Single run') data = smspec[wells[type][i]] datah = smspec[wells[type][i][:4]+"H"+wells[type][i][4:]] - axs[j].plot(data.dates, data.values, color='m', label = 'opm-tests') - if sum(datah.values>0): - axs[j].errorbar(datah.dates, datah.values, yerr= [max(minerr[type],var[type]*d_2) for d_2 in datah.values], color=[128 / 255.0, 128 / 255.0, 128 / 255.0], markersize='.5', elinewidth=.5, fmt='o', linestyle='', label = 'Data') + axs[j].plot(smsp_dates, data, color='m', label = 'opm-tests') + if sum(datah>0): + axs[j].errorbar(smsp_dates, datah, yerr= [max(minerr[type],var[type]*d_2) for d_2 in datah], color=[128 / 255.0, 128 / 255.0, 128 / 255.0], markersize='.5', elinewidth=.5, fmt='o', linestyle='', label = 'Data') axs[j].set_ylabel(f'{wells[type][i]} [SM3/day]', fontsize=12) axs[j].set_xlabel('Time [years]', fontsize=12) axs[j].xaxis.set_tick_params(size=6, rotation=45) axs[j].legend() axs[j].set_ylim(bottom=0) - if sum(datah.values>0): + if sum(datah>0): figs[j].savefig(f"{output_folder}/postprocessing/wells/HISTO_DATA_{wells[type][i][:4]}_{wells[type][i][5:]}.png", bbox_inches="tight") else: figs[j].savefig(f"{output_folder}/postprocessing/wells/{wells[type][i][:4]}_{wells[type][i][5:]}.png", bbox_inches="tight") @@ -446,7 +466,7 @@ def visualizeData(): figs, ax = plt.subplots() ax.boxplot([time_ens[i] for i in range(I)], positions=[i for i in range(I)]) ax.axhline(y=time_standard, color="black", ls="--", lw=1, label='opm-tests') - ax.set_title(f"Total time of the HM: {timedelta(seconds=${'{0:.2f}'.format(time)})}") + ax.set_title(f"Total time of the HM: {datetime.timedelta(seconds=${'{0:.2f}'.format(time)})}") ax.set_xlabel("# iteration [-]") ax.set_xticks(range(I)) ax.set_ylabel("Simulation time [s]") @@ -553,8 +573,8 @@ def visualizeData(): with open(f"{output_folder}/postprocessing/errors.txt", 'w') as f: f.write(f'Closest final realization to all obs:{eobs[-1][0][0]}\n') f.write(f'Number of parameters to HM: {len(csvData)}\n') - f.write(f'Mean simulation time of a single ensemble : {timedelta(seconds=meant)}\n') - f.write(f'Total execution time : {timedelta(seconds=${'{0:.2f}'.format(time)})}\n') + f.write(f'Mean simulation time of a single ensemble : {datetime.timedelta(seconds=meant)}\n') + f.write(f'Total execution time : {datetime.timedelta(seconds=${'{0:.2f}'.format(time)})}\n') f.write(f'Missmatch (standard simulation from opm-test deck): {error_standard : .4e}\n') for i in range(I): f.write(f'Iteration {i}; Number of ensembles {int(n_e[i])}\n') @@ -562,8 +582,8 @@ def visualizeData(): f.write(f'Missmatch (closest realization to all obs): {error_ens[i][eobs[i][0][0]]: .4e}\n') print(f'\nClosest final realization to all obs:{eobs[-1][0][0]}') print(f'Number of parameters to HM: {len(csvData)}') - print(f'Mean simulation time of a single ensemble: {timedelta(seconds=meant)}') - print(f'Total execution time: {timedelta(seconds=${'{0:.2f}'.format(time)})}') + print(f'Mean simulation time of a single ensemble: {datetime.timedelta(seconds=meant)}') + print(f'Total execution time: {datetime.timedelta(seconds=${'{0:.2f}'.format(time)})}') print(f'Missmatch (standard simulation from opm-test deck): {error_standard : .4e}') for i in range(I): print(f'Iteration {i}; Number of ensembles {int(n_e[i])}') diff --git a/src/pycopm/utils/generate_files.py b/src/pycopm/utils/generate_files.py index 56e04fe..63d893b 100644 --- a/src/pycopm/utils/generate_files.py +++ b/src/pycopm/utils/generate_files.py @@ -14,8 +14,6 @@ from alive_progress import alive_bar from opm.io.ecl import EclFile as OpmFile from opm.io.ecl import EGrid as OpmGrid -from resdata.grid import Grid -from resdata.resfile import ResdataFile from pycopm.utils.parser_deck import process_the_deck from pycopm.utils.mapping_methods import ( add_pv_bc, @@ -206,28 +204,14 @@ def create_deck(dic): for name in names: bar_animation() dic[name] = np.zeros(dic["tc"]) - if dic["resdata"]: - if name == "porv": - dic[name] = np.divide( - np.array(dic["ini"].iget_kw(name.upper())[0]), dic["nc"] - ) - elif name in dic["rptrst"]: - dic[name][dic["actind"]] = dic["rst"].iget_kw(name.upper())[ - 0 - ] - else: - dic[name][dic["actind"]] = dic["ini"].iget_kw(name.upper())[ - 0 - ] + if name == "porv": + dic[name] = np.divide( + np.array(dic["ini"][name.upper()]), dic["nc"] + ) + elif name in dic["rptrst"]: + dic[name][dic["actind"]] = dic["rst"][name.upper(), 0] else: - if name == "porv": - dic[name] = np.divide( - np.array(dic["ini"][name.upper()]), dic["nc"] - ) - elif name in dic["rptrst"]: - dic[name][dic["actind"]] = dic["rst"][name.upper(), 0] - else: - dic[name][dic["actind"]] = dic["ini"][name.upper()] + dic[name][dic["actind"]] = dic["ini"][name.upper()] dic[f"{name}_c"] = [""] * (dic["nx"] * dic["ny"] * dic["nz"]) n = 0 for k in range(dic["zn"]): @@ -251,81 +235,42 @@ def create_deck(dic): elif dic["vicinity"]: map_vicinity(dic) else: - if not dic["resdata"]: - zti = [0, 1, 2, 3] - zbi = [4, 5, 6, 7] - actnum = 1 * (dic["porv"] > 0) - v_c = np.array(dic["grid"].cellvolumes()) - for name in dic["props"] + dic["regions"] + dic["grids"]: - dic[name][dic["actind"]] = dic["ini"][name.upper()] - for name in dic["rptrst"]: - dic[name][dic["actind"]] = dic["rst"][name.upper(), 0] - with alive_bar(dic["tc"]) as bar_animation: - for k in range(dic["zn"]): - for j in range(dic["yn"]): - for i in range(dic["xn"]): - bar_animation() - ind = i + j * dic["xn"] + k * dic["xn"] * dic["yn"] - cxyz = dic["grid"].xyz_from_ijk(i, j, k) - x_0, y_0, z_0 = 0.0, 0.0, 0.0 - x_1, y_1 = 0.0, 0.0 - for m, o, p in zip( - range(4), [0, 0, 1, 1], [0, 1, 0, 1] - ): - x_0 += ( - abs(cxyz[0][1 + 2 * m] - cxyz[0][2 * m]) / 4.0 - ) - x_1 += ( - abs(cxyz[1][1 + 2 * m] - cxyz[1][2 * m]) / 4.0 - ) - y_0 += ( - abs(cxyz[0][p + o * 4 + 2] - cxyz[0][p + o * 4]) - / 4.0 - ) - y_1 += ( - abs(cxyz[1][p + o * 4 + 2] - cxyz[1][p + o * 4]) - / 4.0 - ) - z_0 += abs(cxyz[2][m + 4] - cxyz[2][m]) / 4.0 - dic["d_x"][ind] = (x_0**2 + x_1**2) ** 0.5 - dic["d_y"][ind] = (y_0**2 + y_1**2) ** 0.5 - dic["d_z"][ind] = z_0 - z_t[ind] = min(cxyz[2][i] for i in zti) - z_b[ind] = max(cxyz[2][i] for i in zti) - tmp = max(cxyz[2][i] for i in zbi) - z_b_t[ind] = tmp - z_t[ind] - else: - zti = [2, 5, 8, 11] - zbi = [14, 17, 20, 23] - cxyz = dic["grid"].export_corners(dic["grid"].export_index()) - for name in dic["props"] + dic["regions"] + dic["grids"]: - dic[name][dic["actind"]] = dic["ini"].iget_kw(name.upper())[0] - for name in dic["rptrst"]: - dic[name][dic["actind"]] = dic["rst"].iget_kw(name.upper())[0] - with alive_bar(dic["tc"]) as bar_animation: - for cell in dic["grid"].cells(): - bar_animation() - dic["d_x"][cell.global_index] = dic["grid"].get_cell_dims( - ijk=(cell.i, cell.j, cell.k) - )[0] - dic["d_y"][cell.global_index] = dic["grid"].get_cell_dims( - ijk=(cell.i, cell.j, cell.k) - )[1] - actnum[cell.global_index] = cell.active - 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] - dic["d_z"][cell.global_index] = dic["grid"].cell_dz( - ijk=(cell.i, cell.j, cell.k) - ) - v_c[cell.global_index] = dic["grid"].cell_volume( - ijk=(cell.i, cell.j, cell.k) - ) + zti = [0, 1, 2, 3] + zbi = [4, 5, 6, 7] + actnum = 1 * (dic["porv"] > 0) + v_c = np.array(dic["grid"].cellvolumes()) + for name in dic["props"] + dic["regions"] + dic["grids"]: + dic[name][dic["actind"]] = dic["ini"][name.upper()] + for name in dic["rptrst"]: + dic[name][dic["actind"]] = dic["rst"][name.upper(), 0] + with alive_bar(dic["tc"]) as bar_animation: + for k in range(dic["zn"]): + for j in range(dic["yn"]): + for i in range(dic["xn"]): + bar_animation() + ind = i + j * dic["xn"] + k * dic["xn"] * dic["yn"] + cxyz = dic["grid"].xyz_from_ijk(i, j, k) + x_0, y_0, z_0 = 0.0, 0.0, 0.0 + x_1, y_1 = 0.0, 0.0 + for m, o, p in zip(range(4), [0, 0, 1, 1], [0, 1, 0, 1]): + x_0 += abs(cxyz[0][1 + 2 * m] - cxyz[0][2 * m]) / 4.0 + x_1 += abs(cxyz[1][1 + 2 * m] - cxyz[1][2 * m]) / 4.0 + y_0 += ( + abs(cxyz[0][p + o * 4 + 2] - cxyz[0][p + o * 4]) + / 4.0 + ) + y_1 += ( + abs(cxyz[1][p + o * 4 + 2] - cxyz[1][p + o * 4]) + / 4.0 + ) + z_0 += abs(cxyz[2][m + 4] - cxyz[2][m]) / 4.0 + dic["d_x"][ind] = (x_0**2 + x_1**2) ** 0.5 + dic["d_y"][ind] = (y_0**2 + y_1**2) ** 0.5 + dic["d_z"][ind] = z_0 + z_t[ind] = min(cxyz[2][i] for i in zti) + z_b[ind] = max(cxyz[2][i] for i in zti) + tmp = max(cxyz[2][i] for i in zbi) + z_b_t[ind] = tmp - z_t[ind] dic["d_ax"][dic["actind"]] = dic["d_x"][dic["actind"]] dic["d_ay"][dic["actind"]] = dic["d_y"][dic["actind"]] dic["d_az"][dic["actind"]] = dic["d_z"][dic["actind"]] @@ -405,24 +350,14 @@ def create_deck(dic): os.system( f"{dic['flow']} {dic['fol']}/{dic['write']}_1STEP.DATA {dic['flags1']}" ) - if dic["resdata"]: - ref = ResdataFile(f"{dic['fol']}/{dic['write']}_1STEP.UNRST") - cor = ResdataFile(f"{dic['fol']}/{dic['write']}_CORR.UNRST") - cori = ResdataFile(f"{dic['fol']}/{dic['write']}_CORR.INIT") - ref_fipg = np.array(ref.iget_kw("FIPGAS")[0]) - ref_fipo = np.array(ref.iget_kw("FIPOIL")[0]) - cor_pv = np.array(cori.iget_kw("PORV")[0]) - cor_fipg = np.array(cor.iget_kw("FIPGAS")[0]) - cor_fipo = np.array(cor.iget_kw("FIPOIL")[0]) - else: - ref = OpmFile(f"{dic['fol']}/{dic['write']}_1STEP.UNRST") - cor = OpmFile(f"{dic['fol']}/{dic['write']}_CORR.UNRST") - cori = OpmFile(f"{dic['fol']}/{dic['write']}_CORR.INIT") - ref_fipg = np.array(ref["FIPGAS", 0]) - ref_fipo = np.array(ref["FIPOIL", 0]) - cor_pv = np.array(cori["PORV"]) - cor_fipg = np.array(cor["FIPGAS", 0]) - cor_fipo = np.array(cor["FIPOIL", 0]) + ref = OpmFile(f"{dic['fol']}/{dic['write']}_1STEP.UNRST") + cor = OpmFile(f"{dic['fol']}/{dic['write']}_CORR.UNRST") + cori = OpmFile(f"{dic['fol']}/{dic['write']}_CORR.INIT") + ref_fipg = np.array(ref["FIPGAS", 0]) + ref_fipo = np.array(ref["FIPOIL", 0]) + cor_pv = np.array(cori["PORV"]) + cor_fipg = np.array(cor["FIPGAS", 0]) + cor_fipo = np.array(cor["FIPOIL", 0]) cor_pa = cor_pv[cor_pv > 0] fact = sum(ref_fipo) / sum(cor_fipo) - 1 cor_pa[cor_fipo <= thr] -= ( @@ -443,20 +378,12 @@ def create_deck(dic): os.system( f"{dic['flow']} {dic['fol']}/{dic['write']}_CORR.DATA {dic['flags1']}" ) - if dic["resdata"]: - cor = ResdataFile(f"{dic['fol']}/{dic['write']}_CORR.UNRST") - cori = ResdataFile(f"{dic['fol']}/{dic['write']}_CORR.INIT") - cor_pv = np.array(cori.iget_kw("PORV")[0]) - cor_fipg = np.array(cor.iget_kw("FIPGAS")[0]) - cor_fipo = np.array(cor.iget_kw("FIPOIL")[0]) - cor_sgas = np.array(cor.iget_kw("SGAS")[0]) - else: - cor = OpmFile(f"{dic['fol']}/{dic['write']}_CORR.UNRST") - cori = OpmFile(f"{dic['fol']}/{dic['write']}_CORR.INIT") - cor_pv = np.array(cori["PORV"]) - cor_fipg = np.array(cor["FIPGAS", 0]) - cor_fipo = np.array(cor["FIPOIL", 0]) - cor_sgas = np.array(cor["SGAS", 0]) + cor = OpmFile(f"{dic['fol']}/{dic['write']}_CORR.UNRST") + cori = OpmFile(f"{dic['fol']}/{dic['write']}_CORR.INIT") + cor_pv = np.array(cori["PORV"]) + cor_fipg = np.array(cor["FIPGAS", 0]) + cor_fipo = np.array(cor["FIPOIL", 0]) + cor_sgas = np.array(cor["SGAS", 0]) cor_pa = cor_pv[cor_pv > 0] fact = (sum(ref_fipg) - sum(cor_fipg)) / sum(cor_fipg[cor_sgas > thr]) cor_pa[cor_fipo <= thr] -= ( @@ -486,18 +413,11 @@ def create_deck(dic): print("\nThis is needed for the nnctrans, please wait.\n") os.chdir(dic["fol"]) os.system(f"{dic['flow']} {dic['fol']}/{dic['write']}.DATA {dic['flags']}") - if dic["resdata"]: - temp = ResdataFile(dic["write"] + ".EGRID") - if temp.has_kw("NNC1") and dic["trans"] > 0: - handle_nnc_trans(dic) - else: - print("\nNo nnctrans found.") + dic["ogrid"] = OpmFile(dic["write"] + ".EGRID") + if dic["ogrid"].count("NNC1") and dic["trans"] > 0: + handle_nnc_trans(dic) else: - dic["ogrid"] = OpmFile(dic["write"] + ".EGRID") - if dic["ogrid"].count("NNC1") and dic["trans"] > 0: - handle_nnc_trans(dic) - else: - print("\nNo nnctrans found.") + print("\nNo nnctrans found.") print( f"\nThe generation of files succeeded, see {dic['fol']}/" f"{dic['write']}.DATA and {dic['fol']}/{dic['label']}*.INC\n" @@ -528,7 +448,7 @@ def create_deck(dic): def initialize_variables(dic): """ - Use resdata or opm to read the dry run + Use opm to read the dry run Args: dic (dict): Global dictionary @@ -539,146 +459,72 @@ def initialize_variables(dic): """ speciales = ["swatinit", "sowcr", "sogcr", "swcr", "sgu", "swl"] speciales += ["krwr", "krw", "krorw", "krorg", "kro", "krgr", "krg"] - if dic["resdata"]: - temp = ResdataFile(dic["deck"] + ".EGRID") - if temp.has_kw("NNC1") and dic["trans"] > 0: - dic["hasnnc"] = True - dic["grid"] = Grid(dic["deck"] + ".EGRID") - dic["ini"] = ResdataFile(dic["deck"] + ".INIT") - for name in speciales: - if dic["ini"].has_kw(name.upper()): + dic["ogrid"] = OpmFile(dic["deck"] + ".EGRID") + if dic["ogrid"].count("NNC1") and dic["trans"] > 0: + dic["hasnnc"] = True + dic["grid"] = OpmGrid(dic["deck"] + ".EGRID") + dic["ini"] = OpmFile(dic["deck"] + ".INIT") + for name in speciales: + if dic["ini"].count(name.upper()): + dic["props"] += [name] + dic["special"] += [name] + for name in ["multx", "multx-", "multy", "multy-", "multz", "multz-"]: + if dic["ini"].count(name.upper()): + tmp = np.array(dic["ini"][name.upper()]) + if 0 < sum(tmp != 1): dic["props"] += [name] - dic["special"] += [name] - for name in ["multx", "multx-", "multy", "multy-", "multz", "multz-"]: - if dic["ini"].has_kw(name.upper()): - tmp = np.array(dic["ini"].iget_kw(name.upper())[0]) - if 0 < sum(tmp != 1): - dic["props"] += [name] - dic["mults"] += [name] - for name in ["multnum", "fluxnum"]: - if dic["ini"].has_kw(name.upper()): - if max(dic["ini"].iget_kw(name.upper())[0]) > 1: - dic["grids"] += [name] - for name in ["thconr", "disperc"]: - if dic["ini"].has_kw(name.upper()): + dic["mults"] += [name] + for name in ["multnum", "fluxnum"]: + if dic["ini"].count(name.upper()): + if max(dic["ini"][name.upper()]) > 1: dic["grids"] += [name] + for name in ["thconr", "disperc"]: + if dic["ini"].count(name.upper()): + dic["grids"] += [name] + for name in [ + "endnum", + "eqlnum", + "fipnum", + "imbnum", + "miscnum", + "opernum", + "pvtnum", + "rocknum", + "satnum", + ]: + if dic["ini"].count(name.upper()): + if max(dic["ini"][name.upper()]) > 1 or min(dic["ini"][name.upper()]) < 1: + dic["regions"] += [name] + dic["xn"] = dic["grid"].dimension[0] + dic["yn"] = dic["grid"].dimension[1] + dic["zn"] = dic["grid"].dimension[2] + dic["porv"] = np.array(dic["ini"]["PORV"]) + if dic["explicit"]: + dic["solution"] = [] + dic["rst"] = OpmFile(dic["deck"] + ".UNRST") for name in [ - "endnum", - "eqlnum", - "fipnum", - "imbnum", - "miscnum", - "opernum", - "pvtnum", - "rocknum", - "satnum", + "sgas", + "soil", + "swat", + "rs", + "rv", + "rsw", + "rvw", + "pressure", + "sbiof", + "scalc", + "smicr", + "soxyg", + "surea", + "ssol", + "spoly", + "surf", + "spoly", + "saltp", + "salt", ]: - if dic["ini"].has_kw(name.upper()): - if ( - max(dic["ini"].iget_kw(name.upper())[0]) > 1 - or min(dic["ini"].iget_kw(name.upper())[0]) < 1 - ): - dic["regions"] += [name] - dic["xn"] = dic["grid"].nx - dic["yn"] = dic["grid"].ny - dic["zn"] = dic["grid"].nz - dic["porv"] = np.array(dic["ini"].iget_kw("PORV")[0]) - if dic["explicit"]: - dic["solution"] = [] - dic["rst"] = ResdataFile(dic["deck"] + ".UNRST") - for name in [ - "sgas", - "soil", - "swat", - "rs", - "rv", - "rsw", - "rvw", - "pressure", - "sbiof", - "scalc", - "smicr", - "soxyg", - "surea", - "ssol", - "spoly", - "surf", - "spoly", - "saltp", - "salt", - ]: - if dic["rst"].has_kw(name.upper()): - dic["rptrst"] += [name] - else: - dic["ogrid"] = OpmFile(dic["deck"] + ".EGRID") - if dic["ogrid"].count("NNC1") and dic["trans"] > 0: - dic["hasnnc"] = True - dic["grid"] = OpmGrid(dic["deck"] + ".EGRID") - dic["ini"] = OpmFile(dic["deck"] + ".INIT") - for name in speciales: - if dic["ini"].count(name.upper()): - dic["props"] += [name] - dic["special"] += [name] - for name in ["multx", "multx-", "multy", "multy-", "multz", "multz-"]: - if dic["ini"].count(name.upper()): - tmp = np.array(dic["ini"][name.upper()]) - if 0 < sum(tmp != 1): - dic["props"] += [name] - dic["mults"] += [name] - for name in ["multnum", "fluxnum"]: - if dic["ini"].count(name.upper()): - if max(dic["ini"][name.upper()]) > 1: - dic["grids"] += [name] - for name in ["thconr", "disperc"]: - if dic["ini"].count(name.upper()): - dic["grids"] += [name] - for name in [ - "endnum", - "eqlnum", - "fipnum", - "imbnum", - "miscnum", - "opernum", - "pvtnum", - "rocknum", - "satnum", - ]: - if dic["ini"].count(name.upper()): - if ( - max(dic["ini"][name.upper()]) > 1 - or min(dic["ini"][name.upper()]) < 1 - ): - dic["regions"] += [name] - dic["xn"] = dic["grid"].dimension[0] - dic["yn"] = dic["grid"].dimension[1] - dic["zn"] = dic["grid"].dimension[2] - dic["porv"] = np.array(dic["ini"]["PORV"]) - if dic["explicit"]: - dic["solution"] = [] - dic["rst"] = OpmFile(dic["deck"] + ".UNRST") - for name in [ - "sgas", - "soil", - "swat", - "rs", - "rv", - "rsw", - "rvw", - "pressure", - "sbiof", - "scalc", - "smicr", - "soxyg", - "surea", - "ssol", - "spoly", - "surf", - "spoly", - "saltp", - "salt", - ]: - if dic["rst"].count(name.upper()): - dic["rptrst"] += [name] + if dic["rst"].count(name.upper()): + dic["rptrst"] += [name] def handle_nnc_trans(dic): @@ -714,58 +560,32 @@ def handle_nnc_trans(dic): ) as file: for row in nncdeck: file.write(row + "\n") - if dic["resdata"]: - temp = ResdataFile(dic["deck"] + ".EGRID") - coa = ResdataFile(dic["write"] + ".INIT") - coag = ResdataFile(dic["write"] + ".EGRID") - rnnc1 = np.array(temp.iget_kw("NNC1")[0]) - rnnc2 = np.array(temp.iget_kw("NNC2")[0]) - rnnct = np.array(dic["ini"].iget_kw("TRANNNC")[0]) - cnnc1 = np.array(coag.iget_kw("NNC1")[0]) - cnnc2 = np.array(coag.iget_kw("NNC2")[0]) - cnnct = np.array(coa.iget_kw("TRANNNC")[0]) - coag = Grid(dic["write"] + ".EGRID") - refpv = np.array(dic["ini"].iget_kw("PORV")[0]) - coapv = np.array(coa.iget_kw("PORV")[0]) - coa_dz = np.zeros(len(coapv)) - ref_dz = np.zeros(len(refpv)) - dic["coa_tranx"] = np.zeros(len(coapv)) - dic["coa_trany"] = np.zeros(len(coapv)) - dic["coa_tranx"][coapv > 0] = np.array(coa.iget_kw("TRANX")[0]) - dic["coa_trany"][coapv > 0] = np.array(coa.iget_kw("TRANY")[0]) - coa_dz[coapv > 0] = np.array(coa.iget_kw("DZ")[0]) - ref_dz[refpv > 0] = np.array(dic["ini"].iget_kw("DZ")[0]) - else: - temp = OpmFile(dic["deck"] + ".EGRID") - coa = OpmFile(dic["write"] + ".INIT") - coag = OpmFile(dic["write"] + ".EGRID") - rnnc1 = np.array(temp["NNC1"]) - rnnc2 = np.array(temp["NNC2"]) - rnnct = np.array(dic["ini"]["TRANNNC"]) - cnnc1 = np.array(coag["NNC1"]) - cnnc2 = np.array(coag["NNC2"]) - cnnct = np.array(coa["TRANNNC"]) - coag = OpmGrid(dic["write"] + ".EGRID") - refpv = np.array(dic["ini"]["PORV"]) - coapv = np.array(coa["PORV"]) - coa_dz = np.zeros(len(coapv)) - ref_dz = np.zeros(len(refpv)) - dic["coa_tranx"] = np.zeros(len(coapv)) - dic["coa_trany"] = np.zeros(len(coapv)) - dic["coa_tranx"][coapv > 0] = np.array(coa["TRANX"]) - dic["coa_trany"][coapv > 0] = np.array(coa["TRANY"]) - coa_dz[coapv > 0] = np.array(coa["DZ"]) - ref_dz[refpv > 0] = np.array(dic["ini"]["DZ"]) + temp = OpmFile(dic["deck"] + ".EGRID") + coa = OpmFile(dic["write"] + ".INIT") + coag = OpmFile(dic["write"] + ".EGRID") + rnnc1 = np.array(temp["NNC1"]) + rnnc2 = np.array(temp["NNC2"]) + rnnct = np.array(dic["ini"]["TRANNNC"]) + cnnc1 = np.array(coag["NNC1"]) + cnnc2 = np.array(coag["NNC2"]) + cnnct = np.array(coa["TRANNNC"]) + coag = OpmGrid(dic["write"] + ".EGRID") + refpv = np.array(dic["ini"]["PORV"]) + coapv = np.array(coa["PORV"]) + coa_dz = np.zeros(len(coapv)) + ref_dz = np.zeros(len(refpv)) + dic["coa_tranx"] = np.zeros(len(coapv)) + dic["coa_trany"] = np.zeros(len(coapv)) + dic["coa_tranx"][coapv > 0] = np.array(coa["TRANX"]) + dic["coa_trany"][coapv > 0] = np.array(coa["TRANY"]) + coa_dz[coapv > 0] = np.array(coa["DZ"]) + ref_dz[refpv > 0] = np.array(dic["ini"]["DZ"]) dic["coa_editnnc"] = [] dic["nnct"] = [[[] for _ in range(dic["yn"])] for _ in range(dic["xn"])] indel = [] for r1, r2, trn in zip(rnnc1, rnnc2, rnnct): - if dic["resdata"]: - rijk1 = dic["grid"].get_ijk(global_index=r1 - 1) - rijk2 = dic["grid"].get_ijk(global_index=r2 - 1) - else: - rijk1 = dic["grid"].ijk_from_global_index(r1 - 1) - rijk2 = dic["grid"].ijk_from_global_index(r2 - 1) + rijk1 = dic["grid"].ijk_from_global_index(r1 - 1) + rijk2 = dic["grid"].ijk_from_global_index(r2 - 1) if dic["kc"][rijk1[2] + 1] == dic["kc"][rijk2[2] + 1] and ( rijk1[0] != rijk2[0] or rijk1[1] != rijk2[1] ): @@ -807,12 +627,8 @@ def handle_nnc_trans(dic): with alive_bar(len(cnnc1)) as bar_animation: for n, (n1, n2) in enumerate(zip(cnnc1, cnnc2)): bar_animation() - if dic["resdata"]: - ijk1 = coag.get_ijk(global_index=n1 - 1) - ijk2 = coag.get_ijk(global_index=n2 - 1) - else: - ijk1 = coag.ijk_from_global_index(n1 - 1) - ijk2 = coag.ijk_from_global_index(n2 - 1) + ijk1 = coag.ijk_from_global_index(n1 - 1) + ijk2 = coag.ijk_from_global_index(n2 - 1) fip1, fip2 = ijk1[2] + 1, ijk2[2] + 1 rtran, found, indel = 0, 0, [] if fip1 != fip2 and (ijk1[0] != ijk2[0] or ijk1[1] != ijk2[1]): diff --git a/src/pycopm/utils/grid_builder.py b/src/pycopm/utils/grid_builder.py index 33f3daf..604b86f 100644 --- a/src/pycopm/utils/grid_builder.py +++ b/src/pycopm/utils/grid_builder.py @@ -18,28 +18,28 @@ def coarser_grid(dic): """ num, num_c = 0, 1 - for k in range(dic["grid"].nz): - for j in range(dic["grid"].ny): - for i in range(dic["grid"].nx): + for k in range(dic["nd"][2]): + for j in range(dic["nd"][1]): + for i in range(dic["nd"][0]): if dic["con"][num] == 0: dic["con"][num] = num_c num_c += 1 if (dic["X"][i + 1]) > 1: dic["con"][num + 1] = dic["con"][num] if (dic["Y"][j + 1]) > 1: - dic["con"][num + dic["grid"].nx] = dic["con"][num] + dic["con"][num + dic["nd"][0]] = dic["con"][num] if (dic["Z"][k + 1]) > 1: - dic["con"][num + dic["grid"].nx * dic["grid"].ny] = dic["con"][num] + dic["con"][num + dic["nd"][0] * dic["nd"][1]] = dic["con"][num] num += 1 - dic["nx"] = dic["grid"].nx - int(sum(dic["X"] == 2)) - dic["ny"] = dic["grid"].ny - int(sum(dic["Y"] == 2)) - dic["nz"] = dic["grid"].nz - int(sum(dic["Z"] == 2)) + dic["nx"] = dic["nd"][0] - int(sum(dic["X"] == 2)) + dic["ny"] = dic["nd"][1] - int(sum(dic["Y"] == 2)) + dic["nz"] = dic["nd"][2] - int(sum(dic["Z"] == 2)) dic["num_cells"] = dic["nx"] * dic["ny"] * dic["nz"] name = ["i_f_c", "j_f_c", "k_f_c"] axis = ["X", "Y", "Z"] - grid = [dic["grid"].nx, dic["grid"].ny, dic["grid"].nz] + grid = [dic["nd"][0], dic["nd"][1], dic["nd"][2]] for name, axis, grid in zip(name, axis, grid): num = 1 num_c = 1 @@ -73,45 +73,41 @@ def handle_face_dir_ip(dic, cell_index, i, j, k): while dic["i_f_c"][i1 + 1] == dic["i_f_c"][i2 + 1]: index1 = [ cell_index, - cell_index + 2 * dic["grid"].nx, - cell_index + 4 * dic["grid"].nx * dic["grid"].ny, - cell_index + 2 * dic["grid"].nx + 4 * dic["grid"].nx * dic["grid"].ny, + cell_index + 2 * dic["nd"][0], + cell_index + 4 * dic["nd"][0] * dic["nd"][1], + cell_index + 2 * dic["nd"][0] + 4 * dic["nd"][0] * dic["nd"][1], ] index2 = [ index1[0] + 3, index1[1] + 3, - index1[0] + 3 + 4 * dic["grid"].nx * dic["grid"].ny, - index1[1] + 3 + 4 * dic["grid"].nx * dic["grid"].ny, + index1[0] + 3 + 4 * dic["nd"][0] * dic["nd"][1], + index1[1] + 3 + 4 * dic["nd"][0] * dic["nd"][1], ] for iter1, iter2 in zip(index1, index2): dic["zc"][iter1] = dic["zc"][iter2] - if j + 1 < dic["grid"].ny and (dic["j_f_c"][j + 1] == dic["j_f_c"][j + 2]): + if j + 1 < dic["nd"][1] and (dic["j_f_c"][j + 1] == dic["j_f_c"][j + 2]): cell_index2 = ( - 2 * i - + 4 * (j + 1) * dic["grid"].nx - + 8 * k * dic["grid"].nx * dic["grid"].ny + 2 * i + 4 * (j + 1) * dic["nd"][0] + 8 * k * dic["nd"][0] * dic["nd"][1] ) index1 = [ cell_index2, - cell_index2 + 2 * dic["grid"].nx, - cell_index2 + 4 * dic["grid"].nx * dic["grid"].ny, - cell_index2 + 2 * dic["grid"].nx + 4 * dic["grid"].nx * dic["grid"].ny, + cell_index2 + 2 * dic["nd"][0], + cell_index2 + 4 * dic["nd"][0] * dic["nd"][1], + cell_index2 + 2 * dic["nd"][0] + 4 * dic["nd"][0] * dic["nd"][1], ] for iter1, iter2 in zip(index1, index2): dic["zc"][iter1] = dic["zc"][iter2] if j > 0 and (dic["j_f_c"][j + 1] == dic["j_f_c"][j]): cell_index2 = ( - 2 * i - + 4 * (j - 1) * dic["grid"].nx - + 8 * k * dic["grid"].nx * dic["grid"].ny + 2 * i + 4 * (j - 1) * dic["nd"][0] + 8 * k * dic["nd"][0] * dic["nd"][1] ) index1 = [ cell_index2, - cell_index2 + 2 * dic["grid"].nx, - cell_index2 + 4 * dic["grid"].nx * dic["grid"].ny, - cell_index2 + 2 * dic["grid"].nx + 4 * dic["grid"].nx * dic["grid"].ny, + cell_index2 + 2 * dic["nd"][0], + cell_index2 + 4 * dic["nd"][0] * dic["nd"][1], + cell_index2 + 2 * dic["nd"][0] + 4 * dic["nd"][0] * dic["nd"][1], ] for iter1, iter2 in zip(index1, index2): dic["zc"][iter1] = dic["zc"][iter2] @@ -138,31 +134,31 @@ def handle_face_dir_im(dic, cell_index, i, j, k): while dic["i_f_c"][i1 + 1] == dic["i_f_c"][i2 + 1]: index1 = [ cell_index + 1, - cell_index + 1 + 2 * dic["grid"].nx, - cell_index + 1 + 4 * dic["grid"].nx * dic["grid"].ny, - cell_index + 1 + 2 * dic["grid"].nx + 4 * dic["grid"].nx * dic["grid"].ny, + cell_index + 1 + 2 * dic["nd"][0], + cell_index + 1 + 4 * dic["nd"][0] * dic["nd"][1], + cell_index + 1 + 2 * dic["nd"][0] + 4 * dic["nd"][0] * dic["nd"][1], ] index2 = [ index1[0] - 3, index1[1] - 3, - index1[0] - 3 + 4 * dic["grid"].nx * dic["grid"].ny, - index1[1] - 3 + 4 * dic["grid"].nx * dic["grid"].ny, + index1[0] - 3 + 4 * dic["nd"][0] * dic["nd"][1], + index1[1] - 3 + 4 * dic["nd"][0] * dic["nd"][1], ] for iter1, iter2 in zip(index1, index2): dic["zc"][iter1] = dic["zc"][iter2] - if j + 1 < dic["grid"].ny and (dic["j_f_c"][j + 1] == dic["j_f_c"][j + 2]): + if j + 1 < dic["nd"][1] and (dic["j_f_c"][j + 1] == dic["j_f_c"][j + 2]): cell_index2 = ( 2 * i - + 4 * (j + 1) * dic["grid"].nx - + 8 * k * dic["grid"].nx * dic["grid"].ny + + 4 * (j + 1) * dic["nd"][0] + + 8 * k * dic["nd"][0] * dic["nd"][1] + 1 ) index1 = [ cell_index2, - cell_index2 + 2 * dic["grid"].nx, - cell_index2 + 4 * dic["grid"].nx * dic["grid"].ny, - cell_index2 + 2 * dic["grid"].nx + 4 * dic["grid"].nx * dic["grid"].ny, + cell_index2 + 2 * dic["nd"][0], + cell_index2 + 4 * dic["nd"][0] * dic["nd"][1], + cell_index2 + 2 * dic["nd"][0] + 4 * dic["nd"][0] * dic["nd"][1], ] for iter1, iter2 in zip(index1, index2): dic["zc"][iter1] = dic["zc"][iter2] @@ -170,15 +166,15 @@ def handle_face_dir_im(dic, cell_index, i, j, k): if j > 0 and (dic["j_f_c"][j + 1] == dic["j_f_c"][j]): cell_index2 = ( 2 * i - + 4 * (j - 1) * dic["grid"].nx - + 8 * k * dic["grid"].nx * dic["grid"].ny + + 4 * (j - 1) * dic["nd"][0] + + 8 * k * dic["nd"][0] * dic["nd"][1] + 1 ) index1 = [ cell_index2, - cell_index2 + 2 * dic["grid"].nx, - cell_index2 + 4 * dic["grid"].nx * dic["grid"].ny, - cell_index2 + 2 * dic["grid"].nx + 4 * dic["grid"].nx * dic["grid"].ny, + cell_index2 + 2 * dic["nd"][0], + cell_index2 + 4 * dic["nd"][0] * dic["nd"][1], + cell_index2 + 2 * dic["nd"][0] + 4 * dic["nd"][0] * dic["nd"][1], ] for iter1, iter2 in zip(index1, index2): dic["zc"][iter1] = dic["zc"][iter2] @@ -204,14 +200,14 @@ def handle_face_dir_jp(dic, cell_index, j): index1 = [ cell_index, cell_index + 1, - cell_index + 4 * dic["grid"].nx * dic["grid"].ny, - cell_index + 1 + 4 * dic["grid"].nx * dic["grid"].ny, + cell_index + 4 * dic["nd"][0] * dic["nd"][1], + cell_index + 1 + 4 * dic["nd"][0] * dic["nd"][1], ] index2 = [ - index1[0] + 6 * dic["grid"].nx, - index1[1] + 6 * dic["grid"].nx, - index1[0] + 6 * dic["grid"].nx + 4 * dic["grid"].nx * dic["grid"].ny, - index1[1] + 6 * dic["grid"].nx + 4 * dic["grid"].nx * dic["grid"].ny, + index1[0] + 6 * dic["nd"][0], + index1[1] + 6 * dic["nd"][0], + index1[0] + 6 * dic["nd"][0] + 4 * dic["nd"][0] * dic["nd"][1], + index1[1] + 6 * dic["nd"][0] + 4 * dic["nd"][0] * dic["nd"][1], ] for iter1, iter2 in zip(index1, index2): dic["zc"][iter1] = dic["zc"][iter2] @@ -236,16 +232,16 @@ def handle_face_dir_jm(dic, cell_index, j): j2 = j - 1 while dic["j_f_c"][j1 + 1] == dic["j_f_c"][j2 + 1]: index1 = [ - cell_index + 2 * dic["grid"].nx, - cell_index + 1 + 2 * dic["grid"].nx, - cell_index + 2 * dic["grid"].nx + 4 * dic["grid"].nx * dic["grid"].ny, - cell_index + 1 + 2 * dic["grid"].nx + 4 * dic["grid"].nx * dic["grid"].ny, + cell_index + 2 * dic["nd"][0], + cell_index + 1 + 2 * dic["nd"][0], + cell_index + 2 * dic["nd"][0] + 4 * dic["nd"][0] * dic["nd"][1], + cell_index + 1 + 2 * dic["nd"][0] + 4 * dic["nd"][0] * dic["nd"][1], ] index2 = [ - index1[0] - 6 * dic["grid"].nx, - index1[1] - 6 * dic["grid"].nx, - index1[0] - 6 * dic["grid"].nx + 4 * dic["grid"].nx * dic["grid"].ny, - index1[1] - 6 * dic["grid"].nx + 4 * dic["grid"].nx * dic["grid"].ny, + index1[0] - 6 * dic["nd"][0], + index1[1] - 6 * dic["nd"][0], + index1[0] - 6 * dic["nd"][0] + 4 * dic["nd"][0] * dic["nd"][1], + index1[1] - 6 * dic["nd"][0] + 4 * dic["nd"][0] * dic["nd"][1], ] for iter1, iter2 in zip(index1, index2): dic["zc"][iter1] = dic["zc"][iter2] @@ -272,8 +268,8 @@ def handle_faults(dic): for k in range(int(f[4]) - 1, int(f[5])): cell_index = ( 2 * i - + 4 * j * dic["grid"].nx - + 8 * k * dic["grid"].nx * dic["grid"].ny + + 4 * j * dic["nd"][0] + + 8 * k * dic["nd"][0] * dic["nd"][1] ) if f[6] == "I": handle_face_dir_ip(dic, cell_index, i, j, k) diff --git a/src/pycopm/utils/input_values.py b/src/pycopm/utils/input_values.py index 980adfa..c4ffe15 100644 --- a/src/pycopm/utils/input_values.py +++ b/src/pycopm/utils/input_values.py @@ -11,8 +11,9 @@ import subprocess from itertools import islice import numpy as np -from resdata.grid import Grid -from resdata.resfile import ResdataFile +from opm.io.ecl import EclFile as OpmFile +from opm.io.ecl import EGrid as OpmGrid +from opm.io.ecl import ERst as OpmRestart def process_input(dic, in_file): @@ -106,21 +107,7 @@ def read_reference(dic): dic (dict): Modified global dictionary """ - dic1 = initialize_values(dic) - j = 0 - for cell in dic["grid"].cells(): - dic["vol"][cell.global_index] = cell.volume + 1e-10 - dic["actnum"][cell.global_index] = cell.active - if cell.active == 1: - dic["swat"][cell.global_index] = dic1["swat"][0][j] - dic["sgas"][cell.global_index] = dic1["sgas"][0][j] - dic["pressure"][cell.global_index] = dic1["pressure"][0][j] - dic["rs"][cell.global_index] = dic1["rs"][0][j] - dic["rv"][cell.global_index] = dic1["rv"][0][j] - - for name in dic1["names"]: - dic[name.lower()][cell.global_index] = dic1[name][0][j] - j += 1 + initialize_values(dic) if dic["field"] == "norne": dic["multz"] = np.load( f"{dic['pat']}/reference_simulation/{dic['field']}/multz.npy" @@ -174,20 +161,13 @@ def initialize_values(dic): """ dic["case"] = dic["pat"] + f"/reference_simulation/{dic['field']}/{dic['name']}" - grid, ini = dic["case"] + ".EGRID", dic["case"] + ".INIT" + gri, ini = dic["case"] + ".EGRID", dic["case"] + ".INIT" rst = dic["case"] + ".UNRST" - dic["grid"], ini, rst = Grid(grid), ResdataFile(ini), ResdataFile(rst) - dic1 = { - "swat": rst.iget_kw("SWAT"), - "sgas": rst.iget_kw("SGAS"), - "pressure": rst.iget_kw("PRESSURE"), - "rs": rst.iget_kw("RS"), - "rv": rst.iget_kw("RV"), - } + grid, gridf, ini, rst = OpmGrid(gri), OpmFile(gri), OpmFile(ini), OpmRestart(rst) if dic["field"] == "norne": - dic1["names"] = ["PORO", "NTG", "SWL", "SGU", "SWCR", "FLUXNUM", "FIPNUM"] + values = ["PORO", "NTG", "SWL", "SGU", "SWCR", "FLUXNUM", "FIPNUM"] else: - dic1["names"] = [ + values = [ "PORO", "NTG", "SWL", @@ -197,29 +177,28 @@ def initialize_values(dic): "MULTNUM", "PVTNUM", ] - dic1["names"] += ["EQLNUM", "PERMX", "PERMY", "PERMZ", "SATNUM"] - for ent in dic1["names"]: - dic1[ent] = ini.iget_kw(ent) - dic["nc"] = dic["grid"].nx * dic["grid"].ny * dic["grid"].nz - dic["i_f_c"] = np.array([0 for _ in range(dic["grid"].nx + 1)]) - dic["j_f_c"] = np.array([0 for _ in range(dic["grid"].ny + 1)]) - dic["k_f_c"] = np.array([0 for _ in range(dic["grid"].nz + 1)]) + values += ["EQLNUM", "PERMX", "PERMY", "PERMZ", "SATNUM"] + dic["nc"] = grid.dimension[0] * grid.dimension[1] * grid.dimension[2] + dic["nd"] = [grid.dimension[0], grid.dimension[1], grid.dimension[2]] + dic["i_f_c"] = np.array([0 for _ in range(dic["nd"][0] + 1)]) + dic["j_f_c"] = np.array([0 for _ in range(dic["nd"][1] + 1)]) + dic["k_f_c"] = np.array([0 for _ in range(dic["nd"][2] + 1)]) for name in ["vol", "poro", "permx", "permy", "permz", "ntg", "swl"]: dic[f"{name}"] = np.array([0.0 for _ in range(dic["nc"])]) + dic["sgu"] = np.array([0.0 for _ in range(dic["nc"])]) + dic["swcr"] = np.array([0.0 for _ in range(dic["nc"])]) for name in ["con", "actnum", "fluxnum", "multnum", "fipnum"]: dic[f"{name}"] = np.array([0 for _ in range(dic["nc"])]) dic["eqlnum"] = np.array([0 for _ in range(dic["nc"])]) - dic["sgu"] = np.array([0.0 for _ in range(dic["nc"])]) - dic["swcr"] = np.array([0.0 for _ in range(dic["nc"])]) - dic["swat"] = np.array([0.0 for _ in range(dic["nc"])]) - dic["sgas"] = np.array([0.0 for _ in range(dic["nc"])]) - dic["rs"] = np.array([0.0 for _ in range(dic["nc"])]) - dic["rv"] = np.array([0.0 for _ in range(dic["nc"])]) - dic["pressure"] = np.array([0.0 for _ in range(dic["nc"])]) - dic["multz"] = np.array([1.0 for _ in range(dic["nc"])]) dic["satnum"] = np.array([1 for _ in range(dic["nc"])]) dic["pvtnum"] = np.array([1 for _ in range(dic["nc"])]) dic["fipzon"] = np.array([1 for _ in range(dic["nc"])]) - dic["zc"], dic["cr"] = dic["grid"].export_zcorn(), dic["grid"].export_coord() - return dic1 + dic["zc"], dic["cr"] = gridf["ZCORN"], gridf["COORD"] + dic["vol"] = np.array(grid.cellvolumes()) + 1e-10 + dic["actnum"] = np.array(ini["PORV"]) > 0 + for name in ["swat", "sgas", "pressure", "rs", "rv"]: + dic[name] = np.array([0.0 for _ in range(dic["nc"])]) + dic[name][dic["actnum"]] = rst[name.upper(), 0] + for name in values: + dic[name.lower()][dic["actnum"]] = ini[name] diff --git a/src/pycopm/utils/mapping_methods.py b/src/pycopm/utils/mapping_methods.py index 603193d..ba4dbf6 100644 --- a/src/pycopm/utils/mapping_methods.py +++ b/src/pycopm/utils/mapping_methods.py @@ -933,18 +933,13 @@ def handle_vicinity(dic): dic["wvicinity"] = [] dic["hvicinity"] = [] if dic["optvic"].upper() == "XYPOLYGON": - if dic["resdata"]: - coords = dic["grid"].export_position(dic["grid"].export_index()) - else: - coords = [] - for k in range(dic["zn"]): - for j in range(dic["yn"]): - for i in range(dic["xn"]): - xyz = dic["grid"].xyz_from_ijk(i, j, k, True) - coords.append( - [sum(xyz[0]) / 8.0, sum(xyz[1]) / 8, sum(xyz[2]) / 8] - ) - coords = np.array(coords) + coords = [] + for k in range(dic["zn"]): + for j in range(dic["yn"]): + for i in range(dic["xn"]): + xyz = dic["grid"].xyz_from_ijk(i, j, k, True) + coords.append([sum(xyz[0]) / 8.0, sum(xyz[1]) / 8, sum(xyz[2]) / 8]) + coords = np.array(coords) nxy = dic["xn"] * dic["yn"] nxyz = nxy * dic["zn"] dic["subm"] = [] @@ -1057,16 +1052,9 @@ def handle_vicinity(dic): found = False dic["subm"] = np.ones(dic["xn"] * dic["yn"] * dic["zn"]) quans = [int(val) for val in vicinity[1].split(",")] - if dic["resdata"]: - if dic["ini"].has_kw(dic["optvic"].upper()): - dic["subm"][dic["actind"]] = dic["ini"].iget_kw(dic["optvic"].upper())[ - 0 - ] - found = True - else: - if dic["ini"].count(dic["optvic"].upper()): - dic["subm"][dic["actind"]] = dic["ini"][dic["optvic"].upper()] - found = True + if dic["ini"].count(dic["optvic"].upper()): + dic["subm"][dic["actind"]] = dic["ini"][dic["optvic"].upper()] + found = True if found: dic["subm"] = [val in quans for val in dic["subm"]] else: @@ -1129,16 +1117,10 @@ def map_vicinity(dic): bar_animation() if name != "porv": dic[name] = np.zeros(nc) - if dic["resdata"]: - if name in dic["rptrst"]: - dic[name][dic["actind"]] = dic["rst"].iget_kw(name.upper())[0] - else: - dic[name][dic["actind"]] = dic["ini"].iget_kw(name.upper())[0] + if name in dic["rptrst"]: + dic[name][dic["actind"]] = dic["rst"][name.upper(), 0] else: - if name in dic["rptrst"]: - dic[name][dic["actind"]] = dic["rst"][name.upper(), 0] - else: - dic[name][dic["actind"]] = dic["ini"][name.upper()] + dic[name][dic["actind"]] = dic["ini"][name.upper()] dic[f"{name}_c"] = [""] * (dic["nx"] * dic["ny"] * dic["nz"]) n = 0 for k in range(dic["zn"]): @@ -1278,12 +1260,8 @@ def handle_cp_grid(dic): """ ir = [] mr = [] - if dic["resdata"]: - zc = dic["grid"].export_zcorn() - cr = dic["grid"].export_coord() - else: - zc = dic["ogrid"]["ZCORN"] - cr = dic["ogrid"]["COORD"] + zc = dic["ogrid"]["ZCORN"] + cr = dic["ogrid"]["COORD"] for i in range(dic["xn"] + 1): if (dic["X"][i]) > 1: for m in range(i, (dic["xn"] + 1) * (dic["yn"] + 1), dic["xn"] + 1): @@ -1349,12 +1327,8 @@ def chop_grid(dic): """ dic["zc"], dic["cr"] = [], [] - if dic["resdata"]: - zc = list(dic["grid"].export_zcorn()) - cr = list(dic["grid"].export_coord()) - else: - zc = list(dic["ogrid"]["ZCORN"]) - cr = list(dic["ogrid"]["COORD"]) + zc = list(dic["ogrid"]["ZCORN"]) + cr = list(dic["ogrid"]["COORD"]) for j in range(dic["yn"] + 1): l = 6 * (dic["xn"] + 1) * j added = False @@ -1408,51 +1382,25 @@ def transform_grid(dic): txyz = np.array([float(txyz[0][1:]), float(txyz[1]), float(txyz[-1][:-1])]) else: txyz = float(trans[1]) - if dic["resdata"]: - zc = list(dic["grid"].export_zcorn()) - cr = list(dic["grid"].export_coord()) - else: - zc = list(dic["ogrid"]["ZCORN"]) - cr = list(dic["ogrid"]["COORD"]) + zc = list(dic["ogrid"]["ZCORN"]) + cr = list(dic["ogrid"]["COORD"]) if trans[0] in ["rotatexz", "rotateyz"]: - if dic["resdata"]: - xyz = dic["grid"].export_corners(dic["grid"].export_index()) - for k in range(dic["zn"]): - for j in range(dic["yn"]): - for i in range(dic["xn"]): - ind = i + j * dic["xn"] + k * dic["xn"] * dic["yn"] - cxy.append([xyz[ind][0], xyz[ind][1]]) - cxy.append([xyz[ind][3], xyz[ind][4]]) - for i in range(dic["xn"]): - ind = i + j * dic["xn"] + k * dic["xn"] * dic["yn"] - cxy.append([xyz[ind][6], xyz[ind][7]]) - cxy.append([xyz[ind][9], xyz[ind][10]]) - for j in range(dic["yn"]): - for i in range(dic["xn"]): - ind = i + j * dic["xn"] + k * dic["xn"] * dic["yn"] - cxy.append([xyz[ind][12], xyz[ind][13]]) - cxy.append([xyz[ind][15], xyz[ind][16]]) - for i in range(dic["xn"]): - ind = i + j * dic["xn"] + k * dic["xn"] * dic["yn"] - cxy.append([xyz[ind][18], xyz[ind][19]]) - cxy.append([xyz[ind][21], xyz[ind][22]]) - else: - for k in range(dic["zn"]): - for j in range(dic["yn"]): - for i in range(dic["xn"]): - xyz = dic["grid"].xyz_from_ijk(i, j, k) - cxy.append([xyz[0][0], xyz[1][0]]) - cxy.append([xyz[0][1], xyz[1][1]]) - for i in range(dic["xn"]): - cxy.append([xyz[0][2], xyz[1][2]]) - cxy.append([xyz[0][3], xyz[1][3]]) - for j in range(dic["yn"]): - for i in range(dic["xn"]): - cxy.append([xyz[0][4], xyz[1][4]]) - cxy.append([xyz[0][5], xyz[1][5]]) - for i in range(dic["xn"]): - cxy.append([xyz[0][6], xyz[1][6]]) - cxy.append([xyz[0][7], xyz[1][7]]) + for k in range(dic["zn"]): + for j in range(dic["yn"]): + for i in range(dic["xn"]): + xyz = dic["grid"].xyz_from_ijk(i, j, k) + cxy.append([xyz[0][0], xyz[1][0]]) + cxy.append([xyz[0][1], xyz[1][1]]) + for i in range(dic["xn"]): + cxy.append([xyz[0][2], xyz[1][2]]) + cxy.append([xyz[0][3], xyz[1][3]]) + for j in range(dic["yn"]): + for i in range(dic["xn"]): + cxy.append([xyz[0][4], xyz[1][4]]) + cxy.append([xyz[0][5], xyz[1][5]]) + for i in range(dic["xn"]): + cxy.append([xyz[0][6], xyz[1][6]]) + cxy.append([xyz[0][7], xyz[1][7]]) for j in range(dic["yn"] + 1): l = 6 * (dic["xn"] + 1) * j for i in range(dic["xn"] + 1): @@ -1529,12 +1477,8 @@ def refine_grid(dic): """ crx, dic["zc"], dic["cr"] = [], [], [] - if dic["resdata"]: - zc = list(dic["grid"].export_zcorn()) - cr = list(dic["grid"].export_coord()) - else: - zc = list(dic["ogrid"]["ZCORN"]) - cr = list(dic["ogrid"]["COORD"]) + zc = list(dic["ogrid"]["ZCORN"]) + cr = list(dic["ogrid"]["COORD"]) for j in range(dic["yn"] + 1): l = 6 * (dic["xn"] + 1) * j for n in range(6): diff --git a/src/pycopm/utils/properties_builder.py b/src/pycopm/utils/properties_builder.py index 23fe806..20541ad 100644 --- a/src/pycopm/utils/properties_builder.py +++ b/src/pycopm/utils/properties_builder.py @@ -21,31 +21,14 @@ def initialize_properties(dic): dic (dict): Modified global dictionary """ + names = ["poro", "porv", "vol", "permx", "permy", "permz", "ntg", "fipzon"] + names += ["swl", "sgu", "swcr", "fluxnum", "fipnum", "eqlnum", "pvtnum"] + names += ["swat", "sgas", "pressure", "rs", "rv", "multz", "multnum"] + for name in names: + dic[f"{name}_c"] = [0.0 for _ in range(dic["num_cells"])] dic["actnum_c"] = [0 for _ in range(dic["num_cells"])] dic["index"] = [[] for _ in range(dic["num_cells"])] - dic["poro_c"] = [0.0 for _ in range(dic["num_cells"])] - dic["porv_c"] = [0.0 for _ in range(dic["num_cells"])] - dic["vol_c"] = [0.0 for _ in range(dic["num_cells"])] - dic["permx_c"] = [0.0 for _ in range(dic["num_cells"])] - dic["permy_c"] = [0.0 for _ in range(dic["num_cells"])] - dic["permz_c"] = [0.0 for _ in range(dic["num_cells"])] - dic["ntg_c"] = [0.0 for _ in range(dic["num_cells"])] - dic["swl_c"] = [0.0 for _ in range(dic["num_cells"])] - dic["sgu_c"] = [0.0 for _ in range(dic["num_cells"])] - dic["swcr_c"] = [0.0 for _ in range(dic["num_cells"])] - dic["fluxnum_c"] = [0.0 for _ in range(dic["num_cells"])] - dic["fipnum_c"] = [0.0 for _ in range(dic["num_cells"])] - dic["eqlnum_c"] = [0.0 for _ in range(dic["num_cells"])] dic["satnum_c"] = [1 for _ in range(dic["num_cells"])] - dic["swat_c"] = [0.0 for _ in range(dic["num_cells"])] - dic["sgas_c"] = [0.0 for _ in range(dic["num_cells"])] - dic["pressure_c"] = [0.0 for _ in range(dic["num_cells"])] - dic["rs_c"] = [0.0 for _ in range(dic["num_cells"])] - dic["rv_c"] = [0.0 for _ in range(dic["num_cells"])] - dic["multz_c"] = [0.0 for _ in range(dic["num_cells"])] - dic["multnum_c"] = [0.0 for _ in range(dic["num_cells"])] - dic["pvtnum_c"] = [0.0 for _ in range(dic["num_cells"])] - dic["fipzon_c"] = [0.0 for _ in range(dic["num_cells"])] for name in ["permx", "permy", "permz"]: dic[name + "_c_min_max"] = [[0.0, 0.0] for _ in range(dic["num_cells"])] @@ -362,32 +345,32 @@ def identify_removed_pilars(dic): """ dic["mr"] = [] dic["ir"] = [] - for i in range(dic["grid"].nx + 1): + for i in range(dic["nd"][0] + 1): if (dic["X"][i]) > 1: for k in range( - i, (dic["grid"].nx + 1) * (dic["grid"].ny + 1), dic["grid"].nx + 1 + i, (dic["nd"][0] + 1) * (dic["nd"][1] + 1), dic["nd"][0] + 1 ): for j in range(6): dic["mr"].append(k * 6 + j) for num in range( 2 * i - 1, - 8 * dic["grid"].nx * dic["grid"].ny * dic["grid"].nz, - 2 * dic["grid"].nx, + 8 * dic["nc"], + 2 * dic["nd"][0], ): dic["ir"].append(num) dic["ir"].append(num + 1) - for j in range(dic["grid"].ny + 1): + for j in range(dic["nd"][1] + 1): if (dic["Y"][j]) > 1: - for k in range(j * (dic["grid"].nx + 1), (j + 1) * (dic["grid"].nx + 1)): + for k in range(j * (dic["nd"][0] + 1), (j + 1) * (dic["nd"][0] + 1)): for i in range(6): dic["mr"].append(k * 6 + i) for num in range( - (2 * j - 1) * 2 * dic["grid"].nx, - 8 * dic["grid"].nx * dic["grid"].ny * dic["grid"].nz, - 4 * dic["grid"].nx * dic["grid"].ny, + (2 * j - 1) * 2 * dic["nd"][0], + 8 * dic["nc"], + 4 * dic["nd"][0] * dic["nd"][1], ): - for i in range(4 * dic["grid"].nx): + for i in range(4 * dic["nd"][0]): dic["ir"].append(num + i) identify_removed_pilars_zdir(dic) @@ -403,10 +386,10 @@ def identify_removed_pilars_zdir(dic): dic (dict): Modified global dictionary """ - for k in range(dic["grid"].nz + 1): + for k in range(dic["nd"][2] + 1): if (dic["Z"][k]) > 1: for num in range( - (2 * k - 1) * 4 * dic["grid"].nx * dic["grid"].ny, - (2 * k + 1) * 4 * dic["grid"].nx * dic["grid"].ny, + (2 * k - 1) * 4 * dic["nd"][0] * dic["nd"][1], + (2 * k + 1) * 4 * dic["nd"][0] * dic["nd"][1], ): dic["ir"].append(num) diff --git a/tests/test_2_coarsening.py b/tests/test_2_coarsening.py index 4610d31..8f21ffb 100644 --- a/tests/test_2_coarsening.py +++ b/tests/test_2_coarsening.py @@ -16,148 +16,137 @@ def test_coarsening(flow): """See examples/decks/HELLO_WORLD.DATA""" if not os.path.exists(f"{testpth}/output"): os.system(f"mkdir {testpth}/output") - for use in ["opm", "resdata"]: - sub = f"FINER{use.upper()}" - subprocess.run( - [ - "pycopm", - "-f", - flow, - "-f", - flow, - "-c", - "5,5,1", - "-i", - f"{mainpth}/examples/decks/HELLO_WORLD.DATA", - "-o", - f"{testpth}/output/coarser", - "-warnings", - "1", - "-m", - "prep", - "-u", - use, - ], - check=True, - ) - assert os.path.exists( - f"{testpth}/output/coarser/HELLO_WORLD_PREP_PYCOPM_DRYRUN.INIT" - ) - assert os.path.exists( - f"{testpth}/output/coarser/HELLO_WORLD_PREP_PYCOPM_DRYRUN.EGRID" - ) - for ahow in ["max", "min", "mode"]: - for nhow in ["max", "min", "mode"]: - for show in ["max", "min", "mean", "pvmean"]: - subprocess.run( - [ - "pycopm", - "-f", - flow, - "-i", - f"{mainpth}/examples/decks/HELLO_WORLD.DATA", - "-o", - f"{testpth}/output/coarser", - "-c", - "5,5,1", - "-m", - "deck", - "-a", - ahow, - "-n", - nhow, - "-warnings", - "1", - "-s", - show, - "-u", - use, - ], - check=True, - ) - assert os.path.exists( - f"{testpth}/output/coarser/HELLO_WORLD_PYCOPM.DATA" - ) - os.system(f"rm {testpth}/output/coarser/HELLO_WORLD_PYCOPM.DATA") - subprocess.run( - [ - "pycopm", - "-f", - flow, - "-i", - f"{mainpth}/examples/decks/HELLO_WORLD.DATA", - "-o", - f"{testpth}/output/coarser", - "-m", - "deck_dry", - "-p", - "1", - "-n", - "mode", - "-warnings", - "1", - "-x", - "6:10", - "-y", - "0,2,2,2,0,0,0,0,0,0,0,0,2,2,2,2,2,2,0,0,0", - "-w", - sub, - "-u", - use, - ], - check=True, - ) - assert os.path.exists(f"{testpth}/output/coarser/{sub}.INIT") - assert os.path.exists(f"{testpth}/output/coarser/{sub}.EGRID") - subprocess.run( - [ - "pycopm", - "-f", - flow, - "-i", - f"{mainpth}/examples/decks/HELLO_WORLD.DATA", - "-o", - f"{testpth}/output/coarser", - "-c", - "1,5,1", - "-m", - "deck_dry", - "-t", - "1", - "-warnings", - "1", - "-w", - f"TRANS{sub}", - "-u", - use, - ], - check=True, - ) - assert os.path.exists(f"{testpth}/output/coarser/TRANS{sub}.INIT") - assert os.path.exists(f"{testpth}/output/coarser/TRANS{sub}.EGRID") - subprocess.run( - [ - "pycopm", - "-f", - flow, - "-i", - f"{mainpth}/examples/decks/HELLO_WORLD.DATA", - "-o", - f"{testpth}/output/coarser", - "-c", - "5,1,4", - "-m", - "deck_dry", - "-t", - "2", - "-w", - f"TRANS2{sub}", - "-u", - use, - "-warnings", - "1", - ], - check=True, - ) - assert os.path.exists(f"{testpth}/output/coarser/TRANS2{sub}.INIT") - assert os.path.exists(f"{testpth}/output/coarser/TRANS2{sub}.EGRID") + sub = "FINER" + subprocess.run( + [ + "pycopm", + "-f", + flow, + "-f", + flow, + "-c", + "5,5,1", + "-i", + f"{mainpth}/examples/decks/HELLO_WORLD.DATA", + "-o", + f"{testpth}/output/coarser", + "-warnings", + "1", + "-m", + "prep", + ], + check=True, + ) + assert os.path.exists( + f"{testpth}/output/coarser/HELLO_WORLD_PREP_PYCOPM_DRYRUN.INIT" + ) + assert os.path.exists( + f"{testpth}/output/coarser/HELLO_WORLD_PREP_PYCOPM_DRYRUN.EGRID" + ) + for ahow in ["max", "min", "mode"]: + for nhow in ["max", "min", "mode"]: + for show in ["max", "min", "mean", "pvmean"]: + subprocess.run( + [ + "pycopm", + "-f", + flow, + "-i", + f"{mainpth}/examples/decks/HELLO_WORLD.DATA", + "-o", + f"{testpth}/output/coarser", + "-c", + "5,5,1", + "-m", + "deck", + "-a", + ahow, + "-n", + nhow, + "-warnings", + "1", + "-s", + show, + ], + check=True, + ) + assert os.path.exists( + f"{testpth}/output/coarser/HELLO_WORLD_PYCOPM.DATA" + ) + os.system(f"rm {testpth}/output/coarser/HELLO_WORLD_PYCOPM.DATA") + subprocess.run( + [ + "pycopm", + "-f", + flow, + "-i", + f"{mainpth}/examples/decks/HELLO_WORLD.DATA", + "-o", + f"{testpth}/output/coarser", + "-m", + "deck_dry", + "-p", + "1", + "-n", + "mode", + "-warnings", + "1", + "-x", + "6:10", + "-y", + "0,2,2,2,0,0,0,0,0,0,0,0,2,2,2,2,2,2,0,0,0", + "-w", + sub, + ], + check=True, + ) + assert os.path.exists(f"{testpth}/output/coarser/{sub}.INIT") + assert os.path.exists(f"{testpth}/output/coarser/{sub}.EGRID") + subprocess.run( + [ + "pycopm", + "-f", + flow, + "-i", + f"{mainpth}/examples/decks/HELLO_WORLD.DATA", + "-o", + f"{testpth}/output/coarser", + "-c", + "1,5,1", + "-m", + "deck_dry", + "-t", + "1", + "-warnings", + "1", + "-w", + f"TRANS{sub}", + ], + check=True, + ) + assert os.path.exists(f"{testpth}/output/coarser/TRANS{sub}.INIT") + assert os.path.exists(f"{testpth}/output/coarser/TRANS{sub}.EGRID") + subprocess.run( + [ + "pycopm", + "-f", + flow, + "-i", + f"{mainpth}/examples/decks/HELLO_WORLD.DATA", + "-o", + f"{testpth}/output/coarser", + "-c", + "5,1,4", + "-m", + "deck_dry", + "-t", + "2", + "-w", + f"TRANS2{sub}", + "-warnings", + "1", + ], + check=True, + ) + assert os.path.exists(f"{testpth}/output/coarser/TRANS2{sub}.INIT") + assert os.path.exists(f"{testpth}/output/coarser/TRANS2{sub}.EGRID") diff --git a/tests/test_3_refinement.py b/tests/test_3_refinement.py index 1ceb0c3..b780f98 100644 --- a/tests/test_3_refinement.py +++ b/tests/test_3_refinement.py @@ -8,7 +8,7 @@ import pathlib import subprocess import numpy as np -from resdata.resfile import ResdataFile +from opm.io.ecl import EclFile as OpmFile mainpth: pathlib.Path = pathlib.Path(__file__).parents[1] testpth: pathlib.Path = pathlib.Path(__file__).parent @@ -18,35 +18,32 @@ def test_refinement(flow): """See examples/decks/MODEL2.DATA""" if not os.path.exists(f"{testpth}/output"): os.system(f"mkdir {testpth}/output") - for use in ["opm", "resdata"]: - sub = f"FINER{use.upper()}" - subprocess.run( - [ - "pycopm", - "-f", - flow, - "-i", - f"{mainpth}/examples/decks/MODEL2.DATA", - "-o", - f"{testpth}/output/finer", - "-g", - "2,4,8", - "-l", - sub, - "-w", - sub, - "-m", - "all", - "-u", - use, - "-warnings", - "1", - ], - check=True, - ) - assert os.path.exists(f"{testpth}/output/finer/{sub}.INIT") - assert os.path.exists(f"{testpth}/output/finer/{sub}.EGRID") - os.chdir(f"{testpth}/output/finer") - porv = np.array(ResdataFile(f"{sub}.INIT").iget_kw("PORV")[0]) - assert abs(sum(porv) - 6506.25) < 1e-4 - assert sum(porv > 0) == 2430 + sub = "FINER" + subprocess.run( + [ + "pycopm", + "-f", + flow, + "-i", + f"{mainpth}/examples/decks/MODEL2.DATA", + "-o", + f"{testpth}/output/finer", + "-g", + "2,4,8", + "-l", + sub, + "-w", + sub, + "-m", + "all", + "-warnings", + "1", + ], + check=True, + ) + assert os.path.exists(f"{testpth}/output/finer/{sub}.INIT") + assert os.path.exists(f"{testpth}/output/finer/{sub}.EGRID") + os.chdir(f"{testpth}/output/finer") + porv = np.array(OpmFile(f"{sub}.INIT")["PORV"]) + assert abs(sum(porv) - 6506.25) < 1e-4 + assert sum(porv > 0) == 2430 diff --git a/tests/test_4_submodel.py b/tests/test_4_submodel.py index 70495c1..abcc643 100644 --- a/tests/test_4_submodel.py +++ b/tests/test_4_submodel.py @@ -8,7 +8,7 @@ import pathlib import subprocess import numpy as np -from resdata.resfile import ResdataFile +from opm.io.ecl import EclFile as OpmFile testpth: pathlib.Path = pathlib.Path(__file__).parent mainpth: pathlib.Path = pathlib.Path(__file__).parents[1] @@ -18,64 +18,59 @@ def test_submodel(flow): """See examples/decks/MODEL0.DATA and MODEL1.DATA""" if not os.path.exists(f"{testpth}/output"): os.system(f"mkdir {testpth}/output") - for use in ["opm", "resdata"]: - for i in range(2): - sub = f"MODEL{i}_FINER{use.upper()}" - os.chdir(f"{testpth}/output") + for i in range(2): + sub = f"MODEL{i}_FINER" + os.chdir(f"{testpth}/output") + subprocess.run( + [ + "pycopm", + "-f", + flow, + "-i", + f"{mainpth}/examples/decks/MODEL{i}.DATA", + "-o", + f"{testpth}/output/submodel", + "-g", + "4,4,3", + "-warnings", + "1", + "-m", + "all", + "-w", + sub, + "-l", + sub, + ], + check=True, + ) + assert os.path.exists(f"{testpth}/output/submodel/{sub}.INIT") + assert os.path.exists(f"{testpth}/output/submodel/{sub}.EGRID") + os.chdir(f"{testpth}/output/submodel") + for j in [1, 3, 4]: subprocess.run( [ "pycopm", "-f", flow, "-i", - f"{mainpth}/examples/decks/MODEL{i}.DATA", + f"{sub}.DATA", "-o", - f"{testpth}/output/submodel", - "-g", - "4,4,3", - "-warnings", - "1", + ".", + "-v", + "xypolygon [3,7.5] [7.5,3] [12,7.5] [7.5,12] [3,7.5]", "-m", "all", "-w", - sub, + f"{sub}SUBMODEL", "-l", - sub, - "-u", - use, + f"{sub}SUBMODEL", + "-warnings", + "1", + "-p", + f"{j}", ], check=True, ) - assert os.path.exists(f"{testpth}/output/submodel/{sub}.INIT") - assert os.path.exists(f"{testpth}/output/submodel/{sub}.EGRID") - os.chdir(f"{testpth}/output/submodel") - for j in [1, 3, 4]: - subprocess.run( - [ - "pycopm", - "-f", - flow, - "-i", - f"{sub}.DATA", - "-o", - ".", - "-v", - "xypolygon [3,7.5] [7.5,3] [12,7.5] [7.5,12] [3,7.5]", - "-m", - "all", - "-w", - f"{sub}SUBMODEL", - "-l", - f"{sub}SUBMODEL", - "-warnings", - "1", - "-p", - f"{j}", - "-u", - use, - ], - check=True, - ) - porv = np.array(ResdataFile(f"{sub}SUBMODEL.INIT").iget_kw("PORV")[0]) - assert abs(sum(porv) - 150) < 1e-6 - assert sum(porv > 0) == 21 + porv = np.array(OpmFile(f"{sub}SUBMODEL.INIT")["PORV"]) + assert abs(sum(porv) - 150) < 1e-6 + assert sum(porv > 0) == 21 diff --git a/tests/test_5_transform.py b/tests/test_5_transform.py index a6668ff..1fcf389 100644 --- a/tests/test_5_transform.py +++ b/tests/test_5_transform.py @@ -7,7 +7,7 @@ import os import pathlib import subprocess -from resdata.grid import Grid +from opm.io.ecl import EGrid as OpmGrid testpth: pathlib.Path = pathlib.Path(__file__).parent mainpth: pathlib.Path = pathlib.Path(__file__).parents[1] @@ -17,38 +17,36 @@ def test_transform(flow): """See examples/decks/MODEL0.DATA""" if not os.path.exists(f"{testpth}/output"): os.system(f"mkdir {testpth}/output") - for use in ["opm", "resdata"]: - flags = ["translate", "scale", "rotatexy", "rotatexz", "rotateyz"] - values = ["[5,-3,2]", "[2,.5,4]", "45", "-10", "15"] - checks = [3, 4, 1, 3.5899, 4.848] - for flag, val, check in zip(flags, values, checks): - sub = flag.upper() + use.upper() - subprocess.run( - [ - "pycopm", - "-f", - flow, - "-i", - f"{mainpth}/examples/decks/MODEL0.DATA", - "-o", - f"{testpth}/output/transform", - "-d", - f"{flag} {val}", - "-m", - "all", - "-warnings", - "1", - "-w", - sub, - "-l", - sub, - "-u", - use, - ], - check=True, - ) - assert os.path.exists(f"{testpth}/output/transform/{sub}.INIT") - assert os.path.exists(f"{testpth}/output/transform/{sub}.EGRID") - grid = Grid(f"{testpth}/output/transform/{sub}.EGRID") - zcoord = grid.export_corners(grid.export_index())[-1][-1] - assert abs(zcoord - check) < 1e-2 + flags = ["translate", "scale", "rotatexy", "rotatexz", "rotateyz"] + values = ["[5,-3,2]", "[2,.5,4]", "45", "-10", "15"] + checks = [3, 4, 1, 3.5899, 4.848] + for flag, val, check in zip(flags, values, checks): + sub = flag.upper() + subprocess.run( + [ + "pycopm", + "-f", + flow, + "-i", + f"{mainpth}/examples/decks/MODEL0.DATA", + "-o", + f"{testpth}/output/transform", + "-d", + f"{flag} {val}", + "-m", + "all", + "-warnings", + "1", + "-w", + sub, + "-l", + sub, + ], + check=True, + ) + assert os.path.exists(f"{testpth}/output/transform/{sub}.INIT") + assert os.path.exists(f"{testpth}/output/transform/{sub}.EGRID") + grid = OpmGrid(f"{testpth}/output/transform/{sub}.EGRID") + dim = grid.dimension + zcoord = grid.xyz_from_ijk(dim[0] - 1, dim[1] - 1, dim[2] - 1)[-1][-1] + assert abs(zcoord - check) < 1e-2 diff --git a/tests/test_6_segwell_faults.py b/tests/test_6_segwell_faults.py index 7a39e44..396d995 100644 --- a/tests/test_6_segwell_faults.py +++ b/tests/test_6_segwell_faults.py @@ -25,7 +25,8 @@ import pathlib import subprocess import numpy as np -from resdata.resfile import ResdataFile +from opm.io.ecl import EclFile as OpmFile +from opm.io.ecl import ERst as OpmRestart testpth: pathlib.Path = pathlib.Path(__file__).parent mainpth: pathlib.Path = pathlib.Path(__file__).parents[1] @@ -43,8 +44,56 @@ def test_complex(flow): ], check=True, ) - for use in ["opm", "resdata"]: - sub = use.upper() + subprocess.run( + [ + "pycopm", + "-f", + flow, + "-o", + f"{testpth}/output/complex", + "-i", + f"{mainpth}/examples/decks/MODEL3.DATA", + "-x", + "0,2,0,2,0,0,0,0,0,0", + "-z", + "0,2,2,0,2,2,0,2,2,0,2,2,0,2,2,0,2,2,0,2,2,0,2,2,0,2,2,0,2,2,2,0", + "-w", + "COARSER", + "-l", + "C0", + "-p", + "1", + "-q", + "1", + "-a", + "max", + "-m", + "all", + ], + check=True, + ) + assert os.path.exists(f"{testpth}/output/complex/COARSER.INIT") + assert os.path.exists(f"{testpth}/output/complex/COARSER.EGRID") + subprocess.run( + [ + flow, + f"{testpth}/output/complex/COARSER.DATA", + f"--output-dir={testpth}/output/complex/coarser", + ], + check=True, + ) + bini = OpmFile(f"{testpth}/output/complex/reference/MODEL3.INIT") + cini = OpmFile(f"{testpth}/output/complex/coarser/COARSER.INIT") + bpv = np.array(bini["PORV"]) + cpv = np.array(cini["PORV"]) + assert abs(sum(bpv) - sum(cpv)) < 50 # ca. 4.61992e8 porv in the ref + assert sum(cpv > 0) == 255 + brst = OpmRestart(f"{testpth}/output/complex/reference/MODEL3.UNRST") + crst = OpmRestart(f"{testpth}/output/complex/coarser/COARSER.UNRST") + bgf = np.array(brst["FIPGAS", 0]) + cgf = np.array(crst["FIPGAS", 0]) + assert abs(sum(bgf) - sum(cgf)) < 5e3 # ca. 2.56191e10 fipgas in the ref + for sub in ["0", "1"]: subprocess.run( [ "pycopm", @@ -54,130 +103,72 @@ def test_complex(flow): f"{testpth}/output/complex", "-i", f"{mainpth}/examples/decks/MODEL3.DATA", - "-x", - "0,2,0,2,0,0,0,0,0,0", - "-z", - "0,2,2,0,2,2,0,2,2,0,2,2,0,2,2,0,2,2,0,2,2,0,2,2,0,2,2,0,2,2,2,0", + "-warnings", + "1", + "-g", + "2,2,2", "-w", - f"COARSER{sub}", + f"FINER{sub}", "-l", - f"C0{sub}", - "-p", - "1", + f"R0{sub}", "-q", "1", - "-a", - "max", "-m", "all", - "-u", - use, + "-explicit", + sub, ], check=True, ) - assert os.path.exists(f"{testpth}/output/complex/COARSER{sub}.INIT") - assert os.path.exists(f"{testpth}/output/complex/COARSER{sub}.EGRID") + assert os.path.exists(f"{testpth}/output/complex/FINER{sub}.INIT") + assert os.path.exists(f"{testpth}/output/complex/FINER{sub}.EGRID") subprocess.run( [ flow, - f"{testpth}/output/complex/COARSER{sub}.DATA", - f"--output-dir={testpth}/output/complex/coarser", + f"{testpth}/output/complex/FINER{sub}.DATA", + f"--output-dir={testpth}/output/complex/finer", + ], + check=True, + ) + rini = OpmFile(f"{testpth}/output/complex/finer/FINER{sub}.INIT") + rpv = np.array(rini["PORV"]) + assert abs(sum(bpv) - sum(rpv)) < 50 # ca. 4.61992e8 porv in the ref + assert sum(rpv > 0) == 22896 + rrst = OpmRestart(f"{testpth}/output/complex/finer/FINER{sub}.UNRST") + rgf = np.array(rrst["FIPGAS", 0]) + assert abs(sum(bgf) - sum(rgf)) < 4e5 # ca. 2.56191e10 fipgas in the ref + for i, val in enumerate( + ["diamond 0", "diamond 1", "diamondxy 3", "box [-3,2] [-1,1] [-1,2]"] + ): + subprocess.run( + [ + "pycopm", + "-f", + flow, + "-o", + f"{testpth}/output/complex", + "-i", + f"{mainpth}/examples/decks/MODEL3.DATA", + "-v", + f"A4 {val}", + "-w", + f"SUBMODEL{i}", + "-warnings", + "1", + "-l", + f"S{i}", + "-p", + f"{[1,3,3,4][i]}", + "-m", + "deck_dry", ], check=True, ) - bini = ResdataFile(f"{testpth}/output/complex/reference/MODEL3.INIT") - cini = ResdataFile(f"{testpth}/output/complex/coarser/COARSER{sub}.INIT") - bpv = np.array(bini.iget_kw("PORV")[0]) - cpv = np.array(cini.iget_kw("PORV")[0]) + assert os.path.exists(f"{testpth}/output/complex/SUBMODEL{i}.INIT") + assert os.path.exists(f"{testpth}/output/complex/SUBMODEL{i}.EGRID") + bini = OpmFile(f"{testpth}/output/complex/reference/MODEL3.INIT") + cini = OpmFile(f"{testpth}/output/complex/SUBMODEL{i}.INIT") + bpv = np.array(bini["PORV"]) + cpv = np.array(cini["PORV"]) assert abs(sum(bpv) - sum(cpv)) < 50 # ca. 4.61992e8 porv in the ref - assert sum(cpv > 0) == 255 - brst = ResdataFile(f"{testpth}/output/complex/reference/MODEL3.UNRST") - crst = ResdataFile(f"{testpth}/output/complex/coarser/COARSER{sub}.UNRST") - bgf = np.array(brst.iget_kw("FIPGAS")[0]) - cgf = np.array(crst.iget_kw("FIPGAS")[0]) - assert abs(sum(bgf) - sum(cgf)) < 5e3 # ca. 2.56191e10 fipgas in the ref - for explicit in ["0", "1"]: - sub = f"{explicit}{use.upper()}" - subprocess.run( - [ - "pycopm", - "-f", - flow, - "-o", - f"{testpth}/output/complex", - "-i", - f"{mainpth}/examples/decks/MODEL3.DATA", - "-warnings", - "1", - "-g", - "2,2,2", - "-w", - f"FINER{sub}", - "-l", - f"R0{sub}", - "-q", - "1", - "-m", - "all", - "-u", - use, - "-explicit", - explicit, - ], - check=True, - ) - assert os.path.exists(f"{testpth}/output/complex/FINER{sub}.INIT") - assert os.path.exists(f"{testpth}/output/complex/FINER{sub}.EGRID") - subprocess.run( - [ - flow, - f"{testpth}/output/complex/FINER{sub}.DATA", - f"--output-dir={testpth}/output/complex/finer", - ], - check=True, - ) - rini = ResdataFile(f"{testpth}/output/complex/finer/FINER{sub}.INIT") - rpv = np.array(rini.iget_kw("PORV")[0]) - assert abs(sum(bpv) - sum(rpv)) < 50 # ca. 4.61992e8 porv in the ref - assert sum(rpv > 0) == 22896 - rrst = ResdataFile(f"{testpth}/output/complex/finer/FINER{sub}.UNRST") - rgf = np.array(rrst.iget_kw("FIPGAS")[0]) - assert abs(sum(bgf) - sum(rgf)) < 4e5 # ca. 2.56191e10 fipgas in the ref - for i, val in enumerate( - ["diamond 0", "diamond 1", "diamondxy 3", "box [-3,2] [-1,1] [-1,2]"] - ): - sub = f"{i}{use.upper()}" - subprocess.run( - [ - "pycopm", - "-f", - flow, - "-o", - f"{testpth}/output/complex", - "-i", - f"{mainpth}/examples/decks/MODEL3.DATA", - "-v", - f"A4 {val}", - "-w", - f"SUBMODEL{sub}", - "-warnings", - "1", - "-l", - f"S{sub}", - "-p", - f"{[1,3,3,4][i]}", - "-m", - "deck_dry", - "-u", - use, - ], - check=True, - ) - assert os.path.exists(f"{testpth}/output/complex/SUBMODEL{sub}.INIT") - assert os.path.exists(f"{testpth}/output/complex/SUBMODEL{sub}.EGRID") - bini = ResdataFile(f"{testpth}/output/complex/reference/MODEL3.INIT") - cini = ResdataFile(f"{testpth}/output/complex/SUBMODEL{sub}.INIT") - bpv = np.array(bini.iget_kw("PORV")[0]) - cpv = np.array(cini.iget_kw("PORV")[0]) - assert abs(sum(bpv) - sum(cpv)) < 50 # ca. 4.61992e8 porv in the ref - assert sum(cpv > 0) == [20, 77, 731, 260][i] + assert sum(cpv > 0) == [20, 77, 731, 260][i] diff --git a/tests/test_7_transmissibilities.py b/tests/test_7_transmissibilities.py index 5621044..94da6d7 100644 --- a/tests/test_7_transmissibilities.py +++ b/tests/test_7_transmissibilities.py @@ -7,7 +7,7 @@ import os import pathlib import subprocess -from resdata.resfile import ResdataFile +from opm.io.ecl import EclFile as OpmFile testpth: pathlib.Path = pathlib.Path(__file__).parent mainpth: pathlib.Path = pathlib.Path(__file__).parents[1] @@ -29,37 +29,33 @@ def test_transmissibilities(flow): [523.75178, 706.33996, 5008.1327, 106.21933], [523.75178, 706.33996, 0, 106.21933], ] - for use in ["opm", "resdata"]: - for i, m in enumerate(["1", "2"]): - sub = use.upper() + m - subprocess.run( - [ - "pycopm", - "-f", - flow, - "-o", - f"{testpth}/output/transmissibilities", - "-i", - f"{mainpth}/examples/decks/MODEL4.DATA", - "-z", - "1:30,31:56,57:111,112:116,117:217", - "-w", - f"COARSER{sub}", - "-l", - f"C0{sub}", - "-t", - m, - "-a", - "max", - "-m", - "all", - "-u", - use, - ], - check=True, - ) - init = ResdataFile(f"{testpth}/output/transmissibilities/COARSER{sub}.INIT") - for j, n in enumerate(["X", "Y", "Z", "NNC"]): - assert ( - abs(sum(init.iget_kw(f"TRAN{n}")[0]) - values[i][j]) < 1e-2 - ), f"Issue in TRAN{n} with -u {use} -t {i}" + for i, sub in enumerate(["1", "2"]): + subprocess.run( + [ + "pycopm", + "-f", + flow, + "-o", + f"{testpth}/output/transmissibilities", + "-i", + f"{mainpth}/examples/decks/MODEL4.DATA", + "-z", + "1:30,31:56,57:111,112:116,117:217", + "-w", + f"COARSER{sub}", + "-l", + f"C0{sub}", + "-t", + sub, + "-a", + "max", + "-m", + "all", + ], + check=True, + ) + init = OpmFile(f"{testpth}/output/transmissibilities/COARSER{sub}.INIT") + for j, n in enumerate(["X", "Y", "Z", "NNC"]): + assert ( + abs(sum(init[f"TRAN{n}"]) - values[i][j]) < 1e-2 + ), f"Issue in TRAN{n} with -t {i}"