├── .gitignore ├── CMakeLists.txt ├── CMakeLists_files.cmake ├── COPYING ├── CTestConfig.cmake ├── Documentation ├── Doxylocal └── Figure │ └── .gitignore ├── README.md ├── attic ├── README.txt ├── test_cfs_tpfa.c ├── test_jacsys.cpp ├── test_lapack.cpp ├── test_read_grid.c ├── test_read_vag.cpp └── test_writeVtkData.cpp ├── debian ├── changelog ├── compat ├── control ├── copyright ├── docs ├── libopm-core1-dbg.install ├── libopm-core1-dev.install ├── libopm-core1-doc.install ├── libopm-core1.install ├── rules └── source │ └── format ├── dune.module ├── examples ├── compute_eikonal_from_files.cpp ├── compute_initial_state.cpp ├── compute_tof_from_files.cpp └── diagnose_relperm.cpp ├── jenkins ├── README.md └── build.sh ├── opm-core-prereqs.cmake ├── opm └── core │ ├── doxygen_main.hpp │ ├── flowdiagnostics │ ├── AnisotropicEikonal.cpp │ ├── AnisotropicEikonal.hpp │ ├── DGBasis.cpp │ ├── DGBasis.hpp │ ├── FlowDiagnostics.cpp │ ├── FlowDiagnostics.hpp │ ├── TofDiscGalReorder.cpp │ ├── TofDiscGalReorder.hpp │ ├── TofReorder.cpp │ └── TofReorder.hpp │ ├── linalg │ ├── LinearSolverFactory.cpp │ ├── LinearSolverFactory.hpp │ ├── LinearSolverInterface.cpp │ ├── LinearSolverInterface.hpp │ ├── LinearSolverIstl.cpp │ ├── LinearSolverIstl.hpp │ ├── LinearSolverPetsc.cpp │ ├── LinearSolverPetsc.hpp │ ├── LinearSolverUmfpack.cpp │ ├── LinearSolverUmfpack.hpp │ ├── ParallelIstlInformation.hpp │ ├── call_umfpack.c │ ├── call_umfpack.h │ ├── sparse_sys.c │ └── sparse_sys.h │ ├── opm-core-pch.hpp │ ├── pressure │ ├── CompressibleTpfa.cpp │ ├── CompressibleTpfa.hpp │ ├── FlowBCManager.cpp │ ├── FlowBCManager.hpp │ ├── IncompTpfa.cpp │ ├── IncompTpfa.hpp │ ├── IncompTpfaSinglePhase.cpp │ ├── IncompTpfaSinglePhase.hpp │ ├── flow_bc.c │ ├── flow_bc.h │ ├── legacy_well.h │ ├── mimetic │ │ ├── mimetic.c │ │ └── mimetic.h │ ├── msmfem │ │ ├── dfs.c │ │ ├── dfs.h │ │ ├── partition.c │ │ └── partition.h │ └── tpfa │ │ ├── cfs_tpfa_residual.c │ │ ├── cfs_tpfa_residual.h │ │ ├── compr_quant_general.h │ │ ├── compr_source.h │ │ ├── ifs_tpfa.c │ │ └── ifs_tpfa.h │ ├── props │ ├── BlackoilPhases.hpp │ ├── BlackoilPropertiesBasic.cpp │ ├── BlackoilPropertiesBasic.hpp │ ├── BlackoilPropertiesFromDeck.cpp │ ├── BlackoilPropertiesFromDeck.hpp │ ├── BlackoilPropertiesInterface.hpp │ ├── IncompPropertiesBasic.cpp │ ├── IncompPropertiesBasic.hpp │ ├── IncompPropertiesFromDeck.cpp │ ├── IncompPropertiesFromDeck.hpp │ ├── IncompPropertiesInterface.hpp │ ├── IncompPropertiesShadow.hpp │ ├── IncompPropertiesShadow_impl.hpp │ ├── IncompPropertiesSinglePhase.cpp │ ├── IncompPropertiesSinglePhase.hpp │ ├── phaseUsageFromDeck.hpp │ ├── pvt │ │ ├── PvtPropertiesBasic.cpp │ │ ├── PvtPropertiesBasic.hpp │ │ ├── PvtPropertiesIncompFromDeck.cpp │ │ ├── PvtPropertiesIncompFromDeck.hpp │ │ ├── ThermalGasPvtWrapper.hpp │ │ ├── ThermalOilPvtWrapper.hpp │ │ └── ThermalWaterPvtWrapper.hpp │ ├── rock │ │ ├── RockBasic.cpp │ │ ├── RockBasic.hpp │ │ ├── RockCompressibility.cpp │ │ ├── RockCompressibility.hpp │ │ ├── RockFromDeck.cpp │ │ └── RockFromDeck.hpp │ └── satfunc │ │ ├── RelpermDiagnostics.cpp │ │ ├── RelpermDiagnostics.hpp │ │ ├── RelpermDiagnostics_impl.hpp │ │ ├── SaturationPropsBasic.cpp │ │ ├── SaturationPropsBasic.hpp │ │ ├── SaturationPropsFromDeck.cpp │ │ ├── SaturationPropsFromDeck.hpp │ │ └── SaturationPropsInterface.hpp │ ├── simulator │ ├── BlackoilState.cpp │ ├── BlackoilState.hpp │ ├── BlackoilStateToFluidState.hpp │ ├── EquilibrationHelpers.hpp │ ├── ExplicitArraysFluidState.hpp │ ├── ExplicitArraysSatDerivativesFluidState.hpp │ ├── SimulatorReport.cpp │ ├── SimulatorReport.hpp │ ├── TwophaseState.cpp │ ├── TwophaseState.hpp │ ├── TwophaseState_impl.hpp │ ├── WellState.hpp │ ├── initState.hpp │ ├── initStateEquil.hpp │ ├── initStateEquil_impl.hpp │ └── initState_impl.hpp │ ├── transport │ ├── TransportSolverTwophaseInterface.cpp │ ├── TransportSolverTwophaseInterface.hpp │ └── reorder │ │ ├── ReorderSolverInterface.cpp │ │ ├── ReorderSolverInterface.hpp │ │ ├── TransportSolverCompressibleTwophaseReorder.cpp │ │ ├── TransportSolverCompressibleTwophaseReorder.hpp │ │ ├── TransportSolverTwophaseReorder.cpp │ │ ├── TransportSolverTwophaseReorder.hpp │ │ ├── reordersequence.cpp │ │ ├── reordersequence.h │ │ ├── tarjan.c │ │ └── tarjan.h │ ├── utility │ ├── initHydroCarbonState.hpp │ ├── miscUtilities.cpp │ ├── miscUtilities.hpp │ ├── miscUtilitiesBlackoil.cpp │ ├── miscUtilitiesBlackoil.hpp │ └── miscUtilities_impl.hpp │ ├── well_controls.h │ ├── wells.h │ └── wells │ ├── DynamicListEconLimited.hpp │ ├── InjectionSpecification.cpp │ ├── InjectionSpecification.hpp │ ├── ProductionSpecification.cpp │ ├── ProductionSpecification.hpp │ ├── WellCollection.cpp │ ├── WellCollection.hpp │ ├── WellsGroup.cpp │ ├── WellsGroup.hpp │ ├── WellsManager.cpp │ ├── WellsManager.hpp │ ├── WellsManager_impl.hpp │ ├── well_controls.c │ └── wells.c ├── redhat └── opm-core.spec └── tests ├── DuneIstlTestHelpers.hpp ├── capillary.DATA ├── capillarySwatinit.DATA ├── capillary_overlap.DATA ├── deadfluids.DATA ├── equil_livegas.DATA ├── equil_liveoil.DATA ├── equil_liveoil_grid.DATA ├── equil_rsvd_and_rvvd.DATA ├── liveoil.DATA ├── norne_pvt.data ├── relpermDiagnostics.DATA ├── satfuncEPSBase.DATA ├── satfuncEPS_A.DATA ├── satfuncEPS_B.DATA ├── satfuncEPS_C.DATA ├── satfuncEPS_D.DATA ├── satfuncStandard.DATA ├── testBlackoilState1.DATA ├── testBlackoilState2.DATA ├── testBlackoilState3.DATA ├── testFluid.DATA ├── testPinch1.DATA ├── test_anisotropiceikonal.cpp ├── test_blackoilstate.cpp ├── test_dgbasis.cpp ├── test_equil.cpp ├── test_flowdiagnostics.cpp ├── test_linearsolver.cpp ├── test_norne_pvt.cpp ├── test_parallel_linearsolver.cpp ├── test_parallelistlinformation.cpp ├── test_pinchprocessor.cpp ├── test_relpermdiagnostics.cpp ├── test_satfunc.cpp ├── test_shadow.cpp ├── test_stoppedwells.cpp ├── test_wellcollection.cpp ├── test_wellcontrols.cpp ├── test_wells.cpp ├── test_wellsgroup.cpp ├── test_wellsmanager.cpp ├── wells_group.data ├── wells_manager_data.data ├── wells_manager_data_expanded.data ├── wells_manager_data_wellSTOP.data ├── wells_stopped.data └── wetgas.DATA /.gitignore: -------------------------------------------------------------------------------- 1 | # editor backup files 2 | *~ 3 | .\#* 4 | \#*\# 5 | .\#*\# 6 | 7 | # compiler output 8 | *.o 9 | *.mod 10 | 11 | # libtool compatible files 12 | *.lo 13 | *.la 14 | 15 | # Eclipse project settings 16 | .cproject 17 | .project 18 | .settings/* 19 | 20 | # QtCreator project settings 21 | CMakeLists.txt.user* 22 | 23 | # in-tree build with CMake 24 | CMakeCache.txt 25 | CMakeFiles/ 26 | cmake_install.cmake 27 | config.h 28 | opm-core-config.cmake 29 | opm-core-config-version.cmake 30 | opm-core-install.cmake 31 | Makefile 32 | bin/ 33 | lib/ 34 | Doxyfile 35 | Documentation/html 36 | dune.module 37 | *.pc 38 | install_manifest.txt 39 | 40 | # testing framework 41 | CTestTestfile.cmake 42 | DartConfiguration.tcl 43 | Testing/ 44 | .DS_Store 45 | .idea 46 | build 47 | -------------------------------------------------------------------------------- /CTestConfig.cmake: -------------------------------------------------------------------------------- 1 | # this is included after opm-core_NAME is set 2 | set(CTEST_PROJECT_NAME "${${project}_NAME}") 3 | set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC") 4 | set(CTEST_DROP_METHOD "http") 5 | set(CTEST_DROP_SITE "cdash.opm-project.org") 6 | set(CTEST_DROP_LOCATION "/submit.php?project=${${project}_NAME}") 7 | set(CTEST_DROP_SITE_CDASH TRUE) 8 | -------------------------------------------------------------------------------- /Documentation/Doxylocal: -------------------------------------------------------------------------------- 1 | # The INPUT tag can be used to specify the files and/or directories that contain 2 | # documented source files. You may enter file names like "myfile.cpp" or 3 | # directories like "/usr/src/myproject". Separate the files or directories 4 | # with spaces. 5 | 6 | INPUT = @PROJECT_SOURCE_DIR@/@src_DIR@/ \ 7 | @PROJECT_SOURCE_DIR@/tutorials/ \ 8 | @PROJECT_SOURCE_DIR@/examples/ 9 | 10 | # The EXCLUDE tag can be used to specify files and/or directories that should 11 | # excluded from the INPUT source files. This way you can easily exclude a 12 | # subdirectory from a directory tree whose root is specified with the INPUT tag. 13 | 14 | EXCLUDE = @PROJECT_SOURCE_DIR@/@src_DIR@/core/utility/parameters/tinyxml 15 | 16 | # The EXAMPLE_PATH tag can be used to specify one or more files or 17 | # directories that contain example code fragments that are included (see 18 | # the \include command). 19 | 20 | EXAMPLE_PATH = @PROJECT_SOURCE_DIR@/tutorials/ 21 | 22 | # The IMAGE_PATH tag can be used to specify one or more files or 23 | # directories that contain image that are included in the documentation (see 24 | # the \image command). 25 | 26 | IMAGE_PATH = @PROJECT_SOURCE_DIR@/@doxy_dir@/Figure 27 | -------------------------------------------------------------------------------- /Documentation/Figure/.gitignore: -------------------------------------------------------------------------------- 1 | # intentionally empty -- present just to get directory created 2 | -------------------------------------------------------------------------------- /attic/README.txt: -------------------------------------------------------------------------------- 1 | These files are not actively maintained. They may not compile, run 2 | properly nor produce sensible results. In the future they may be 3 | promoted into proper examples or unit tests, or deleted. 4 | -------------------------------------------------------------------------------- /attic/test_jacsys.cpp: -------------------------------------------------------------------------------- 1 | #include "config.h" 2 | #include 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | template 10 | Ostream& 11 | operator<<(Ostream& os, const Coll& c) { 12 | typedef typename Coll::value_type VT; 13 | 14 | os << "[ "; 15 | std::copy(c.begin(), c.end(), std::ostream_iterator(os, " ")); 16 | os << "]"; 17 | 18 | return os; 19 | } 20 | 21 | #if 0 22 | int 23 | main() { 24 | std::vector a; 25 | 26 | a.push_back(0); 27 | a.push_back(1); 28 | 29 | std::cerr << "a[0] = " << a << '\n'; 30 | 31 | for (::std::size_t i = 1; i < 7; ++i) { 32 | a.reserve(2 * a.size()); 33 | a.insert(a.end(), a.begin(), a.end()); 34 | 35 | std::cerr << "a[" << i << "] = " << a << '\n'; 36 | } 37 | } 38 | #endif 39 | 40 | 41 | #if 0 42 | #include "VectorBlockAssembler.hpp" 43 | 44 | using namespace Opm::LinAlgSupport; 45 | 46 | int 47 | main() { 48 | typedef std::vector stvd; 49 | 50 | typedef AccumulationNorm OneNorm; 51 | typedef AccumulationNorm TwoNorm; 52 | typedef AccumulationNorm MaxNorm; 53 | 54 | typedef NumericVector VectorOne; 55 | typedef NumericVector VectorTwo; 56 | typedef NumericVector VectorInf; 57 | 58 | VectorOne v1; 59 | 60 | v1.resize(10, 1.0); 61 | 62 | std::cerr << v1 << '\n'; 63 | std::cerr << "Norm = " << v1.norm() << '\n'; 64 | 65 | VectorTwo v2; 66 | 67 | v2.resize(10, 1.0); 68 | 69 | std::cerr << v2 << '\n'; 70 | std::cerr << "Norm = " << v2.norm() << '\n'; 71 | 72 | VectorInf vi; 73 | 74 | vi.resize(10, 1.0); 75 | 76 | std::cerr << vi << '\n'; 77 | std::cerr << "Norm = " << vi.norm() << '\n'; 78 | } 79 | #endif 80 | 81 | #if 0 82 | #include 83 | 84 | //using namespace Opm::LinAlgSupport; 85 | using namespace Opm::ImplicitTransportDefault; 86 | 87 | int 88 | main() { 89 | typedef std::vector STVD; 90 | 91 | NewtonVectorCollection nvcoll; 92 | 93 | STVD blk(2, 1.0); 94 | 95 | nvcoll.setSize(blk.size(), 1); 96 | nvcoll.assembleBlock(blk.size(), 0, blk); 97 | 98 | std::cerr << "Residual = " << nvcoll.residual () << '\n'; 99 | std::cerr << "Increment = " << nvcoll.increment() << '\n'; 100 | std::cerr << "Solution = " << nvcoll.solution () << '\n'; 101 | } 102 | #endif 103 | 104 | #if 1 105 | #include 106 | 107 | #include 108 | #include 109 | #include 110 | 111 | using namespace Opm::ImplicitTransportDefault; 112 | 113 | int 114 | main() { 115 | typedef std::vector STVD; 116 | typedef NewtonVectorCollection NVecColl; 117 | 118 | JacobianSystem< struct CSRMatrix, NVecColl > JS; 119 | JS.setSize(1, 2, 2); 120 | std::cerr << "Residual = " << JS.vector().residual() << '\n'; 121 | 122 | std::vector conn(1); 123 | conn[0] = 0; 124 | JS.matasm().createBlockRow(0, conn, 1); 125 | 126 | double blk[] = { 1.0 }; 127 | JS.matasm().assembleBlock(1, 0, 0, blk); 128 | JS.vector().assembleBlock(1, 0, blk); 129 | 130 | conn[0] = 1; 131 | JS.matasm().createBlockRow(1, conn, 1); 132 | JS.matasm().assembleBlock(1, 1, 1, blk); 133 | JS.vector().assembleBlock(1, 1, blk); 134 | 135 | const CSRMatrix& A = JS.matrix(); 136 | csrmatrix_write_stream(&A, stderr); 137 | 138 | std::cerr << "Residual = " << JS.vector().residual() << '\n'; 139 | 140 | Opm::ImplicitTransportLinAlgSupport::CSRMatrixUmfpackSolver linsolve; 141 | 142 | std::cerr << "Increment = " << JS.vector().increment() << '\n'; 143 | linsolve.solve(A, JS.vector().residual(), 144 | JS.vector().writableIncrement()); 145 | 146 | std::cerr << "Increment = " << JS.vector().increment() << '\n'; 147 | 148 | std::cerr << "Solution = " << JS.vector().solution() << '\n'; 149 | JS.vector().addIncrement(); 150 | std::cerr << "Solution = " << JS.vector().solution() << '\n'; 151 | } 152 | #endif 153 | -------------------------------------------------------------------------------- /attic/test_read_grid.c: -------------------------------------------------------------------------------- 1 | /* 2 | * test_read_grid.c 3 | * 4 | * Created on: Aug 28, 2012 5 | * Author: bska 6 | */ 7 | #include "config.h" 8 | #include 9 | 10 | #include 11 | #include 12 | 13 | int 14 | main(void) 15 | { 16 | struct UnstructuredGrid *G1, *G2; 17 | 18 | G1 = read_grid("cart_grid_2d.txt"); 19 | G2 = create_grid_cart2d(2, 2, 1., 1.); 20 | 21 | destroy_grid(G2); 22 | destroy_grid(G1); 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /attic/test_read_vag.cpp: -------------------------------------------------------------------------------- 1 | /*=========================================================================== 2 | // 3 | // File: test_read_vag.cpp 4 | // 5 | // Created: 2012-06-08 15:44:43+0200 6 | // 7 | // Authors: Knut-Andreas Lie 8 | // Halvor M. Nilsen 9 | // Atgeirr F. Rasmussen 10 | // Xavier Raynaud 11 | // Bård Skaflestad 12 | // 13 | //==========================================================================*/ 14 | 15 | 16 | /* 17 | Copyright 2012 SINTEF ICT, Applied Mathematics. 18 | Copyright 2012 Statoil ASA. 19 | 20 | This file is part of the Open Porous Media Project (OPM). 21 | 22 | OPM is free software: you can redistribute it and/or modify 23 | it under the terms of the GNU General Public License as published by 24 | the Free Software Foundation, either version 3 of the License, or 25 | (at your option) any later version. 26 | 27 | OPM is distributed in the hope that it will be useful, 28 | but WITHOUT ANY WARRANTY; without even the implied warranty of 29 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 30 | GNU General Public License for more details. 31 | 32 | You should have received a copy of the GNU General Public License 33 | along with OPM. If not, see . 34 | */ 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | //#include "../config.h" 42 | /* test reading of vag grid format */ 43 | int main(int argc, char** argv) 44 | { 45 | using namespace std; 46 | using namespace Opm; 47 | std::string filename; 48 | if (argc == 2) { 49 | filename = argv[1]; 50 | } else { 51 | std::cout << "\nUsage: test_read_vag filename\n"; 52 | exit( 1 ); 53 | } 54 | ifstream is(filename.c_str());//"/home/hnil/heim/SVN/simmatlab/projects/clastic/utils/unstructuredgrids/data/3x3_w_layered-vag.dat"); 55 | //ifstream is("/home/hnil/heim/SVN/simmatlab/projects/clastic/utils/unstructuredgrids/data/test.txt"); 56 | //std::ofstream is(""); 57 | UnstructuredGrid *grid;// make a pointer, can it be avoided?? 58 | //{ 59 | VAG vag_grid; 60 | readVagGrid(is,vag_grid); 61 | // Size of mappings found 62 | std::cout << " faces_to_vertices " << vag_grid.faces_to_vertices.value.size() << endl; 63 | std::cout << " volumes_to_faces " << vag_grid.volumes_to_vertices.value.size() << endl; 64 | 65 | grid = allocate_grid(3, 66 | vag_grid.number_of_volumes, 67 | vag_grid.number_of_faces, 68 | vag_grid.faces_to_vertices.value.size(), 69 | vag_grid.volumes_to_faces.value.size(), 70 | vag_grid.number_of_vertices); 71 | vagToUnstructuredGrid(vag_grid,*grid); 72 | 73 | 74 | 75 | //} 76 | // { 77 | std::cout << "*************************************************************\n"; 78 | VAG vag_grid_new; 79 | unstructuredGridToVag(*grid,vag_grid_new); 80 | writeVagFormat(std::cout,vag_grid_new); 81 | // } 82 | destroy_grid(grid); 83 | 84 | } 85 | -------------------------------------------------------------------------------- /attic/test_writeVtkData.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2012 SINTEF ICT, Applied Mathematics. 3 | 4 | This file is part of the Open Porous Media project (OPM). 5 | 6 | OPM is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | OPM is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with OPM. If not, see . 18 | */ 19 | 20 | #include "config.h" 21 | #include 22 | #include 23 | #include 24 | 25 | int main() 26 | { 27 | std::array dims = {{ 2, 2, 2 }}; 28 | std::array cell_size = {{ 1.0, 2.0, 3.0 }}; 29 | Opm::DataMap m; 30 | double foov[8] = { 1, 2, 3, 4, 5, 6, 7, 8 }; 31 | std::vector foo(foov, foov + sizeof foov/sizeof foov[0]); 32 | m["foo"] = &foo; 33 | double barv[16] = { 1, 10, 2, 20, 3, 30, 4, 40, 5, 50, 6, 60, 7, 70, 8, 80 }; 34 | std::vector bar(barv, barv + sizeof barv/sizeof barv[0]); 35 | m["bar"] = &bar; 36 | std::ofstream os("testoutput.vtk"); 37 | Opm::writeVtkData(dims, cell_size, m, os); 38 | } 39 | -------------------------------------------------------------------------------- /debian/changelog: -------------------------------------------------------------------------------- 1 | opm-core (2013.10-2~precise) precise; urgency=low 2 | 3 | * New release 4 | 5 | -- Arne Morten Kvarving Tue, 22 Oct 2013 12:22:29 +0200 6 | 7 | opm-core (2013.03-2) precise; urgency=low 8 | 9 | * Now compatible with precise + launchpad 10 | 11 | -- Arne Morten Kvarving Wed, 03 Apr 2013 12:27:52 +0200 12 | 13 | opm-core (2013.03-1) precise; urgency=low 14 | 15 | * Initial release 16 | 17 | -- Arne Morten Kvarving Mon, 14 Jan 2013 15:33:54 +0100 18 | -------------------------------------------------------------------------------- /debian/compat: -------------------------------------------------------------------------------- 1 | 9 2 | -------------------------------------------------------------------------------- /debian/control: -------------------------------------------------------------------------------- 1 | Source: opm-core 2 | Priority: extra 3 | Maintainer: Arne Morten Kvarving 4 | Build-Depends: build-essential, debhelper (>= 9), libboost-filesystem-dev, 5 | libboost-system-dev, libboost-date-time-dev, libboost-test-dev, 6 | libsuperlu3-dev (>= 3.0) | libsuperlu-dev (>= 4.3), gfortran, libsuitesparse-dev, pkg-config, 7 | libdune-common-dev, libdune-istl-dev, cmake, libtinyxml-dev, bc, 8 | libecl-dev, git, zlib1g-dev, libtool, doxygen, libopm-parser-dev, 9 | libopm-material-dev, texlive-latex-extra, texlive-latex-recommended, 10 | ghostscript, libboost-iostreams-dev, libopm-common-dev, 11 | libopm-material-dev, libopenmpi-dev, mpi-default-bin, 12 | libtrilinos-zoltan-dev, libopm-output-dev, 13 | libopm-grid-dev, libdune-geometry-dev, libdune-grid-dev 14 | Standards-Version: 3.9.2 15 | Section: libs 16 | Homepage: http://opm-project.org 17 | Vcs-Git: git://github.com/OPM/opm-core.git 18 | Vcs-Browser: https://github.com/OPM/opm-core 19 | 20 | Package: libopm-core1-dev 21 | Section: libdevel 22 | Architecture: any 23 | Multi-Arch: foreign 24 | Depends: libopm-core1 (= ${binary:Version}), libdune-istl-dev 25 | Provides: libopm-core-dev 26 | Suggests: libopm-core1-doc 27 | Description: OPM core library -- development files 28 | The OPM core library is the core library within OPM and contains 29 | * Eclipse deck input and preprosessing 30 | * Fluid properties (basic PVT models and rock properties) 31 | * Grid handling (cornerpoint grids, unstructured grid interface) 32 | * Linear Algebra (interface to different linear solvers) 33 | * Pressure solvers (various discretization schemes, flow models) 34 | * Simulators (some basic examples of simulators based on sequential splitting schemes) 35 | * Transport solvers (various discretization schemes, flow models) 36 | * Utilities (input and output processing, unit conversion) 37 | * Wells (basic well handling) 38 | 39 | Package: libopm-core1 40 | Section: libs 41 | Pre-Depends: ${misc:Pre-Depends}, multiarch-support 42 | Architecture: any 43 | Multi-Arch: same 44 | Depends: ${shlibs:Depends}, ${misc:Depends} 45 | Provides: libopm-core 46 | Description: OPM core library 47 | The OPM core library is the core library within OPM and contains 48 | * Eclipse deck input and preprosessing 49 | * Fluid properties (basic PVT models and rock properties) 50 | * Grid handling (cornerpoint grids, unstructured grid interface) 51 | * Linear Algebra (interface to different linear solvers) 52 | * Pressure solvers (various discretization schemes, flow models) 53 | * Simulators (some basic examples of simulators based on sequential splitting schemes) 54 | * Transport solvers (various discretization schemes, flow models) 55 | * Utilities (input and output processing, unit conversion) 56 | * Wells (basic well handling) 57 | 58 | Package: libopm-core1-doc 59 | Section: doc 60 | Architecture: all 61 | Multi-Arch: foreign 62 | Provides: libopm-core-doc 63 | Description: OPM core library -- documentation 64 | The OPM core library is the core library within OPM and contains 65 | * Eclipse deck input and preprosessing 66 | * Fluid properties (basic PVT models and rock properties) 67 | * Grid handling (cornerpoint grids, unstructured grid interface) 68 | * Linear Algebra (interface to different linear solvers) 69 | * Pressure solvers (various discretization schemes, flow models) 70 | * Simulators (some basic examples of simulators based on sequential splitting schemes) 71 | * Transport solvers (various discretization schemes, flow models) 72 | * Utilities (input and output processing, unit conversion) 73 | * Wells (basic well handling) 74 | 75 | Package: libopm-core1-dbg 76 | Section: debug 77 | Architecture: any 78 | Multi-Arch: foreign 79 | Provides: libopm-core-dbg 80 | Depends: libopm-core1 (= ${binary:Version}), ${misc:Depends} 81 | Description: OPM core library -- debug symbols 82 | The OPM core library is the core library within OPM and contains 83 | * Eclipse deck input and preprosessing 84 | * Fluid properties (basic PVT models and rock properties) 85 | * Grid handling (cornerpoint grids, unstructured grid interface) 86 | * Linear Algebra (interface to different linear solvers) 87 | * Pressure solvers (various discretization schemes, flow models) 88 | * Simulators (some basic examples of simulators based on sequential splitting schemes) 89 | * Transport solvers (various discretization schemes, flow models) 90 | * Utilities (input and output processing, unit conversion) 91 | * Wells (basic well handling) 92 | -------------------------------------------------------------------------------- /debian/copyright: -------------------------------------------------------------------------------- 1 | License: GPL-3+ 2 | This package is free software; you can redistribute it and/or modify 3 | it under the terms of the GNU General Public License as published by 4 | the Free Software Foundation; either version 3 of the License, or 5 | (at your option) any later version. 6 | 7 | This package is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | 12 | You should have received a copy of the GNU General Public License 13 | along with this program. If not, see 14 | -------------------------------------------------------------------------------- /debian/docs: -------------------------------------------------------------------------------- 1 | README.md 2 | COPYING 3 | -------------------------------------------------------------------------------- /debian/libopm-core1-dbg.install: -------------------------------------------------------------------------------- 1 | usr/lib/debug/usr/lib/*/libopmcore*.debug 2 | -------------------------------------------------------------------------------- /debian/libopm-core1-dev.install: -------------------------------------------------------------------------------- 1 | usr/include/* 2 | usr/lib/*/lib*.so 3 | usr/lib/dunecontrol/* 4 | usr/lib/*/pkgconfig/* 5 | usr/share/cmake/* 6 | usr/share/opm/cmake/Modules/* 7 | -------------------------------------------------------------------------------- /debian/libopm-core1-doc.install: -------------------------------------------------------------------------------- 1 | usr/share/doc/* 2 | -------------------------------------------------------------------------------- /debian/libopm-core1.install: -------------------------------------------------------------------------------- 1 | usr/lib/*/lib*.so.* 2 | -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # -*- makefile -*- 3 | # Sample debian/rules that uses debhelper. 4 | # This file was originally written by Joey Hess and Craig Small. 5 | # As a special exception, when this file is copied by dh-make into a 6 | # dh-make output file, you may use that output file without restriction. 7 | # This special exception was added by Craig Small in version 0.37 of dh-make. 8 | 9 | # Uncomment this to turn on verbose mode. 10 | #export DH_VERBOSE=1 11 | export OMPI_MCA_plm_rsh_agent=/bin/false 12 | 13 | %: 14 | dh $@ 15 | 16 | override_dh_auto_clean: 17 | dh_auto_clean --buildsystem=cmake 18 | 19 | override_dh_auto_build: 20 | dh_auto_build --buildsystem=cmake 21 | 22 | # consider using -DUSE_VERSIONED_DIR=ON if backporting 23 | override_dh_auto_configure: 24 | dh_auto_configure --buildsystem=cmake -- -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUSE_MPI=1 -DSTRIP_DEBUGGING_SYMBOLS=ON -DBUILD_SHARED_LIBS=1 -DCMAKE_INSTALL_DOCDIR=share/doc/libopm-core1 -DWHOLE_PROG_OPTIM=ON -DUSE_RUNPATH=OFF -DWITH_NATIVE=OFF 25 | 26 | override_dh_auto_install: 27 | dh_auto_install -- install-html 28 | 29 | override_dh_installdocs: 30 | dh_installdocs --link-doc=libopm-core1 31 | -------------------------------------------------------------------------------- /debian/source/format: -------------------------------------------------------------------------------- 1 | 1.0 2 | -------------------------------------------------------------------------------- /dune.module: -------------------------------------------------------------------------------- 1 | #################################################################### 2 | # Dune module information file: This file gets parsed by dunecontrol 3 | # and by the CMake build scripts. 4 | #################################################################### 5 | 6 | Module: opm-core 7 | Description: Open Porous Media Initiative Core Library 8 | Version: 2018.04-pre 9 | Label: 2018.04-pre 10 | Maintainer: atgeirr@sintef.no 11 | MaintainerName: Atgeirr F. Rasmussen 12 | Url: http://opm-project.org 13 | Depends: dune-common (>= 2.4) dune-istl (>= 2.4) opm-common opm-parser opm-grid opm-output opm-material 14 | -------------------------------------------------------------------------------- /examples/diagnose_relperm.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Statoil ASA. 3 | 4 | This file is part of the Open Porous Media project (OPM). 5 | 6 | OPM is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | OPM is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with OPM. If not, see . 18 | */ 19 | 20 | 21 | 22 | #ifdef HAVE_CONFIG_H 23 | #include "config.h" 24 | #endif // HAVE_CONFIG_H 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | #include 49 | 50 | 51 | void usage() { 52 | std::cout << std::endl << 53 | "Usage: diagnose_relperm " << std::endl; 54 | } 55 | 56 | 57 | // ----------------- Main program ----------------- 58 | int 59 | main(int argc, char** argv) 60 | try 61 | { 62 | using namespace Opm; 63 | if (argc <= 1) { 64 | usage(); 65 | exit(1); 66 | } 67 | const char* eclipseFilename = argv[1]; 68 | Parser parser; 69 | Opm::ParseContext parseContext({{ ParseContext::PARSE_RANDOM_SLASH , InputError::IGNORE }, 70 | { ParseContext::PARSE_UNKNOWN_KEYWORD, InputError::IGNORE}, 71 | { ParseContext::PARSE_RANDOM_TEXT, InputError::IGNORE}, 72 | { ParseContext::UNSUPPORTED_SCHEDULE_GEO_MODIFIER, InputError::IGNORE}, 73 | { ParseContext::UNSUPPORTED_COMPORD_TYPE, InputError::IGNORE}, 74 | { ParseContext::UNSUPPORTED_INITIAL_THPRES, InputError::IGNORE}, 75 | { ParseContext::INTERNAL_ERROR_UNINITIALIZED_THPRES, InputError::IGNORE} 76 | }); 77 | Opm::Deck deck = parser.parseFile(eclipseFilename, parseContext); 78 | Opm::EclipseState eclState( deck, parseContext ); 79 | 80 | GridManager gm(eclState.getInputGrid()); 81 | const UnstructuredGrid& grid = *gm.c_grid(); 82 | using boost::filesystem::path; 83 | path fpath(eclipseFilename); 84 | std::string baseName; 85 | if (boost::to_upper_copy(path(fpath.extension()).string())== ".DATA") { 86 | baseName = path(fpath.stem()).string(); 87 | } else { 88 | baseName = path(fpath.filename()).string(); 89 | } 90 | 91 | std::string logFile = baseName + ".SATFUNCLOG"; 92 | std::shared_ptr prtLog = std::make_shared(logFile, Log::DefaultMessageTypes); 93 | OpmLog::addBackend( "ECLIPSEPRTLOG" , prtLog ); 94 | prtLog->setMessageFormatter(std::make_shared(true, false)); 95 | std::shared_ptr streamLog = std::make_shared(std::cout, Log::DefaultMessageTypes); 96 | OpmLog::addBackend( "STREAMLOG" , streamLog ); 97 | streamLog->setMessageLimiter(std::make_shared(10)); 98 | streamLog->setMessageFormatter(std::make_shared(true, true)); 99 | RelpermDiagnostics diagnostic; 100 | diagnostic.diagnosis(eclState, deck, grid); 101 | } 102 | catch (const std::exception &e) { 103 | std::cerr << "Program threw an exception: " << e.what() << "\n"; 104 | throw; 105 | } 106 | -------------------------------------------------------------------------------- /jenkins/README.md: -------------------------------------------------------------------------------- 1 | # opm-core jenkins build scripts: 2 | 3 | **build.sh**: 4 | This script will build dependencies, then build opm-core and execute its tests. 5 | It also inspects the $ghbPrBuildComment environmental variable and builds 6 | downstreams if requested. It inspects the $ghbPrBuildComment 7 | environmental variable to obtain a pull request to use for the modules. 8 | 9 | It is intended for pre-merge builds of pull requests. 10 | 11 | To specify a given pull request to use for upstreams and downstreams, 12 | trigger line needs to contain <module-name>=<pull request number>. 13 | 14 | To build with downstreams the trigger line needs to contain 'with downstreams'. 15 | -------------------------------------------------------------------------------- /jenkins/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | declare -a upstreams 4 | upstreams=(opm-common 5 | libecl 6 | opm-parser 7 | opm-material 8 | opm-output 9 | opm-grid) 10 | 11 | declare -A upstreamRev 12 | upstreamRev[opm-common]=master 13 | upstreamRev[libecl]=master 14 | upstreamRev[opm-parser]=master 15 | upstreamRev[opm-material]=master 16 | upstreamRev[opm-output]=master 17 | upstreamRev[opm-grid]=master 18 | 19 | if grep -q "opm-common=" <<< $ghprbCommentBody 20 | then 21 | upstreamRev[opm-common]=pull/`echo $ghprbCommentBody | sed -r 's/.*opm-common=([0-9]+).*/\1/g'`/merge 22 | fi 23 | 24 | # Downstream revisions 25 | declare -a downstreams 26 | downstreams=(ewoms 27 | opm-simulators 28 | opm-upscaling) 29 | 30 | declare -A downstreamRev 31 | downstreamRev[ewoms]=master 32 | downstreamRev[opm-simulators]=master 33 | downstreamRev[opm-upscaling]=master 34 | 35 | # Clone opm-common 36 | pushd . 37 | mkdir -p $WORKSPACE/deps/opm-common 38 | cd $WORKSPACE/deps/opm-common 39 | git init . 40 | git remote add origin https://github.com/OPM/opm-common 41 | git fetch --depth 1 origin ${upstreamRev[opm-common]}:branch_to_build 42 | test $? -eq 0 || exit 1 43 | git checkout branch_to_build 44 | popd 45 | 46 | source $WORKSPACE/deps/opm-common/jenkins/build-opm-module.sh 47 | 48 | parseRevisions 49 | printHeader opm-core 50 | 51 | # Setup opm-data 52 | if grep -q "with downstreams" <<< $ghprbCommentBody 53 | then 54 | source $WORKSPACE/deps/opm-common/jenkins/setup-opm-data.sh 55 | fi 56 | 57 | build_module_full opm-core 58 | -------------------------------------------------------------------------------- /opm-core-prereqs.cmake: -------------------------------------------------------------------------------- 1 | # defines that must be present in config.h for our headers 2 | set (opm-core_CONFIG_VAR 3 | HAVE_ERT 4 | HAVE_SUITESPARSE_UMFPACK_H 5 | HAVE_DUNE_ISTL 6 | HAVE_MPI 7 | HAVE_PETSC 8 | DUNE_ISTL_VERSION_MAJOR 9 | DUNE_ISTL_VERSION_MINOR 10 | DUNE_ISTL_VERSION_REVISION 11 | ) 12 | 13 | # dependencies 14 | set (opm-core_DEPS 15 | # compile with C99 support if available 16 | "C99" 17 | # compile with C++0x/11 support if available 18 | "CXX11Features REQUIRED" 19 | # various runtime library enhancements 20 | "Boost 1.44.0 21 | COMPONENTS date_time filesystem system unit_test_framework REQUIRED" 22 | # matrix library 23 | "BLAS REQUIRED" 24 | "LAPACK REQUIRED" 25 | # Tim Davis' SuiteSparse archive 26 | "SuiteSparse COMPONENTS umfpack" 27 | # solver 28 | "SuperLU" 29 | # Eclipse I/O tools 30 | "ecl REQUIRED" 31 | # Look for MPI support 32 | "MPI" 33 | # PETSc numerical backend 34 | "PETSc" 35 | # DUNE dependency 36 | "dune-common" 37 | "dune-istl" 38 | "opm-common REQUIRED" 39 | # Parser library for ECL-type simulation models 40 | "opm-parser REQUIRED" 41 | # the code which implements the material laws 42 | "opm-material REQUIRED" 43 | # the code which implements the output routines 44 | "opm-output REQUIRED" 45 | # the code which implements grids 46 | "opm-grid REQUIRED" 47 | ) 48 | 49 | find_package_deps(opm-core) 50 | -------------------------------------------------------------------------------- /opm/core/flowdiagnostics/AnisotropicEikonal.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2014 SINTEF ICT, Applied Mathematics. 3 | 4 | This file is part of the Open Porous Media project (OPM). 5 | 6 | OPM is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | OPM is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with OPM. If not, see . 18 | */ 19 | 20 | #ifndef OPM_ANISOTROPICEIKONAL_HEADER_INCLUDED 21 | #define OPM_ANISOTROPICEIKONAL_HEADER_INCLUDED 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | #include 29 | 30 | #include 31 | 32 | #define BOOST_HEAP_AVAILABLE ((BOOST_VERSION / 100 % 1000) >= 49) 33 | 34 | #if BOOST_HEAP_AVAILABLE 35 | #include 36 | #endif 37 | 38 | #include 39 | 40 | 41 | struct UnstructuredGrid; 42 | 43 | namespace Opm 44 | { 45 | /// A solver for the anisotropic eikonal equation: 46 | /// \f[ || \nabla u^T M^{-1}(x) \nabla u || = 1 \qquad x \in \Omega \f] 47 | /// where M(x) is a symmetric positive definite matrix. 48 | /// The boundary conditions are assumed to be 49 | /// \f[ u(x) = 0 \qquad x \in \partial\Omega \f]. 50 | class AnisotropicEikonal2d 51 | { 52 | public: 53 | /// Construct solver. 54 | /// \param[in] grid A 2d grid. 55 | explicit AnisotropicEikonal2d(const UnstructuredGrid& grid); 56 | 57 | /// Solve the eikonal equation. 58 | /// \param[in] metric Array of metric tensors, M, for each cell. 59 | /// \param[in] startcells Array of cells where u = 0 at the centroid. 60 | /// \param[out] solution Array of solution to the eikonal equation. 61 | void solve(const double* metric, 62 | const std::vector& startcells, 63 | std::vector& solution); 64 | private: 65 | #if BOOST_HEAP_AVAILABLE 66 | // Grid and topology. 67 | const UnstructuredGrid& grid_; 68 | SparseTable cell_neighbours_; 69 | 70 | // Keep track of accepted cells. 71 | std::vector is_accepted_; 72 | std::set accepted_front_; 73 | 74 | // Quantities relating to anisotropy. 75 | std::vector grid_radius_; 76 | std::vector aniso_ratio_; 77 | const double safety_factor_; 78 | 79 | // Keep track of considered cells. 80 | typedef std::pair ValueAndCell; 81 | typedef boost::heap::compare> Comparator; 82 | typedef boost::heap::fibonacci_heap Heap; 83 | Heap considered_; 84 | typedef Heap::handle_type HeapHandle; 85 | std::map considered_handles_; 86 | std::vector is_considered_; 87 | 88 | bool isClose(const int c1, const int c2) const; 89 | double computeValue(const int cell, const double* metric, const double* solution) const; 90 | double computeValueUpdate(const int cell, const double* metric, const double* solution, const int new_cell) const; 91 | double computeFromLine(const int cell, const int from, const double* metric, const double* solution) const; 92 | double computeFromTri(const int cell, const int n0, const int n1, const double* metric, const double* solution) const; 93 | 94 | const ValueAndCell& topConsidered() const; 95 | void pushConsidered(const ValueAndCell& vc); 96 | void popConsidered(); 97 | 98 | void computeGridRadius(); 99 | void computeAnisoRatio(const double* metric); 100 | #endif // BOOST_HEAP_AVAILABLE 101 | }; 102 | 103 | } // namespace Opm 104 | 105 | 106 | #endif // OPM_ANISOTROPICEIKONAL_HEADER_INCLUDED 107 | -------------------------------------------------------------------------------- /opm/core/linalg/LinearSolverFactory.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2012 SINTEF ICT, Applied Mathematics. 3 | 4 | This file is part of the Open Porous Media project (OPM). 5 | 6 | OPM is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | OPM is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with OPM. If not, see . 18 | */ 19 | 20 | #ifdef HAVE_CONFIG_H 21 | #include "config.h" 22 | #endif 23 | 24 | #include 25 | 26 | #if HAVE_SUITESPARSE_UMFPACK_H 27 | #include 28 | #endif 29 | 30 | #if HAVE_DUNE_ISTL 31 | #include 32 | #endif 33 | 34 | #if HAVE_PETSC 35 | #include 36 | #endif 37 | 38 | #include 39 | #include 40 | #include 41 | 42 | 43 | namespace Opm 44 | { 45 | 46 | LinearSolverFactory::LinearSolverFactory() 47 | { 48 | #if HAVE_SUITESPARSE_UMFPACK_H 49 | solver_.reset(new LinearSolverUmfpack); 50 | #elif HAVE_DUNE_ISTL 51 | solver_.reset(new LinearSolverIstl); 52 | #elif HAVE_PETSC 53 | solver_.reset(new LinearSolverPetsc); 54 | #else 55 | OPM_THROW(std::runtime_error, "No linear solver available, you must have UMFPACK , dune-istl or Petsc installed to use LinearSolverFactory."); 56 | #endif 57 | } 58 | 59 | 60 | 61 | 62 | LinearSolverFactory::LinearSolverFactory(const ParameterGroup& param) 63 | { 64 | #if HAVE_SUITESPARSE_UMFPACK_H 65 | std::string default_solver = "umfpack"; 66 | #elif HAVE_DUNE_ISTL 67 | std::string default_solver = "istl"; 68 | #elif HAVE_PETSC 69 | std::string default_solver = "petsc"; 70 | #else 71 | std::string default_solver = "no_solver_available"; 72 | OPM_THROW(std::runtime_error, "No linear solver available, you must have UMFPACK , dune-istl or Petsc installed to use LinearSolverFactory."); 73 | #endif 74 | 75 | const std::string ls = 76 | param.getDefault("linsolver", default_solver); 77 | 78 | if (ls == "umfpack") { 79 | #if HAVE_SUITESPARSE_UMFPACK_H 80 | solver_.reset(new LinearSolverUmfpack); 81 | #endif 82 | } 83 | 84 | else if (ls == "istl") { 85 | #if HAVE_DUNE_ISTL 86 | solver_.reset(new LinearSolverIstl(param)); 87 | #endif 88 | } 89 | else if (ls == "petsc"){ 90 | #if HAVE_PETSC 91 | solver_.reset(new LinearSolverPetsc(param)); 92 | #endif 93 | } 94 | 95 | else { 96 | OPM_THROW(std::runtime_error, "Linear solver " << ls << " is unknown."); 97 | } 98 | 99 | if (! solver_) { 100 | OPM_THROW(std::runtime_error, "Linear solver " << ls << " is not enabled in " 101 | "this configuration."); 102 | } 103 | } 104 | 105 | 106 | 107 | 108 | LinearSolverFactory::~LinearSolverFactory() 109 | { 110 | } 111 | 112 | 113 | 114 | 115 | LinearSolverInterface::LinearSolverReport 116 | LinearSolverFactory::solve(const int size, 117 | const int nonzeros, 118 | const int* ia, 119 | const int* ja, 120 | const double* sa, 121 | const double* rhs, 122 | double* solution, 123 | const boost::any& add) const 124 | { 125 | return solver_->solve(size, nonzeros, ia, ja, sa, rhs, solution, add); 126 | } 127 | 128 | void LinearSolverFactory::setTolerance(const double tol) 129 | { 130 | solver_->setTolerance(tol); 131 | } 132 | 133 | double LinearSolverFactory::getTolerance() const 134 | { 135 | return solver_->getTolerance(); 136 | } 137 | 138 | 139 | 140 | } // namespace Opm 141 | 142 | -------------------------------------------------------------------------------- /opm/core/linalg/LinearSolverInterface.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2012 SINTEF ICT, Applied Mathematics. 3 | 4 | This file is part of the Open Porous Media project (OPM). 5 | 6 | OPM is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | OPM is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with OPM. If not, see . 18 | */ 19 | 20 | 21 | #include "config.h" 22 | #include 23 | #include 24 | #include 25 | 26 | namespace Opm 27 | { 28 | 29 | LinearSolverInterface::~LinearSolverInterface() 30 | { 31 | } 32 | 33 | 34 | 35 | 36 | LinearSolverInterface::LinearSolverReport 37 | LinearSolverInterface::solve(const CSRMatrix* A, 38 | const double* rhs, 39 | double* solution) const 40 | { 41 | return solve(A->m, A->nnz, A->ia, A->ja, A->sa, rhs, solution); 42 | } 43 | 44 | } // namespace Opm 45 | 46 | -------------------------------------------------------------------------------- /opm/core/linalg/LinearSolverInterface.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2012 SINTEF ICT, Applied Mathematics. 3 | 4 | This file is part of the Open Porous Media project (OPM). 5 | 6 | OPM is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | OPM is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with OPM. If not, see . 18 | */ 19 | 20 | #ifndef OPM_LINEARSOLVERINTERFACE_HEADER_INCLUDED 21 | #define OPM_LINEARSOLVERINTERFACE_HEADER_INCLUDED 22 | 23 | #include 24 | 25 | struct CSRMatrix; 26 | 27 | namespace Opm 28 | { 29 | 30 | 31 | /// Abstract interface for linear solvers. 32 | class LinearSolverInterface 33 | { 34 | public: 35 | /// Virtual destructor. 36 | virtual ~LinearSolverInterface(); 37 | 38 | /// Struct for reporting data about the solution process back 39 | /// to the caller. The only field that is mandatory to set is 40 | /// 'converged' (even for direct solvers) to indicate success. 41 | struct LinearSolverReport 42 | { 43 | bool converged; 44 | int iterations; 45 | double residual_reduction; 46 | }; 47 | 48 | /// Solve a linear system, with a matrix given in compressed sparse row format. 49 | /// \param[in] A matrix in CSR format 50 | /// \param[in] rhs array of length A->m containing the right hand side 51 | /// \param[inout] solution array of length A->m to which the solution will be written, may also be used 52 | /// as initial guess by iterative solvers. 53 | /// Note: this method is a convenience method that calls the virtual solve() method. 54 | LinearSolverReport solve(const CSRMatrix* A, 55 | const double* rhs, 56 | double* solution) const; 57 | 58 | /// Solve a linear system, with a matrix given in compressed sparse row format. 59 | /// \param[in] size # of rows in matrix 60 | /// \param[in] nonzeros # of nonzeros elements in matrix 61 | /// \param[in] ia array of length (size + 1) containing start and end indices for each row 62 | /// \param[in] ja array of length nonzeros containing column numbers for the nonzero elements 63 | /// \param[in] sa array of length nonzeros containing the values of the nonzero elements 64 | /// \param[in] rhs array of length size containing the right hand side 65 | /// \param[inout] solution array of length size to which the solution will be written, may also be used 66 | /// as initial guess by iterative solvers. 67 | virtual LinearSolverReport solve(const int size, 68 | const int nonzeros, 69 | const int* ia, 70 | const int* ja, 71 | const double* sa, 72 | const double* rhs, 73 | double* solution, 74 | const boost::any& add=boost::any()) const = 0; 75 | 76 | /// Set tolerance for the linear solver. 77 | /// \param[in] tol tolerance value 78 | virtual void setTolerance(const double tol) = 0; 79 | 80 | /// Get tolerance for the linear solver. 81 | /// \param[out] tolerance value 82 | virtual double getTolerance() const = 0; 83 | 84 | }; 85 | 86 | 87 | } // namespace Opm 88 | 89 | 90 | 91 | #endif // OPM_LINEARSOLVERINTERFACE_HEADER_INCLUDED 92 | -------------------------------------------------------------------------------- /opm/core/linalg/LinearSolverPetsc.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2014 SINTEF ICT, Applied Mathematics. 3 | Copyright 2014 STATOIL ASA. 4 | 5 | This file is part of the Open Porous Media project (OPM). 6 | 7 | OPM is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | OPM is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with OPM. If not, see . 19 | */ 20 | 21 | #ifndef OPM_LINEARSOLVERPETSC_HEADER_INCLUDED 22 | #define OPM_LINEARSOLVERPETSC_HEADER_INCLUDED 23 | 24 | #if !HAVE_PETSC 25 | #error "LinearSolverPetsc.hpp included, but the PETSc libraries are not available!" 26 | #endif 27 | 28 | #include 29 | #include 30 | #include 31 | 32 | namespace Opm 33 | { 34 | 35 | 36 | /// Concrete class encapsulating some Petsc linear solvers. 37 | class LinearSolverPetsc : public LinearSolverInterface 38 | { 39 | public: 40 | /// Default constructor. 41 | /// Declared, but not implemented. Petsc can only be created through 42 | /// the ParameterGroup constructor, everything else is an error. This way 43 | /// the error is caught compile time and not rune time, which is nice as 44 | /// it is a static error. 45 | LinearSolverPetsc(); 46 | 47 | /// Construct from parameters 48 | /// Accepted parameters are, with defaults, listed in the 49 | /// default constructor. 50 | LinearSolverPetsc(const ParameterGroup& param); 51 | 52 | /// Destructor. 53 | virtual ~LinearSolverPetsc(); 54 | 55 | using LinearSolverInterface::solve; 56 | 57 | /// Solve a linear system, with a matrix given in compressed sparse row format. 58 | /// \param[in] size # of rows in matrix 59 | /// \param[in] nonzeros # of nonzeros elements in matrix 60 | /// \param[in] ia array of length (size + 1) containing start and end indices for each row 61 | /// \param[in] ja array of length nonzeros containing column numbers for the nonzero elements 62 | /// \param[in] sa array of length nonzeros containing the values of the nonzero elements 63 | /// \param[in] rhs array of length size containing the right hand side 64 | /// \param[inout] solution array of length size to which the solution will be written, may also be used 65 | /// as initial guess by iterative solvers. 66 | virtual LinearSolverReport solve(const int size, 67 | const int nonzeros, 68 | const int* ia, 69 | const int* ja, 70 | const double* sa, 71 | const double* rhs, 72 | double* solution, 73 | const boost::any&) const; 74 | 75 | /// Set tolerance for the residual in dune istl linear solver. 76 | /// \param[in] tol tolerance value 77 | virtual void setTolerance(const double tol); 78 | 79 | /// Get tolerance ofthe linear solver. 80 | /// \param[out] tolerance value 81 | virtual double getTolerance() const; 82 | private: 83 | std::string ksp_type_; 84 | std::string pc_type_; 85 | int ksp_view_; 86 | double rtol_; 87 | double atol_; 88 | double dtol_; 89 | int maxits_; 90 | }; 91 | 92 | 93 | } // namespace Opm 94 | 95 | 96 | 97 | #endif // OPM_LINEARSOLVERPETSC_HEADER_INCLUDED 98 | -------------------------------------------------------------------------------- /opm/core/linalg/LinearSolverUmfpack.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2012 SINTEF ICT, Applied Mathematics. 3 | 4 | This file is part of the Open Porous Media project (OPM). 5 | 6 | OPM is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | OPM is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with OPM. If not, see . 18 | */ 19 | 20 | #include "config.h" 21 | #include 22 | #include 23 | #include 24 | 25 | namespace Opm 26 | { 27 | 28 | LinearSolverUmfpack::LinearSolverUmfpack() 29 | { 30 | } 31 | 32 | 33 | 34 | 35 | LinearSolverUmfpack::~LinearSolverUmfpack() 36 | { 37 | } 38 | 39 | 40 | 41 | 42 | LinearSolverInterface::LinearSolverReport 43 | LinearSolverUmfpack::solve(const int size, 44 | const int nonzeros, 45 | const int* ia, 46 | const int* ja, 47 | const double* sa, 48 | const double* rhs, 49 | double* solution, 50 | const boost::any&) const 51 | { 52 | CSRMatrix A = { 53 | (size_t)size, 54 | (size_t)nonzeros, 55 | const_cast(ia), 56 | const_cast(ja), 57 | const_cast(sa) 58 | }; 59 | call_UMFPACK(&A, rhs, solution); 60 | LinearSolverReport rep = {}; 61 | rep.converged = true; 62 | return rep; 63 | } 64 | 65 | void LinearSolverUmfpack::setTolerance(const double /*tol*/) 66 | { 67 | } 68 | 69 | double LinearSolverUmfpack::getTolerance() const 70 | { 71 | return -1.; 72 | } 73 | 74 | 75 | } // namespace Opm 76 | 77 | -------------------------------------------------------------------------------- /opm/core/linalg/LinearSolverUmfpack.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2012 SINTEF ICT, Applied Mathematics. 3 | 4 | This file is part of the Open Porous Media project (OPM). 5 | 6 | OPM is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | OPM is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with OPM. If not, see . 18 | */ 19 | 20 | #ifndef OPM_LINEARSOLVERUMFPACK_HEADER_INCLUDED 21 | #define OPM_LINEARSOLVERUMFPACK_HEADER_INCLUDED 22 | 23 | 24 | #include 25 | 26 | 27 | namespace Opm 28 | { 29 | 30 | 31 | /// Concrete class encapsulating the UMFPACK direct linear solver. 32 | class LinearSolverUmfpack : public LinearSolverInterface 33 | { 34 | public: 35 | /// Default constructor. 36 | LinearSolverUmfpack(); 37 | 38 | /// Destructor. 39 | virtual ~LinearSolverUmfpack(); 40 | 41 | using LinearSolverInterface::solve; 42 | 43 | /// Solve a linear system, with a matrix given in compressed sparse row format. 44 | /// \param[in] size # of rows in matrix 45 | /// \param[in] nonzeros # of nonzeros elements in matrix 46 | /// \param[in] ia array of length (size + 1) containing start and end indices for each row 47 | /// \param[in] ja array of length nonzeros containing column numbers for the nonzero elements 48 | /// \param[in] sa array of length nonzeros containing the values of the nonzero elements 49 | /// \param[in] rhs array of length size containing the right hand side 50 | /// \param[inout] solution array of length size to which the solution will be written, may also be used 51 | /// as initial guess by iterative solvers. 52 | virtual LinearSolverReport solve(const int size, 53 | const int nonzeros, 54 | const int* ia, 55 | const int* ja, 56 | const double* sa, 57 | const double* rhs, 58 | double* solution, 59 | const boost::any& add=boost::any()) const; 60 | 61 | /// Set tolerance for the linear solver. 62 | /// \param[in] tol tolerance value 63 | /// Not used for UMFPACK solver. 64 | virtual void setTolerance(const double /*tol*/); 65 | 66 | /// Get tolerance for the linear solver. 67 | /// \param[out] tolerance value 68 | /// Not used for UMFPACK solver. Returns -1. 69 | virtual double getTolerance() const; 70 | 71 | 72 | }; 73 | 74 | 75 | } // namespace Opm 76 | 77 | 78 | 79 | #endif // OPM_LINEARSOLVERUMFPACK_HEADER_INCLUDED 80 | -------------------------------------------------------------------------------- /opm/core/linalg/call_umfpack.h: -------------------------------------------------------------------------------- 1 | /*=========================================================================== 2 | // 3 | // File: call_umfpack.h 4 | // 5 | // Created: 2011-10-05 19:55:58+0200 6 | // 7 | // Authors: Ingeborg S. Ligaarden 8 | // Jostein R. Natvig 9 | // Halvor M. Nilsen 10 | // Atgeirr F. Rasmussen 11 | // Bård Skaflestad 12 | // 13 | //==========================================================================*/ 14 | 15 | 16 | /* 17 | Copyright 2011 SINTEF ICT, Applied Mathematics. 18 | Copyright 2011 Statoil ASA. 19 | 20 | This file is part of the Open Porous Media Project (OPM). 21 | 22 | OPM is free software: you can redistribute it and/or modify 23 | it under the terms of the GNU General Public License as published by 24 | the Free Software Foundation, either version 3 of the License, or 25 | (at your option) any later version. 26 | 27 | OPM is distributed in the hope that it will be useful, 28 | but WITHOUT ANY WARRANTY; without even the implied warranty of 29 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 30 | GNU General Public License for more details. 31 | 32 | You should have received a copy of the GNU General Public License 33 | along with OPM. If not, see . 34 | */ 35 | 36 | #ifndef OPM_CALL_UMFPACK_H_HEADER 37 | #define OPM_CALL_UMFPACK_H_HEADER 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | struct CSRMatrix; 43 | 44 | void call_UMFPACK(struct CSRMatrix *A, const double *b, double *x); 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | #endif /* OPM_CALL_UMFPACK_H_HEADER */ 50 | -------------------------------------------------------------------------------- /opm/core/opm-core-pch.hpp: -------------------------------------------------------------------------------- 1 | /* List of headers that should be precompiled */ 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | -------------------------------------------------------------------------------- /opm/core/pressure/FlowBCManager.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2012 SINTEF ICT, Applied Mathematics. 3 | 4 | This file is part of the Open Porous Media project (OPM). 5 | 6 | OPM is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | OPM is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with OPM. If not, see . 18 | */ 19 | 20 | #ifndef OPM_FLOWBCMANAGER_HEADER_INCLUDED 21 | #define OPM_FLOWBCMANAGER_HEADER_INCLUDED 22 | 23 | #include 24 | 25 | struct UnstructuredGrid; 26 | 27 | namespace Opm 28 | { 29 | 30 | /// This class manages a FlowBoundaryConditions struct in the 31 | /// sense that it encapsulates creation and destruction of the 32 | /// data structure. 33 | /// The resulting struct is available through the c_bcs() method. 34 | class FlowBCManager 35 | { 36 | public: 37 | /// Default constructor sets up empty boundary conditions. 38 | /// By convention, this is equivalent to all-noflow conditions. 39 | FlowBCManager(); 40 | 41 | /// Destructor. 42 | ~FlowBCManager(); 43 | 44 | /// Remove all appended BCs. 45 | /// By convention, BCs are now equivalent to all-noflow conditions. 46 | void clear(); 47 | 48 | /// Append a single boundary condition. 49 | /// If the type is BC_NOFLOW the value argument is not used. 50 | /// If the type is BC_PRESSURE the value argument is a pressure value. 51 | /// If the type is BC_FLUX_TOTVOL the value argument is a total flux value (m^3/s). 52 | /// Note: unset boundary conditions are noflow by convention, 53 | /// so it is normally not necessary to explicitly append 54 | /// BC_NOFLOW conditions. However, it may make sense to do so 55 | /// if the bc will change during a simulation run. 56 | /// Note: if normal velocity bcs are desired, convert to 57 | /// fluxes by multiplying with face area. 58 | void append(const FlowBCType type, 59 | const int face, 60 | const double value); 61 | 62 | /// Defines the canonical sides for logical cartesian grids. 63 | enum Side { Xmin, Xmax, Ymin, Ymax, Zmin, Zmax }; 64 | 65 | /// Add BC_PRESSURE boundary conditions to all faces on a given side. 66 | /// The grid must have a logical cartesian structure, and grid 67 | /// faces must be tagged (i.e. grid.cell_facetag must be 68 | /// non-null). Only the set of faces adjacent to cells with 69 | /// minimum/maximum I/J/K coordinate (depending on side) are 70 | /// considered. 71 | void pressureSide(const UnstructuredGrid& grid, 72 | const Side side, 73 | const double pressure); 74 | 75 | /// Add BC_FLUX_TOTVOL boundary conditions to all faces on a given side. 76 | /// The grid must have a logical cartesian structure, and grid 77 | /// faces must be tagged (i.e. grid.cell_facetag must be 78 | /// non-null). Only the set of faces adjacent to cells with 79 | /// minimum/maximum I/J/K coordinate (depending on side) are 80 | /// considered. 81 | /// The flux specified is taken to be the total flux through 82 | /// the side, each individual face receiving a part of the 83 | /// total flux in proportion to its area, so that all faces 84 | /// will have identical normal velocities. 85 | void fluxSide(const UnstructuredGrid& grid, 86 | const Side side, 87 | const double flux); 88 | 89 | /// Access the managed boundary conditions. 90 | /// The method is named similarly to c_str() in std::string, 91 | /// to make it clear that we are returning a C-compatible struct. 92 | const FlowBoundaryConditions* c_bcs() const; 93 | 94 | private: 95 | // Disable copying and assignment. 96 | FlowBCManager(const FlowBCManager& other); 97 | FlowBCManager& operator=(const FlowBCManager& other); 98 | // The managed struct. 99 | FlowBoundaryConditions* bc_; 100 | }; 101 | 102 | } // namespace Opm 103 | 104 | #endif // OPM_FLOWBCMANAGER_HEADER_INCLUDED 105 | -------------------------------------------------------------------------------- /opm/core/pressure/IncompTpfaSinglePhase.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 SINTEF ICT, Applied Mathematics. 3 | 4 | This file is part of the Open Porous Media project (OPM). 5 | 6 | OPM is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | OPM is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with OPM. If not, see . 18 | */ 19 | 20 | #ifndef OPM_INCOMPTPFASINGLEPHASE_HEADER_INCLUDED 21 | #define OPM_INCOMPTPFASINGLEPHASE_HEADER_INCLUDED 22 | 23 | 24 | #include 25 | #include 26 | 27 | struct UnstructuredGrid; 28 | struct Wells; 29 | 30 | namespace Opm 31 | { 32 | 33 | class IncompPropertiesSinglePhase; 34 | class LinearSolverInterface; 35 | 36 | /// Encapsulating a tpfa pressure solver for the incompressible-fluid case. 37 | /// Supports gravity, wells controlled by bhp or reservoir rates, 38 | /// boundary conditions and simple sources as driving forces. 39 | /// Rock compressibility can be included, and necessary nonlinear 40 | /// iterations are handled. 41 | /// Below we use the shortcuts D for the number of dimensions, N 42 | /// for the number of cells and F for the number of faces. 43 | class IncompTpfaSinglePhase 44 | { 45 | public: 46 | /// Construct solver for incompressible case. 47 | /// \param[in] grid A 2d or 3d grid. 48 | /// \param[in] props Rock and fluid properties. 49 | /// \param[in] linsolver Linear solver to use. 50 | /// \param[in] wells The wells used as driving forces. 51 | IncompTpfaSinglePhase(const UnstructuredGrid& grid, 52 | const IncompPropertiesSinglePhase& props, 53 | const LinearSolverInterface& linsolver, 54 | const Wells& wells); 55 | 56 | /// Destructor. 57 | ~IncompTpfaSinglePhase(); 58 | 59 | /// Solve the pressure equation. 60 | void solve(std::vector& press, 61 | std::vector& flux, 62 | std::vector& bhp, 63 | std::vector& wellrates); 64 | 65 | private: 66 | // Helper functions. 67 | void computeStaticData(); 68 | void computePerSolveDynamicData(); 69 | 70 | protected: 71 | // ------ Data that will remain unmodified after construction. ------ 72 | const UnstructuredGrid& grid_; 73 | const IncompPropertiesSinglePhase& props_; 74 | const LinearSolverInterface& linsolver_; 75 | const Wells& wells_; 76 | std::vector htrans_; 77 | std::vector trans_ ; 78 | std::vector zeros_; 79 | std::vector totmob_; 80 | struct ifs_tpfa_forces forces_; 81 | 82 | // ------ Internal data for the ifs_tpfa solver. ------ 83 | struct ifs_tpfa_data* h_; 84 | }; 85 | 86 | } // namespace Opm 87 | 88 | #endif // OPM_INCOMPTPFASINGLEPHASE_HEADER_INCLUDED 89 | -------------------------------------------------------------------------------- /opm/core/pressure/flow_bc.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2010 SINTEF ICT, Applied Mathematics. 3 | 4 | This file is part of the Open Porous Media project (OPM). 5 | 6 | OPM is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | OPM is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with OPM. If not, see . 18 | */ 19 | 20 | #ifndef OPM_FLOW_BC_HEADER_INCLUDED 21 | #define OPM_FLOW_BC_HEADER_INCLUDED 22 | 23 | #include 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | enum FlowBCType { BC_NOFLOW , 30 | BC_PRESSURE , 31 | BC_FLUX_TOTVOL }; 32 | 33 | /* Boundary condition structure. 34 | * 35 | * Condition i (in [0 .. nbc-1]) affects (outer) interface face[i], is 36 | * of type type[i], and specifies a target value of value[i]. 37 | * 38 | * The field 'cpty' is for internal use by the implementation. */ 39 | struct FlowBoundaryConditions { 40 | size_t nbc; /* Current number of bdry. conditions */ 41 | 42 | size_t face_cpty; /* Internal management. Do not touch */ 43 | size_t cond_cpty; /* Internal management. Do not touch */ 44 | 45 | size_t *cond_pos; /* Indirection pointer into '.face' */ 46 | 47 | enum FlowBCType *type; /* Condition type */ 48 | double *value; /* Condition value (target) */ 49 | int *face; /* Outer faces affected by ind. target */ 50 | }; 51 | 52 | 53 | /* Allocate a 'FlowBoundaryConditions' structure, initially capable of 54 | * managing 'nbc' individual boundary conditions. */ 55 | struct FlowBoundaryConditions * 56 | flow_conditions_construct(size_t nbc); 57 | 58 | 59 | /* Release memory resources managed by 'fbc', including the containing 60 | * 'struct' pointer, 'fbc'. */ 61 | void 62 | flow_conditions_destroy(struct FlowBoundaryConditions *fbc); 63 | 64 | 65 | /* Append a new boundary condition to existing set. 66 | * 67 | * Return one (1) if successful, and zero (0) otherwise. */ 68 | int 69 | flow_conditions_append(enum FlowBCType type , 70 | int face , 71 | double value, 72 | struct FlowBoundaryConditions *fbc ); 73 | 74 | /* Append a new boundary condition that affects multiple interfaces. 75 | * 76 | * Return one (1) if successful, and zero (0) otherwise. */ 77 | int 78 | flow_conditions_append_multi(enum FlowBCType type , 79 | size_t nfaces, 80 | const int *faces , 81 | double value , 82 | struct FlowBoundaryConditions *fbc ); 83 | 84 | 85 | /* Clear existing set of boundary conditions */ 86 | void 87 | flow_conditions_clear(struct FlowBoundaryConditions *fbc); 88 | 89 | #ifdef __cplusplus 90 | } 91 | #endif 92 | 93 | #endif /* OPM_FLOW_BC_HEADER_INCLUDED */ 94 | -------------------------------------------------------------------------------- /opm/core/pressure/legacy_well.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2010 SINTEF ICT, Applied Mathematics. 3 | 4 | This file is part of the Open Porous Media project (OPM). 5 | 6 | OPM is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | OPM is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with OPM. If not, see . 18 | */ 19 | 20 | #ifndef OPM_LEGACY_WELL_HEADER_INCLUDED 21 | #define OPM_LEGACY_WELL_HEADER_INCLUDED 22 | 23 | /** 24 | * \file 25 | * Deprecated (and obsolescent) well definition. Still in use by 26 | * the hybridized pressure solvers. 27 | */ 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | 34 | /** 35 | * Well taxonomy. 36 | */ 37 | enum well_type { INJECTOR, PRODUCER }; 38 | 39 | /** 40 | * Control types recognised in system. 41 | */ 42 | enum well_control { BHP , RATE }; 43 | 44 | /** 45 | * Compositions recognised in injection wells. 46 | */ 47 | enum surface_component { WATER = 0, OIL = 1, GAS = 2 }; 48 | 49 | /** 50 | * Basic representation of well topology. 51 | */ 52 | struct LegacyWellCompletions { 53 | int number_of_wells; /**< Number of wells. */ 54 | int *well_connpos; /**< Well topology start pointers. */ 55 | int *well_cells; /**< Well connections */ 56 | }; 57 | 58 | /** 59 | * Basic representation of well controls. 60 | */ 61 | struct LegacyWellControls { 62 | enum well_type *type; /**< Individual well taxonomy */ 63 | enum well_control *ctrl; /**< Individual well controls */ 64 | double *target; /**< Control target */ 65 | double *zfrac; /**< Surface injection composition */ 66 | }; 67 | 68 | /** 69 | * Dynamic discretisation data relating well to flow in reservoir. 70 | */ 71 | struct completion_data { 72 | double *WI; /**< Well indices */ 73 | double *gpot; /**< Gravity potential */ 74 | double *A; /**< \f$RB^{-1}\f$ for compressible flows. */ 75 | double *phasemob; /**< Phase mobility, per connection. */ 76 | }; 77 | 78 | /** 79 | * Convenience type alias to preserve backwards compatibility in 80 | * well topology definitions used by hybridised pressure solver. 81 | */ 82 | typedef struct LegacyWellCompletions well_t; 83 | 84 | /** 85 | * Convenience type alias to preserve backwards compatiblity in 86 | * well control definitions used by hybridised pressure solver. 87 | */ 88 | typedef struct LegacyWellControls well_control_t; 89 | 90 | #ifdef __cplusplus 91 | } 92 | #endif 93 | 94 | #endif /* OPM_LEGACY_WELL_HEADER_INCLUDED */ 95 | -------------------------------------------------------------------------------- /opm/core/pressure/msmfem/dfs.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2010 SINTEF ICT, Applied Mathematics. 3 | 4 | This file is part of the Open Porous Media project (OPM). 5 | 6 | OPM is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | OPM is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with OPM. If not, see . 18 | */ 19 | 20 | 21 | #include "config.h" 22 | #include 23 | 24 | #include 25 | 26 | /* 27 | * Assign color (nonnegative number) to each connected component of graph 28 | */ 29 | void dfs (int size, int *ia, int *ja, int *ncolors, int *color, int* work) 30 | { 31 | int i, c; 32 | enum {UNVISITED = -1, VISITED = -2}; 33 | int *stack = work; 34 | int *count = work + size; 35 | int *bottom = stack; 36 | 37 | *ncolors = 0; /* colors are nonnegative */ 38 | 39 | for (i=0; i= 0) { /* FINISHED */ 47 | continue; 48 | } 49 | 50 | *stack++ = i; /* push i */ 51 | color[i] = VISITED; 52 | 53 | while ( stack != bottom ) { 54 | c = *(stack-1); /* peek */ 55 | 56 | if (count[c] > 0){ 57 | int child = ja[ia[c] + count[c]-1]; 58 | count[c]--; 59 | 60 | if (color[child] == UNVISITED) { 61 | *stack++ = child; 62 | color[c] = VISITED; 63 | } 64 | 65 | } else { 66 | color[c] = *ncolors; 67 | --stack; /* pop c */ 68 | } 69 | } 70 | ++*ncolors; 71 | } 72 | } 73 | 74 | 75 | 76 | 77 | #if defined(TEST) && TEST 78 | #include 79 | #include 80 | 81 | 82 | /* Test code. Reads a sparse matrix from a file specified on the */ 83 | /* command line with file format "m n\n i1 j1 v1\n i2 j2 v2\n ...". */ 84 | /* Computes reorder sequence */ 85 | int main (int argc, char *argv []) 86 | { 87 | int *color, *work; 88 | int j, ncolors; 89 | #if 0 90 | int size = 8; 91 | int ia[] = {0, 1, 2, 4, 5, 5, 7, 7, 8}; 92 | int ja[] = {1, 2, 0, 3, 4, 5, 6, 6}; 93 | #else 94 | int size = 3; 95 | int ia[] = {0,2,5,7}; 96 | int ja[] = {0,1,1,0,2,2,1}; 97 | #endif 98 | 99 | 100 | color = malloc (size * sizeof *color); 101 | work = malloc (2*size * sizeof *work); 102 | dfs(size, ia, ja, &ncolors, color, work); 103 | 104 | 105 | fprintf(stderr, "ncolors = %d\n", ncolors); 106 | for (j=0; j. 18 | */ 19 | 20 | #ifndef OPM_DFS_HEADER_INCLUDED 21 | #define OPM_DFS_HEADER_INCLUDED 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | 28 | void dfs (int size, int *ia, int *ja, int *ncolors, int *color, int* work); 29 | 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /opm/core/pressure/msmfem/partition.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2010 SINTEF ICT, Applied Mathematics. 3 | 4 | This file is part of the Open Porous Media project (OPM). 5 | 6 | OPM is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | OPM is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with OPM. If not, see . 18 | */ 19 | 20 | #ifndef OPM_PARTITION_HEADER_INCLUDED 21 | #define OPM_PARTITION_HEADER_INCLUDED 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | int 28 | partition_unif_idx(int ndims, int nc, 29 | const int *fine_d, 30 | const int *coarse_d, 31 | const int *idx, 32 | int *p); 33 | 34 | int 35 | partition_compress(int n, int *p); 36 | 37 | 38 | int 39 | partition_allocate_inverse(int nc, int max_blk, 40 | int **pi, int **inverse); 41 | 42 | void 43 | partition_deallocate_inverse(int *pi, int *inverse); 44 | 45 | void 46 | partition_invert(int nc, const int *p, 47 | int *pi, int *inverse); 48 | 49 | void 50 | partition_localidx(int nblk, const int *pi, const int *inverse, 51 | int *localidx); 52 | 53 | 54 | int 55 | partition_split_disconnected(int nc, int nneigh, const int *neigh, 56 | int *p); 57 | 58 | #ifdef __cplusplus 59 | } 60 | #endif 61 | 62 | #endif /* PARTITION_H_INLCUDED */ 63 | -------------------------------------------------------------------------------- /opm/core/pressure/tpfa/compr_quant_general.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2010 SINTEF ICT, Applied Mathematics. 3 | 4 | This file is part of the Open Porous Media project (OPM). 5 | 6 | OPM is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | OPM is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with OPM. If not, see . 18 | */ 19 | 20 | #ifndef OPM_COMPR_QUANT_HEADER_INCLUDED 21 | #define OPM_COMPR_QUANT_HEADER_INCLUDED 22 | 23 | #include 24 | 25 | /** 26 | * \file 27 | * Module defining derived fluid quantities needed to discretise compressible 28 | * and miscible pressure (flow) problems. 29 | */ 30 | 31 | #ifdef __cplusplus 32 | extern "C" { 33 | #endif 34 | 35 | /** 36 | * Aggregate structure that represents an atomic view of the current fluid 37 | * state. These quantities are used directly in the cfs_tpfa_residual module to 38 | * discretise a particular, linearised flow problem. 39 | */ 40 | struct compr_quantities_gen { 41 | /** 42 | * Number of fluid phases. The pressure solvers also assume that the number 43 | * of fluid components (at surface conditions) equals the number of fluid 44 | * phases. 45 | */ 46 | int nphases; 47 | 48 | /** 49 | * Pressure and mass-dependent fluid matrix that converts phase volumes at 50 | * reservoir conditions into component volumes at surface conditions. Obeys 51 | * the defining formula 52 | * \f[ 53 | * A = RB^{-1} 54 | * \f] 55 | * in which \f$R\f$ denotes the miscibility ratios (i.e., the dissolved 56 | * gas-oil ratio, \f$R_s\f$ and the evaporated oil-gas ratio, \f$R_v\f$) 57 | * collected as a matrix and \f$B\f$ is the diagonal matrix of 58 | * formation-volume expansion factors. The function is sampled in each grid 59 | * cell. Array of size nphases * nphases * nc. 60 | */ 61 | double *Ac; 62 | 63 | /** 64 | * Derivative of \f$A\f$ with respect to pressure, 65 | * \f[ 66 | * \frac{\partial A}{\partial p} = \frac{\partial R}{\partial p}B^{-1} + 67 | * R\frac{\partial B^{-1}}{\partial p} = (\frac{\partial R}{\partial p} - 68 | * A\frac{\partial B}{\partial p})B^{-1} 69 | * \f] 70 | * sampled in each grid cell. Array of size 71 | * nphases * nphases * nc. 72 | */ 73 | double *dAc; 74 | 75 | /** 76 | * Fluid matrix sampled at each interface. Possibly as a result of an 77 | * upwind calculation. Array of size nphases * nphases * nf. 78 | */ 79 | double *Af; 80 | 81 | /** 82 | * Phase mobility per interface. Possibly defined through an upwind 83 | * calculation. Array of size nphases * nf. 84 | */ 85 | double *phasemobf; 86 | 87 | /** 88 | * Deceptively named "volume-discrepancy" term. Array of size @c nc. 89 | * Unused by the cfs_tpfa_residual module. 90 | */ 91 | double *voldiscr; 92 | }; 93 | 94 | #ifdef __cplusplus 95 | } 96 | #endif 97 | 98 | #endif /* OPM_COMPR_QUANT_HEADER_INCLUDED */ 99 | -------------------------------------------------------------------------------- /opm/core/pressure/tpfa/compr_source.h: -------------------------------------------------------------------------------- 1 | /*=========================================================================== 2 | // 3 | // File: compr_source.h 4 | // 5 | // Created: 2011-10-19 19:14:30+0200 6 | // 7 | // Authors: Ingeborg S. Ligaarden 8 | // Jostein R. Natvig 9 | // Halvor M. Nilsen 10 | // Atgeirr F. Rasmussen 11 | // Bård Skaflestad 12 | // 13 | //==========================================================================*/ 14 | 15 | 16 | /* 17 | Copyright 2011 SINTEF ICT, Applied Mathematics. 18 | Copyright 2011 Statoil ASA. 19 | 20 | This file is part of the Open Porous Media Project (OPM). 21 | 22 | OPM is free software: you can redistribute it and/or modify 23 | it under the terms of the GNU General Public License as published by 24 | the Free Software Foundation, either version 3 of the License, or 25 | (at your option) any later version. 26 | 27 | OPM is distributed in the hope that it will be useful, 28 | but WITHOUT ANY WARRANTY; without even the implied warranty of 29 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 30 | GNU General Public License for more details. 31 | 32 | You should have received a copy of the GNU General Public License 33 | along with OPM. If not, see . 34 | */ 35 | 36 | #ifndef OPM_COMPR_SOURCE_H_HEADER 37 | #define OPM_COMPR_SOURCE_H_HEADER 38 | 39 | /** 40 | * \file 41 | * Data structures and support routines needed to represent explicit, 42 | * compressible source terms. 43 | */ 44 | 45 | #ifdef __cplusplus 46 | extern "C" { 47 | #endif 48 | 49 | /** 50 | * Collection of explicit, compressible source terms. 51 | */ 52 | struct compr_src { 53 | /** 54 | * Number of source terms. 55 | */ 56 | int nsrc; 57 | 58 | /** 59 | * Source term capacity. Client code should treat this member as read-only. 60 | * The field is used in internal memory management. 61 | */ 62 | int cpty; 63 | 64 | /** 65 | * Number of fluid phases. 66 | */ 67 | int nphases; 68 | 69 | /** 70 | * Cells influenced by explicit source terms. Array of size @c cpty, the 71 | * @c nsrc first elements (only) of which are valid. 72 | */ 73 | int *cell; 74 | 75 | /** 76 | * Total Darcy rate of inflow (measured at reservoir conditions) of each 77 | * individual source term. Sign convention: Positive rate into reservoir 78 | * (i.e., injection) and negative rate out of reservoir (production). 79 | * Array of size @c cpty, the @c nsrc first elements (only) of which are 80 | * valid. 81 | */ 82 | double *flux; 83 | 84 | /** 85 | * Injection composition for all explicit source terms. Not referenced for 86 | * production sources (i.e., those terms for which ->flux[] is 87 | * negative). Array of size nphases * cpty, the 88 | * nphases * nsrc of which (only) are valid. 89 | */ 90 | double *saturation; 91 | }; 92 | 93 | #ifdef __cplusplus 94 | } 95 | #endif 96 | 97 | #endif /* OPM_COMPR_SOURCE_H_HEADER */ 98 | -------------------------------------------------------------------------------- /opm/core/props/BlackoilPhases.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2010, 2011, 2012 SINTEF ICT, Applied Mathematics. 3 | 4 | This file is part of the Open Porous Media project (OPM). 5 | 6 | OPM is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | OPM is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with OPM. If not, see . 18 | */ 19 | 20 | #ifndef OPM_BLACKOILPHASES_HEADER_INCLUDED 21 | #define OPM_BLACKOILPHASES_HEADER_INCLUDED 22 | 23 | 24 | namespace Opm 25 | { 26 | 27 | class BlackoilPhases 28 | { 29 | public: 30 | static const int MaxNumPhases = 3; 31 | 32 | // "Crypto phases" are "phases" (or rather "conservation quantities") in the 33 | // sense that they can be active or not and canonical indices can be translated 34 | // to and from active ones. That said, they are not considered by num_phases or 35 | // MaxNumPhases. The crypto phases which are currently implemented are solvent, 36 | // polymer and energy. 37 | static const int NumCryptoPhases = 3; 38 | 39 | // enum ComponentIndex { Water = 0, Oil = 1, Gas = 2 }; 40 | enum PhaseIndex { Aqua = 0, Liquid = 1, Vapour = 2, Solvent = 3, Polymer = 4, Energy = 5 }; 41 | }; 42 | 43 | struct PhaseUsage : public BlackoilPhases 44 | { 45 | int num_phases; 46 | int phase_used[MaxNumPhases + NumCryptoPhases]; 47 | int phase_pos[MaxNumPhases + NumCryptoPhases]; 48 | bool has_solvent; 49 | bool has_polymer; 50 | bool has_energy; 51 | }; 52 | 53 | /// Check or assign presence of a formed, free phase. Limited to 54 | /// the 'BlackoilPhases'. 55 | /// 56 | /// Use a std::vector to represent the conditions 57 | /// in an entire model. 58 | class PhasePresence 59 | { 60 | public: 61 | PhasePresence() 62 | : present_(0) 63 | {} 64 | 65 | bool hasFreeWater() const { return present(BlackoilPhases::Aqua ); } 66 | bool hasFreeOil () const { return present(BlackoilPhases::Liquid); } 67 | bool hasFreeGas () const { return present(BlackoilPhases::Vapour); } 68 | 69 | void setFreeWater() { insert(BlackoilPhases::Aqua ); } 70 | void setFreeOil () { insert(BlackoilPhases::Liquid); } 71 | void setFreeGas () { insert(BlackoilPhases::Vapour); } 72 | 73 | bool operator==(const PhasePresence& other) const { return present_ == other.present_; } 74 | bool operator!=(const PhasePresence& other) const { return !this->operator==(other); } 75 | 76 | private: 77 | unsigned char present_; 78 | 79 | bool present(const BlackoilPhases::PhaseIndex i) const 80 | { 81 | return present_ & (1 << i); 82 | } 83 | 84 | void insert(const BlackoilPhases::PhaseIndex i) 85 | { 86 | present_ |= (1 << i); 87 | } 88 | }; 89 | 90 | } // namespace Opm 91 | 92 | #endif // OPM_BLACKOILPHASES_HEADER_INCLUDED 93 | -------------------------------------------------------------------------------- /opm/core/props/pvt/PvtPropertiesBasic.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2012 SINTEF ICT, Applied Mathematics. 3 | 4 | This file is part of the Open Porous Media project (OPM). 5 | 6 | OPM is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | OPM is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with OPM. If not, see . 18 | */ 19 | 20 | #ifndef OPM_PVTPROPERTIESBASIC_HEADER_INCLUDED 21 | #define OPM_PVTPROPERTIESBASIC_HEADER_INCLUDED 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | namespace Opm 28 | { 29 | 30 | /// Class collecting simple pvt properties for 1-3 phases. 31 | /// All phases are incompressible and have constant viscosities. 32 | /// For all the methods, the following apply: p, T and z are unused. 33 | /// Output arrays shall be of size n*numPhases(), and must be valid 34 | /// before calling the method. 35 | /// NOTE: This class is intentionally similar to BlackoilPvtProperties. 36 | class PvtPropertiesBasic 37 | { 38 | public: 39 | /// Default constructor. 40 | PvtPropertiesBasic(); 41 | 42 | /// Initialize from parameters. 43 | /// The following parameters are accepted (defaults): 44 | /// - num_phases (2) -- Must be 1, 2 or 3. 45 | /// - rho1, rho2, rho3 (1.0e3) -- Density in kg/m^3 46 | /// - mu1, mu2, mu3 (1.0) -- Viscosity in cP 47 | void init(const ParameterGroup& param); 48 | 49 | /// Initialize from arguments. 50 | /// Basic multi phase fluid pvt properties. 51 | void init(const int num_phases, 52 | const std::vector& rho, 53 | const std::vector& visc); 54 | 55 | /// Number of active phases. 56 | int numPhases() const; 57 | 58 | /// \return Object describing the active phases. 59 | PhaseUsage phaseUsage() const; 60 | 61 | /// Densities of stock components at surface conditions. 62 | /// \return Array of size numPhases(). 63 | const double* surfaceDensities() const; 64 | 65 | /// Viscosity as a function of p, T and z. 66 | void mu(const int n, 67 | const double* p, 68 | const double* T, 69 | const double* z, 70 | double* output_mu) const; 71 | 72 | /// Formation volume factor as a function of p, T and z. 73 | void B(const int n, 74 | const double* p, 75 | const double* T, 76 | const double* z, 77 | double* output_B) const; 78 | 79 | /// Formation volume factor and p-derivative as functions of p, T and z. 80 | void dBdp(const int n, 81 | const double* p, 82 | const double* T, 83 | const double* z, 84 | double* output_B, 85 | double* output_dBdp) const; 86 | 87 | /// Solution factor as a function of p and z. 88 | void R(const int n, 89 | const double* p, 90 | const double* z, 91 | double* output_R) const; 92 | 93 | /// Solution factor and p-derivative as functions of p and z. 94 | void dRdp(const int n, 95 | const double* p, 96 | const double* z, 97 | double* output_R, 98 | double* output_dRdp) const; 99 | 100 | private: 101 | // The PVT properties. We need to store one value per PVT 102 | // region. 103 | std::vector density_; 104 | std::vector viscosity_; 105 | std::vector formation_volume_factor_; 106 | }; 107 | 108 | } 109 | 110 | 111 | 112 | #endif // OPM_PVTPROPERTIESBASIC_HEADER_INCLUDED 113 | -------------------------------------------------------------------------------- /opm/core/props/pvt/PvtPropertiesIncompFromDeck.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2012 SINTEF ICT, Applied Mathematics. 3 | 4 | This file is part of the Open Porous Media project (OPM). 5 | 6 | OPM is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | OPM is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with OPM. If not, see . 18 | */ 19 | 20 | #ifndef OPM_PVTPROPERTIESINCOMPFROMDECK_HEADER_INCLUDED 21 | #define OPM_PVTPROPERTIESINCOMPFROMDECK_HEADER_INCLUDED 22 | 23 | #include 24 | #include 25 | 26 | #include 27 | 28 | namespace Opm 29 | { 30 | 31 | /// Class collecting pvt properties for 2 phases, reading from 32 | /// eclipse input (keywords DENSITY, PVTW, PVCDO). 33 | /// 34 | /// All phases are incompressible and have constant viscosities. 35 | /// NOTE: This class is intentionally similar to BlackoilPvtProperties. 36 | class PvtPropertiesIncompFromDeck 37 | { 38 | public: 39 | /// Default constructor. 40 | PvtPropertiesIncompFromDeck(); 41 | 42 | /// Initialize from deck. 43 | void init(const EclipseState&, const Opm::Deck& deck); 44 | 45 | /// Number of active phases. 46 | int numPhases() const; 47 | 48 | /// Densities of stock components at surface conditions. 49 | /// \return Array of size numPhases(). 50 | const double* surfaceDensities() const; 51 | 52 | /// Densities of stock components at reservoir conditions. 53 | /// Note: a reasonable question to ask is why there can be 54 | /// different densities at surface and reservoir conditions, 55 | /// when the phases are assumed incompressible. The answer is 56 | /// that even if we approximate the phases as being 57 | /// incompressible during simulation, the density difference 58 | /// between surface and reservoir may be larger. For accurate 59 | /// reporting and using data given in terms of surface values, 60 | /// we need to handle this difference. 61 | /// \return Array of size numPhases(). 62 | const double* reservoirDensities() const; 63 | 64 | /// Viscosities. 65 | const double* viscosity() const; 66 | 67 | private: 68 | std::array surface_density_; 69 | std::array reservoir_density_; 70 | std::array viscosity_; 71 | }; 72 | 73 | } 74 | 75 | 76 | 77 | #endif // OPM_PVTPROPERTIESINCOMPFROMDECK_HEADER_INCLUDED 78 | -------------------------------------------------------------------------------- /opm/core/props/rock/RockBasic.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2012 SINTEF ICT, Applied Mathematics. 3 | 4 | This file is part of the Open Porous Media project (OPM). 5 | 6 | OPM is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | OPM is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with OPM. If not, see . 18 | */ 19 | 20 | #include "config.h" 21 | #include 22 | 23 | namespace Opm 24 | { 25 | 26 | 27 | /// Default constructor. 28 | RockBasic::RockBasic() 29 | : dimensions_(-1) 30 | { 31 | } 32 | 33 | 34 | /// Initialize with homogenous porosity and permeability. 35 | void RockBasic::init(const int dimensions, 36 | const int num_cells, 37 | const double poro, 38 | const double perm) 39 | { 40 | dimensions_ = dimensions; 41 | porosity_.clear(); 42 | porosity_.resize(num_cells, poro); 43 | permeability_.clear(); 44 | const int dsq = dimensions*dimensions; 45 | permeability_.resize(num_cells*dsq, 0.0); 46 | // #pragma omp parallel for 47 | for (int i = 0; i < num_cells; ++i) { 48 | for (int d = 0; d < dimensions; ++d) { 49 | permeability_[dsq*i + dimensions*d + d] = perm; 50 | } 51 | } 52 | } 53 | 54 | 55 | } // namespace Opm 56 | -------------------------------------------------------------------------------- /opm/core/props/rock/RockBasic.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2012 SINTEF ICT, Applied Mathematics. 3 | 4 | This file is part of the Open Porous Media project (OPM). 5 | 6 | OPM is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | OPM is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with OPM. If not, see . 18 | */ 19 | 20 | #ifndef OPM_ROCKBASIC_HEADER_INCLUDED 21 | #define OPM_ROCKBASIC_HEADER_INCLUDED 22 | 23 | 24 | #include 25 | 26 | 27 | namespace Opm 28 | { 29 | 30 | class RockBasic 31 | { 32 | public: 33 | /// Default constructor. 34 | RockBasic(); 35 | 36 | /// Initialize with homogenous porosity and permeability. 37 | void init(const int dimensions, 38 | const int num_cells, 39 | const double poro, 40 | const double perm); 41 | 42 | /// \return D, the number of spatial dimensions. 43 | int numDimensions() const 44 | { 45 | return dimensions_; 46 | } 47 | 48 | /// \return N, the number of cells. 49 | int numCells() const 50 | { 51 | return porosity_.size(); 52 | } 53 | 54 | /// \return Array of N porosity values. 55 | const double* porosity() const 56 | { 57 | return &porosity_[0]; 58 | } 59 | 60 | /// \return Array of ND^2 permeability values. 61 | /// The D^2 permeability values for a cell are organized as a matrix, 62 | /// which is symmetric (so ordering does not matter). 63 | const double* permeability() const 64 | { 65 | return &permeability_[0]; 66 | } 67 | 68 | private: 69 | int dimensions_; 70 | std::vector porosity_; 71 | std::vector permeability_; 72 | }; 73 | 74 | 75 | 76 | } // namespace Opm 77 | 78 | 79 | #endif // OPM_ROCKBASIC_HEADER_INCLUDED 80 | -------------------------------------------------------------------------------- /opm/core/props/rock/RockCompressibility.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2012 SINTEF ICT, Applied Mathematics. 3 | 4 | This file is part of the Open Porous Media project (OPM). 5 | 6 | OPM is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | OPM is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with OPM. If not, see . 18 | */ 19 | 20 | #ifndef OPM_ROCKCOMPRESSIBILITY_HEADER_INCLUDED 21 | #define OPM_ROCKCOMPRESSIBILITY_HEADER_INCLUDED 22 | 23 | #include 24 | 25 | #include 26 | 27 | namespace Opm 28 | { 29 | 30 | class ParameterGroup; 31 | 32 | class RockCompressibility 33 | { 34 | public: 35 | /// Construct from input deck. 36 | /// Looks for the keywords ROCK and ROCKTAB. 37 | RockCompressibility(const Opm::EclipseState& eclipseState, 38 | const bool is_io_rank = true); 39 | 40 | /// Construct from parameters. 41 | /// Accepts the following parameters (with defaults). 42 | /// rock_compressibility_pref (100.0) [given in bar] 43 | /// rock_compressibility (0.0) [given in bar^{-1}] 44 | RockCompressibility(const ParameterGroup& param); 45 | 46 | /// Returns true if there are compressibility effects. 47 | bool isActive() const; 48 | 49 | /// Porosity multiplier. 50 | double poroMult(double pressure) const; 51 | 52 | /// Derivative of porosity multiplier with respect to pressure. 53 | double poroMultDeriv(double pressure) const; 54 | 55 | /// Transmissibility multiplier. 56 | double transMult(double pressure) const; 57 | 58 | /// Derivative of transmissibility multiplier with respect to pressure. 59 | double transMultDeriv(double pressure) const; 60 | 61 | /// Rock compressibility = (d poro / d p)*(1 / poro). 62 | double rockComp(double pressure) const; 63 | 64 | private: 65 | std::vector p_; 66 | std::vector poromult_; 67 | std::vector transmult_; 68 | double pref_; 69 | double rock_comp_; 70 | }; 71 | 72 | } // namespace Opm 73 | 74 | 75 | #endif // OPM_ROCKCOMPRESSIBILITY_HEADER_INCLUDED 76 | -------------------------------------------------------------------------------- /opm/core/simulator/BlackoilState.cpp: -------------------------------------------------------------------------------- 1 | #include "BlackoilState.hpp" 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | 8 | using namespace Opm; 9 | 10 | 11 | const std::string BlackoilState::GASOILRATIO = "GASOILRATIO"; 12 | const std::string BlackoilState::RV = "RV"; 13 | const std::string BlackoilState::SURFACEVOL = "SURFACEVOL"; 14 | const std::string BlackoilState::SSOL = "SSOL"; 15 | const std::string BlackoilState::POLYMER = "POLYMER"; 16 | 17 | 18 | BlackoilState::BlackoilState( size_t num_cells , size_t num_faces , size_t num_phases) 19 | : SimulationDataContainer( num_cells , num_faces , num_phases) 20 | { 21 | registerCellData( GASOILRATIO , 1 ); 22 | registerCellData( RV, 1 ); 23 | registerCellData( SURFACEVOL, num_phases ); 24 | registerCellData( SSOL , 1 ); 25 | registerCellData( POLYMER , 1 ); 26 | setBlackoilStateReferencePointers(); 27 | } 28 | 29 | BlackoilState::BlackoilState( const BlackoilState& other ) 30 | : SimulationDataContainer(other), 31 | hydrocarbonstate_(other.hydroCarbonState()) 32 | { 33 | setBlackoilStateReferencePointers(); 34 | 35 | } 36 | 37 | BlackoilState& BlackoilState::operator=( const BlackoilState& other ) 38 | { 39 | SimulationDataContainer::operator=(other); 40 | setBlackoilStateReferencePointers(); 41 | hydrocarbonstate_ = other.hydroCarbonState(); 42 | return *this; 43 | } 44 | 45 | void BlackoilState::setBlackoilStateReferencePointers() 46 | { 47 | // This sets the reference pointers for the fast 48 | // accessors, the fields must have been created first. 49 | gasoilratio_ref_ = &getCellData(GASOILRATIO); 50 | rv_ref_ = &getCellData(RV); 51 | surfacevol_ref_ = &getCellData(SURFACEVOL); 52 | } 53 | -------------------------------------------------------------------------------- /opm/core/simulator/BlackoilState.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2012 SINTEF ICT, Applied Mathematics. 3 | Copyright 2015 IRIS AS 4 | 5 | This file is part of the Open Porous Media project (OPM). 6 | 7 | OPM is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | OPM is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with OPM. If not, see . 19 | */ 20 | 21 | #ifndef OPM_BLACKOILSTATE_HEADER_INCLUDED 22 | #define OPM_BLACKOILSTATE_HEADER_INCLUDED 23 | 24 | #include 25 | 26 | #include 27 | #include 28 | #include 29 | 30 | namespace Opm 31 | { 32 | 33 | enum HydroCarbonState { 34 | GasOnly = 0, 35 | GasAndOil = 1, 36 | OilOnly = 2 37 | }; 38 | 39 | /// Simulator state for a blackoil simulator. 40 | class BlackoilState : public SimulationDataContainer 41 | { 42 | public: 43 | static const std::string GASOILRATIO; 44 | static const std::string RV; 45 | static const std::string SURFACEVOL; 46 | static const std::string SSOL; 47 | static const std::string POLYMER; 48 | 49 | /// Main constructor setting the sizes for the contained data 50 | /// types. 51 | /// \param num_cells number of elements in cell data vectors 52 | /// \param num_faces number of elements in face data vectors 53 | /// \param num_phases number of phases, the number of components 54 | /// in any data vector must equal 1 or this 55 | /// number (this behaviour and argument is deprecated). 56 | BlackoilState(size_t num_cells, size_t num_faces, size_t num_phases); 57 | 58 | /// Copy constructor. 59 | /// Must be defined explicitly because class contains non-value objects 60 | /// (the reference pointers rv_ref_ etc.) that should not simply 61 | /// be copied. 62 | BlackoilState(const BlackoilState& other); 63 | 64 | /// Copy assignment operator. 65 | /// Must be defined explicitly because class contains non-value objects 66 | /// (the reference pointers rv_ref_ etc.) that should not simply 67 | /// be copied. 68 | BlackoilState& operator=(const BlackoilState& other); 69 | 70 | std::vector& surfacevol () { return *surfacevol_ref_; } 71 | std::vector& gasoilratio () { return *gasoilratio_ref_; } 72 | std::vector& rv () { return *rv_ref_; } 73 | std::vector& hydroCarbonState() { return hydrocarbonstate_; } 74 | 75 | const std::vector& surfacevol () const { return *surfacevol_ref_; } 76 | const std::vector& gasoilratio () const { return *gasoilratio_ref_; } 77 | const std::vector& rv () const { return *rv_ref_; } 78 | const std::vector& hydroCarbonState() const { return hydrocarbonstate_; } 79 | 80 | private: 81 | void setBlackoilStateReferencePointers(); 82 | std::vector* surfacevol_ref_; 83 | std::vector* gasoilratio_ref_; 84 | std::vector* rv_ref_; 85 | 86 | // A vector storing the hydro carbon state. 87 | std::vector hydrocarbonstate_; 88 | 89 | 90 | }; 91 | } // namespace Opm 92 | 93 | 94 | #endif // OPM_BLACKOILSTATE_HEADER_INCLUDED 95 | -------------------------------------------------------------------------------- /opm/core/simulator/BlackoilStateToFluidState.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Andreas Lauser 3 | 4 | This file is part of the Open Porous Media project (OPM). 5 | 6 | OPM is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | OPM is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with OPM. If not, see . 18 | */ 19 | 20 | #ifndef OPM_BLACKOIL_STATE_TO_FLUID_STATE_HEADER_INCLUDED 21 | #define OPM_BLACKOIL_STATE_TO_FLUID_STATE_HEADER_INCLUDED 22 | 23 | #include 24 | 25 | namespace Opm 26 | { 27 | 28 | /*! 29 | * \brief This is an light weight "impedance adaption" class with a well defined API for 30 | * saturation and PVT functions. 31 | * 32 | * It uses a stripped down version of opm-material's FluidState API and takes an 33 | * Opm::BlackoilState plus a cell index. 34 | * 35 | * Note that this class requires that is underlying BlackoilState must valid for at least 36 | * as long as an object of BlackoilStateToFluidState is used. 37 | */ 38 | class BlackoilStateToFluidState 39 | { 40 | public: 41 | typedef double Scalar; 42 | 43 | enum { numPhases = 3 }; 44 | enum { numComponents = 3 }; 45 | 46 | /*! 47 | * \brief Create a BlackoilState to Fluid state wrapper object. 48 | * 49 | * Note that this class requires that is underlying BlackoilState must valid for at least 50 | * as long as an object of BlackoilStateToFluidState is used. 51 | */ 52 | BlackoilStateToFluidState(const BlackoilState& blackoilState) 53 | : blackoilState_(blackoilState) 54 | { 55 | if (blackoilState_.numPhases() != numPhases) { 56 | OPM_THROW(std::runtime_error, 57 | "Only " << numPhases << " are supported, but the deck specifies " << blackoilState_.numPhases()); 58 | } 59 | } 60 | 61 | /*! 62 | * \brief Sets the index of the currently used cell. 63 | * 64 | * After calling this, the values returned by the other methods are specific for this 65 | * cell. 66 | */ 67 | void setCurrentCellIndex(unsigned cellIdx) 68 | { cellIdx_ = cellIdx; } 69 | 70 | /*! 71 | * \brief Returns the saturation of a phase for the current cell index. 72 | */ 73 | Scalar saturation(int phaseIdx) const 74 | { return blackoilState_.saturation()[numPhases*cellIdx_ + phaseIdx]; } 75 | 76 | /*! 77 | * \brief Returns the temperature [K] of a phase for the current cell index. 78 | */ 79 | Scalar temperature(int phaseIdx) const 80 | { return blackoilState_.temperature()[cellIdx_]; } 81 | 82 | // TODO (?) pressure, composition, etc 83 | 84 | private: 85 | size_t numCells() const 86 | { return blackoilState_.pressure().size(); } 87 | 88 | const BlackoilState& blackoilState_; 89 | unsigned cellIdx_; 90 | } 91 | 92 | } // namespace Opm 93 | 94 | #endif // OPM_SIMULATORTIMER_HEADER_INCLUDED 95 | -------------------------------------------------------------------------------- /opm/core/simulator/ExplicitArraysFluidState.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Andreas Lauser 3 | 4 | This file is part of the Open Porous Media project (OPM). 5 | 6 | OPM is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | OPM is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with OPM. If not, see . 18 | */ 19 | 20 | #ifndef OPM_EXPLICIT_ARRAYS_FLUID_STATE_HEADER_INCLUDED 21 | #define OPM_EXPLICIT_ARRAYS_FLUID_STATE_HEADER_INCLUDED 22 | 23 | #include 24 | 25 | #include 26 | 27 | namespace Opm 28 | { 29 | 30 | /*! 31 | * \brief This is a fluid state which translates global arrays and translates them to a 32 | * subset of the fluid state API. 33 | * 34 | * This class is similar to Opm::BlackoilStateToFluidState. 35 | */ 36 | class ExplicitArraysFluidState 37 | { 38 | public: 39 | typedef double Scalar; 40 | enum { numPhases = BlackoilPhases::MaxNumPhases }; 41 | 42 | explicit ExplicitArraysFluidState(const PhaseUsage& phaseUsage) 43 | : phaseUsage_(phaseUsage) 44 | {} 45 | 46 | /*! 47 | * \brief Sets the currently used array index. 48 | * 49 | * After calling this, the values returned by the other methods are specific for this 50 | * index. 51 | */ 52 | void setIndex(unsigned arrayIdx) 53 | { 54 | int np = phaseUsage_.num_phases; 55 | for (int phaseIdx = 0; phaseIdx < BlackoilPhases::MaxNumPhases; ++phaseIdx) { 56 | if (!phaseUsage_.phase_used[phaseIdx]) { 57 | sats_[phaseIdx] = 0.0; 58 | } 59 | else { 60 | sats_[phaseIdx] = saturations_[np*arrayIdx + phaseUsage_.phase_pos[phaseIdx]]; 61 | } 62 | } 63 | } 64 | 65 | /*! 66 | * \brief Set the array containing the phase saturations. 67 | * 68 | * This array is supposed to be of size numPhases*size and is not allowed to be 69 | * deleted while the ExplicitArraysFluidState object is alive. This class assumes 70 | * that the saturations of all phase saturations for a point are consequtive, i.e., 71 | * in the array the saturations cycle fastest. 72 | */ 73 | void setSaturationArray(const double* saturations) 74 | { saturations_ = saturations; } 75 | 76 | /*! 77 | * \brief Returns the saturation of a phase for the current cell index. 78 | */ 79 | Scalar saturation(int phaseIdx) const 80 | { return sats_[phaseIdx]; } 81 | 82 | // TODO (?) temperature, pressure, composition, etc 83 | 84 | private: 85 | const PhaseUsage phaseUsage_; 86 | const double* saturations_; 87 | std::array sats_; 88 | }; 89 | 90 | } // namespace Opm 91 | 92 | #endif // OPM_SIMULATORTIMER_HEADER_INCLUDED 93 | -------------------------------------------------------------------------------- /opm/core/simulator/ExplicitArraysSatDerivativesFluidState.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Andreas Lauser 3 | 4 | This file is part of the Open Porous Media project (OPM). 5 | 6 | OPM is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | OPM is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with OPM. If not, see . 18 | */ 19 | 20 | #ifndef OPM_EXPLICIT_ARRAYS_SAT_DERIVATIVES_FLUID_STATE_HEADER_INCLUDED 21 | #define OPM_EXPLICIT_ARRAYS_SAT_DERIVATIVES_FLUID_STATE_HEADER_INCLUDED 22 | 23 | #include 24 | #include 25 | 26 | #include 27 | 28 | #include 29 | 30 | namespace Opm 31 | { 32 | 33 | /*! 34 | * \brief This is a fluid state which translates global arrays and translates them to a 35 | * subset of the fluid state API. 36 | * 37 | * This class is similar to Opm::ExplicitArraysFluidState except for the fact that it 38 | * uses opm-material's local automatic differentiation framework to allow implicit 39 | * treatment of saturation derivatives. 40 | */ 41 | class ExplicitArraysSatDerivativesFluidState 42 | { 43 | public: 44 | enum { numPhases = BlackoilPhases::MaxNumPhases }; 45 | enum { numComponents = 3 }; 46 | 47 | typedef Opm::DenseAd::Evaluation Evaluation; 48 | typedef Evaluation Scalar; 49 | 50 | ExplicitArraysSatDerivativesFluidState(const PhaseUsage& phaseUsage) 51 | : phaseUsage_(phaseUsage) 52 | { 53 | globalSaturationArray_ = 0; 54 | 55 | // initialize the evaluation objects for the saturations 56 | for (int phaseIdx = 0; phaseIdx < numPhases; ++ phaseIdx) { 57 | saturation_[phaseIdx] = Evaluation::createVariable(0.0, phaseIdx); 58 | } 59 | } 60 | 61 | /*! 62 | * \brief Sets the currently used array index. 63 | * 64 | * After calling this, the values returned by the other methods are specific for this 65 | * index. 66 | */ 67 | void setIndex(unsigned arrayIdx) 68 | { 69 | int np = phaseUsage_.num_phases; 70 | 71 | // copy the saturations values from the global value. the derivatives do not need 72 | // to be modified for these... 73 | for (int phaseIdx = 0; phaseIdx < numPhases; ++ phaseIdx) { 74 | if (!phaseUsage_.phase_used[phaseIdx]) { 75 | saturation_[phaseIdx].setValue(0.0); 76 | } 77 | else { 78 | saturation_[phaseIdx].setValue(globalSaturationArray_[np*arrayIdx + phaseUsage_.phase_pos[phaseIdx]]); 79 | } 80 | } 81 | } 82 | 83 | /*! 84 | * \brief Set the array containing the phase saturations. 85 | * 86 | * This array is supposed to be of size numPhases*size and is not allowed to be 87 | * deleted while the ExplicitArraysFluidState object is alive. This class assumes 88 | * that the saturations of all phase saturations for a point are consequtive, i.e., 89 | * in the array the saturations cycle fastest. 90 | */ 91 | void setSaturationArray(const double* saturations) 92 | { globalSaturationArray_ = saturations; } 93 | 94 | /*! 95 | * \brief Returns the saturation of a phase for the current cell index. 96 | */ 97 | const Evaluation& saturation(int phaseIdx) const 98 | { return saturation_[phaseIdx]; } 99 | 100 | // TODO (?) temperature, pressure, composition, etc 101 | 102 | private: 103 | const PhaseUsage phaseUsage_; 104 | const double* globalSaturationArray_; 105 | 106 | std::array saturation_; 107 | }; 108 | 109 | } // namespace Opm 110 | 111 | #endif 112 | -------------------------------------------------------------------------------- /opm/core/simulator/SimulatorReport.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2012 SINTEF ICT, Applied Mathematics. 3 | 4 | This file is part of the Open Porous Media project (OPM). 5 | 6 | OPM is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | OPM is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with OPM. If not, see . 18 | */ 19 | 20 | #ifndef OPM_SIMULATORREPORT_HEADER_INCLUDED 21 | #define OPM_SIMULATORREPORT_HEADER_INCLUDED 22 | 23 | #include 24 | 25 | namespace Opm 26 | { 27 | 28 | /// A struct for returning timing data from a simulator to its caller. 29 | struct SimulatorReport 30 | { 31 | double pressure_time; 32 | double transport_time; 33 | double total_time; 34 | double solver_time; 35 | double assemble_time; 36 | double linear_solve_time; 37 | double update_time; 38 | double output_write_time; 39 | 40 | unsigned int total_well_iterations; 41 | unsigned int total_linearizations; 42 | unsigned int total_newton_iterations; 43 | unsigned int total_linear_iterations; 44 | 45 | bool converged; 46 | 47 | /// Default constructor initializing all times to 0.0. 48 | SimulatorReport(bool verbose=true); 49 | /// Copy constructor 50 | SimulatorReport(const SimulatorReport&) = default; 51 | /// Increment this report's times by those in sr. 52 | void operator+=(const SimulatorReport& sr); 53 | /// Print a report to the given stream. 54 | void report(std::ostream& os); 55 | /// Print a report, leaving out the transport time. 56 | void reportFullyImplicit(std::ostream& os, const SimulatorReport* failedReport = nullptr); 57 | void reportParam(std::ostream& os); 58 | private: 59 | // Whether to print statistics to std::cout 60 | bool verbose_; 61 | }; 62 | 63 | } // namespace Opm 64 | 65 | #endif // OPM_SIMULATORREPORT_HEADER_INCLUDED 66 | -------------------------------------------------------------------------------- /opm/core/simulator/TwophaseState.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2012 SINTEF ICT, Applied Mathematics. 3 | 4 | This file is part of the Open Porous Media project (OPM). 5 | 6 | OPM is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | OPM is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with OPM. If not, see . 18 | */ 19 | 20 | #include 21 | 22 | namespace Opm 23 | { 24 | 25 | TwophaseState::TwophaseState(size_t num_cells , size_t num_faces) : 26 | SimulationDataContainer( num_cells , num_faces , 2 ) 27 | { 28 | } 29 | 30 | 31 | } 32 | 33 | 34 | -------------------------------------------------------------------------------- /opm/core/simulator/TwophaseState.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2012 SINTEF ICT, Applied Mathematics. 3 | 4 | This file is part of the Open Porous Media project (OPM). 5 | 6 | OPM is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | OPM is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with OPM. If not, see . 18 | */ 19 | 20 | #ifndef OPM_TWOPHASESTATE_HEADER_INCLUDED 21 | #define OPM_TWOPHASESTATE_HEADER_INCLUDED 22 | 23 | #include 24 | 25 | namespace Opm 26 | { 27 | class TwophaseState : public SimulationDataContainer 28 | { 29 | public: 30 | TwophaseState(size_t num_cells , size_t num_faces); 31 | }; 32 | 33 | } 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /opm/core/simulator/TwophaseState_impl.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPM_TWOPHASESTATE_HEADER_INCLUDED 2 | #error Do not include this file directly! 3 | #endif 4 | 5 | namespace Opm { 6 | 7 | inline bool 8 | TwophaseState::equals (const SimulatorState& other, 9 | double epsilon) const { 10 | return dynamic_cast (&other) 11 | ? SimulatorState::equals (other, epsilon) 12 | : false; 13 | } 14 | 15 | } // namespace Opm 16 | -------------------------------------------------------------------------------- /opm/core/transport/TransportSolverTwophaseInterface.cpp: -------------------------------------------------------------------------------- 1 | /*=========================================================================== 2 | // 3 | // File: TwoPhaseTransportSolver.cpp 4 | // 5 | // Author: hnil 6 | // 7 | // Created: 9 Nov 2012 8 | //==========================================================================*/ 9 | /* 10 | Copyright 2011 SINTEF ICT, Applied Mathematics. 11 | Copyright 2011 Statoil ASA. 12 | 13 | This file is part of the Open Porous Media Project (OPM). 14 | 15 | OPM is free software: you can redistribute it and/or modify 16 | it under the terms of the GNU General Public License as published by 17 | the Free Software Foundation, either version 3 of the License, or 18 | (at your option) any later version. 19 | 20 | OPM is distributed in the hope that it will be useful, 21 | but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | GNU General Public License for more details. 24 | 25 | You should have received a copy of the GNU General Public License 26 | along with OPM. If not, see . 27 | */ 28 | 29 | 30 | #include "config.h" 31 | #include "TransportSolverTwophaseInterface.hpp" 32 | 33 | Opm::TransportSolverTwophaseInterface::~TransportSolverTwophaseInterface() 34 | { 35 | } 36 | -------------------------------------------------------------------------------- /opm/core/transport/TransportSolverTwophaseInterface.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2012, 2013 SINTEF ICT, Applied Mathematics. 3 | 4 | This file is part of the Open Porous Media Project (OPM). 5 | 6 | OPM is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | OPM is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with OPM. If not, see . 18 | */ 19 | 20 | #ifndef OPM_TRANSPORTSOLVERTWOPHASEINTERFACE_HEADER_INCLUDED 21 | #define OPM_TRANSPORTSOLVERTWOPHASEINTERFACE_HEADER_INCLUDED 22 | 23 | #include 24 | #include 25 | 26 | namespace Opm 27 | { 28 | 29 | /// Base class for two-phase incompressible transport solvers. 30 | class TransportSolverTwophaseInterface 31 | { 32 | public: 33 | /// Virtual destructor to enable inheritance. 34 | virtual ~TransportSolverTwophaseInterface(); 35 | 36 | /// Solve for saturation at next timestep. 37 | /// \param[in] porevolume Array of pore volumes. 38 | /// \param[in] source Transport source term. For interpretation see Opm::computeTransportSource(). 39 | /// \param[in] dt Time step. 40 | /// \param[in, out] state Reservoir state. Calling solve() will read state.faceflux() and 41 | /// read and write state.saturation(). 42 | virtual void solve(const double* porevolume, 43 | const double* source, 44 | const double dt, 45 | TwophaseState& state) = 0; 46 | }; 47 | 48 | } 49 | 50 | #endif // OPM_TRANSPORTSOLVERTWOPHASEINTERFACE_HEADER_INCLUDED 51 | -------------------------------------------------------------------------------- /opm/core/transport/reorder/ReorderSolverInterface.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2012 SINTEF ICT, Applied Mathematics. 3 | 4 | This file is part of the Open Porous Media project (OPM). 5 | 6 | OPM is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | OPM is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with OPM. If not, see . 18 | */ 19 | 20 | #include "config.h" 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | #include 27 | #include 28 | #include 29 | 30 | 31 | void Opm::ReorderSolverInterface::reorderAndTransport(const UnstructuredGrid& grid, const double* darcyflux) 32 | { 33 | // Compute reordered sequence of single-cell problems 34 | sequence_.resize(grid.number_of_cells); 35 | components_.resize(grid.number_of_cells + 1); 36 | int ncomponents; 37 | time::StopWatch clock; 38 | clock.start(); 39 | compute_sequence(&grid, darcyflux, &sequence_[0], &components_[0], &ncomponents); 40 | clock.stop(); 41 | std::cout << "Topological sort took: " << clock.secsSinceStart() << " seconds." << std::endl; 42 | 43 | // Make vector's size match actual used data. 44 | components_.resize(ncomponents + 1); 45 | 46 | // Invoke appropriate solve method for each interdependent component. 47 | for (int comp = 0; comp < ncomponents; ++comp) { 48 | #if 0 49 | #ifdef MATLAB_MEX_FILE 50 | // \TODO replace this with general signal handling code, check if it costs performance. 51 | if (interrupt_signal) { 52 | mexPrintf("Reorder loop interrupted by user: %d of %d " 53 | "cells finished.\n", i, grid.number_of_cells); 54 | break; 55 | } 56 | #endif 57 | #endif 58 | const int comp_size = components_[comp + 1] - components_[comp]; 59 | if (comp_size == 1) { 60 | solveSingleCell(sequence_[components_[comp]]); 61 | } else { 62 | solveMultiCell(comp_size, &sequence_[components_[comp]]); 63 | } 64 | } 65 | } 66 | 67 | 68 | const std::vector& Opm::ReorderSolverInterface::sequence() const 69 | { 70 | return sequence_; 71 | } 72 | 73 | 74 | const std::vector& Opm::ReorderSolverInterface::components() const 75 | { 76 | return components_; 77 | } 78 | -------------------------------------------------------------------------------- /opm/core/transport/reorder/ReorderSolverInterface.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2012 SINTEF ICT, Applied Mathematics. 3 | 4 | This file is part of the Open Porous Media project (OPM). 5 | 6 | OPM is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | OPM is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with OPM. If not, see . 18 | */ 19 | 20 | #ifndef OPM_REORDERSOLVERINTERFACE_HEADER_INCLUDED 21 | #define OPM_REORDERSOLVERINTERFACE_HEADER_INCLUDED 22 | 23 | #include 24 | 25 | struct UnstructuredGrid; 26 | 27 | namespace Opm 28 | { 29 | 30 | /// Interface for implementing reordering solvers. 31 | /// A subclass must provide the solveSingleCell() and 32 | /// solveMultiCell methods, and is expected to implement a solve() 33 | /// method that will have an interface geared to its own 34 | /// needs. (The solve() method is therefore not virtual in this 35 | /// class.) The reorderAndTransport() method is provided as an aid 36 | /// to implementing solve() in subclasses, together with the 37 | /// sequence() and components() methods for accessing the ordering. 38 | class ReorderSolverInterface 39 | { 40 | public: 41 | virtual ~ReorderSolverInterface() {} 42 | private: 43 | virtual void solveSingleCell(const int cell) = 0; 44 | virtual void solveMultiCell(const int num_cells, const int* cells) = 0; 45 | protected: 46 | void reorderAndTransport(const UnstructuredGrid& grid, const double* darcyflux); 47 | const std::vector& sequence() const; 48 | const std::vector& components() const; 49 | private: 50 | std::vector sequence_; 51 | std::vector components_; 52 | }; 53 | 54 | 55 | } // namespace Opm 56 | 57 | #endif // OPM_TRANSPORTMODELINTERFACE_HEADER_INCLUDED 58 | -------------------------------------------------------------------------------- /opm/core/transport/reorder/tarjan.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2012 (c) Jostein R. Natvig 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | this software and associated documentation files (the "Software"), to deal in 6 | the Software without restriction, including without limitation the rights to 7 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | of the Software, and to permit persons to whom the Software is furnished to do 9 | so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all 12 | copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | SOFTWARE. 21 | */ 22 | 23 | /** 24 | * \file 25 | * 26 | * Simple implementation of of Tarjan's algorithm for computing the 27 | * strongly connected components of a directed graph, \f$G(V,E)\f$. 28 | * Run-time complexity is \f$O(|V| + |E|)\f$. 29 | * 30 | * The implementation is based on 31 | * "http://en.wikipedia.org/wiki/Tarjan's_strongly_connected_components_algorithm". 32 | */ 33 | 34 | #ifndef TARJAN_H_INCLUDED 35 | #define TARJAN_H_INCLUDED 36 | 37 | #ifdef __cplusplus 38 | extern "C" { 39 | #endif /* __cplusplus */ 40 | 41 | /** 42 | * Compute the strongly connected components of a directed graph, 43 | * \f$G(V,E)\f$. 44 | * 45 | * The components are returned in reverse topological sorted sequence. 46 | * 47 | * \param[in] nv Number of graph vertices. 48 | * 49 | * \param[in] ia 50 | * \param[in] ja adjacency matrix for directed graph in compressed sparse row 51 | * format: vertex i has directed edges to vertices ja[ia[i]], 52 | * ..., ja[ia[i+1]-1]. 53 | * 54 | * \param[out] vert Permutation of vertices into topologically sorted 55 | * sequence of strong components (i.e., loops). 56 | * Array of size nv. 57 | * 58 | * \param[out] comp Pointers to start of each strongly connected 59 | * component in vert, the i'th component has vertices 60 | * vert[comp[i]], ..., vert[comp[i+1] - 1]. Array of 61 | * size nv + 1. 62 | * 63 | * \param[out] ncomp Number of strong components. Pointer to a single 64 | * int. 65 | * 66 | * \param[out] work Pointer to a scratch array represented as a block 67 | * of memory capable of holding 3 * nv 68 | * elements of type int. 69 | */ 70 | void 71 | tarjan(int nv , 72 | const int *ia , 73 | const int *ja , 74 | int *vert , 75 | int *comp , 76 | int *ncomp, 77 | int *work ); 78 | 79 | #ifdef __cplusplus 80 | } 81 | #endif /* __cplusplus */ 82 | 83 | #endif /* TARJAN_H_INCLUDED */ 84 | 85 | /* Local Variables: */ 86 | /* c-basic-offset:4 */ 87 | /* End: */ 88 | -------------------------------------------------------------------------------- /opm/core/utility/initHydroCarbonState.hpp: -------------------------------------------------------------------------------- 1 | #ifndef INITHYDROCARBONSTATE_HPP 2 | #define INITHYDROCARBONSTATE_HPP 3 | 4 | #include "opm/core/simulator/BlackoilState.hpp" 5 | 6 | namespace Opm 7 | { 8 | 9 | inline void initHydroCarbonState(BlackoilState& state, const PhaseUsage& pu, const int num_cells, const bool has_disgas, const bool has_vapoil) { 10 | enum { Oil = BlackoilPhases::Liquid, Gas = BlackoilPhases::Vapour, Water = BlackoilPhases::Aqua }; 11 | // hydrocarbonstate is only used when gas and oil is present 12 | assert(pu.phase_used[Oil]); 13 | std::vector& hydroCarbonState = state.hydroCarbonState(); 14 | hydroCarbonState.resize(num_cells); 15 | if (!pu.phase_used[Gas]) { 16 | // hydroCarbonState should only be used when oil and gas is present. Return OilOnly to avoid potential trouble. 17 | std::fill(hydroCarbonState.begin(), hydroCarbonState.end(), HydroCarbonState::OilOnly); 18 | return; 19 | } 20 | const int np = pu.num_phases; 21 | std::fill(hydroCarbonState.begin(), hydroCarbonState.end(), HydroCarbonState::GasAndOil); 22 | 23 | // set hydrocarbon state 24 | const double epsilon = std::sqrt(std::numeric_limits::epsilon()); 25 | const std::vector& saturation = state.saturation(); 26 | for (int c = 0; c < num_cells; ++c) { 27 | if (pu.phase_used[Water]) { 28 | if ( saturation[c*np + pu.phase_pos[ Water ]] > (1.0 - epsilon)) { 29 | continue; // cases (almost) filled with water is treated as GasAndOil case; 30 | } 31 | } 32 | if ( saturation[c*np + pu.phase_pos[ Gas ]] == 0.0 && has_disgas) { 33 | hydroCarbonState[c] = HydroCarbonState::OilOnly; 34 | continue; 35 | } 36 | if ( saturation[c*np + pu.phase_pos[ Oil ]] == 0.0 && has_vapoil) { 37 | hydroCarbonState[c] = HydroCarbonState::GasOnly; 38 | } 39 | } 40 | } 41 | 42 | 43 | } // namespace Opm 44 | #endif // INITHYDROCARBONSTATE_HPP 45 | -------------------------------------------------------------------------------- /opm/core/well_controls.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2012 SINTEF ICT, Applied Mathematics. 3 | 4 | This file is part of the Open Porous Media project (OPM). 5 | 6 | OPM is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | OPM is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with OPM. If not, see . 18 | */ 19 | 20 | #ifndef OPM_WELL_CONTROLS_H_INCLUDED 21 | #define OPM_WELL_CONTROLS_H_INCLUDED 22 | 23 | #include 24 | 25 | /** 26 | * @file 27 | * API for managing sets of well controls. 28 | */ 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | enum WellControlType { 35 | BHP, /**< Well constrained by BHP target */ 36 | THP, /**< Well constrained by THP target */ 37 | RESERVOIR_RATE, /**< Well constrained by reservoir volume flow rate */ 38 | SURFACE_RATE /**< Well constrained by surface volume flow rate */ 39 | }; 40 | 41 | struct WellControls; 42 | 43 | bool 44 | well_controls_equal(const struct WellControls *ctrls1, const struct WellControls *ctrls2 , bool verbose); 45 | 46 | struct WellControls * 47 | well_controls_create(void); 48 | 49 | /** 50 | * Create deep copy (clone) of an existing set of well controls. 51 | * 52 | * @param[in] ctrl Existing set of well controls. 53 | * 54 | * @return Deep copy of @c ctrl. 55 | */ 56 | struct WellControls * 57 | well_controls_clone(const struct WellControls *ctrl); 58 | 59 | void 60 | well_controls_destroy(struct WellControls *ctrl); 61 | 62 | 63 | int 64 | well_controls_get_num(const struct WellControls *ctrl); 65 | 66 | int 67 | well_controls_get_current( const struct WellControls * ctrl); 68 | 69 | void 70 | well_controls_set_current( struct WellControls * ctrl, int current); 71 | 72 | 73 | bool 74 | well_controls_well_is_stopped(const struct WellControls * ctrl); 75 | 76 | bool 77 | well_controls_well_is_open(const struct WellControls * ctrl); 78 | 79 | void 80 | well_controls_open_well( struct WellControls * ctrl); 81 | 82 | void 83 | well_controls_stop_well( struct WellControls * ctrl); 84 | 85 | int 86 | well_controls_add_new(enum WellControlType type , double target , double alq , int vfp , const double * distr , struct WellControls * ctrl); 87 | 88 | enum WellControlType 89 | well_controls_iget_type(const struct WellControls * ctrl, int control_index); 90 | 91 | enum WellControlType 92 | well_controls_get_current_type(const struct WellControls * ctrl); 93 | 94 | void 95 | well_controls_iset_type( struct WellControls * ctrls , int control_index , enum WellControlType type); 96 | 97 | void 98 | well_controls_iset_target(struct WellControls * ctrl, int control_index , double target); 99 | 100 | double 101 | well_controls_iget_target(const struct WellControls * ctrl, int control_index); 102 | 103 | void 104 | well_controls_iset_alq(struct WellControls * ctrl, int control_index , double alq); 105 | 106 | double 107 | well_controls_iget_alq(const struct WellControls * ctrl, int control_index ); 108 | 109 | void 110 | well_controls_iset_vfp(struct WellControls * ctrl, int control_index , int vfp); 111 | 112 | int 113 | well_controls_iget_vfp(const struct WellControls * ctrl, int control_index ); 114 | 115 | double 116 | well_controls_get_current_target(const struct WellControls * ctrl); 117 | 118 | const double * 119 | well_controls_iget_distr(const struct WellControls * ctrl, int control_index); 120 | 121 | void 122 | well_controls_iset_distr(const struct WellControls * ctrl, int control_index, const double * distr); 123 | 124 | const double * 125 | well_controls_get_current_distr(const struct WellControls * ctrl); 126 | 127 | void 128 | well_controls_assert_number_of_phases(struct WellControls * ctrl , int number_of_phases); 129 | 130 | void 131 | well_controls_clear(struct WellControls * ctrl); 132 | 133 | 134 | #ifdef __cplusplus 135 | } 136 | #endif 137 | 138 | #endif /* OPM_WELL_CONTROLS_H_INCLUDED */ 139 | -------------------------------------------------------------------------------- /opm/core/wells/DynamicListEconLimited.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2016 SINTEF ICT, Applied Mathematics. 3 | 4 | This file is part of the Open Porous Media project (OPM). 5 | 6 | OPM is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | OPM is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with OPM. If not, see . 18 | */ 19 | #ifndef OPM_DYNAMICLISTECONLIMITED_HPP 20 | #define OPM_DYNAMICLISTECONLIMITED_HPP 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | #include 27 | 28 | namespace Opm 29 | { 30 | 31 | /// to handle the wells and connections violating economic limits. 32 | class DynamicListEconLimited 33 | { 34 | public: 35 | 36 | DynamicListEconLimited() { 37 | } 38 | 39 | bool wellShutEconLimited(const std::string& well_name) const { 40 | return std::find(m_shut_wells.begin(), m_shut_wells.end(), well_name) != m_shut_wells.end(); 41 | } 42 | 43 | void addShutWell(const std::string& well_name) { 44 | assert( !wellShutEconLimited(well_name) ); 45 | assert( !wellStoppedEconLimited(well_name) ); 46 | 47 | m_shut_wells.push_back(well_name); 48 | } 49 | 50 | bool wellStoppedEconLimited(const std::string& well_name) const { 51 | return std::find(m_stopped_wells.begin(), m_stopped_wells.end(), well_name) != m_stopped_wells.end(); 52 | } 53 | 54 | void addStoppedWell(const std::string& well_name) { 55 | assert( !wellShutEconLimited(well_name) ); 56 | assert( !wellStoppedEconLimited(well_name) ); 57 | 58 | m_stopped_wells.push_back(well_name); 59 | } 60 | 61 | 62 | // TODO: maybe completion better here 63 | bool anyConnectionClosedForWell(const std::string& well_name) const { 64 | return (m_cells_closed_connections.find(well_name) != m_cells_closed_connections.end()); 65 | } 66 | 67 | const std::vector& getClosedConnectionsForWell(const std::string& well_name) const { 68 | return (m_cells_closed_connections.find(well_name)->second); 69 | } 70 | 71 | void addClosedConnectionsForWell(const std::string& well_name, 72 | const int cell_closed_connection) { 73 | if (!anyConnectionClosedForWell(well_name)) { 74 | // first time adding a connection for the well 75 | std::vector vector_cells = {cell_closed_connection}; 76 | m_cells_closed_connections[well_name] = vector_cells; 77 | } else { 78 | std::vector& closed_connections = m_cells_closed_connections.find(well_name)->second; 79 | closed_connections.push_back(cell_closed_connection); 80 | } 81 | } 82 | 83 | private: 84 | std::vector m_shut_wells; 85 | std::vector m_stopped_wells; 86 | // using grid cell number to indicate the location of the connections 87 | std::map> m_cells_closed_connections; 88 | }; 89 | 90 | } // namespace Opm 91 | #endif /* OPM_DYNAMICLISTECONLIMITED_HPP */ 92 | 93 | -------------------------------------------------------------------------------- /opm/core/wells/InjectionSpecification.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2012 Sintef. 3 | Copyright 2016 Statoil. 4 | 5 | This file is part of the Open Porous Media project (OPM). 6 | 7 | OPM is free software: you can redistribute it and/or modify it under the terms 8 | of the GNU General Public License as published by the Free Software 9 | Foundation, either version 3 of the License, or (at your option) any later 10 | version. 11 | 12 | OPM is distributed in the hope that it will be useful, but WITHOUT ANY 13 | WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 14 | A PARTICULAR PURPOSE. See the GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License along with 17 | OPM. If not, see . 18 | */ 19 | 20 | #include 21 | #include "config.h" 22 | 23 | #include 24 | #include 25 | 26 | namespace Opm 27 | { 28 | 29 | InjectionSpecification::InjectionSpecification() 30 | : injector_type_(WATER), 31 | control_mode_(NONE), 32 | surface_flow_max_rate_(-1e100), 33 | reservoir_flow_max_rate_(-1e100), 34 | BHP_limit_(-1e100), 35 | reinjection_fraction_target_(1), 36 | voidage_replacment_fraction_(1), 37 | guide_rate_(-1.0), 38 | guide_rate_type_(NONE_GRT) 39 | { 40 | 41 | } 42 | 43 | std::string 44 | InjectionSpecification::toString(const ControlMode& mode) 45 | { 46 | switch(mode) { 47 | case ControlMode::NONE: return "NONE"; 48 | case ControlMode::RATE: return "RATE"; 49 | case ControlMode::RESV: return "RESV"; 50 | case ControlMode::BHP : return "BHP" ; 51 | case ControlMode::THP : return "THP" ; 52 | case ControlMode::REIN: return "REIN"; 53 | case ControlMode::VREP: return "VREP"; 54 | case ControlMode::GRUP: return "GRUP"; 55 | case ControlMode::FLD : return "FLD" ; 56 | } 57 | OPM_THROW(std::domain_error, "Unknown control mode " << mode << " encountered in injection specification"); 58 | } 59 | 60 | 61 | std::string 62 | InjectionSpecification::toString(const InjectorType& type) 63 | { 64 | switch(type) { 65 | case InjectorType::WATER: return "WATER"; 66 | case InjectorType::OIL : return "OIL" ; 67 | case InjectorType::GAS : return "GAS" ; 68 | } 69 | OPM_THROW(std::domain_error, "Unknown injector type " << type << " encountered in injection specification"); 70 | } 71 | 72 | 73 | std::string 74 | InjectionSpecification::toString(const GuideRateType& type) 75 | { 76 | switch(type) { 77 | case GuideRateType::RAT : return "RAT" ; 78 | case GuideRateType::NONE_GRT: return "NONE_GRT"; 79 | } 80 | OPM_THROW(std::domain_error, "Unknown guide rate type " << type << " encountered in injection specification"); 81 | } 82 | } // namespace Opm 83 | -------------------------------------------------------------------------------- /opm/core/wells/InjectionSpecification.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPM_INJECTORSPECIFICATION_HPP 2 | #define OPM_INJECTORSPECIFICATION_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace Opm 8 | { 9 | 10 | struct InjectionSpecification 11 | { 12 | 13 | enum ControlMode 14 | { 15 | NONE, RATE, RESV, BHP, THP, REIN, VREP, GRUP, FLD 16 | }; 17 | 18 | enum InjectorType 19 | { 20 | WATER, OIL, GAS 21 | }; 22 | 23 | enum GuideRateType 24 | { 25 | RAT, NONE_GRT 26 | }; 27 | 28 | InjectionSpecification(); 29 | static std::string toString(const ControlMode& mode); 30 | static std::string toString(const InjectorType& type); 31 | static std::string toString(const GuideRateType& type); 32 | InjectorType injector_type_; 33 | ControlMode control_mode_; 34 | double surface_flow_max_rate_; 35 | double reservoir_flow_max_rate_; 36 | double BHP_limit_; 37 | double reinjection_fraction_target_; 38 | double voidage_replacment_fraction_; 39 | double guide_rate_; 40 | GuideRateType guide_rate_type_; 41 | }; 42 | 43 | } 44 | 45 | #endif /* OPM_INJECTORSPECIFICATION_HPP */ 46 | 47 | -------------------------------------------------------------------------------- /opm/core/wells/ProductionSpecification.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2012 Sintef. 3 | Copyright 2016 Statoil. 4 | 5 | This file is part of the Open Porous Media project (OPM). 6 | 7 | OPM is free software: you can redistribute it and/or modify it under the terms 8 | of the GNU General Public License as published by the Free Software 9 | Foundation, either version 3 of the License, or (at your option) any later 10 | version. 11 | 12 | OPM is distributed in the hope that it will be useful, but WITHOUT ANY 13 | WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 14 | A PARTICULAR PURPOSE. See the GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License along with 17 | OPM. If not, see . 18 | */ 19 | 20 | #include 21 | #include "config.h" 22 | 23 | #include 24 | #include 25 | 26 | namespace Opm 27 | { 28 | 29 | ProductionSpecification::ProductionSpecification() 30 | : 31 | control_mode_(NONE), 32 | procedure_(NONE_P), 33 | oil_max_rate_(-1e100), 34 | water_max_rate_(-1e100), 35 | gas_max_rate_(-1e100), 36 | liquid_max_rate_(-1e100), 37 | reservoir_flow_max_rate_(-1e100), 38 | BHP_limit_(-1e100), 39 | guide_rate_(-1.0), 40 | guide_rate_type_(NONE_GRT) 41 | { 42 | } 43 | 44 | 45 | std::string 46 | ProductionSpecification::toString(const ControlMode& mode) 47 | { 48 | switch(mode) { 49 | case ControlMode::NONE: return "NONE"; 50 | case ControlMode::ORAT: return "ORAT"; 51 | case ControlMode::WRAT: return "WRAT"; 52 | case ControlMode::GRAT: return "GRAT"; 53 | case ControlMode::LRAT: return "LRAT"; 54 | case ControlMode::CRAT: return "CRAT"; 55 | case ControlMode::RESV: return "RESV"; 56 | case ControlMode::PRBL: return "RPBL"; 57 | case ControlMode::BHP : return "BHP" ; 58 | case ControlMode::THP : return "THP" ; 59 | case ControlMode::GRUP: return "GRUP"; 60 | case ControlMode::FLD : return "FLD" ; 61 | } 62 | OPM_THROW(std::domain_error, "Unknown control mode " << mode << " encountered in production specification"); 63 | } 64 | 65 | 66 | std::string 67 | ProductionSpecification::toString(const Procedure& type) 68 | { 69 | switch(type) { 70 | case Procedure::NONE_P: return "NONE_P"; 71 | case Procedure::RATE : return "RATE" ; 72 | case Procedure::WELL : return "WELL" ; 73 | } 74 | OPM_THROW(std::domain_error, "Unknown procedure " << type << " encountered in production specification"); 75 | } 76 | 77 | 78 | std::string 79 | ProductionSpecification::toString(const GuideRateType& type) 80 | { 81 | switch(type) { 82 | case GuideRateType::OIL : return "OIL" ; 83 | case GuideRateType::GAS : return "GAS" ; 84 | case GuideRateType::WATER : return "WATER" ; 85 | case GuideRateType::LIQ : return "LIQ" ; 86 | case GuideRateType::NONE_GRT: return "NONE_GRT"; 87 | } 88 | OPM_THROW(std::domain_error, "Unknown guide rate type " << type << " encountered in production specification"); 89 | } 90 | 91 | 92 | } 93 | -------------------------------------------------------------------------------- /opm/core/wells/ProductionSpecification.hpp: -------------------------------------------------------------------------------- 1 | #ifndef OPM_PRODUCTIONSPECIFICATION_HPP 2 | #define OPM_PRODUCTIONSPECIFICATION_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace Opm 8 | { 9 | 10 | struct ProductionSpecification 11 | { 12 | 13 | enum ControlMode 14 | { 15 | NONE = 0, ORAT = 1, WRAT=2, GRAT=3, LRAT=4, CRAT=5, RESV=6, PRBL=7, BHP=8, THP=9, GRUP=10, FLD=11 16 | }; 17 | 18 | enum Procedure 19 | { 20 | NONE_P, RATE, WELL 21 | }; 22 | 23 | enum GuideRateType 24 | { 25 | OIL, GAS, WATER, LIQ, NONE_GRT 26 | }; 27 | 28 | ProductionSpecification(); 29 | static std::string toString(const ControlMode& mode); 30 | static std::string toString(const Procedure& type); 31 | static std::string toString(const GuideRateType& type); 32 | 33 | ControlMode control_mode_; 34 | Procedure procedure_; 35 | 36 | double oil_max_rate_; 37 | double water_max_rate_; 38 | double gas_max_rate_; 39 | double liquid_max_rate_; 40 | double reservoir_flow_max_rate_; 41 | double BHP_limit_; 42 | double guide_rate_; 43 | GuideRateType guide_rate_type_; 44 | 45 | }; 46 | } 47 | 48 | #endif /* OPM_PRODUCTIONSPECIFICATION_HPP */ 49 | -------------------------------------------------------------------------------- /redhat/opm-core.spec: -------------------------------------------------------------------------------- 1 | # 2 | # spec file for package opm-core 3 | # 4 | 5 | %define tag rc1 6 | 7 | Name: opm-core 8 | Version: 2017.10 9 | Release: 0 10 | Summary: Open Porous Media - core library 11 | License: GPL-3.0 12 | Group: Development/Libraries/C and C++ 13 | Url: http://www.opm-project.org/ 14 | Source0: https://github.com/OPM/%{name}/archive/release/%{version}/%{tag}.tar.gz#/%{name}-%{version}.tar.gz 15 | BuildRequires: blas-devel lapack-devel dune-common-devel opm-grid-devel 16 | BuildRequires: git suitesparse-devel doxygen bc opm-material-devel 17 | BuildRequires: tinyxml-devel dune-istl-devel ecl-devel opm-common-devel 18 | BuildRequires: opm-parser-devel opm-material-devel opm-output-devel 19 | BuildRequires: devtoolset-6-toolchain 20 | %{?el6:BuildRequires: cmake3 boost148-devel} 21 | %{?!el6:BuildRequires: cmake boost-devel} 22 | BuildRoot: %{_tmppath}/%{name}-%{version}-build 23 | Requires: libopm-core1 = %{version} 24 | 25 | %description 26 | The Open Porous Media (OPM) initiative provides a set of open-source tools centered around the simulation of flow and transport of fluids in porous media. The goal of the initiative is to establish a sustainable environment for the development of an efficient and well-maintained software suite. 27 | 28 | %package -n libopm-core1 29 | Summary: Open Porous Media - core library 30 | Group: System/Libraries 31 | 32 | %description -n libopm-core1 33 | The Open Porous Media (OPM) initiative provides a set of open-source tools centered around the simulation of flow and transport of fluids in porous media. The goal of the initiative is to establish a sustainable environment for the development of an efficient and well-maintained software suite. 34 | 35 | %package devel 36 | Summary: Development and header files for opm-core 37 | Group: Development/Libraries/C and C++ 38 | Requires: %{name} = %{version} 39 | Requires: blas-devel 40 | Requires: lapack-devel 41 | Requires: suitesparse-devel 42 | Requires: libopm-core1 = %{version} 43 | 44 | %description devel 45 | This package contains the development and header files for opm-core 46 | 47 | %package doc 48 | Summary: Documentation files for opm-core 49 | Group: Documentation 50 | BuildArch: noarch 51 | 52 | %description doc 53 | This package contains the documentation files for opm-core 54 | 55 | %prep 56 | %setup -q -n %{name}-release-%{version}-%{tag} 57 | 58 | # consider using -DUSE_VERSIONED_DIR=ON if backporting 59 | %build 60 | scl enable devtoolset-6 bash 61 | %{?el6:cmake3} %{!?el6:cmake} -DBUILD_SHARED_LIBS=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DSTRIP_DEBUGGING_SYMBOLS=ON -DCMAKE_INSTALL_PREFIX=%{_prefix} -DCMAKE_INSTALL_DOCDIR=share/doc/%{name}-%{version} -DUSE_RUNPATH=OFF -DWITH_NATIVE=OFF -DCMAKE_CXX_COMPILER=/opt/rh/devtoolset-6/root/usr/bin/g++ -DCMAKE_C_COMPILER=/opt/rh/devtoolset-6/root/usr/bin/gcc -DCMAKE_Fortran_COMPILER=/opt/rh/devtoolset-6/root/usr/bin/gfortran %{?el6:-DBOOST_LIBRARYDIR=%{_libdir}/boost148 -DBOOST_INCLUDEDIR=%{_includedir}/boost148} 62 | make 63 | 64 | %install 65 | make install DESTDIR=${RPM_BUILD_ROOT} 66 | make install-html DESTDIR=${RPM_BUILD_ROOT} 67 | 68 | %clean 69 | rm -rf %{buildroot} 70 | 71 | %post -n libopm-core1 -p /sbin/ldconfig 72 | 73 | %postun -n libopm-core1 -p /sbin/ldconfig 74 | 75 | %files 76 | %doc COPYING README.md 77 | 78 | %files doc 79 | %{_docdir}/* 80 | 81 | %files -n libopm-core1 82 | %defattr(-,root,root,-) 83 | %{_libdir}/*.so.* 84 | 85 | %files devel 86 | %defattr(-,root,root,-) 87 | %{_libdir}/*.so 88 | %{_libdir}/dunecontrol/* 89 | %{_libdir}/pkgconfig/* 90 | %{_includedir}/* 91 | %{_datadir}/cmake/* 92 | %{_datadir}/opm/cmake/Modules/* 93 | -------------------------------------------------------------------------------- /tests/capillary.DATA: -------------------------------------------------------------------------------- 1 | -- Most of the following sections are not actually needed by the test, 2 | -- but it is required by the Eclipse reference manual that they are 3 | -- present. Also, the higher level opm-parser classes 4 | -- (i.e. Opm::EclipseState et al.) assume that they are present. 5 | 6 | ------------------------------------- 7 | RUNSPEC 8 | 9 | WATER 10 | OIL 11 | GAS 12 | 13 | DIMENS 14 | 40 40 40 / 15 | 16 | TABDIMS 17 | 1 1 40 20 1 20 / 18 | 19 | EQLDIMS 20 | -- NTEQUL 21 | 1 / 22 | 23 | ------------------------------------- 24 | GRID 25 | 26 | -- Opm::EclipseState assumes that _some_ grid gets defined, so let's 27 | -- specify a fake one... 28 | 29 | DXV 30 | 40*1 / 31 | 32 | DYV 33 | 40*1 / 34 | 35 | DZV 36 | 40*1 / 37 | 38 | DEPTHZ 39 | 1681*123.456 / 40 | 41 | ------------------------------------- 42 | PROPS 43 | 44 | PVDO 45 | 100 1.0 1.0 46 | 200 0.9 1.0 47 | / 48 | 49 | PVDG 50 | 100 0.010 0.1 51 | 200 0.005 0.2 52 | / 53 | 54 | PVTW 55 | 1.0 1.0 4.0E-5 0.96 0.0 56 | / 57 | 58 | SWOF 59 | 0.2 0 1 0.4 60 | 1 1 0 0.1 61 | / 62 | 63 | SGOF 64 | 0 0 1 0.2 65 | 0.8 1 0 0.5 66 | / 67 | 68 | DENSITY 69 | 700 1000 1 70 | / 71 | 72 | ------------------------------------- 73 | SOLUTION 74 | 75 | EQUIL 76 | 50 150 50 0.25 20 0.35 1* 1* 0 77 | / 78 | 79 | ------------------------------------- 80 | SCHEDULE 81 | -- empty section 82 | -------------------------------------------------------------------------------- /tests/capillarySwatinit.DATA: -------------------------------------------------------------------------------- 1 | -- Most of the following sections are not actually needed by the test, 2 | -- but it is required by the Eclipse reference manual that they are 3 | -- present. Also, the higher level opm-parser classes 4 | -- (i.e. Opm::EclipseState et al.) assume that they are present. 5 | 6 | ------------------------------------- 7 | RUNSPEC 8 | 9 | WATER 10 | OIL 11 | GAS 12 | 13 | DIMENS 14 | 1 1 20 / 15 | 16 | TABDIMS 17 | 1 1 40 20 1 20 / 18 | 19 | EQLDIMS 20 | -- NTEQUL 21 | 1 / 22 | 23 | START 24 | 1 'JAN' 2015 / 25 | ------------------------------------- 26 | GRID 27 | 28 | -- Opm::EclipseState assumes that _some_ grid gets defined, so let's 29 | -- specify a fake one... 30 | 31 | DXV 32 | 1 / 33 | 34 | DYV 35 | 1 / 36 | 37 | DZ 38 | 20*5 / 39 | 40 | TOPS 41 | 0 / 42 | 43 | PORO 44 | 20*0.3 / 45 | 46 | PERMX 47 | 20*500 / 48 | 49 | PERMZ 50 | 20*500 / 51 | ------------------------------------- 52 | PROPS 53 | 54 | ROCK 55 | 14.7 3E-6 / 56 | 57 | PVDO 58 | 100 1.0 1.0 59 | 200 0.9 1.0 60 | / 61 | 62 | PVDG 63 | 100 0.010 0.1 64 | 200 0.005 0.2 65 | / 66 | 67 | PVTW 68 | 1.0 1.0 4.0E-5 0.96 0.0 69 | / 70 | 71 | SWOF 72 | 0.2 0 1 0.4 73 | 1 1 0 0.1 74 | / 75 | 76 | SGOF 77 | 0 0 1 0.2 78 | 0.8 1 0 0.5 79 | / 80 | 81 | DENSITY 82 | 700 1000 1 83 | / 84 | 85 | SWATINIT 86 | 5*0 87 | 10*0.5 88 | 5*1 / 89 | 90 | ------------------------------------- 91 | SOLUTION 92 | 93 | EQUIL 94 | 50 150 50 0.25 20 0.35 1* 1* 0 95 | / 96 | 97 | RPTSOL 98 | SWATINIT SWAT SGAS SOIL PCOG PCOW 99 | / 100 | ------------------------------------- 101 | SCHEDULE 102 | -- empty section 103 | -------------------------------------------------------------------------------- /tests/capillary_overlap.DATA: -------------------------------------------------------------------------------- 1 | NOECHO 2 | 3 | RUNSPEC ====== 4 | 5 | WATER 6 | OIL 7 | GAS 8 | 9 | TABDIMS 10 | 1 1 40 20 1 20 / 11 | 12 | DIMENS 13 | 1 1 20 14 | / 15 | 16 | WELLDIMS 17 | 30 10 2 30 / 18 | 19 | START 20 | 1 'JAN' 1990 / 21 | 22 | NSTACK 23 | 25 / 24 | 25 | EQLDIMS 26 | -- NTEQUL 27 | 1 / 28 | 29 | 30 | FMTOUT 31 | FMTIN 32 | 33 | GRID ====== 34 | 35 | DXV 36 | 1.0 37 | / 38 | 39 | DYV 40 | 1.0 41 | / 42 | 43 | DZV 44 | 20*5.0 45 | / 46 | 47 | 48 | PORO 49 | 20*0.2 50 | / 51 | 52 | 53 | PERMZ 54 | 20*1.0 55 | / 56 | 57 | PERMY 58 | 20*100.0 59 | / 60 | 61 | PERMX 62 | 20*100.0 63 | / 64 | 65 | BOX 66 | 1 1 1 1 1 1 / 67 | 68 | TOPS 69 | 0.0 70 | / 71 | 72 | PROPS ====== 73 | 74 | 75 | PVDO 76 | 100 1.0 1.0 77 | 200 0.9 1.0 78 | / 79 | 80 | PVDG 81 | 100 0.010 0.1 82 | 200 0.005 0.2 83 | / 84 | 85 | SWOF 86 | 0.2 0 1 0.9 87 | 1 1 0 0.1 88 | / 89 | 90 | SGOF 91 | 0 0 1 0.2 92 | 0.8 1 0 0.5 93 | / 94 | 95 | PVTW 96 | --RefPres Bw Comp Vw Cv 97 | 1. 1.0 4.0E-5 0.96 0.0 / 98 | 99 | 100 | ROCK 101 | --RefPres Comp 102 | 1. 5.0E-5 / 103 | 104 | DENSITY 105 | 700 1000 1 106 | / 107 | 108 | SOLUTION ====== 109 | 110 | EQUIL 111 | 45 150 50 0.25 45 0.35 1* 1* 0 112 | / 113 | 114 | RPTSOL 115 | 'PRES' 'PGAS' 'PWAT' 'SOIL' 'SWAT' 'SGAS' 'RESTART=2' / 116 | 117 | SUMMARY ====== 118 | RUNSUM 119 | 120 | SEPARATE 121 | 122 | SCHEDULE ====== 123 | 124 | RPTSCHED 125 | 'PRES' 'PGAS' 'PWAT' 'SOIL' 'SWAT' 'SGAS' 'RESTART=3' 'NEWTON=2' / 126 | 127 | 128 | END 129 | -------------------------------------------------------------------------------- /tests/deadfluids.DATA: -------------------------------------------------------------------------------- 1 | -- Most of the following sections are not actually needed by the test, 2 | -- but it is required by the Eclipse reference manual that they are 3 | -- present. Also, the higher level opm-parser classes 4 | -- (i.e. Opm::EclipseState et al.) assume that they are present. 5 | 6 | ------------------------------------- 7 | RUNSPEC 8 | 9 | WATER 10 | OIL 11 | GAS 12 | 13 | DIMENS 14 | 3 3 3 / 15 | 16 | TABDIMS 17 | 1 1 40 20 1 20 / 18 | 19 | EQLDIMS 20 | -- NTEQUL 21 | 1 / 22 | 23 | ------------------------------------- 24 | GRID 25 | 26 | -- Opm::EclipseState assumes that _some_ grid gets defined, so let's 27 | -- specify a fake one... 28 | 29 | DXV 30 | 1 2 3 / 31 | 32 | DYV 33 | 4 5 6 / 34 | 35 | DZV 36 | 7 8 9 / 37 | 38 | DEPTHZ 39 | 16*123.456 / 40 | 41 | ------------------------------------- 42 | PROPS 43 | 44 | PVDO 45 | 100 1.0 1.0 46 | 200 0.5 1.0 47 | / 48 | 49 | PVDG 50 | 100 0.05 0.1 51 | 200 0.02 0.2 52 | / 53 | 54 | PVTW 55 | 1.0 1.0 4.0E-5 0.96 0.0 56 | / 57 | 58 | SWOF 59 | 0 0 1 0 60 | 1 1 0 0 61 | / 62 | 63 | SGOF 64 | 0 0 1 0 65 | 1 1 0 0 66 | / 67 | 68 | DENSITY 69 | 700 1000 10 70 | / 71 | 72 | ------------------------------------- 73 | SOLUTION 74 | 75 | EQUIL 76 | 5 150 5 0 2 0 1* 1* 0 77 | / 78 | 79 | ------------------------------------- 80 | SCHEDULE 81 | -- empty section 82 | -------------------------------------------------------------------------------- /tests/equil_livegas.DATA: -------------------------------------------------------------------------------- 1 | NOECHO 2 | 3 | RUNSPEC ====== 4 | 5 | WATER 6 | OIL 7 | GAS 8 | VAPOIL 9 | 10 | TABDIMS 11 | 1 1 40 20 1 20 / 12 | 13 | DIMENS 14 | 1 1 20 15 | / 16 | 17 | WELLDIMS 18 | 30 10 2 30 / 19 | 20 | START 21 | 1 'JAN' 1990 / 22 | 23 | NSTACK 24 | 25 / 25 | 26 | EQLDIMS 27 | -- NTEQUL 28 | 1 / 29 | 30 | 31 | FMTOUT 32 | FMTIN 33 | 34 | GRID ====== 35 | 36 | DXV 37 | 1.0 38 | / 39 | 40 | DYV 41 | 1.0 42 | / 43 | 44 | DZV 45 | 20*5.0 46 | / 47 | 48 | 49 | PORO 50 | 20*0.2 51 | / 52 | 53 | 54 | PERMZ 55 | 20*1.0 56 | / 57 | 58 | PERMY 59 | 20*100.0 60 | / 61 | 62 | PERMX 63 | 20*100.0 64 | / 65 | 66 | BOX 67 | 1 1 1 1 1 1 / 68 | 69 | TOPS 70 | 0.0 71 | / 72 | 73 | PROPS ====== 74 | 75 | PVDO 76 | 100 1.0 1.0 77 | 200 0.9 1.0 78 | / 79 | 80 | PVTG 81 | -- Pg Rv Bg Vg 82 | 100 0.0001 0.010 0.1 83 | 0.0 0.0104 0.1 / 84 | 200 0.0004 0.005 0.2 85 | 0.0 0.0054 0.2 / 86 | / 87 | 88 | SWOF 89 | 0.2 0 1 0.9 90 | 1 1 0 0.1 91 | / 92 | 93 | SGOF 94 | 0 0 1 0.2 95 | 0.8 1 0 0.5 96 | / 97 | 98 | PVTW 99 | --RefPres Bw Comp Vw Cv 100 | 1. 1.0 4.0E-5 0.96 0.0 / 101 | 102 | 103 | ROCK 104 | --RefPres Comp 105 | 1. 5.0E-5 / 106 | 107 | DENSITY 108 | 700 1000 1 109 | / 110 | 111 | SOLUTION ====== 112 | 113 | EQUIL 114 | 45 150 50 0.25 45 0.35 1* 1* 0 115 | / 116 | 117 | RPTSOL 118 | 'PRES' 'PGAS' 'PWAT' 'SOIL' 'SWAT' 'SGAS' 'RS' 'RESTART=2' / 119 | 120 | SUMMARY ====== 121 | RUNSUM 122 | 123 | SEPARATE 124 | 125 | SCHEDULE ====== 126 | 127 | RPTSCHED 128 | 'PRES' 'PGAS' 'PWAT' 'SOIL' 'SWAT' 'SGAS' 'RS' 'RESTART=3' 'NEWTON=2' / 129 | 130 | 131 | END 132 | -------------------------------------------------------------------------------- /tests/equil_liveoil.DATA: -------------------------------------------------------------------------------- 1 | NOECHO 2 | 3 | RUNSPEC ====== 4 | 5 | WATER 6 | OIL 7 | GAS 8 | DISGAS 9 | 10 | TABDIMS 11 | 1 1 40 20 1 20 / 12 | 13 | DIMENS 14 | 1 1 20 15 | / 16 | 17 | WELLDIMS 18 | 30 10 2 30 / 19 | 20 | START 21 | 1 'JAN' 1990 / 22 | 23 | NSTACK 24 | 25 / 25 | 26 | EQLDIMS 27 | -- NTEQUL 28 | 1 / 29 | 30 | 31 | FMTOUT 32 | FMTIN 33 | 34 | GRID ====== 35 | 36 | DXV 37 | 1.0 38 | / 39 | 40 | DYV 41 | 1.0 42 | / 43 | 44 | DZV 45 | 20*5.0 46 | / 47 | 48 | 49 | PORO 50 | 20*0.2 51 | / 52 | 53 | 54 | PERMZ 55 | 20*1.0 56 | / 57 | 58 | PERMY 59 | 20*100.0 60 | / 61 | 62 | PERMX 63 | 20*100.0 64 | / 65 | 66 | BOX 67 | 1 1 1 1 1 1 / 68 | 69 | TOPS 70 | 0.0 71 | / 72 | 73 | PROPS ====== 74 | 75 | 76 | PVTO 77 | -- Rs Pbub Bo Vo 78 | 0 1. 1.0000 1.20 / 79 | 20 40. 1.0120 1.17 / 80 | 40 80. 1.0255 1.14 / 81 | 60 120. 1.0380 1.11 / 82 | 80 160. 1.0510 1.08 / 83 | 100 200. 1.0630 1.06 / 84 | 120 240. 1.0750 1.03 / 85 | 140 280. 1.0870 1.00 / 86 | 160 320. 1.0985 .98 / 87 | 180 360. 1.1100 .95 / 88 | 200 400. 1.1200 .94 89 | 500. 1.1189 .94 / 90 | / 91 | 92 | PVDG 93 | 100 0.010 0.1 94 | 200 0.005 0.2 95 | / 96 | 97 | SWOF 98 | 0.2 0 1 0.9 99 | 1 1 0 0.1 100 | / 101 | 102 | SGOF 103 | 0 0 1 0.2 104 | 0.8 1 0 0.5 105 | / 106 | 107 | PVTW 108 | --RefPres Bw Comp Vw Cv 109 | 1. 1.0 4.0E-5 0.96 0.0 / 110 | 111 | 112 | ROCK 113 | --RefPres Comp 114 | 1. 5.0E-5 / 115 | 116 | DENSITY 117 | 700 1000 1 118 | / 119 | 120 | SOLUTION ====== 121 | 122 | EQUIL 123 | 45 150 50 0.25 45 0.35 1* 1* 0 124 | / 125 | 126 | RPTSOL 127 | 'PRES' 'PGAS' 'PWAT' 'SOIL' 'SWAT' 'SGAS' 'RS' 'RESTART=2' / 128 | 129 | SUMMARY ====== 130 | RUNSUM 131 | 132 | SEPARATE 133 | 134 | SCHEDULE ====== 135 | 136 | RPTSCHED 137 | 'PRES' 'PGAS' 'PWAT' 'SOIL' 'SWAT' 'SGAS' 'RS' 'RESTART=3' 'NEWTON=2' / 138 | 139 | 140 | END 141 | -------------------------------------------------------------------------------- /tests/equil_liveoil_grid.DATA: -------------------------------------------------------------------------------- 1 | WATER 2 | OIL 3 | GAS 4 | DISGAS 5 | 6 | DIMENS 7 | 1 1 20 8 | / 9 | 10 | DXV 11 | 1.0 12 | / 13 | 14 | DYV 15 | 1.0 16 | / 17 | 18 | DZV 19 | 20*5.0 20 | / 21 | 22 | TOPS 23 | 4*0.0 24 | / 25 | 26 | 27 | PVTO 28 | -- Rs Pbub Bo Vo 29 | 0 1. 1.0000 1.20 / 30 | 100 40. 1.0120 1.17 / 31 | 200 80. 1.0255 1.14 / 32 | 300 120. 1.0380 1.11 / 33 | 400 160. 1.0510 1.08 / 34 | 500 200. 1.0630 1.06 / 35 | 600 240. 1.0750 1.03 / 36 | 700 280. 1.0870 1.00 / 37 | 800 320. 1.0985 .98 / 38 | 900 360. 1.1100 .95 / 39 | 1000 400. 1.1200 .94 40 | 500. 1.1189 .94 / 41 | / 42 | 43 | 44 | PVDG 45 | 100 0.010 0.1 46 | 200 0.005 0.2 47 | / 48 | 49 | SWOF 50 | 0.2 0 1 0.9 51 | 1 1 0 0.1 52 | / 53 | 54 | SGOF 55 | 0 0 1 0.2 56 | 0.8 1 0 0.5 57 | / 58 | 59 | DENSITY 60 | 700 1000 1 61 | / 62 | 63 | EQUIL 64 | 45 150 50 0.25 45 0.35 65 | / 66 | -------------------------------------------------------------------------------- /tests/equil_rsvd_and_rvvd.DATA: -------------------------------------------------------------------------------- 1 | NOECHO 2 | 3 | RUNSPEC ====== 4 | 5 | WATER 6 | OIL 7 | GAS 8 | DISGAS 9 | VAPOIL 10 | 11 | TABDIMS 12 | 1 1 40 20 1 20 / 13 | 14 | DIMENS 15 | 1 1 20 16 | / 17 | 18 | WELLDIMS 19 | 30 10 2 30 / 20 | 21 | START 22 | 1 'JAN' 1990 / 23 | 24 | NSTACK 25 | 25 / 26 | 27 | EQLDIMS 28 | -- NTEQUL 29 | 1 / 30 | 31 | 32 | FMTOUT 33 | FMTIN 34 | 35 | GRID ====== 36 | 37 | DXV 38 | 1.0 39 | / 40 | 41 | DYV 42 | 1.0 43 | / 44 | 45 | DZV 46 | 20*5.0 47 | / 48 | 49 | 50 | PORO 51 | 20*0.2 52 | / 53 | 54 | 55 | PERMZ 56 | 20*1.0 57 | / 58 | 59 | PERMY 60 | 20*100.0 61 | / 62 | 63 | PERMX 64 | 20*100.0 65 | / 66 | 67 | BOX 68 | 1 1 1 1 1 1 / 69 | 70 | TOPS 71 | 0.0 72 | / 73 | 74 | PROPS ====== 75 | 76 | PVTO 77 | -- Rs Pbub Bo Vo 78 | 0 1. 1.0000 1.20 / 79 | 20 40. 1.0120 1.17 / 80 | 40 80. 1.0255 1.14 / 81 | 60 120. 1.0380 1.11 / 82 | 80 160. 1.0510 1.08 / 83 | 100 200. 1.0630 1.06 / 84 | 120 240. 1.0750 1.03 / 85 | 140 280. 1.0870 1.00 / 86 | 160 320. 1.0985 .98 / 87 | 180 360. 1.1100 .95 / 88 | 200 400. 1.1200 .94 89 | 500. 1.1189 .94 / 90 | / 91 | 92 | PVTG 93 | -- Pg Rv Bg Vg 94 | 100 0.0001 0.010 0.1 95 | 0.0 0.0104 0.1 / 96 | 200 0.0004 0.005 0.2 97 | 0.0 0.0054 0.2 / 98 | / 99 | 100 | SWOF 101 | 0.2 0 1 0.9 102 | 1 1 0 0.1 103 | / 104 | 105 | SGOF 106 | 0 0 1 0.2 107 | 0.8 1 0 0.5 108 | / 109 | 110 | PVTW 111 | --RefPres Bw Comp Vw Cv 112 | 1. 1.0 4.0E-5 0.96 0.0 / 113 | 114 | 115 | ROCK 116 | --RefPres Comp 117 | 1. 5.0E-5 / 118 | 119 | DENSITY 120 | 700 1000 1 121 | / 122 | 123 | SOLUTION ====== 124 | 125 | EQUIL 126 | 45 150 50 0.25 45 0.35 1 1 0 127 | / 128 | 129 | RSVD 130 | 0 0.0 131 | 100 100. / 132 | 133 | RVVD 134 | 0. 0. 135 | 100. 0.0001 / 136 | 137 | RPTSOL 138 | 'PRES' 'PGAS' 'PWAT' 'SOIL' 'SWAT' 'SGAS' 'RS' 'RESTART=2' / 139 | 140 | SUMMARY ====== 141 | RUNSUM 142 | 143 | SEPARATE 144 | 145 | SCHEDULE ====== 146 | 147 | RPTSCHED 148 | 'PRES' 'PGAS' 'PWAT' 'SOIL' 'SWAT' 'SGAS' 'RS' 'RESTART=3' 'NEWTON=2' / 149 | 150 | 151 | END 152 | -------------------------------------------------------------------------------- /tests/liveoil.DATA: -------------------------------------------------------------------------------- 1 | RUNSPEC 2 | 3 | TABDIMS 4 | -- use the defaults of TABDIMS but the keyword must be present in the deck 5 | -- for it to be usable 6 | / 7 | 8 | DIMENS 9 | 3 3 3 / 10 | 11 | OIL 12 | GAS 13 | WATER 14 | 15 | FIELD 16 | 17 | GRID 18 | 19 | -- tests for the PVT functions need a grid because the OPM-API for the 20 | -- PVT functions assumes the presence of compressed grid cells, 21 | -- i.e. we need to be able to map from compressed to logical cartesian 22 | -- cell indices to find out the PVT region of a cell 23 | DXV 24 | 1 2 3 / 25 | DYV 26 | 1 2 3 / 27 | DZV 28 | 1 2 3 / 29 | 30 | TOPS 31 | 9*123.456 / 32 | 33 | PROPS 34 | 35 | PVTO 36 | -- Rs Pbub Bo Vo 37 | .0 14.7 1.0000 1.20 / 38 | .165 400. 1.0120 1.17 / 39 | .335 800. 1.0255 1.14 / 40 | .500 1200. 1.0380 1.11 / 41 | .665 1600. 1.0510 1.08 / 42 | .828 2000. 1.0630 1.06 / 43 | .985 2400. 1.0750 1.03 / 44 | 1.130 2800. 1.0870 1.00 / 45 | 1.270 3200. 1.0985 .98 / 46 | 1.390 3600. 1.1100 .95 / 47 | 1.500 4000. 1.1200 .94 48 | 5000. 1.1189 .94 / 49 | / 50 | 51 | PVDG 52 | -- Pg Bg Vg 53 | 14.7 178.08 .0125 54 | 400. 5.4777 .0130 55 | 800. 2.7392 .0135 56 | 1200. 1.8198 .0140 57 | 1600. 1.3648 .0145 58 | 2000. 1.0957 .0150 59 | 2400. 0.9099 .0155 60 | 2800. 0.7799 .0160 61 | 3200. 0.6871 .0165 62 | 3600. 0.6035 .0170 63 | 4000. 0.5432 .0175 / 64 | 65 | -------------------------------------------------------------------------------- /tests/relpermDiagnostics.DATA: -------------------------------------------------------------------------------- 1 | 2 | RUNSPEC 3 | 4 | TITLE 5 | 6 | 7 | DIMENS 8 | 10 10 3 / 9 | 10 | EQLDIMS 11 | / 12 | 13 | TABDIMS 14 | / 15 | 16 | OIL 17 | GAS 18 | WATER 19 | DISGAS 20 | 21 | FIELD 22 | 23 | START 24 | 1 'JAN' 2015 / 25 | 26 | WELLDIMS 27 | 2 1 1 2 / 28 | 29 | UNIFOUT 30 | 31 | GRID 32 | -- ------------------------------------------------------------------------- 33 | NOECHO 34 | 35 | DX 36 | 300*1000 / 37 | DY 38 | 300*1000 / 39 | DZ 40 | 100*20 100*30 100*50 / 41 | 42 | TOPS 43 | 100*8325 / 44 | 45 | PORO 46 | 300*0.3 / 47 | 48 | PERMX 49 | 100*500 100*50 100*200 / 50 | 51 | PERMY 52 | 100*500 100*50 100*200 / 53 | 54 | PERMZ 55 | 100*500 100*50 100*200 / 56 | ECHO 57 | 58 | PROPS 59 | -- ------------------------------------------------------------------------- 60 | SWOF 61 | 0.13 0 1 0 62 | 0.18 4.64876033057851E-008 1 0 63 | 0.24 0.000000186 0.997 0 64 | 0.3 4.18388429752066E-007 0.98 0 65 | 0.36 7.43801652892562E-007 0.7 0 66 | 0.42 1.16219008264463E-006 0.35 0 67 | 0.48 1.67355371900826E-006 0.2 0 68 | 0.54 2.27789256198347E-006 0.09 0 69 | 0.6 2.97520661157025E-006 0.021 0 70 | 0.66 3.7654958677686E-006 0.01 0 71 | 0.72 4.64876033057851E-006 0.001 0 72 | 0.78 0.000005625 0.0001 0 73 | 0.84 6.69421487603306E-006 0 0 74 | 0.91 8.05914256198347E-006 0 0 75 | 1 0.00001 0 0 / 76 | 77 | 78 | SGOF 79 | 0 0 1 0 80 | 0.001 0 1 0 81 | 0.02 0 0.997 0 82 | 0.05 0.005 0.980 0 83 | 0.12 0.025 0.700 0 84 | 0.2 0.075 0.350 0 85 | 0.25 0.125 0.200 0 86 | 0.3 0.190 0.090 0 87 | 0.4 0.410 0.021 0 88 | 0.45 0.60 0.010 0 89 | 0.5 0.72 0.001 0 90 | 0.6 0.87 0.0001 0 91 | 0.7 0.94 0.000 0 92 | 0.85 0.98 0.000 0 93 | 0.88 0.984 0.000 0 / 94 | -------------------------------------------------------------------------------- /tests/satfuncEPSBase.DATA: -------------------------------------------------------------------------------- 1 | NOECHO 2 | 3 | RUNSPEC ====== 4 | 5 | WATER 6 | OIL 7 | GAS 8 | DISGAS 9 | VAPOIL 10 | 11 | TABDIMS 12 | 1 1 40 20 1 20 / 13 | 14 | DIMENS 15 | 1 1 20 16 | / 17 | 18 | WELLDIMS 19 | 30 10 2 30 / 20 | 21 | ENDSCALE 22 | --DIR REV NTENDP NSENDP 23 | 'NODIR' 'REVERS' 1 20 / 24 | 25 | 26 | START 27 | 1 'JAN' 1990 / 28 | 29 | NSTACK 30 | 25 / 31 | 32 | EQLDIMS 33 | -- NTEQUL 34 | 1 / 35 | 36 | 37 | FMTOUT 38 | FMTIN 39 | 40 | GRID ====== 41 | 42 | DXV 43 | 1.0 44 | / 45 | 46 | DYV 47 | 1.0 48 | / 49 | 50 | DZV 51 | 20*5.0 52 | / 53 | 54 | 55 | PORO 56 | 20*0.2 57 | / 58 | 59 | 60 | PERMZ 61 | 20*1.0 62 | / 63 | 64 | PERMY 65 | 20*100.0 66 | / 67 | 68 | PERMX 69 | 20*100.0 70 | / 71 | 72 | BOX 73 | 1 1 1 1 1 1 / 74 | 75 | TOPS 76 | 0.0 77 | / 78 | 79 | PROPS ====== 80 | 81 | PVTO 82 | -- Rs Pbub Bo Vo 83 | 0 1. 1.0000 1.20 / 84 | 20 40. 1.0120 1.17 / 85 | 40 80. 1.0255 1.14 / 86 | 60 120. 1.0380 1.11 / 87 | 80 160. 1.0510 1.08 / 88 | 100 200. 1.0630 1.06 / 89 | 120 240. 1.0750 1.03 / 90 | 140 280. 1.0870 1.00 / 91 | 160 320. 1.0985 .98 / 92 | 180 360. 1.1100 .95 / 93 | 200 400. 1.1200 .94 94 | 500. 1.1189 .94 / 95 | / 96 | 97 | PVTG 98 | -- Pg Rv Bg Vg 99 | 100 0.0001 0.010 0.1 100 | 0.0 0.0104 0.1 / 101 | 200 0.0004 0.005 0.2 102 | 0.0 0.0054 0.2 / 103 | / 104 | 105 | SCALECRS 106 | -- YES / 107 | NO/ 108 | 109 | SWOF 110 | 0.1 0.0 1.0 0.9 111 | 0.2 0.0 0.8 0.8 112 | 0.3 0.1 0.6 0.7 113 | 0.4 0.2 0.4 0.6 114 | 0.7 0.5 0.1 0.3 115 | 0.8 0.6 0.0 0.2 116 | 0.9 0.7 0.0 0.1 117 | / 118 | 119 | SGOF 120 | 0.0 0.0 1.0 0.2 121 | 0.1 0.0 0.7 0.4 122 | 0.2 0.1 0.6 0.6 123 | 0.8 0.7 0.0 2.0 124 | 0.9 1.0 0.0 2.1 125 | / 126 | 127 | PVTW 128 | --RefPres Bw Comp Vw Cv 129 | 1. 1.0 4.0E-5 0.96 0.0 / 130 | 131 | 132 | ROCK 133 | --RefPres Comp 134 | 1. 5.0E-5 / 135 | 136 | DENSITY 137 | 700 1000 1 138 | / 139 | 140 | SOLUTION ====== 141 | 142 | EQUIL 143 | 45 150 50 0.25 45 0.35 1 1 0 144 | / 145 | 146 | RSVD 147 | 0 0.0 148 | 100 100. / 149 | 150 | RVVD 151 | 0. 0. 152 | 100. 0.0001 / 153 | 154 | RPTSOL 155 | 'PRES' 'PGAS' 'PWAT' 'SOIL' 'SWAT' 'SGAS' 'RS' 'RESTART=2' / 156 | 157 | SUMMARY ====== 158 | RUNSUM 159 | 160 | SEPARATE 161 | 162 | SCHEDULE ====== 163 | 164 | RPTSCHED 165 | 'PRES' 'PGAS' 'PWAT' 'SOIL' 'SWAT' 'SGAS' 'RS' 'RESTART=3' 'NEWTON=2' / 166 | 167 | 168 | END 169 | -------------------------------------------------------------------------------- /tests/satfuncEPS_A.DATA: -------------------------------------------------------------------------------- 1 | NOECHO 2 | 3 | RUNSPEC ====== 4 | 5 | WATER 6 | OIL 7 | GAS 8 | DISGAS 9 | VAPOIL 10 | 11 | TABDIMS 12 | 1 1 40 20 1 20 / 13 | 14 | DIMENS 15 | 1 1 10 16 | / 17 | 18 | WELLDIMS 19 | 30 10 2 30 / 20 | 21 | ENDSCALE 22 | --DIR REV NTENDP NSENDP 23 | 'NODIR' 'REVERS' 1 20 / 24 | 25 | 26 | START 27 | 1 'JAN' 1990 / 28 | 29 | NSTACK 30 | 25 / 31 | 32 | EQLDIMS 33 | -- NTEQUL 34 | 1 / 35 | 36 | 37 | FMTOUT 38 | FMTIN 39 | 40 | GRID ====== 41 | 42 | DXV 43 | 1.0 44 | / 45 | 46 | DYV 47 | 1.0 48 | / 49 | 50 | DZV 51 | 10*5.0 52 | / 53 | 54 | 55 | PORO 56 | 10*0.2 57 | / 58 | 59 | 60 | PERMZ 61 | 10*1.0 62 | / 63 | 64 | PERMY 65 | 10*100.0 66 | / 67 | 68 | PERMX 69 | 10*100.0 70 | / 71 | 72 | BOX 73 | 1 1 1 1 1 1 / 74 | 75 | TOPS 76 | 0.0 77 | / 78 | 79 | PROPS ====== 80 | 81 | PVTO 82 | -- Rs Pbub Bo Vo 83 | 0 1. 1.0000 1.20 / 84 | 20 40. 1.0120 1.17 / 85 | 40 80. 1.0255 1.14 / 86 | 60 120. 1.0380 1.11 / 87 | 80 160. 1.0510 1.08 / 88 | 100 200. 1.0630 1.06 / 89 | 120 240. 1.0750 1.03 / 90 | 140 280. 1.0870 1.00 / 91 | 160 320. 1.0985 .98 / 92 | 180 360. 1.1100 .95 / 93 | 200 400. 1.1200 .94 94 | 500. 1.1189 .94 / 95 | / 96 | 97 | PVTG 98 | -- Pg Rv Bg Vg 99 | 100 0.0001 0.010 0.1 100 | 0.0 0.0104 0.1 / 101 | 200 0.0004 0.005 0.2 102 | 0.0 0.0054 0.2 / 103 | / 104 | 105 | SCALECRS 106 | -- YES / 107 | NO/ 108 | 109 | SWL 110 | 4*0.1 4*0.2 2*0.1/ 111 | 112 | SWCR 113 | 0.2 0.2 0.4 0.4 0.2 0.2 0.4 0.4 2*0.2 / 114 | 115 | SWU 116 | 0.9 0.7 0.9 0.7 0.9 0.7 0.9 0.7 2*0.9 / 117 | 118 | SWOF 119 | 0.1 0.0 1.0 0.9 120 | 0.2 0.0 0.8 0.8 121 | 0.3 0.1 0.6 0.7 122 | 0.4 0.2 0.4 0.6 123 | 0.7 0.5 0.1 0.3 124 | 0.8 0.6 0.0 0.2 125 | 0.9 0.7 0.0 0.1 126 | / 127 | 128 | SGOF 129 | 0.0 0.0 1.0 0.2 130 | 0.1 0.0 0.7 0.4 131 | 0.2 0.1 0.6 0.6 132 | 0.8 0.7 0.0 2.0 133 | 0.9 1.0 0.0 2.1 134 | / 135 | 136 | PVTW 137 | --RefPres Bw Comp Vw Cv 138 | 1. 1.0 4.0E-5 0.96 0.0 / 139 | 140 | 141 | ROCK 142 | --RefPres Comp 143 | 1. 5.0E-5 / 144 | 145 | DENSITY 146 | 700 1000 1 147 | / 148 | 149 | SOLUTION ====== 150 | 151 | EQUIL 152 | 45 150 50 0.25 45 0.35 1 1 0 153 | / 154 | 155 | RSVD 156 | 0 0.0 157 | 100 100. / 158 | 159 | RVVD 160 | 0. 0. 161 | 100. 0.0001 / 162 | 163 | RPTSOL 164 | 'PRES' 'PGAS' 'PWAT' 'SOIL' 'SWAT' 'SGAS' 'RS' 'RESTART=2' / 165 | 166 | SUMMARY ====== 167 | RUNSUM 168 | 169 | SEPARATE 170 | 171 | SCHEDULE ====== 172 | 173 | RPTSCHED 174 | 'PRES' 'PGAS' 'PWAT' 'SOIL' 'SWAT' 'SGAS' 'RS' 'RESTART=3' 'NEWTON=2' / 175 | 176 | 177 | END 178 | -------------------------------------------------------------------------------- /tests/satfuncEPS_B.DATA: -------------------------------------------------------------------------------- 1 | NOECHO 2 | 3 | RUNSPEC ====== 4 | 5 | WATER 6 | OIL 7 | GAS 8 | DISGAS 9 | VAPOIL 10 | 11 | TABDIMS 12 | 1 1 40 20 1 20 / 13 | 14 | DIMENS 15 | 1 1 10 16 | / 17 | 18 | WELLDIMS 19 | 30 10 2 30 / 20 | 21 | ENDSCALE 22 | --DIR REV NTENDP NSENDP 23 | 'NODIR' 'REVERS' 1 20 / 24 | 25 | 26 | START 27 | 1 'JAN' 1990 / 28 | 29 | NSTACK 30 | 25 / 31 | 32 | EQLDIMS 33 | -- NTEQUL 34 | 1 / 35 | 36 | 37 | FMTOUT 38 | FMTIN 39 | 40 | GRID ====== 41 | 42 | DXV 43 | 1.0 44 | / 45 | 46 | DYV 47 | 1.0 48 | / 49 | 50 | DZV 51 | 10*5.0 52 | / 53 | 54 | 55 | PORO 56 | 10*0.2 57 | / 58 | 59 | 60 | PERMZ 61 | 10*1.0 62 | / 63 | 64 | PERMY 65 | 10*100.0 66 | / 67 | 68 | PERMX 69 | 10*100.0 70 | / 71 | 72 | BOX 73 | 1 1 1 1 1 1 / 74 | 75 | TOPS 76 | 0.0 77 | / 78 | 79 | PROPS ====== 80 | 81 | PVTO 82 | -- Rs Pbub Bo Vo 83 | 0 1. 1.0000 1.20 / 84 | 20 40. 1.0120 1.17 / 85 | 40 80. 1.0255 1.14 / 86 | 60 120. 1.0380 1.11 / 87 | 80 160. 1.0510 1.08 / 88 | 100 200. 1.0630 1.06 / 89 | 120 240. 1.0750 1.03 / 90 | 140 280. 1.0870 1.00 / 91 | 160 320. 1.0985 .98 / 92 | 180 360. 1.1100 .95 / 93 | 200 400. 1.1200 .94 94 | 500. 1.1189 .94 / 95 | / 96 | 97 | PVTG 98 | -- Pg Rv Bg Vg 99 | 100 0.0001 0.010 0.1 100 | 0.0 0.0104 0.1 / 101 | 200 0.0004 0.005 0.2 102 | 0.0 0.0054 0.2 / 103 | / 104 | 105 | SCALECRS 106 | -- YES / 107 | NO/ 108 | 109 | ENPTVD 110 | -- Depth swl swcr swu sgl sgcr sgu sowcr sogcr 111 | -- Sandstone 112 | 2.5 .1 0.2 0.9 .0 0.1 0.9 0.2 0.2 113 | 7.5 .1 0.2 0.7 .0 0.1 0.9 0.2 0.2 114 | 12.5 .1 0.4 0.9 .0 0.1 0.9 0.2 0.2 115 | 17.5 .1 0.4 0.7 .0 0.1 0.9 0.2 0.2 116 | 22.5 .2 0.2 0.9 .0 0.1 0.9 0.2 0.2 117 | 27.5 .2 0.2 0.7 .0 0.1 0.9 0.2 0.2 118 | 32.5 .2 0.4 0.9 .0 0.1 0.9 0.2 0.2 119 | 37.5 .2 0.4 0.7 .0 0.1 0.9 0.2 0.2 120 | 42.5 .1 0.2 0.9 .0 0.1 0.9 0.2 0.2 121 | 47.5 .1 0.2 0.9 .0 0.1 0.9 0.2 0.2 122 | 50.0 .1 0.2 0.9 .0 0.1 0.9 0.2 0.2 / 123 | / 124 | 125 | SWOF 126 | 0.1 0.0 1.0 0.9 127 | 0.2 0.0 0.8 0.8 128 | 0.3 0.1 0.6 0.7 129 | 0.4 0.2 0.4 0.6 130 | 0.7 0.5 0.1 0.3 131 | 0.8 0.6 0.0 0.2 132 | 0.9 0.7 0.0 0.1 133 | / 134 | 135 | SGOF 136 | 0.0 0.0 1.0 0.2 137 | 0.1 0.0 0.7 0.4 138 | 0.2 0.1 0.6 0.6 139 | 0.8 0.7 0.0 2.0 140 | 0.9 1.0 0.0 2.1 141 | / 142 | 143 | PVTW 144 | --RefPres Bw Comp Vw Cv 145 | 1. 1.0 4.0E-5 0.96 0.0 / 146 | 147 | 148 | ROCK 149 | --RefPres Comp 150 | 1. 5.0E-5 / 151 | 152 | DENSITY 153 | 700 1000 1 154 | / 155 | 156 | REGIONS ====== 157 | 158 | ENDNUM 159 | 10*1 160 | / 161 | 162 | SOLUTION ====== 163 | 164 | EQUIL 165 | 45 150 50 0.25 45 0.35 1 1 0 166 | / 167 | 168 | RSVD 169 | 0 0.0 170 | 100 100. / 171 | 172 | RVVD 173 | 0. 0. 174 | 100. 0.0001 / 175 | 176 | RPTSOL 177 | 'PRES' 'PGAS' 'PWAT' 'SOIL' 'SWAT' 'SGAS' 'RS' 'RESTART=2' / 178 | 179 | SUMMARY ====== 180 | RUNSUM 181 | 182 | SEPARATE 183 | 184 | SCHEDULE ====== 185 | 186 | RPTSCHED 187 | 'PRES' 'PGAS' 'PWAT' 'SOIL' 'SWAT' 'SGAS' 'RS' 'RESTART=3' 'NEWTON=2' / 188 | 189 | 190 | END 191 | -------------------------------------------------------------------------------- /tests/satfuncEPS_C.DATA: -------------------------------------------------------------------------------- 1 | NOECHO 2 | 3 | RUNSPEC ====== 4 | 5 | WATER 6 | OIL 7 | GAS 8 | DISGAS 9 | VAPOIL 10 | 11 | TABDIMS 12 | 1 1 40 20 1 20 / 13 | 14 | DIMENS 15 | 1 1 10 16 | / 17 | 18 | WELLDIMS 19 | 30 10 2 30 / 20 | 21 | ENDSCALE 22 | --DIR REV NTENDP NSENDP 23 | 'NODIR' 'REVERS' 1 20 / 24 | 25 | 26 | START 27 | 1 'JAN' 1990 / 28 | 29 | NSTACK 30 | 25 / 31 | 32 | EQLDIMS 33 | -- NTEQUL 34 | 1 / 35 | 36 | 37 | FMTOUT 38 | FMTIN 39 | 40 | GRID ====== 41 | 42 | DXV 43 | 1.0 44 | / 45 | 46 | DYV 47 | 1.0 48 | / 49 | 50 | DZV 51 | 10*5.0 52 | / 53 | 54 | 55 | PORO 56 | 10*0.2 57 | / 58 | 59 | 60 | PERMZ 61 | 10*1.0 62 | / 63 | 64 | PERMY 65 | 10*100.0 66 | / 67 | 68 | PERMX 69 | 10*100.0 70 | / 71 | 72 | BOX 73 | 1 1 1 1 1 1 / 74 | 75 | TOPS 76 | 0.0 77 | / 78 | 79 | PROPS ====== 80 | 81 | PVTO 82 | -- Rs Pbub Bo Vo 83 | 0 1. 1.0000 1.20 / 84 | 20 40. 1.0120 1.17 / 85 | 40 80. 1.0255 1.14 / 86 | 60 120. 1.0380 1.11 / 87 | 80 160. 1.0510 1.08 / 88 | 100 200. 1.0630 1.06 / 89 | 120 240. 1.0750 1.03 / 90 | 140 280. 1.0870 1.00 / 91 | 160 320. 1.0985 .98 / 92 | 180 360. 1.1100 .95 / 93 | 200 400. 1.1200 .94 94 | 500. 1.1189 .94 / 95 | / 96 | 97 | PVTG 98 | -- Pg Rv Bg Vg 99 | 100 0.0001 0.010 0.1 100 | 0.0 0.0104 0.1 / 101 | 200 0.0004 0.005 0.2 102 | 0.0 0.0054 0.2 / 103 | / 104 | 105 | SCALECRS 106 | -- YES / 107 | NO/ 108 | 109 | --SWL 110 | --4*0.1 4*0.2 2*0.1/ 111 | 112 | EQUALS 113 | SWL 0.1 1 1 1 1 1 1 / 114 | SWL 0.1 1 1 1 1 2 2 / 115 | SWL 0.1 1 1 1 1 3 3 / 116 | SWL 0.1 1 1 1 1 4 4 / 117 | SWL 0.2 1 1 1 1 5 5 / 118 | SWL 0.2 1 1 1 1 6 6 / 119 | SWL 0.2 1 1 1 1 7 7 / 120 | SWL 0.2 1 1 1 1 8 8 / 121 | SWL 0.1 1 1 1 1 9 9 / 122 | SWL 0.1 1 1 1 1 10 10 / 123 | / 124 | 125 | --SWCR 126 | --0.2 0.2 0.4 0.4 0.2 0.2 0.4 0.4 2*0.2 / 127 | 128 | COPY 129 | SWL SWCR / 130 | SWL SWU / 131 | / 132 | 133 | ADD 134 | SWCR 0.1 1 1 1 1 1 2 / 135 | SWCR 0.3 1 1 1 1 3 4 / 136 | SWCR 0.2 1 1 1 1 7 8 / 137 | SWCR 0.1 1 1 1 1 9 10 / 138 | / 139 | 140 | --SWU 141 | --0.9 0.7 0.9 0.7 0.9 0.7 0.9 0.7 2*0.9 / 142 | 143 | MULTIPLY 144 | SWU -1.0 1 1 1 1 1 10 / 145 | / 146 | 147 | ADD 148 | SWU 1.0 1 1 1 1 1 10 / 149 | / 150 | 151 | ADD 152 | SWU -0.2 1 1 1 1 2 2 / 153 | SWU -0.2 1 1 1 1 4 4 / 154 | SWU 0.1 1 1 1 1 5 5 / 155 | SWU -0.1 1 1 1 1 6 6 / 156 | SWU 0.1 1 1 1 1 7 7 / 157 | SWU -0.1 1 1 1 1 8 8 / 158 | / 159 | 160 | SWOF 161 | 0.1 0.0 1.0 0.9 162 | 0.2 0.0 0.8 0.8 163 | 0.3 0.1 0.6 0.7 164 | 0.4 0.2 0.4 0.6 165 | 0.7 0.5 0.1 0.3 166 | 0.8 0.6 0.0 0.2 167 | 0.9 0.7 0.0 0.1 168 | / 169 | 170 | SGOF 171 | 0.0 0.0 1.0 0.2 172 | 0.1 0.0 0.7 0.4 173 | 0.2 0.1 0.6 0.6 174 | 0.8 0.7 0.0 2.0 175 | 0.9 1.0 0.0 2.1 176 | / 177 | 178 | PVTW 179 | --RefPres Bw Comp Vw Cv 180 | 1. 1.0 4.0E-5 0.96 0.0 / 181 | 182 | 183 | ROCK 184 | --RefPres Comp 185 | 1. 5.0E-5 / 186 | 187 | DENSITY 188 | 700 1000 1 189 | / 190 | 191 | REGIONS ====== 192 | 193 | ENDNUM 194 | 10*1 195 | / 196 | 197 | SOLUTION ====== 198 | 199 | EQUIL 200 | 45 150 50 0.25 45 0.35 1 1 0 201 | / 202 | 203 | RSVD 204 | 0 0.0 205 | 100 100. / 206 | 207 | RVVD 208 | 0. 0. 209 | 100. 0.0001 / 210 | 211 | RPTSOL 212 | 'PRES' 'PGAS' 'PWAT' 'SOIL' 'SWAT' 'SGAS' 'RS' 'RESTART=2' / 213 | 214 | SUMMARY ====== 215 | RUNSUM 216 | 217 | SEPARATE 218 | 219 | SCHEDULE ====== 220 | 221 | RPTSCHED 222 | 'PRES' 'PGAS' 'PWAT' 'SOIL' 'SWAT' 'SGAS' 'RS' 'RESTART=3' 'NEWTON=2' / 223 | 224 | 225 | END 226 | -------------------------------------------------------------------------------- /tests/satfuncEPS_D.DATA: -------------------------------------------------------------------------------- 1 | NOECHO 2 | 3 | RUNSPEC ====== 4 | 5 | WATER 6 | OIL 7 | GAS 8 | DISGAS 9 | VAPOIL 10 | 11 | TABDIMS 12 | 1 1 40 20 1 20 / 13 | 14 | DIMENS 15 | 1 1 10 16 | / 17 | 18 | WELLDIMS 19 | 30 10 2 30 / 20 | 21 | ENDSCALE 22 | --DIR REV NTENDP NSENDP 23 | 'NODIR' 'REVERS' 1 20 / 24 | 25 | 26 | SATOPTS 27 | HYSTER / 28 | 29 | START 30 | 1 'JAN' 1990 / 31 | 32 | NSTACK 33 | 25 / 34 | 35 | EQLDIMS 36 | -- NTEQUL 37 | 1 / 38 | 39 | 40 | FMTOUT 41 | FMTIN 42 | 43 | GRID ====== 44 | 45 | DXV 46 | 1.0 47 | / 48 | 49 | DYV 50 | 1.0 51 | / 52 | 53 | DZV 54 | 10*5.0 55 | / 56 | 57 | 58 | PORO 59 | 10*0.2 60 | / 61 | 62 | 63 | PERMZ 64 | 10*1.0 65 | / 66 | 67 | PERMY 68 | 10*100.0 69 | / 70 | 71 | PERMX 72 | 10*100.0 73 | / 74 | 75 | BOX 76 | 1 1 1 1 1 1 / 77 | 78 | TOPS 79 | 0.0 80 | / 81 | 82 | PROPS ====== 83 | 84 | -- Hysteresis input 85 | EHYSTR 86 | 0.1 0 0.1 1* KR / 87 | 88 | PVTO 89 | -- Rs Pbub Bo Vo 90 | 0 1. 1.0000 1.20 / 91 | 20 40. 1.0120 1.17 / 92 | 40 80. 1.0255 1.14 / 93 | 60 120. 1.0380 1.11 / 94 | 80 160. 1.0510 1.08 / 95 | 100 200. 1.0630 1.06 / 96 | 120 240. 1.0750 1.03 / 97 | 140 280. 1.0870 1.00 / 98 | 160 320. 1.0985 .98 / 99 | 180 360. 1.1100 .95 / 100 | 200 400. 1.1200 .94 101 | 500. 1.1189 .94 / 102 | / 103 | 104 | PVTG 105 | -- Pg Rv Bg Vg 106 | 100 0.0001 0.010 0.1 107 | 0.0 0.0104 0.1 / 108 | 200 0.0004 0.005 0.2 109 | 0.0 0.0054 0.2 / 110 | / 111 | 112 | SCALECRS 113 | -- YES / 114 | NO/ 115 | 116 | SWOF 117 | 0.1 0.0 1.0 0.9 118 | 0.2 0.0 0.8 0.8 119 | 0.3 0.1 0.6 0.7 120 | 0.4 0.2 0.4 0.6 121 | 0.7 0.5 0.1 0.3 122 | 0.8 0.6 0.0 0.2 123 | 0.9 0.7 0.0 0.1 124 | / 125 | 126 | SGOF 127 | 0.0 0.0 1.0 0.2 128 | 0.1 0.0 0.7 0.4 129 | 0.2 0.1 0.6 0.6 130 | 0.8 0.7 0.0 2.0 131 | 0.9 1.0 0.0 2.1 132 | / 133 | 134 | PVTW 135 | --RefPres Bw Comp Vw Cv 136 | 1. 1.0 4.0E-5 0.96 0.0 / 137 | 138 | 139 | ROCK 140 | --RefPres Comp 141 | 1. 5.0E-5 / 142 | 143 | DENSITY 144 | 700 1000 1 145 | / 146 | 147 | REGIONS ====== 148 | 149 | ENDNUM 150 | 10*1 151 | / 152 | 153 | SOLUTION ====== 154 | 155 | EQUIL 156 | 45 150 50 0.25 45 0.35 1 1 0 157 | / 158 | 159 | RSVD 160 | 0 0.0 161 | 100 100. / 162 | 163 | RVVD 164 | 0. 0. 165 | 100. 0.0001 / 166 | 167 | RPTSOL 168 | 'PRES' 'PGAS' 'PWAT' 'SOIL' 'SWAT' 'SGAS' 'RS' 'RESTART=2' / 169 | 170 | SUMMARY ====== 171 | RUNSUM 172 | 173 | SEPARATE 174 | 175 | SCHEDULE ====== 176 | 177 | RPTSCHED 178 | 'PRES' 'PGAS' 'PWAT' 'SOIL' 'SWAT' 'SGAS' 'RS' 'RESTART=3' 'NEWTON=2' / 179 | 180 | 181 | END 182 | -------------------------------------------------------------------------------- /tests/satfuncStandard.DATA: -------------------------------------------------------------------------------- 1 | NOECHO 2 | 3 | RUNSPEC ====== 4 | 5 | WATER 6 | OIL 7 | GAS 8 | DISGAS 9 | VAPOIL 10 | 11 | TABDIMS 12 | 1 1 40 20 1 20 / 13 | 14 | DIMENS 15 | 1 1 10 16 | / 17 | 18 | WELLDIMS 19 | 30 10 2 30 / 20 | 21 | --ENDSCALE 22 | --DIR REV NTENDP NSENDP 23 | --'NODIR' 'REVERS' 1 20 / 24 | --/ 25 | 26 | START 27 | 1 'JAN' 1990 / 28 | 29 | NSTACK 30 | 25 / 31 | 32 | EQLDIMS 33 | -- NTEQUL 34 | 1 / 35 | 36 | 37 | FMTOUT 38 | FMTIN 39 | 40 | GRID ====== 41 | 42 | DXV 43 | 1.0 44 | / 45 | 46 | DYV 47 | 1.0 48 | / 49 | 50 | DZV 51 | 10*5.0 52 | / 53 | 54 | 55 | PORO 56 | 10*0.2 57 | / 58 | 59 | 60 | PERMZ 61 | 10*1.0 62 | / 63 | 64 | PERMY 65 | 10*100.0 66 | / 67 | 68 | PERMX 69 | 10*100.0 70 | / 71 | 72 | BOX 73 | 1 1 1 1 1 1 / 74 | 75 | TOPS 76 | 0.0 77 | / 78 | 79 | PROPS ====== 80 | 81 | PVTO 82 | -- Rs Pbub Bo Vo 83 | 0 1. 1.0000 1.20 / 84 | 20 40. 1.0120 1.17 / 85 | 40 80. 1.0255 1.14 / 86 | 60 120. 1.0380 1.11 / 87 | 80 160. 1.0510 1.08 / 88 | 100 200. 1.0630 1.06 / 89 | 120 240. 1.0750 1.03 / 90 | 140 280. 1.0870 1.00 / 91 | 160 320. 1.0985 .98 / 92 | 180 360. 1.1100 .95 / 93 | 200 400. 1.1200 .94 94 | 500. 1.1189 .94 / 95 | / 96 | 97 | PVTG 98 | -- Pg Rv Bg Vg 99 | 100 0.0001 0.010 0.1 100 | 0.0 0.0104 0.1 / 101 | 200 0.0004 0.005 0.2 102 | 0.0 0.0054 0.2 / 103 | / 104 | 105 | --SCALECRS 106 | -- YES / 107 | -- NO/ 108 | 109 | SWOF 110 | 0.1 0.0 1.0 0.9 111 | 0.2 0.0 0.8 0.8 112 | 0.3 0.1 0.6 0.7 113 | 0.4 0.2 0.4 0.6 114 | 0.7 0.5 0.1 0.3 115 | 0.8 0.6 0.0 0.2 116 | 0.9 0.7 0.0 0.1 117 | / 118 | 119 | SGOF 120 | 0.0 0.0 1.0 0.2 121 | 0.1 0.0 0.7 0.4 122 | 0.2 0.1 0.6 0.6 123 | 0.8 0.7 0.0 2.0 124 | 0.9 1.0 0.0 2.1 125 | / 126 | 127 | PVTW 128 | --RefPres Bw Comp Vw Cv 129 | 1. 1.0 4.0E-5 0.96 0.0 / 130 | 131 | 132 | ROCK 133 | --RefPres Comp 134 | 1. 5.0E-5 / 135 | 136 | DENSITY 137 | 700 1000 1 138 | / 139 | 140 | SOLUTION ====== 141 | 142 | EQUIL 143 | 45 150 50 0.25 45 0.35 1 1 0 144 | / 145 | 146 | RSVD 147 | 0 0.0 148 | 100 100. / 149 | 150 | RVVD 151 | 0. 0. 152 | 100. 0.0001 / 153 | 154 | RPTSOL 155 | 'PRES' 'PGAS' 'PWAT' 'SOIL' 'SWAT' 'SGAS' 'RS' 'RESTART=2' / 156 | 157 | SUMMARY ====== 158 | RUNSUM 159 | 160 | SEPARATE 161 | 162 | SCHEDULE ====== 163 | 164 | RPTSCHED 165 | 'PRES' 'PGAS' 'PWAT' 'SOIL' 'SWAT' 'SGAS' 'RS' 'RESTART=3' 'NEWTON=2' / 166 | 167 | 168 | END 169 | -------------------------------------------------------------------------------- /tests/testBlackoilState1.DATA: -------------------------------------------------------------------------------- 1 | DIMENS 2 | 10 10 10 / 3 | 4 | DXV 5 | 10*10 / 6 | 7 | DYV 8 | 10*10 / 9 | 10 | DZV 11 | 10*10 / 12 | 13 | ACTNUM 14 | 1 998*2 3 / 15 | 16 | 17 | DEPTHZ 18 | 121*2000 / 19 | -------------------------------------------------------------------------------- /tests/testBlackoilState2.DATA: -------------------------------------------------------------------------------- 1 | DIMENS 2 | 9 10 10 / 3 | 4 | DXV 5 | 9*10 / 6 | 7 | DYV 8 | 10*10 / 9 | 10 | DZV 11 | 10*10 / 12 | 13 | DEPTHZ 14 | 110*2000 / 15 | -------------------------------------------------------------------------------- /tests/testFluid.DATA: -------------------------------------------------------------------------------- 1 | OIL 2 | WATER 3 | GAS 4 | 5 | FIELD 6 | 7 | PVTO 8 | -- Rs Pbub Bo Vo 9 | .0 14.7 1.0000 1.20 / 10 | .165 400. 1.0120 1.17 / 11 | .335 800. 1.0255 1.14 / 12 | .500 1200. 1.0380 1.11 / 13 | .665 1600. 1.0510 1.08 / 14 | .828 2000. 1.0630 1.06 / 15 | .985 2400. 1.0750 1.03 / 16 | 1.130 2800. 1.0870 1.00 / 17 | 1.270 3200. 1.0985 .98 / 18 | 1.390 3600. 1.1100 .95 / 19 | 1.500 4000. 1.1200 .94 20 | 5000. 1.1189 .94 / 21 | / 22 | 23 | PVDG 24 | -- Pg Bg Vg 25 | 14.7 178.08 .0125 26 | 400. 5.4777 .0130 27 | 800. 2.7392 .0135 28 | 1200. 1.8198 .0140 29 | 1600. 1.3648 .0145 30 | 2000. 1.0957 .0150 31 | 2400. 0.9099 .0155 32 | 2800. 0.7799 .0160 33 | 3200. 0.6871 .0165 34 | 3600. 0.6035 .0170 35 | 4000. 0.5432 .0175 / 36 | 37 | PVTW 38 | --Depth Bw Comp Vw Cv 39 | 3600. 1.0034 1.0E-6 0.96 0.0 / 40 | 41 | 42 | DENSITY 43 | -- Oil Water Gas 44 | 44.98 63.01 0.0702 / 45 | -------------------------------------------------------------------------------- /tests/test_anisotropiceikonal.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2014 SINTEF ICT, Applied Mathematics. 3 | 4 | This file is part of the Open Porous Media project (OPM). 5 | 6 | OPM is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | OPM is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with OPM. If not, see . 18 | */ 19 | 20 | #include 21 | 22 | #if HAVE_DYNAMIC_BOOST_TEST 23 | #define BOOST_TEST_DYN_LINK 24 | #endif 25 | #define NVERBOSE // to suppress our messages when throwing 26 | 27 | #define BOOST_TEST_MODULE AnisotropicEikonalTest 28 | 29 | #include 30 | #include 31 | #include 32 | 33 | #include 34 | #include 35 | #include 36 | #include 37 | 38 | using namespace Opm; 39 | 40 | #if BOOST_HEAP_AVAILABLE 41 | 42 | BOOST_AUTO_TEST_CASE(cartesian_2d_a) 43 | { 44 | const GridManager gm(2, 2); 45 | const UnstructuredGrid& grid = *gm.c_grid(); 46 | AnisotropicEikonal2d ae(grid); 47 | 48 | const std::vector metric = { 49 | 1, 0, 0, 1, 50 | 1, 0, 0, 1, 51 | 1, 0, 0, 1, 52 | 1, 0, 0, 1 53 | }; 54 | BOOST_REQUIRE_EQUAL(metric.size(), grid.number_of_cells*grid.dimensions*grid.dimensions); 55 | const std::vector start = { 0 }; 56 | std::vector sol; 57 | ae.solve(metric.data(), start, sol); 58 | BOOST_REQUIRE(!sol.empty()); 59 | BOOST_CHECK_EQUAL(sol.size(), grid.number_of_cells); 60 | std::vector truth = { 0, 1, 1, std::sqrt(2) }; 61 | BOOST_CHECK_EQUAL_COLLECTIONS(sol.begin(), sol.end(), truth.begin(), truth.end()); 62 | } 63 | 64 | 65 | BOOST_AUTO_TEST_CASE(cartesian_2d_b) 66 | { 67 | const GridManager gm(3, 2, 1.0, 2.0); 68 | const UnstructuredGrid& grid = *gm.c_grid(); 69 | AnisotropicEikonal2d ae(grid); 70 | 71 | const std::vector metric = { 72 | 1, 0, 0, 1, 73 | 1, 0, 0, 1, 74 | 1, 0, 0, 1, 75 | 1, 0, 0, 1, 76 | 1, 0, 0, 1, 77 | 1, 0, 0, 1 78 | }; 79 | BOOST_REQUIRE_EQUAL(metric.size(), grid.number_of_cells*grid.dimensions*grid.dimensions); 80 | const std::vector start = { 0 }; 81 | std::vector sol; 82 | ae.solve(metric.data(), start, sol); 83 | BOOST_REQUIRE(!sol.empty()); 84 | BOOST_CHECK_EQUAL(sol.size(), grid.number_of_cells); 85 | // The test below works as a regression test, but does not test 86 | // that cell 5 is close to the truth, which is sqrt(8). 87 | std::vector expected = { 0, 1, 2, 2, std::sqrt(5), 3.0222193552572132 }; 88 | for (int cell = 0; cell < grid.number_of_cells; ++cell) { 89 | BOOST_CHECK_CLOSE(sol[cell], expected[cell], 1e-5); 90 | } 91 | } 92 | 93 | #else // BOOST_HEAP_AVAILABLE is false 94 | 95 | BOOST_AUTO_TEST_CASE(dummy) 96 | { 97 | BOOST_CHECK(true); 98 | } 99 | 100 | #endif // BOOST_HEAP_AVAILABLE 101 | -------------------------------------------------------------------------------- /tests/test_parallel_linearsolver.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2014 Dr. Markus Blatt - HPC-Simulation-Software & Services 3 | 4 | This file is part of the Open Porous Media project (OPM). 5 | 6 | OPM is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | OPM is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with OPM. If not, see . 18 | */ 19 | 20 | #include 21 | 22 | #if HAVE_DYNAMIC_BOOST_TEST 23 | #define BOOST_TEST_DYN_LINK 24 | #endif 25 | #define NVERBOSE // to suppress our messages when throwing 26 | 27 | #define BOOST_TEST_MODULE OPM-ParallelIterativeSolverTest 28 | #include 29 | 30 | // MPI header 31 | #if HAVE_MPI 32 | #include 33 | #include 34 | #else 35 | #error "This file needs to compiled with MPI support!" 36 | #endif 37 | #include "DuneIstlTestHelpers.hpp" 38 | #include 39 | #include 40 | 41 | #include 42 | #include 43 | #include 44 | 45 | void run_test(const Opm::ParameterGroup& param) 46 | { 47 | int N=100; 48 | int start, end, istart, iend; 49 | std::tie(start,istart,iend,end) = computeRegions(N); 50 | Opm::ParallelISTLInformation comm(MPI_COMM_WORLD); 51 | auto mat = create1DLaplacian(*comm.indexSet(), N, start, end, istart, iend); 52 | std::vector x(end-start), b(end-start); 53 | createRandomVectors(comm, end-start, x, b, *mat); 54 | std::vector exact(x); 55 | std::fill(x.begin(), x.end(), 0.0); 56 | Opm::LinearSolverFactory ls(param); 57 | boost::any anyComm(comm); 58 | ls.solve(b.size(), mat->data.size(), &(mat->rowStart[0]), 59 | &(mat->colIndex[0]), &(mat->data[0]), &(b[0]), 60 | &(x[0]), anyComm); 61 | } 62 | 63 | #ifdef HAVE_DUNE_ISTL 64 | BOOST_AUTO_TEST_CASE(CGAMGTest) 65 | { 66 | Opm::ParameterGroup param; 67 | param.insertParameter(std::string("linsolver"), std::string("istl")); 68 | param.insertParameter(std::string("linsolver_type"), std::string("1")); 69 | param.insertParameter(std::string("linsolver_max_iterations"), std::string("200")); 70 | run_test(param); 71 | } 72 | 73 | BOOST_AUTO_TEST_CASE(CGILUTest) 74 | { 75 | Opm::ParameterGroup param; 76 | param.insertParameter(std::string("linsolver"), std::string("istl")); 77 | param.insertParameter(std::string("linsolver_type"), std::string("0")); 78 | param.insertParameter(std::string("linsolver_max_iterations"), std::string("200")); 79 | run_test(param); 80 | } 81 | 82 | BOOST_AUTO_TEST_CASE(BiCGILUTest) 83 | { 84 | Opm::ParameterGroup param; 85 | param.insertParameter(std::string("linsolver"), std::string("istl")); 86 | param.insertParameter(std::string("linsolver_type"), std::string("2")); 87 | param.insertParameter(std::string("linsolver_max_iterations"), std::string("200")); 88 | run_test(param); 89 | } 90 | #endif 91 | 92 | -------------------------------------------------------------------------------- /tests/test_relpermdiagnostics.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2015 Statoil ASA. 3 | 4 | This file is part of the Open Porous Media project (OPM). 5 | 6 | OPM is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | OPM is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with OPM. If not, see . 18 | */ 19 | 20 | #include "config.h" 21 | 22 | /* --- Boost.Test boilerplate --- */ 23 | #if HAVE_DYNAMIC_BOOST_TEST 24 | #define BOOST_TEST_DYN_LINK 25 | #endif 26 | 27 | #define NVERBOSE // Suppress own messages when throw()ing 28 | 29 | #define BOOST_TEST_MODULE RelpermDiagnostics 30 | 31 | 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | 39 | #include 40 | #include 41 | #include 42 | 43 | #include 44 | #include 45 | #include 46 | #include 47 | 48 | BOOST_AUTO_TEST_SUITE () 49 | 50 | BOOST_AUTO_TEST_CASE(diagnosis) 51 | { 52 | using namespace Opm; 53 | Parser parser; 54 | Opm::ParseContext parseContext; 55 | 56 | Opm::Deck deck = parser.parseFile("../tests/relpermDiagnostics.DATA", parseContext); 57 | EclipseState eclState(deck, parseContext); 58 | GridManager gm(eclState.getInputGrid()); 59 | const UnstructuredGrid& grid = *gm.c_grid(); 60 | std::shared_ptr counterLog = std::make_shared(Log::DefaultMessageTypes); 61 | OpmLog::addBackend( "COUNTERLOG" , counterLog ); 62 | RelpermDiagnostics diagnostics; 63 | diagnostics.diagnosis(eclState, deck, grid); 64 | BOOST_CHECK_EQUAL(1, counterLog->numMessages(Log::MessageType::Warning)); 65 | } 66 | BOOST_AUTO_TEST_SUITE_END() 67 | -------------------------------------------------------------------------------- /tests/test_shadow.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2013 Uni Research AS. 2 | This file is licensed under the GNU General Public License v3.0 or later. */ 3 | #include 4 | 5 | #if HAVE_DYNAMIC_BOOST_TEST 6 | #define BOOST_TEST_DYN_LINK 7 | #endif 8 | #define NVERBOSE // to suppress our messages when throwing 9 | 10 | #define BOOST_TEST_MODULE ShadowTest 11 | #include 12 | #include 13 | #include 14 | 15 | #include 16 | #include 17 | #include 18 | 19 | using namespace Opm; 20 | 21 | BOOST_AUTO_TEST_CASE(shadowPorosity) 22 | { 23 | const double defaultPorosity = 1.0; 24 | const double newPorosity = 0.5; 25 | 26 | ParameterGroup param; 27 | IncompPropertiesBasic basic (param, 2, 1); 28 | IncompPropertiesShadow shadow (basic); 29 | BOOST_CHECK_CLOSE (*(shadow.porosity()), defaultPorosity, 0.001); 30 | shadow.usePorosity (&newPorosity); 31 | BOOST_CHECK_CLOSE (*(shadow.porosity()), newPorosity, 0.001); 32 | shadow.usePorosity (basic); 33 | BOOST_CHECK_CLOSE (*(shadow.porosity()), defaultPorosity, 0.001); 34 | } 35 | -------------------------------------------------------------------------------- /tests/test_stoppedwells.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2014 IRIS 3 | 4 | This file is part of the Open Porous Media project (OPM). 5 | 6 | OPM is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | OPM is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | GNU General Public License for more details. 15 | 16 | You should have received a copy of the GNU General Public License 17 | along with OPM. If not, see . 18 | */ 19 | 20 | #include 21 | 22 | #if HAVE_DYNAMIC_BOOST_TEST 23 | #define BOOST_TEST_DYN_LINK 24 | #endif 25 | 26 | #define BOOST_TEST_MODULE StoppedWellsTests 27 | #include 28 | 29 | #include 30 | #include 31 | #include 32 | 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | 40 | 41 | using namespace Opm; 42 | 43 | BOOST_AUTO_TEST_CASE(TestStoppedWells) 44 | { 45 | const std::string filename = "wells_stopped.data"; 46 | Opm::ParseContext parseContext; 47 | Opm::Parser parser; 48 | Opm::Deck deck(parser.parseFile(filename , parseContext)); 49 | Opm::EclipseState eclipseState(deck , parseContext); 50 | Opm::GridManager gridManager(eclipseState.getInputGrid()); 51 | const auto& grid = eclipseState.getInputGrid(); 52 | const TableManager table ( deck ); 53 | const Eclipse3DProperties eclipseProperties ( deck , table, grid); 54 | const Schedule sched(deck, grid, eclipseProperties, Phases(true, true, true), parseContext ); 55 | 56 | 57 | double target_surfacerate_inj; 58 | double target_surfacerate_prod; 59 | 60 | const std::vector pressure = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; 61 | BlackoilState state( pressure.size() , 0 , 3); 62 | state.pressure() = pressure; 63 | 64 | // Both wells are open in the first schedule step 65 | { 66 | Opm::WellsManager wellsManager(eclipseState , sched, 0, *gridManager.c_grid()); 67 | const Wells* wells = wellsManager.c_wells(); 68 | const struct WellControls* ctrls0 = wells->ctrls[0]; 69 | const struct WellControls* ctrls1 = wells->ctrls[1]; 70 | BOOST_CHECK(well_controls_well_is_open(ctrls0)); 71 | BOOST_CHECK(well_controls_well_is_open(ctrls1)); 72 | 73 | target_surfacerate_inj = well_controls_iget_target(ctrls0 , 0); 74 | target_surfacerate_prod = well_controls_iget_target(ctrls1 , 0); 75 | 76 | WellState wellstate; 77 | wellstate.init(wells, state); 78 | const std::vector wellrates = wellstate.wellRates(); 79 | BOOST_CHECK_EQUAL (target_surfacerate_inj, wellrates[2]); // Gas injector 80 | BOOST_CHECK_EQUAL (target_surfacerate_prod, wellrates[4]); // Oil target rate 81 | } 82 | 83 | 84 | // The injector is stopped 85 | { 86 | Opm::WellsManager wellsManager(eclipseState, sched, 1 , *gridManager.c_grid()); 87 | const Wells* wells = wellsManager.c_wells(); 88 | const struct WellControls* ctrls0 = wells->ctrls[0]; 89 | const struct WellControls* ctrls1 = wells->ctrls[1]; 90 | BOOST_CHECK(well_controls_well_is_stopped(ctrls0)); // injector is stopped 91 | BOOST_CHECK(well_controls_well_is_open(ctrls1)); 92 | 93 | WellState wellstate; 94 | wellstate.init(wells, state); 95 | 96 | const std::vector wellrates = wellstate.wellRates(); 97 | BOOST_CHECK_EQUAL (0, wellrates[2]); // Gas injector 98 | BOOST_CHECK_EQUAL (target_surfacerate_prod, wellrates[4]); // Oil target rate 99 | } 100 | 101 | } 102 | -------------------------------------------------------------------------------- /tests/wells_group.data: -------------------------------------------------------------------------------- 1 | RUNSPEC 2 | 3 | OIL 4 | GAS 5 | WATER 6 | 7 | DIMENS 8 | 10 10 5 / 9 | 10 | GRID 11 | 12 | DXV 13 | 10*1000.0 / 14 | 15 | DYV 16 | 10*1000.0 / 17 | 18 | DZV 19 | 10.0 20.0 30.0 10.0 5.0 / 20 | 21 | TOPS 22 | 100*10 / 23 | 24 | SCHEDULE 25 | 26 | GRUPTREE 27 | 'G1' 'FIELD' / 28 | 'G2' 'FIELD' / 29 | / 30 | 31 | 32 | WELSPECS 33 | 'INJ1' 'G1' 1 1 8335 'GAS' / 34 | 'PROD1' 'G2' 10 10 8400 'OIL' / 35 | / 36 | 37 | COMPDAT 38 | 'INJ1' 1 1 1 1 'OPEN' 1 10.6092 0.5 / 39 | 'PROD1' 10 1 1 1 'OPEN' 0 10.6092 0.5 / 40 | / 41 | 42 | WEFAC 43 | 'INJ1' 0.5 / 44 | 'PROD1' 0.5 / 45 | / 46 | 47 | TSTEP 48 | 14.0 / 49 | 50 | 51 | WELSPECS 52 | 'INJ2' 'G1' 1 1 8335 'GAS' / 53 | 'PROD2' 'G2' 10 10 8400 'OIL' / 54 | / 55 | 56 | COMPDAT 57 | 'INJ2' 1 1 1 1 'OPEN' 1 10.6092 0.5 / 58 | 'PROD2' 10 1 1 1 'OPEN' 0 10.6092 0.5 / 59 | / 60 | 61 | GCONINJE 62 | 'G1' GAS RATE 30000 / 63 | / 64 | 65 | GCONPROD 66 | 'G2' ORAT 10000 / 67 | / 68 | 69 | WEFAC 70 | 'INJ2' 0.8 / 71 | 'PROD2' 1.0 / 72 | / 73 | 74 | GEFAC 75 | 'G1' 0.8 / 76 | / 77 | 78 | WCONINJE 79 | 'INJ1' 'WATER' 'OPEN' 'RESV' 10 20 40 / 80 | 'INJ2' 'WATER' 'OPEN' 'RESV' 10 20 40 / 81 | / 82 | 83 | WCONPROD 84 | 'PROD1' 'OPEN' 'RESV' 999 3* 123 100 / 85 | 'PROD2' 'OPEN' 'RESV' 999 3* 123 100 / 86 | / 87 | 88 | TSTEP 89 | 3 / 90 | 91 | 92 | 93 | END 94 | -------------------------------------------------------------------------------- /tests/wells_manager_data.data: -------------------------------------------------------------------------------- 1 | RUNSPEC 2 | 3 | OIL 4 | GAS 5 | WATER 6 | 7 | DIMENS 8 | 10 10 5 / 9 | 10 | GRID 11 | 12 | DXV 13 | 10*1000.0 / 14 | 15 | DYV 16 | 10*1000.0 / 17 | 18 | DZV 19 | 10.0 20.0 30.0 10.0 5.0 / 20 | 21 | TOPS 22 | 100*10 / 23 | 24 | PERMX 25 | 500*1.0 / 26 | 27 | SCHEDULE 28 | 29 | WELSPECS 30 | 'INJ1' 'G' 1 1 8335 'GAS' / 31 | 'PROD1' 'G' 10 10 8400 'OIL' / 32 | / 33 | 34 | COMPDAT 35 | 'INJ1' 1 1 1 1 'OPEN' 1 10.6092 0.5 / 36 | 'PROD1' 10 3 3 3 'OPEN' 0 10.6092 0.5 / 37 | / 38 | 39 | WCONPROD 40 | 'PROD1' 'OPEN' 'ORAT' 20000 4* 1000 / 41 | / 42 | 43 | WCONINJE 44 | 'INJ1' 'GAS' 'OPEN' 'RATE' 100 200 400 / 45 | / 46 | 47 | 48 | DATES -- Step1 49 | 1 'FEB' 2000 / 50 | / 51 | 52 | WCONPROD 53 | 'PROD1' 'OPEN' 'RESV' 999 3* 123 100 / 54 | / 55 | 56 | WCONINJE 57 | 'INJ1' 'WATER' 'OPEN' 'RESV' 10 20 40 / 58 | / 59 | 60 | 61 | DATES -- Step2 62 | 1 'MAR' 2000 / 63 | / 64 | 65 | 66 | WCONPROD 67 | 'PROD1' 'SHUT' / 68 | / 69 | 70 | 71 | DATES -- Step3 72 | 1 'APR' 2000 / 73 | / 74 | 75 | WELSPECS 76 | 'NEW' 'G' 2 2 1* 'OIL' 2* 'STOP' 4* / 77 | / 78 | 79 | COMPDAT 80 | 'NEW' 2 2 2 2 'OPEN' 1 10.6092 0.5 / 81 | / 82 | 83 | 84 | WCONHIST 85 | 'NEW' 'OPEN' 'ORAT' 0.000 0.000 0.000 5* / 86 | / 87 | 88 | END 89 | 90 | -------------------------------------------------------------------------------- /tests/wells_manager_data_expanded.data: -------------------------------------------------------------------------------- 1 | OIL 2 | GAS 3 | WATER 4 | 5 | DIMENS 6 | 10 10 5 / 7 | 8 | GRID 9 | 10 | DXV 11 | 10*1000.0 / 12 | 13 | DYV 14 | 10*1000.0 / 15 | 16 | DZV 17 | 10.0 20.0 30.0 10.0 5.0 / 18 | 19 | -- The DEPTHZ keyword is only here to satisfy the old parser; content might 20 | -- completely bogus. 21 | DEPTHZ 22 | 121*2000 / 23 | 24 | 25 | SCHEDULE 26 | 27 | WELSPECS 28 | 'INJ1' 'G' 1 1 8335 'GAS' / 29 | 'PROD1' 'G' 10 10 8400 'OIL' / 30 | / 31 | 32 | COMPDAT 33 | 'INJ1' 1 1 1 2 'OPEN' 1 10.6092 0.5 / 34 | 'INJ1' 1 1 3 5 'OPEN' 1 12.6092 0.5 / 35 | 'INJ1' 2 2 1 1 'OPEN' 1 14.6092 0.5 / 36 | 'PROD1' 10 3 3 3 'OPEN' 0 10.6092 0.5 / 37 | / 38 | 39 | WCONPROD 40 | 'PROD1' 'OPEN' 'ORAT' 20000 4* 1000 / 41 | / 42 | 43 | WCONINJE 44 | 'INJ1' 'GAS' 'OPEN' 'RATE' 100 200 400 / 45 | / 46 | 47 | 48 | DATES 49 | 1 'FEB' 2000 / 50 | / 51 | 52 | WELSPECS 53 | 'INJ1' 'G3' 1 1 8335 'GAS' / 54 | 'QNJ2' 'G3' 1 1 8335 'GAS' / 55 | / 56 | 57 | 58 | COMPDAT 59 | 'QNJ2' 3 4 1 2 'OPEN' 1 10.6092 0.5 / 60 | 'QNJ2' 4 4 3 5 'OPEN' 1 12.6092 0.5 / 61 | / 62 | 63 | WCONPROD 64 | 'PROD1' 'OPEN' 'RESV' 999 3* 123 100 / 65 | / 66 | 67 | WCONINJE 68 | 'INJ1' 'WATER' 'OPEN' 'RESV' 10 20 40 / 69 | 'QNJ2' 'WATER' 'OPEN' 'RESV' 7 33 39 / 70 | / 71 | 72 | 73 | 74 | TSTEP 75 | 14.0 / 76 | / 77 | 78 | WELOPEN 79 | 'INJ1' 'SHUT' 5* / 80 | / 81 | 82 | TSTEP 83 | 14.0 / 84 | / 85 | 86 | END 87 | -------------------------------------------------------------------------------- /tests/wells_manager_data_wellSTOP.data: -------------------------------------------------------------------------------- 1 | RUNSPEC 2 | 3 | OIL 4 | GAS 5 | WATER 6 | 7 | 8 | DIMENS 9 | 10 10 5 / 10 | 11 | GRID 12 | 13 | DXV 14 | 10*1000.0 / 15 | 16 | DYV 17 | 10*1000.0 / 18 | 19 | DZV 20 | 10.0 20.0 30.0 10.0 5.0 / 21 | 22 | TOPS 23 | 100*10 / 24 | 25 | PERMX 26 | 500*1.0 / 27 | 28 | SCHEDULE 29 | 30 | WELSPECS 31 | 'INJ1' 'G' 1 1 8335 'GAS' / 32 | 'PROD1' 'G' 10 10 8400 'OIL' / 33 | / 34 | 35 | COMPDAT 36 | 'INJ1' 1 1 1 1 'OPEN' 1 10.6092 0.5 / 37 | 'PROD1' 10 3 3 3 'OPEN' 0 10.6092 0.5 / 38 | / 39 | 40 | WCONPROD 41 | 'PROD1' 'OPEN' 'ORAT' 20000 4* 1000 / 42 | / 43 | 44 | WCONINJE 45 | 'INJ1' 'GAS' 'OPEN' 'RATE' 100 200 400 / 46 | / 47 | 48 | 49 | WELOPEN 50 | 'INJ1' 'STOP' 5* / 51 | / 52 | 53 | TSTEP 54 | 10 / 55 | 56 | END 57 | -------------------------------------------------------------------------------- /tests/wells_stopped.data: -------------------------------------------------------------------------------- 1 | RUNSPEC 2 | 3 | OIL 4 | GAS 5 | WATER 6 | 7 | 8 | DIMENS 9 | 10 10 1 / 10 | 11 | GRID 12 | 13 | DXV 14 | 10*1000.0 15 | / 16 | 17 | DYV 18 | 10*1000.0 19 | / 20 | 21 | DZ 22 | 100*20.0 23 | / 24 | 25 | TOPS 26 | 100*10 27 | / 28 | 29 | PERMX 30 | 100*1.0 / 31 | 32 | SCHEDULE 33 | 34 | WELSPECS 35 | 'INJ1' 'G' 1 1 8335 'GAS' / 36 | 'PROD1' 'G' 10 10 8400 'OIL' / 37 | / 38 | 39 | COMPDAT 40 | 'INJ1' 1 1 1 1 'OPEN' 1 10.6092 0.5 / 41 | 'PROD1' 10 1 1 1 'OPEN' 0 10.6092 0.5 / 42 | / 43 | 44 | WCONPROD 45 | 'PROD1' 'OPEN' 'ORAT' 20000 4* 1000 / 46 | / 47 | 48 | WCONINJE 49 | 'INJ1' 'GAS' 'OPEN' 'RATE' 100 200 400 / 50 | / 51 | 52 | 53 | TSTEP 54 | 1 / 55 | 56 | WELOPEN 57 | 'INJ1' 'STOP' 5* / 58 | / 59 | 60 | END 61 | -------------------------------------------------------------------------------- /tests/wetgas.DATA: -------------------------------------------------------------------------------- 1 | RUNSPEC 2 | 3 | TABDIMS 4 | -- use the defaults of TABDIMS but the keyword must be present in the deck 5 | -- for it to be usable 6 | / 7 | 8 | DIMENS 9 | 3 3 3 / 10 | 11 | WATER 12 | OIL 13 | GAS 14 | 15 | FIELD 16 | 17 | GRID 18 | 19 | -- tests for the PVT functions need a grid because the OPM-API for the 20 | -- PVT functions assumes the presence of compressed grid cells, 21 | -- i.e. we need to be able to map from compressed to logical cartesian 22 | -- cell indices to find out the PVT region of a cell 23 | DXV 24 | 1 2 3 / 25 | DYV 26 | 1 2 3 / 27 | DZV 28 | 1 2 3 / 29 | 30 | TOPS 31 | 9*123.456 / 32 | 33 | PROPS 34 | 35 | -- PVT PROPERTIES OF DRY GAS (NO VAPOURISED OIL) 36 | -- FROM SPE3 Blackoil Kleppe 37 | -- 38 | -- 'Pressure' 'Oil FVF' 'Oil Visc' 39 | PVDO 40 | 1214.7000 1.0632 0.3668 41 | 1814.7000 1.0518 0.4241 42 | 2414.7000 1.0418 0.5018 43 | 3014.7000 1.0332 0.6068 44 | 3214.7000 1.0308 0.6461 45 | 3364.7000 1.0291 0.6753 46 | 3414.7000 1.0285 0.6852 47 | 3443.8831 1.0282 0.6912 48 | / 49 | 50 | -- Wet Gas PVT Properties (Vapourised Oil) 51 | -- Column Properties are: 52 | -- 'Gas Pressure' 'Gas OGR' 'Gas FVF' 'Gas Visc' 53 | -- Units: psia stb /Mscf rb /Mscf cp 54 | PVTG 55 | 1214.7000 0.0013130 2.2799 0.0149 56 | 0 2.2815 0.01488/ 57 | 1814.7000 0.00353 1.4401 0.01791 58 | 0.001313 1.4429 0.01782 59 | 0 1.4445 0.01735 / 60 | 2414.7000 0.01102 1.0438 0.02328 61 | 0.00353 1.0495 0.02267 62 | 0.001313 1.0512 0.0225 63 | 0 1.0522 0.02240 / 64 | 3014.7000 0.0331 0.8456 0.0318 65 | 0.01102 0.8489 0.02924 66 | 0.00353 0.8500 0.02844 67 | 0.001313 0.8503 0.02820 68 | 0 0.8505 0.02807 / 69 | 3214.7000 0.0454 0.8082 0.03539 70 | 0.0331 0.8080 0.03371 71 | 0.01102 0.8075 0.03113 72 | 0.00353 0.8073 0.03029 73 | 0.001313 0.8073 0.03004 74 | 0 0.8073 0.02989 / 75 | 3364.7000 0.05670 0.7875 0.0384 76 | 0.04540 0.7860 0.03667 77 | 0.03310 0.7843 0.03515 78 | 0.01102 0.7814 0.03429 79 | 0.00353 0.7804 0.03162 80 | 0.001313 0.7801 0.03136 81 | 0 0.7799 0.03121 / 82 | 3416.7575 0.0612 0.7816 0.03955 83 | 0.0567 0.7809 0.0386 84 | 0.0454 0.7789 0.03717 85 | 0.0331 0.7768 0.03564 86 | 0.01102 0.7731 0.03296 87 | 0.00353 0.7718 0.03207 88 | 0.001313 0.7714 0.03181 89 | 0 0.7712 0.03166 / 90 | 3449.3322 0.0642 0.7783 0.0403 91 | 0.0612 0.7777 0.0395 92 | 0.0567 0.7769 0.03892 93 | 0.0454 0.7747 0.03748 94 | 0.0331 0.7723 0.03594 95 | 0.01102 0.7681 0.03325 96 | 0.00353 0.7666 0.03236 97 | 0.001313 0.7662 0.0321 98 | 0 0.7660 0.03194 / 99 | / 100 | --------------------------------------------------------------------------------