Commit Graph

1223 Commits

Author SHA1 Message Date
Joakim Hove
ce78326ac1 WellTestState::openAllCompletions -> WellTestState::open_completions 2021-10-07 14:53:06 +02:00
Joakim Hove
0c40771c7a
Merge pull request #3579 from joakim-hove/template-on-content-type
WTEST: only count actually closed wells.
2021-10-07 09:27:41 +02:00
Markus Blatt
011fb1034e
Merge pull request #3571 from atgeirr/allow-non-world-comm
Replacing use of MPI_COMM_WORLD with a variable communicator.
2021-10-06 15:52:17 +02:00
Joakim Hove
4816762b66 Well testing: only count actually closed wells. Change in opm-common 2021-10-06 15:32:17 +02:00
Joakim Hove
f27a82ebc3 Use plain WellTestState::hasWellClosed() without reason 2021-10-05 16:52:16 +02:00
Elyes Ahmed
0202b00d59 clean up after review 2021-10-05 13:07:52 +02:00
Elyes Ahmed
f53c597f90 Replacing use of MPI_COMM_WORLD with a variable communicator. 2021-10-05 13:07:52 +02:00
Tor Harald Sandve
afdfe55bbc restrict maximum number of times a well can switch to the same control 2021-10-04 10:12:39 +02:00
Joakim Hove
122678e5ea Remove unused function argument 2021-10-01 08:34:58 +02:00
Joakim Hove
2f94f0436b Remove irrelevant private functions 2021-10-01 08:34:27 +02:00
Joakim Hove
38d327b447 Add Some documentation to WellState 2021-10-01 08:26:41 +02:00
Joakim Hove
2168b8c296
Merge pull request #3563 from totto82/openComp
open completions after well event
2021-09-30 16:43:39 +02:00
Tor Harald Sandve
1e547ff714
Merge pull request #3564 from totto82/moveCom
communicate before usage not after
2021-09-30 14:34:15 +02:00
Tor Harald Sandve
623ff2c3ce communicate before usage not after 2021-09-30 11:54:56 +02:00
Tor Harald Sandve
dc8c9021b5 open completions after well event 2021-09-30 11:40:34 +02:00
Joakim Hove
6e37b9ae05
Merge pull request #3559 from joakim-hove/wtest-config-empty
Use WellTestConfig.empty() instead of size()
2021-09-30 10:31:17 +02:00
Tor Harald Sandve
cb9254636b rename and cleanup 2021-09-30 09:01:07 +02:00
Tor Harald Sandve
bc8da79779 stop checking operability in the beginning of an timestep 2021-09-30 08:47:47 +02:00
Tor Harald Sandve
c9e93e6155 stop updating operability during iterations 2021-09-30 08:47:47 +02:00
Joakim Hove
21c2dd0c1d Use WellTestConfig.empty() instead of size() 2021-09-29 15:05:23 +02:00
Joakim Hove
fc139e844e Use const reference 2021-09-29 11:07:21 +02:00
Joakim Hove
a527dc7fdd Remove stale TODO 2021-09-28 23:45:40 +02:00
Joakim Hove
3aaaa23ed1 Implement connection rate summation in SingleWellState 2021-09-28 23:45:40 +02:00
Joakim Hove
86a0662381 Use std::reference_wrapper<> for parallel well info 2021-09-28 21:42:57 +02:00
Joakim Hove
cf340644b2 Add ParallelWellInfo member to SingleWellState 2021-09-28 21:42:57 +02:00
Bård Skaflestad
0b8778e432
Merge pull request #3547 from totto82/makeWTESTrobust
Make wtest more robust
2021-09-28 12:06:10 +02:00
Tor Harald Sandve
c790b14753 Make WTEST more robust
Only open wells that are solvable, operable and economical
2021-09-28 10:07:12 +02:00
Joakim Hove
ef12186d78 Remove unused query/switch code for GLO - it is always on 2021-09-27 14:11:54 +02:00
Markus Blatt
88ae5b5963
Merge pull request #3545 from blattms/fix-parallel-try-catch
[bugfix] Fix deadlocks because of parallel try-catch for some CO2 storage cases
2021-09-27 13:02:34 +02:00
Tor Harald Sandve
9381b0857b updateWsolvent only after well container is created 2021-09-24 12:09:02 +02:00
Markus Blatt
5be027348a Fix buggy interplay of parallel exceptions and communication.
There cannot happen any collective blocking communication within a
parallel try-catch clause if exceptions might be thrown before the
communication. The communication has to either be reached by all
processes or no processes.
2021-09-24 10:17:13 +02:00
Markus Blatt
f64230e462 Remove parallel try-catch from prepareTimeStep because of nestedness.
Although not declared as such, prepareTimeStep seems to be an internal
function (despite usage in a test) and hence error control can be done
in code calling it.

There was the following problem with the try-catch approach taken:
The calling site `BlackoilWellModel::assemble` looked like this:

```
OPM_BEGIN_PARALLEL_TRY_CATCH();
{
    if (iterationIdx == 0) {
        calculateExplicitQuantities(local_deferredLogger); // no parallel try-catch
        prepareTimeStep(local_deferredLogger); //includes parallel try-catch
    }
    updateWellControls(local_deferredLogger, /* check group controls */ true);

    // Set the well primary variables based on the value of well solutions
    initPrimaryVariablesEvaluation();

    maybeDoGasLiftOptimize(local_deferredLogger);
    assembleWellEq(dt, local_deferredLogger);
}
OPM_END_PARALLEL_TRY_CATCH_LOG(local_deferredLogger, "assemble() failed: ",
                               terminal_output_);
```

calculateExplicitQuantities had no parallel-try-catch clause inside,
but prepareTimeStep had one.
Unfortunately, calculateExplicitQuantities might throw (on some
processors). In that case non-throwing processors will try to trigger a
collective communication (to check for errors) in
prepareTimeStep. While the one throwing will move to the
OPM_END_PARALLEL_TRY_CATCH_LOG macro at the end and also trigger a different
collective communication. Booom, we have a deadlock.

With this patch there is no (nested parallel)-try-catch clause in the
functions called. (And if an exception is thrown in prepareTimeStep, it
will be logged as being an assemble failure).

The other option would have been to add parallel-try-catch clauses
to all functions called. That would have created a lot more
synchronization points limiting scalability even further.
2021-09-24 10:15:28 +02:00
Markus Blatt
3cda8a2fdb Added missing parallel try-catch clause for updatePrimaryIntensities.
As Problem::updatePrimaryIntensities might throw we need to do this
to prevent dealocks in parallel run in case problem occurs.
2021-09-24 09:25:44 +02:00
Markus Blatt
a927f8e23b Unify parallel try-catch clauses with Macros and catch everything.
Not a big fan of Macros but here at least they seem ot be the only
option. The problem is that the catch clauses must all catch the same
exceptions that have a entry in ExceptionType, because they might be
nested. In addition we did not have a catch all clause, which is added
now and is needed in case a called method throws an unexpected exception.
2021-09-24 09:25:44 +02:00
Joakim Hove
a11e3222bd
Merge pull request #3534 from joakim-hove/use-single-well-state
Use single well state
2021-09-22 12:35:15 +02:00
Tor Harald Sandve
b294ea5d8b
Merge pull request #3490 from totto82/targUpdate
Update well rates from target during well/group control update
2021-09-22 12:26:29 +02:00
Tor Harald Sandve
eb4997a011 update gpmain before not after timestep 2021-09-21 14:03:35 +02:00
Joakim Hove
b2ac3eaa59
Merge pull request #3535 from totto82/storePrevWellTestState
add well_test_state to WGState
2021-09-21 11:44:58 +02:00
Joakim Hove
30bd1d6314
Merge pull request #3537 from totto82/openWellWtest
update status after WTEST
2021-09-21 11:42:22 +02:00
Tor Harald Sandve
a650b529d1 commit WGstate after shut well from outside 2021-09-21 11:05:03 +02:00
Tor Harald Sandve
30592c7593 update status after WTEST 2021-09-21 10:32:56 +02:00
Tor Harald Sandve
21942f0cc2 use getMobilityScalar in updateIPR 2021-09-21 09:50:20 +02:00
Tor Harald Sandve
6fa9c05985 add well_test_state to WGState to be able to access last valid wellTestState 2021-09-21 09:30:02 +02:00
Tor Harald Sandve
c6660f0aa2 only update when control is changed 2021-09-21 08:53:25 +02:00
Tor Harald Sandve
9db6b2b946 handle unoperable wells
set potentials and rates to zero
2021-09-21 08:53:25 +02:00
Tor Harald Sandve
dc4436961f update well rates from target 2021-09-21 08:53:25 +02:00
Joakim Hove
0472bc3bf2 Remove unused argument 2021-09-20 11:45:24 +02:00
Joakim Hove
5531120411 Use SingleWellState argument instead of full WellState 2021-09-20 11:45:24 +02:00
Bård Skaflestad
a8078ed695
Merge pull request #3528 from blattms/parallel-throw-untabulated
bugfix: Detect exception during beginReportStep in parallel & abort
2021-09-15 22:41:04 +02:00
Bård Skaflestad
90520f248f
Merge pull request #3527 from totto82/fixNupcol
pass updated well rates totarget reduction not the nupcol ones
2021-09-15 21:44:14 +02:00
Markus Blatt
b056557f57 bugfix: Detect exception during beginReportStep in parallel a. abort
Previously, exceptions happening at this stage have deadlocked
flow. E.g.  UniformTabulated2DFunction in opm-material throws
a NumericalIssue if the values passed are outside the tabulated
reason. This function is e.g. called in 2-phase CO2-storage cases
during BlackoilModel::initializeWellState

BTW: This is only the first step as it is not very user friendly that
a simulation aborts at this (late) stage.
2021-09-15 20:50:49 +02:00
Tor Harald Sandve
bd066d9300
Merge pull request #3524 from totto82/speedUpPot
Do not iterate inside computeBhpFromThp in MSW
2021-09-15 12:44:52 +02:00
Tor Harald Sandve
dd454063d4 pass updated well rates totarget reduction not the nupcol ones + cleanup 2021-09-15 09:47:31 +02:00
Tor Harald Sandve
81d9a8c178 add option for relaxed convergence for stw 2021-09-14 14:32:14 +02:00
Tor Harald Sandve
49dfe1006f cleanup 2021-09-13 15:11:38 +02:00
Tor Harald Sandve
43a858ef25 rename computeBhpFromThpPotential to computeBhpFromThpIterations in std wells 2021-09-13 14:07:21 +02:00
Tor Harald Sandve
c8a59946e3 avoid iter in computeBhpFromThp 2021-09-13 14:01:56 +02:00
Tor Harald Sandve
a799c6fc8c
Merge pull request #3522 from totto82/scalarPerfRate
make scalar version of computePerfRate for MSW
2021-09-13 13:39:47 +02:00
Tor Harald Sandve
bc1bc90504
Merge pull request #3520 from totto82/fixAssertGaslift
oil target may be limited by LRAT as well
2021-09-13 11:32:43 +02:00
Tor Harald Sandve
972a832d65 make scalar version of computePerfRate 2021-09-13 09:36:16 +02:00
Tor Harald Sandve
f203c2106e only compute fip avg pressure when gpmaint 2021-09-10 15:49:02 +02:00
Tor Harald Sandve
305de4016e oil target may be limited by LRAT as well 2021-09-10 13:19:07 +02:00
Arne Morten Kvarving
ce4028b2f0 drop using statement for getAllowCrossFlow
rather qualify member function calls with this->
2021-09-09 11:53:48 +02:00
Arne Morten Kvarving
7609f7e1f7 drop using statement for ebosCompIdxToFlowCompIdx
rather qualify member function calls with this->
2021-09-09 11:53:35 +02:00
Arne Morten Kvarving
36cec80269 drop using statement for flowPhaseToEbosPhaseIdx
rather qualify member function calls with this->
2021-09-09 11:53:35 +02:00
Arne Morten Kvarving
d2fb4f3266 drop using statement for flowPhaseToEbosCompIdx
rather qualify member function calls with this->
2021-09-09 11:53:35 +02:00
Arne Morten Kvarving
fc882fbc29 drop using statement for name
rather qualify member function calls with this->
2021-09-09 11:53:35 +02:00
Arne Morten Kvarving
ddf621acdd drop using statement for phaseUsage
rather qualify member function calls with this->
2021-09-09 11:53:35 +02:00
Arne Morten Kvarving
824232b7c9 drop using statement for ipr_b_
rather qualify member variable with this->
2021-09-09 11:53:35 +02:00
Arne Morten Kvarving
115cfe26df drop using statement for ipr_a_
rather qualify member variable with this->
2021-09-09 11:53:35 +02:00
Arne Morten Kvarving
14273b8c2d drop using statement for connectionRates_
rather qualify member variable with this->
2021-09-09 11:53:35 +02:00
Arne Morten Kvarving
15b4ea672f drop using statement for num_components_
rather qualify member variable with this->
2021-09-09 11:53:35 +02:00
Arne Morten Kvarving
9970fb4ab4 drop using statement for perf_depth_
rather qualify member variable with this->
2021-09-09 11:53:35 +02:00
Arne Morten Kvarving
78a4aa3ede drop using statement for gravity_
rather qualify member variable with this->
2021-09-09 11:53:34 +02:00
Arne Morten Kvarving
5c3e13abd5 drop using statement for well_efficiency_factor_
rather qualify member variable with this->
2021-09-09 11:53:34 +02:00
Arne Morten Kvarving
4a0aa788ee drop using statement for saturation_table_number_
rather qualify member variable with this->
2021-09-09 11:53:34 +02:00
Arne Morten Kvarving
b34808895a drop using statement for well_index_
rather qualify member variable with this->
2021-09-09 11:53:34 +02:00
Arne Morten Kvarving
bfb7d2a466 drop using statement for param_
rather qualify member variable with this->
2021-09-09 11:53:34 +02:00
Arne Morten Kvarving
6f4f41f080 drop using statement for well_cells_
rather qualify member variable with this->
2021-09-09 11:53:34 +02:00
Arne Morten Kvarving
d10fa061c3 drop using statement for number_of_phases_
rather qualify member variable with this->
2021-09-09 11:53:34 +02:00
Arne Morten Kvarving
72b14cf07e drop using statement for number_of_perforations_
rather qualify member variable with this->
2021-09-09 11:53:34 +02:00
Arne Morten Kvarving
aa389ff4f8 drop using statement for ref_depth_
rather qualify member variable with this->
2021-09-09 11:53:34 +02:00
Arne Morten Kvarving
0f6e07676e drop using statement for well_ecl_
rather qualify member variable with this->
2021-09-09 11:53:34 +02:00
Arne Morten Kvarving
af745f26ef drop unused using statements 2021-09-09 11:53:33 +02:00
Tor Harald Sandve
ea392b58ce
Merge pull request #3514 from totto82/fixEmptyRegion
Handle empty region in average calculator
2021-09-09 09:06:00 +02:00
Tor Harald Sandve
a1e70711a6 Handle empty region in average calculator 2021-09-09 08:17:45 +02:00
Bård Skaflestad
42f86ce2c4
Merge pull request #3511 from akva2/drop_using_statements
Drop using statements
2021-09-08 20:59:09 +02:00
Tor Harald Sandve
3b7cf9a565
Merge pull request #3506 from totto82/relaxWell
relax well convergence for the last newton iterations
2021-09-08 10:46:14 +02:00
Tor Harald Sandve
f3513a31eb add option for relaxed well convergence for the last netwon iterations 2021-09-08 09:58:14 +02:00
Tor Harald Sandve
3b5a040197
Merge pull request #3498 from totto82/gpmaint
Support for gpmaint
2021-09-07 12:38:48 +02:00
Arne Morten Kvarving
ae212ff883 drop using statement for ipr_b_
rather qualify member variable with this->
2021-09-07 11:26:33 +02:00
Arne Morten Kvarving
870cb04e68 drop using statement for ipr_a_
rather qualify member variable with this->
2021-09-07 11:26:33 +02:00
Arne Morten Kvarving
ad39dbdaf0 drop using statement for bore_diameters_
rather qualify member variable with this->
2021-09-07 11:26:33 +02:00
Arne Morten Kvarving
001d69c17b drop using statement for perf_length_
rather qualify member variable with this->
2021-09-07 11:26:33 +02:00
Arne Morten Kvarving
475bea085c drop using statement for perf_rep_radius_
rather qualify member variable with this->
2021-09-07 11:26:33 +02:00
Arne Morten Kvarving
2cc38ed396 drop using statement for connectionRates_
rather qualify member variable with this->
2021-09-07 11:26:33 +02:00
Arne Morten Kvarving
9b92837673 drop using statement for num_components_
rather qualify member variable with this->
2021-09-07 11:26:33 +02:00
Arne Morten Kvarving
1d15c3064a drop using statement for index_of_well_
rather qualify member variable with this->
2021-09-07 11:25:09 +02:00
Arne Morten Kvarving
10b756d08c drop using statement for well_index_
rather qualify member variable with this->
2021-09-07 11:25:09 +02:00
Arne Morten Kvarving
aaf216a29a drop using statement for saturation_table_number_
rather qualify member variable with this->
2021-09-07 11:25:09 +02:00
Arne Morten Kvarving
55b52c3bd4 drop using statement for number_of_phases_
rather qualify member variable with this->
2021-09-07 11:25:09 +02:00
Arne Morten Kvarving
79801bb63a drop using statement for number_of_perforations_
rather qualify member variable with this->
2021-09-07 11:25:09 +02:00
Arne Morten Kvarving
66e938b13e drop using statement for well_cells_
rather qualify member variable with this->
2021-09-07 11:24:51 +02:00
Arne Morten Kvarving
97cbbe910a drop using statement for perf_depth_
rather qualify member variable with this->
2021-09-07 11:24:51 +02:00
Arne Morten Kvarving
68786651f5 drop using statement for well_efficiency_factor_
rather qualify member variable with this->
2021-09-07 11:24:51 +02:00
Arne Morten Kvarving
73be71bff5 drop using statement for param_
rather qualify member variable with this->
2021-09-07 11:24:06 +02:00
Arne Morten Kvarving
79d8cf90fd drop using statement for well_ecl_
rather qualify member variable with this->
2021-09-07 11:24:06 +02:00
Arne Morten Kvarving
874a7a3830 drop using statement for getALQ
rather qualify member function calls with this->
2021-09-07 11:24:06 +02:00
Arne Morten Kvarving
45de63f0f5 drop using statement for mostStrictBhpFromBhpLimits
rather qualify member function calls with this->
2021-09-07 11:24:06 +02:00
Arne Morten Kvarving
83671b3448 drop using statement for wfoam
rather qualify member function calls with this->
2021-09-07 11:24:06 +02:00
Arne Morten Kvarving
6cfd259f2f drop using statement for wpolymer
rather qualify member function calls with this->
2021-09-07 11:24:06 +02:00
Arne Morten Kvarving
fd2185d3f9 drop using statement for wsolvent
rather qualify member function calls with this->
2021-09-07 11:23:25 +02:00
Arne Morten Kvarving
2c0743c888 drop using statement for wsalt
rather qualify member function calls with this->
2021-09-07 11:23:25 +02:00
Arne Morten Kvarving
dae0e73327 drop using statement for ebosCompIdxToFlowCompIdx
rather qualify member function calls with this->
2021-09-07 11:23:25 +02:00
Arne Morten Kvarving
9ebb315002 drop using statement for flowPhaseToEbosPhaseIdx
rather qualify member function calls with this->
2021-09-07 11:23:24 +02:00
Arne Morten Kvarving
35cc1b9a2a drop using statement for flowPhaseToEbosCompIdx
rather qualify member function calls with this->
2021-09-07 11:23:24 +02:00
Arne Morten Kvarving
48e282bd65 drop using statement for getAllowCrossFlow
rather qualify member function calls with this->
2021-09-07 11:23:24 +02:00
Markus Blatt
0aa60a6f7c
Merge pull request #3508 from akva2/drop_aliases
drop aliases for Indices entries
2021-09-07 11:22:26 +02:00
Tor Harald Sandve
adda160098 clean-up 2021-09-07 09:47:41 +02:00
Tor Harald Sandve
f497fa0fd7 add support for region = 0 i.e. field 2021-09-07 08:53:09 +02:00
Tor Harald Sandve
f9832d8830 split RateConverter 2021-09-07 08:53:09 +02:00
Tor Harald Sandve
9d2f26f7e8 Add support for gpmaint 2021-09-07 08:52:52 +02:00
Arne Morten Kvarving
86a3a1bac7 drop unused using statements 2021-09-06 15:48:41 +02:00
Arne Morten Kvarving
2b1ac22c99 drop aliases for Indices entries
using Indices directly more clearly shows where the data comes
from without having to hop through hoops to do so.
2021-09-06 12:49:01 +02:00
Joakim Hove
2b3f3bf630 Use Group instance to check for available controls 2021-09-02 22:23:21 +02:00
Joakim Hove
bb23993556 Add GPMaint::State member to GroupState 2021-09-01 21:36:13 +02:00
Joakim Hove
7bb3dba310 Special case wells with no open connections in ParallelWellInfo 2021-08-31 17:31:45 +02:00
Tor Harald Sandve
7c8a39fdb6 fix after rebase 2021-08-26 10:32:58 +02:00
Tor Harald Sandve
514c2a67a9 always compute potentials 2021-08-26 10:29:25 +02:00
Tor Harald Sandve
7e3cca1316 iterate to get more accurate potentials for stw wells 2021-08-26 10:29:25 +02:00
Tor Harald Sandve
c4c0173d2b
Merge pull request #3486 from totto82/handleTrivialGR
always return fraction 1.0 if only one well is under group control
2021-08-26 10:09:55 +02:00
Tor Harald Sandve
002256a045 return fraction 1.0 if only one well under group control even in cases where the guide rate is zero 2021-08-26 08:27:06 +02:00
Joakim Hove
1a02ac7bd5
Merge pull request #3487 from joakim-hove/single-well-state
Single well state
2021-08-25 14:27:41 +02:00
Arne Morten Kvarving
fc3e4ab5bc avoid unused variable warning 2021-08-25 08:28:57 +02:00
Joakim Hove
94d12e1230 Remove unused variable 2021-08-24 13:25:02 +02:00
Joakim Hove
5a721b8cd2 Remove WellMap from WellState 2021-08-24 13:25:02 +02:00
Joakim Hove
8f9e7d8e96 Add method PerfData::empty() 2021-08-24 12:46:24 +02:00
Joakim Hove
579aba8d08 Include perforation data in SingleWellState 2021-08-24 12:46:24 +02:00
Joakim Hove
46f45e3999 Add PerfData member to SingleWellState 2021-08-24 12:46:24 +02:00
Joakim Hove
8b652c821b Use SingleWellState for reservoir rates 2021-08-24 12:46:24 +02:00
Joakim Hove
755de65eb4 Use SingleWellState to manage well surface rates 2021-08-24 12:46:24 +02:00
Joakim Hove
8937c9cba9 Refactor sumWellRates to accept bool argument 2021-08-24 12:46:24 +02:00
Tor Harald Sandve
0b1a909ee2 guards for one-phase flow 2021-08-24 12:06:03 +02:00
Joakim Hove
77a9fd352b Add SegmentState member to SingleWellState 2021-08-23 13:17:24 +02:00
Joakim Hove
67bd2fd333 Add productivity_index to SingleWellState 2021-08-23 12:05:26 +02:00
Joakim Hove
2f504536f4 Add well potentials to SingleWellState 2021-08-23 12:05:26 +02:00
Joakim Hove
e84eaa3179 Add dissolved_gas_rate and vaporized_oil_rate to SingleWellState 2021-08-23 12:05:26 +02:00
Joakim Hove
baeeb34508 Merge two perforation data members in WellState 2021-08-23 12:05:26 +02:00
Tor Harald Sandve
97d82cb97a
Merge pull request #3481 from totto82/fixTracer
fix case where wells are shut behind our back
2021-08-20 09:00:17 +02:00
Tor Harald Sandve
295f41ba2b
Merge pull request #3464 from totto82/fixGEFF
Fixes related to GEFAC
2021-08-19 19:06:55 +02:00