Commit Graph

168 Commits

Author SHA1 Message Date
Atgeirr Flø Rasmussen
061b283a03 Merge pull request #888 from totto82/avoid_throw_wellManager
WARN instead of THROW if completion is not found in the grid
2015-09-28 10:02:06 +02:00
Markus Blatt
e2e9ea1bf5 Prevent WellsManager from subscripting empty container.
While hopefully not a bug it raises an exception with gcc's
libc debugging mode. Therefore we resort to using C++11's
std::vector::data instead.

The exception was rosen when running SPE9 in parallel.
2015-09-23 09:28:59 +02:00
Tor Harald Sandve
fb127aeb9a WARN instead of THROW if completion is not found in the grid
Completions that are not found in the grid are ignored.
2015-09-22 13:51:06 +02:00
Atgeirr Flø Rasmussen
99d3ca24bb Use compressedToCartesian() to avoid possible null reference. 2015-09-15 14:23:10 +02:00
Tor Harald Sandve
8d9bdb8d47 Use cell thickness from EclipseGrid in well transmissibility
calculations

The dz calculated in WellDetails::getCubeDim is not correct in cases
where the face centroid of the horizontal faces is located above or
below the face centroid or the vertical faces. The cell thickness in
EclipseGrid, calculated using the Z-coordinates, is therefore used
instead.
2015-09-15 10:50:56 +02:00
Markus Blatt
af2f3a0a90 Allow a few well completions in the overlap.
If on one process a well completion is next to border then
it might also be stored in the neighbor process. Still not
all the completions of the well are known to the neighbor.
This breaks the previous assumption that for each well all
completions must belong to the partition of the process.

Therefore with this commit we allow wells that only have a
part of their completions assigned to the partition of the process.
This wells are deactivated under the assumption that they must
exist completely on another process due to the partitioning.
2015-09-08 20:38:02 +02:00
Markus Blatt
602310541e Make code clearer with and if-else-if statements and spaces. 2015-09-08 10:48:55 +02:00
Markus Blatt
50eab88274 Improve code comments. 2015-09-08 10:48:14 +02:00
Markus Blatt
8b11b7069f Make last commit compile 2015-09-08 09:30:16 +02:00
Markus Blatt
4fc36e58fb [bugfix] Account for shut completions when checking well in a parallel run.
Previously well with just some shut completions errorneously triggered an
exception in parallel runs. This is fixed with this commit.

Due to the logic shut completions will always be marked as existing
on a process. (Initially all completions are marked as found. For
each open completion we check whether the cartesian index belongs to
the local grid. If that is not the case we mark it as not found).
Therefore we now check whether the found number of completions
is either the number of shut completions or the number of all completions.
In the former case the well is not stored on this process, and in the latter
case it is. In other cases we throw an exception.
2015-09-07 16:55:08 +02:00
Markus Blatt
4102846873 Fix complaint about initial declaration in foor loop.
gcc-4.7.2 (Debian 4.7.2-5) complained about:
"‘for’ loop initial declarations are only allowed in C99 mode
note: use option -std=c99 or -std=gnu99 to compile your code"
when seeing a loop like
for(int i=0; i<end; ++i)

This is fixed by moving the declaration before the for loop with
this commit. Altenatively, we could use the above option.
2015-09-03 14:03:25 +02:00
babrodtk
9458fcc498 Fixed several compiler warnings 2015-08-19 13:12:14 +02:00
babrodtk
a002781998 Bugfix with THP for injection wells 2015-08-19 13:12:14 +02:00
babrodtk
ede4945282 Removed superfluous line 2015-08-19 13:12:14 +02:00
babrodtk
a743efe819 Refactoring 2015-08-19 13:12:14 +02:00
babrodtk
83f6b02941 More integration of VFP tables 2015-08-19 13:10:48 +02:00
babrodtk
f320b04c4d Initial integration of VFP 2015-08-19 13:10:48 +02:00
Atgeirr Flø Rasmussen
24f91aa248 Use the correct (new) method from the Group class for group RESV.
Production controls now are no longer initialised from injection control data.
2015-08-13 10:21:24 +02:00
Fredrik Gundersen
13f30e294a Added support for WPIMULT 2015-06-02 13:24:37 +02:00
Markus Blatt
3aa869cfa0 Removes well debugging output. 2015-05-27 09:22:54 +02:00
Markus Blatt
63d8d5e781 [bugfix,parallel] Deactivate non-existing wells in manager.
Previously, we used the setStatus method to set wells that do not
exist on the local grid to SHUT. Or at least this is what I thought
that ```well.setStatus(timestep, SHUT)```. Unfortunately, my
assumption was wrong. This was revealed while testing a parallel run
with SPE9 that threw an expeption about "Elements must be added in
weakly increasing order" in Opm::DynamicState::add(int, T). Seems like
the method name is a bit misleading.

As it turns out the WellManager has its own complete list of active
wells (shut wells are simply left out). Therefore we can use this
behaviour to our advantage: With this commit we not only exclude shut
wells from the list, but also the ones that do not exist on the local
grid. We even get rid of an ugly const_cast.

Currently, I have running a parallel SPE9 test that has not yet
aborted.
2015-05-26 21:01:16 +02:00
Markus Blatt
1a7ab6b81c Get rid of unclear continue; statement in favor of if-else 2015-05-12 15:30:20 +02:00
Markus Blatt
9514b8c89a Switched from default constructing to explicit construction with false. 2015-05-08 19:44:50 +02:00
Markus Blatt
2b4ebb94cc Adds possibility of having a well not stored on a grid partitioning.
In a parallel run each process only knows a part of the grid. Nevertheless
it does hold the complete well information. To resolve this the WellsManager
must be able to handle this case.

With this commit its constructor gets a flag indicating whether this is
a parallel run. If it is, then it does not throw if a well has cells that
are not present on the local part of the grid. Nevertheless it will check
that either all or none of the cells of a well are stored in the local part
of the grid.

Wells with no perforated cells on the local will still be present but set to SHUT.
2015-05-08 16:35:00 +02:00
Atgeirr Flø Rasmussen
529662ca1a Complete function argument cleanup. 2015-02-17 13:56:02 +01:00
Atgeirr Flø Rasmussen
a38bdaf4c3 Remove unused argument from several functions. 2015-02-17 10:28:11 +01:00
Atgeirr Flø Rasmussen
fb983a44b1 Add default producer BHP control when not given in deck.
Default limit is 1 atm.
2015-02-04 10:30:15 +01:00
Joakim Hove
f27f75b0b9 Use Value<double> for Connection Factor 2015-02-03 13:10:38 +01:00
Joakim Hove
d2dab23d60 Using Parser to calculate well reference depth. 2015-01-26 12:03:11 +01:00
Joakim Hove
c2f9390d95 Wellsmanager will check completion status
With this commit the WellsManager will check the status of completions
before adding them to the internal struct wells
datastructure. Completions can be in the four states:

  OPEN, SHUT, AUTO, POPN

Completions with state == SHUT will be ignored, wheras the wellsmanager
will throw  if the states AUTO or POPN are encountered. The WELOPEN
keyword can also have the value 'STOP'; for completions that is
translated to 'SHUT' by Schedule object.
2015-01-12 12:43:45 +01:00
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