Commit Graph

188 Commits

Author SHA1 Message Date
Joakim Hove
80423a0188 Pure white-space change 2015-01-12 12:43:44 +01:00
Joakim Hove
b9e7c88314 Added missing enum rename 2015-01-12 12:41:56 +01:00
Joakim Hove
a0d41dc130 Added WellCompletion namespace 2015-01-12 12:10:51 +01:00
Tor Harald Sandve
880026e893 Fix comments. 2015-01-09 09:10:10 +01:00
Tor Harald Sandve
82eafbb510 Renaming well is shut to well is stopped.
Rename the the meaning for shut as whats used in Eclipse.
STOP: Well stopped off above the formation. I.e. allow for flow in the
well.
SHUT: Well completely isolated from the formation. The well is removed
from the well list.
2015-01-09 09:10:10 +01:00
Tor Harald Sandve
b8bf45d24d Support stopped wells
The given control is applied to the stopped well, and the status is set
to not open. (i.e closed, but currently named shut)
2015-01-09 09:10:10 +01:00
Markus Blatt
f763192a32 [cleanup] Removes a superfluous if-check of the well state.
There were to identical if statements and the second one was followed
by an else branch. While in this case (if statement just throws) it is not
a bug, this commit cleans up one of the if statements.
2014-11-20 14:47:21 +01:00
Markus Blatt
529d0887a3 Fixes missing return value in non-void function of WellsManager.
gcc warned about the following

/home/mblatt/src/dune/opm/opm-core/opm/core/wells/WellsManager.cpp: In function ‘std::array<long unsigned int, 3ul> WellsManagerDetail::directionIndices(Opm::CompletionDirection::DirectionEnum)’:
/home/mblatt/src/dune/opm/opm-core/opm/core/wells/WellsManager.cpp:191: warning: control reaches end of non-void function

To calm it I introduced a throw clause after the switch statements. Thus adding a new
enum value will raise a warning on smart compilers, hopefully.
2014-11-20 11:53:23 +01:00
Tor Harald Sandve
3fe61bfb1b BUGFIX. Do not increase well index for shut wells.
Shut wells are not added to the well list and the well index should
therefore not be increased when well control is set. This is similar to
whats is done for shut wells in createWellsFromSpecs.
2014-10-27 07:20:03 +01:00
Tor Harald Sandve
4585446e5a Fix SHUT wells
Shut wells are not added to the well list and thus not considered in the
simulator.

The shut well test in test_wellsmanager is modified to assert this
behaviour.

BUG: This change provokes an assert in the EclipeWriter as number of
wells in wellstate is different from number of wells in the schedule.
2014-10-24 06:57:38 +02:00
Joakim Hove
642c5309c9 Minor whitespace fixup 2014-10-17 08:05:13 +02:00
Joakim Hove
827089b835 Bug in well_index increment in WellsManager 2014-10-14 12:43:57 +02:00
Joakim Hove
c9ad66168f Will not update WellControls if cmode == CMODE_UNDEFINED 2014-10-14 12:42:55 +02:00
Joakim Hove
cbff4612a3 ControlMode is left undefined if it unset in deck. 2014-10-14 12:34:58 +02:00
Andreas Lauser
0a1775db02 WellsManager: do not require a control mode to be set if the well status is SHUT
For Norne it fell on its nose because of this...
2014-10-08 12:35:38 +02:00
Andreas Lauser
2a0c9dd009 rename getCF() to getConnectionTransmissibilityFactor() 2014-09-06 22:28:21 +02:00
Bård Skaflestad
86550fd6c9 effectiveRadius: Fix numerator formula
We must take the square root of the permeability ratios, not use them
as is.  This was lost in the refactorisation commit 96cf137.

Pointy hat: @bska.
2014-09-02 15:12:50 +02:00
Bård Skaflestad
66293e8aed effectiveExtent: Fix out-of-bounds indexing
Commit 96cf137 introduced support for Peaceman index calculation
that honoured general completion directions (X,Y,Z).  This was
accomplished through a permutation index that reordered the
permeability and geometric extent components according to a local
coordinate system along the completion.

In a complete breakdown of logic, however, the d-component extent
vector was indexed as though it were a d-by-d matrix.  This commit
restores sanity to the processing.

Pointy hat: @bska.
2014-09-01 13:30:32 +02:00
Atgeirr Flø Rasmussen
402044a54a Use double braces for std::array init to avoid warning.
Warning triggered at least using clang.
2014-09-01 10:09:27 +02:00
Bård Skaflestad
6ab31022fc WellsManager: Support NTG and horizontal completions
This commit extends the feature set of the WellsManager to support
horizontal ("X" and "Y") completions and include the net-to-gross
ratio in the Peaceman index ("Completion Transmissibility Factor,
CTF") of a well completion.  The NTG factor is included if present
in the input deck represented by the "eclipseState".

There are two separate, though related, parts to this commit.  The
first part splits the calculation of Peaceman's "effective radius"
out to a separate utility function, effectiveRadius(), and
generalises WellsManagerDetail::computeWellIndex() to account for
arbitrary directions and NTG factors.  The second part uses
GridPropertyAccess::Compressed<> to extract the NTG vector from the
input if present while providing a fall-back value of 1.0 if no such
vector is available.

Note: We may wish to make the extraction policy configurable at some
point in the future.
2014-08-31 21:24:37 +02:00
Bård Skaflestad
70c0139a0f Annotate namespace closing brace with namespace name 2014-08-29 12:31:35 +02:00
Bård Skaflestad
a85638ec12 Adjust white-space for readability
This is mostly just splitting long lines and aligning parameters where
appropriate.  No functional changes.
2014-08-29 12:22:26 +02:00
Bård Skaflestad
c0da69925e createWellsFromSpecs: Assert three space dimensions
Method WellsManager::createWellsFromSpecs() is only supported in
three space dimensions.  Assert that we don't use anything else.
2014-08-29 12:18:59 +02:00
Bård Skaflestad
8766e6468c createWellsFromSpecs: Use ref-to-const cart2active
This commit tightens the function header of method

    WellsManager::createWellsFromSpecs()

to accept a reference-to-const 'cartesian_to_compressed' map.  It
used to be a complete, copy-constructed object, so this is a slight
performance enhancement as we no longer need to copy a (somewhat)
large object on every call to the method.
2014-08-29 12:13:38 +02:00
Bård Skaflestad
5f34301b92 getCubeDim: Support arbitrary number of dimensions
This commit generalises the implementation of utility function
'getCubeDim' to support arbitrary number of space dimensions.  In
actual practice there's no change in features as we only really use
a compile-time constant (= 3) to specify the number of space
dimensions.
2014-08-29 11:39:24 +02:00
Atgeirr Flø Rasmussen
070f2456c4 Properly handle defaulted well reference depths. 2014-08-07 12:57:05 +02:00
Bård Skaflestad
3a6ac6a759 Reimplement clone_wells() in terms of well_controls_clone() 2014-07-03 16:09:56 +02:00
Bård Skaflestad
033625c5a8 well_controls: Add deep-copy (clone) support
New function well_controls_clone(), implemented in terms of the
public API only, mirrors the objective of function clone_wells(),
only for well control sets.  Add a basic test to demonstrate the
function too.
2014-07-03 16:09:56 +02:00
Bård Skaflestad
24804a1f6f clone_wells(): Assert result equal to input
This adds a debug-mode safety belt that cloning wells produces a
comparable set of wells to the input.
2014-07-03 16:09:56 +02:00
Bård Skaflestad
464b0c3d15 well_controls_equal(): Don't compare set capacities
The 'cpty' field is for internal memory management purposes only.
No client can know of its existence, let alone inspect or directly
change the value, so it should not be used to adjudicate control set
equality.  This was useful during the refactoring work to introduce
the opm-parser support, but its utility has since ceased.

Okay'ed by: [at] atgeirr and [at] joakim-hove
2014-07-03 16:09:56 +02:00
Andreas Lauser
f360562aee remove EclipseGridParser compatibility methods from all classes 2014-05-21 11:22:43 +02:00
Atgeirr Flø Rasmussen
320c3332ad Add missing break statements in switch, add default case. 2014-04-24 15:43:54 +02:00
Markus Blatt
ab5e011f34 Merge remote-tracking branch 'upstream/master' into master-refactor-for-cpgrid-support
Manually resolved conflicts in:
	opm/core/io/eclipse/EclipseWriter.cpp
	opm/core/io/eclipse/EclipseWriter.hpp
	opm/core/props/satfunc/SaturationPropsFromDeck_impl.hpp
2014-04-08 21:50:00 +02:00
Atgeirr Flø Rasmussen
db88058b34 Use preferred phase of producer well to set comp_fraction.
This replaces the previous hack, that set comp_fraction to (0,1,0) always.
2014-04-06 23:33:43 +02:00
Markus Blatt
472844e454 Merge remote-tracking branch 'upstream/master' into master-refactor-for-cpgrid-support
Removed conflicts in
	opm/core/wells/WellsManager.cpp
that were due to the change
```diff
-                    pd.well_index = WellsManagerDetail::computeWellIndex(radius, cubical, cell_perm, completion->getDiameter());
+                    pd.well_index = WellsManagerDetail::computeWellIndex(radius, cubical, cell_perm, completion->getSkinFactor());
```
in  WellsManager::createWellsFromSpecs which moved from WellsManager.cpp to WellsManager_impl.hpp file in a previous commit.
2014-04-04 21:21:22 +02:00
Tor Harald Sandve
d90717877b Hack to set compi for producer.
compi is set to [0 1 0] for all producers
2014-04-04 12:15:49 +02:00
Atgeirr Flø Rasmussen
eb19031c17 Bugfix: skin factor, not diameter. 2014-03-31 14:47:16 +02:00
Markus Blatt
7aa8728be9 Removed last artefact of checkCellExistence (in constructor taking wells)
Somehow this slipped one of the merges. With the last
patch this module failed to compile as we use the new
definition without the bool parameters.
2014-03-29 10:35:12 +01:00
Markus Blatt
0c96066a79 Readd definition of WellsManager constructor from wells.
As @bska pointed in my issue #518 this definition was
accidentally removed in commit 20468d1 during a merge of
upstream changes. Therefore I readd it with this patch.
2014-03-29 10:12:40 +01:00
Markus Blatt
c282949400 Merge remote-tracking branch 'upstream/master' into master-refactor-for-cpgrid-support
Manually resolved conflicts:
	opm/core/io/eclipse/EclipseWriter.cpp
	opm/core/io/eclipse/EclipseWriter.hpp
	opm/core/props/BlackoilPropertiesFromDeck.cpp
	opm/core/simulator/initState_impl.hpp
	opm/core/wells/WellsManager.cpp
	opm/core/wells/WellsManager.hpp
2014-03-27 15:27:11 +01:00
Joakim Hove
f0126b2501 Removed WellsManager constructor which takes an ole Eclipsegridparser instance. 2014-03-25 18:57:58 +01:00
Joakim Hove
2eab8aeb38 Changed the access to Parser/EclipseState/Schedule to use new well injection and production properties. To be aligned with opm-parser:e75970a28b96374409a55e3e6cea2198b6a0ea23 2014-03-21 00:35:15 +01:00
Atgeirr Flø Rasmussen
5fc6cbc16f Made single-argument constructors explicit.
Avoids unintended implicit conversions.
2014-03-17 13:27:50 +01:00
Markus Blatt
c6daebc35d Merge branch 'refactor-for-cpgrid-support' into master-refactor-for-cpgrid-support
Manually resolved conflicts in:
	opm/core/props/BlackoilPropertiesFromDeck.cpp
	opm/core/wells/WellsManager.cpp
2014-03-13 13:41:45 +01:00
Joakim Hove
ca7de3c7c1 Will check if a well is open before throwing for an invalid control. 2014-03-12 20:27:17 +01:00
Joakim Hove
7413894a67 Removed cpos = ~cpos constructions for closing a well; using well_controls_shut_well explicitly instead. 2014-03-12 17:41:40 +01:00
Joakim Hove
8be1f0e8d3 Changed open / close behaviour of well_controls: 1) well_controls has an explicit open_close flag. 2) Will NOT flip current value to change open|close status 2014-03-04 20:23:19 +01:00
Markus Blatt
2d54a7398b Refactored WellsManager to partial use without UnstructuredGrid. 2014-02-25 17:52:51 +01:00
Kristian Flikka
a055b529ec Add handling of WGRUPCON to new-parser friendly WellsManager constructor 2014-02-24 15:24:33 +01:00
Markus Blatt
21864388bd Merge remote-tracking branch 'origin/opm-parser-integrate' into refactor-for-cpgrid-support
Resolved Conflicts:
	opm/core/props/BlackoilPropertiesFromDeck.cpp
	opm/core/props/rock/RockFromDeck.hpp
	opm/core/props/satfunc/SaturationPropsFromDeck.hpp
	opm/core/props/satfunc/SaturationPropsFromDeck_impl.hpp
2014-02-19 15:22:18 +01:00
Markus Blatt
d5f470cb68 Refactored parts needed for Blackoil in autodiff to get rid of UG dependency.
This patch refactors (hopefully) all parts of opm-core that are needed
by the fully implicite black oil solver in opm-autodiff and that inherently
relied on UnstructuredGrid.

We added a new simple grid interface consisting out of free functions
that will allow us to use CpGrid without copying it to an UnstructuredGrid
by the means of the GridAdapter. Using this interface we have add methods that
allow specifying the grid information (global_cell, cartdims, etc.) wherever
possible to prevent introducing grid parameters for the type of the grid.
Unfortunately this was not possible everywhere.
2014-02-17 13:23:01 +01:00
Kristian Flikka
ab42682399 Removed old EclipseGridParser from WellsManager constructor, WGROUPCON still missing 2014-02-14 15:36:32 +01:00
Kristian Flikka
d1494e7daa Removed the previously introduced getAndUnRootChild method 2014-02-14 13:46:54 +01:00
Kristian Flikka
3c93c7a781 Added building of WellsCollection group structure from new opm-parser objects 2014-02-14 13:43:25 +01:00
Kristian Flikka
ae8944f6ea Added an else to avoid unnecessary checking. 2014-02-14 09:01:21 +01:00
Kristian Flikka
d7568b4adf Changed the WellCollection addChild functions to be more specific, and strict 2014-02-13 16:00:39 +01:00
Kristian Flikka
f94f63ff56 Extracted common functionality from the three create functions 2014-02-12 15:45:06 +01:00
Kristian Flikka
1181d1c1bc Create WellsGroupInterface from opm-parser Well/Group objects 2014-02-12 15:39:57 +01:00
Kristian Flikka
b6072e5112 Added support for creation of WellsGroup objects from new parser Well and Group objects 2014-02-11 14:12:36 +01:00
Kristian Flikka
aa329b8b3e Removed WELOPEN from constructor, added throwing on non OPEN/SHUT statuses 2014-02-06 16:31:35 +01:00
Kristian Flikka
3d215691da Removed WELTARG commented code, moved wellperf_data into createWellsFromSpecs function 2014-02-03 09:22:28 +01:00
Kristian Flikka
76dff2e326 Extracted well controls setup to separate function 2014-02-03 09:07:58 +01:00
Kristian Flikka
e12ec1b25d Extracted well specification and completion data setup to a function 2014-02-03 08:58:54 +01:00
Joakim Hove
30df3cab37 Using well->hasInjectionControl() to check whether a particular control is available. 2014-01-30 16:37:20 +01:00
Joakim Hove
35d0808fbe Implemented WCONPROD support from Parser::Schedule object. 2014-01-30 15:55:17 +01:00
Joakim Hove
3e2df33a65 Merge remote-tracking branch 'upstream/opm-parser-integrate' into wellsmanager-rates
Conflicts:
	opm/core/wells/WellsManager.cpp
2014-01-30 09:50:09 +01:00
Joakim Hove
70e2dd9f12 Implemented well injector properties from opm-parser::Well. 2014-01-30 08:02:13 +01:00
Kristian Flikka
d621fdfe79 Removed print statement 2014-01-29 12:30:03 +01:00
Kristian Flikka
fbe2f31653 Updated COMPDAT i,j,k indices, and removed the old commented part 2014-01-29 11:58:14 +01:00
Kristian Flikka
7ce9cb9055 Compdat extraction from new CompletionXXX classes 2014-01-29 11:58:13 +01:00
Joakim Hove
7774a11eee WellType is determined from well->isProducer() instead of looking for WCONINJE / WCONPROD keywords. 2014-01-24 12:00:58 +01:00
Kristian Flikka
3b0a9067b4 Removes the WELSPECS usage in WellsManager constructor. Step 1 in rewrite of constructor 2014-01-22 15:22:32 +01:00
Kristian Flikka
691148122c Merged from upstream/opm-parser-integrate 2014-01-21 13:05:59 +01:00
Kristian Flikka
2ffcb219bb Changed phaseUsageFromDeck to use eclipseState 2014-01-10 13:43:02 +01:00
Kristian Flikka
731fe7d3f4 Changed new WellsManager constructor to take in EclipseStateConstPtr instead of SchedulePtr 2014-01-08 16:10:55 +01:00
Joakim Hove
f00e3d5763 Comparing well names protects againts NULL. 2014-01-08 16:10:43 +01:00
Joakim Hove
ddf6a3c084 Removed access to internal variabel cpty. 2014-01-08 11:32:00 +01:00
Kristian Flikka
1f1c0ebcf3 New constructor for WellsManager that also takes the new parser as argument. New test comparing old and new 2014-01-07 16:10:45 +01:00
Joakim Hove
370f9f0458 Using && instead of &= in the functions comparing wells and well_controls. 2014-01-06 19:22:39 +01:00
Joakim Hove
9fa7362992 Removed explicit (struct WellControls *) cast to align with the rest of the code. 2014-01-06 19:09:36 +01:00
Joakim Hove
b22b3f9fe2 Moved struct WellControls to the implementation file well_controls.c. 2014-01-06 15:13:32 +01:00
Joakim Hove
8132954b85 Added functions to get type, target and distr of *current* control. 2014-01-06 14:40:03 +01:00
Joakim Hove
965c12a689 Implemented well_control based on well_controls_iset_xxx() functions. 2014-01-06 12:40:03 +01:00
Joakim Hove
2ee6331ac1 Implemented well_controls_add_new() with well_controls_iset_xxx() functions. 2014-01-06 12:24:32 +01:00
Joakim Hove
6098368d08 Added new function well_controls_iset_distr(). 2014-01-06 12:22:15 +01:00
Joakim Hove
3d171bd961 Using new function well_controls_invert_current(). 2014-01-06 12:08:29 +01:00
Joakim Hove
bf95c9f768 Added new functions to set target and type and invert value of current control. 2014-01-06 12:06:36 +01:00
Joakim Hove
d783028bcb Using well_controls_get_num() and well_controls_get|set_current() in WellsManager 2014-01-06 10:12:11 +01:00
Joakim Hove
17b800796f Temporarily added symbol HAVE_WELLCONTROLS before including well_controls.h - to get acces to the internal elements in struct WellControls. 2014-01-05 16:25:31 +01:00
Joakim Hove
3653404c41 Reimplemnted struct WellControls access to use the set/get functions in well_controls.c 2014-01-05 16:23:22 +01:00
Joakim Hove
aea54d073a Added well_controls_get_xxx() and well_controls_set_xxx() functions. The well_controls_reserved() function is called from well_controls_add() and not explicitly. 2014-01-05 16:22:30 +01:00
Joakim Hove
fb8413960c Removed #include <opm/core/well_controls.h> from wells.h and inserted explicit #include <opm/core/well_controls.h> where needed. 2014-01-05 15:03:30 +01:00
Joakim Hove
157d0870f2 Removed struct WellControlManagement and replaced with simple integer field cpty in the WellControls structure. 2014-01-05 14:54:56 +01:00
Joakim Hove
8acdf34653 Moved well_controls implementation to separate file well_controls.c. 2014-01-05 14:47:15 +01:00
Joakim Hove
0450e1bb77 Extracted everything related to well controls to separate header well_controls.h - to simplify introducing new parser. 2014-01-03 16:04:12 +01:00
Kristian Flikka
e4a7a33598 Implementation (not finished) of wells_equal, well_controls_equal, and tests. To build a WellsManager test for old and new parser
Conflicts:
	CMakeLists_files.cmake
2014-01-03 16:00:10 +01:00
Andreas Lauser
fde3fe3332 convert users of MESSAGE to OPM_MESSAGE 2013-09-05 13:04:38 +02:00
Andreas Lauser
d6fa31b452 convert users of the ASSERT and the ASSERT2 macros to standard assert() 2013-09-05 13:04:37 +02:00
Andreas Lauser
cb76a0fd7f convert THROW to OPM_THROW 2013-09-05 13:04:37 +02:00
Andreas Lauser
408d3389c3 include iostream in the files which use std::cerr or std::cout
for some of these files this is needed to make to keep it compiling
after the next patch because the new ErrorMacros.hpp file will no
longer implicitly includes <iostream>. for the remaining files it is
just good style.

While at it, the includes for most of these files have been ordered in
order of decreasing abstraction level.
2013-09-05 13:04:37 +02:00