From 60ed9468357dbfd50e3556f814517dd998b100ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Thu, 24 May 2012 09:18:37 +0200 Subject: [PATCH] Added program refine_wells. --- examples/Makefile.am | 5 +++- examples/refine_wells.cpp | 50 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 examples/refine_wells.cpp diff --git a/examples/Makefile.am b/examples/Makefile.am index 703e4bd3..b8bb1c08 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -8,7 +8,8 @@ noinst_PROGRAMS = \ scaneclipsedeck \ spu_2p \ wells_example \ -sim_wateroil +sim_wateroil \ +refine_wells spu_2p_SOURCES = spu_2p.cpp spu_2p_LDADD = $(LDADD) $(LIBS) $(BOOST_SYSTEM_LIB) $(BOOST_FILESYSTEM_LIB) $(LAPACK_LIBS) $(LIBS) $(LIBS) @@ -17,3 +18,5 @@ sim_wateroil_SOURCES = sim_wateroil.cpp sim_wateroil_LDADD = $(LDADD) $(LIBS) $(BOOST_SYSTEM_LIB) $(BOOST_FILESYSTEM_LIB) $(LAPACK_LIBS) $(LIBS) $(LIBS) wells_example_SOURCES = wells_example.cpp + +refine_wells_SOURCES = refine_wells.cpp \ No newline at end of file diff --git a/examples/refine_wells.cpp b/examples/refine_wells.cpp new file mode 100644 index 00000000..0058c483 --- /dev/null +++ b/examples/refine_wells.cpp @@ -0,0 +1,50 @@ +/* + Copyright 2012 SINTEF ICT, Applied Mathematics. + + This file is part of the Open Porous Media project (OPM). + + OPM is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OPM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with OPM. If not, see . +*/ + +#include + +// Double I and J coordinates of wells and completions. +// Do not change any well productivity indices or any other data. +int main(int argc, char** argv) +{ + using namespace Opm; + if (argc != 2) { + std::cerr << "Usage: " << argv[0] << " deck\n"; + return 1; + } + EclipseGridParser deck(argv[1], false); + + WELSPECS ws = deck.getWELSPECS(); + const int nw = ws.welspecs.size(); + for (int w = 0; w < nw; ++w) { + ws.welspecs[w].I_ *= 2; + ws.welspecs[w].J_ *= 2; + } + + COMPDAT cd = deck.getCOMPDAT(); + const int nc = cd.compdat.size(); + for (int c = 0; c < nc; ++c) { + cd.compdat[c].grid_ind_[0] *= 2; + cd.compdat[c].grid_ind_[1] *= 2; + } + + ws.write(std::cout); + std::cout << '\n'; + cd.write(std::cout); +}