mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Remove reservoirState from BlackoilModelEbos
1) Use the solution variable directly in RelativeChange(...) 2) Add a method in the RateConverter that takes the simulator instead of the state. 3) Pass the reservoir pressure directly to the well initialization. 4) Move convertInput(...) to SimulatorFullyImplicitBlackoilEbos.hpp. This code is only used to convert the initial reservoir state. 5) Modify updateState(...). The solution variable is updated directly and adaptPrimaryVariable(...) from ewoms is used to switch primary variables. An epsilon is passed to adaptPrimaryVarible(...) after a switch of primary variables to make it harder to immediately switch back. The following code used by flow_ebos still uses the reservoirState 1) the initialization 2) restart 3) output of the initial state 4) the step methods in AdaptiveTimeStepping and NonlinearSolver. The reservoirState is not used by this methods, so after the initial step, an empty reservoirState is passed around in the code.
This commit is contained in:
@@ -53,14 +53,20 @@ namespace Opm
|
||||
using BaseType :: numWells;
|
||||
using BaseType :: numPhases;
|
||||
|
||||
template <class State, class PrevWellState>
|
||||
void init(const Wells* wells, const State& state, const PrevWellState& prevState)
|
||||
{
|
||||
init(wells, state.pressure(), prevState);
|
||||
}
|
||||
|
||||
/// Allocate and initialize if wells is non-null. Also tries
|
||||
/// to give useful initial values to the bhp(), wellRates()
|
||||
/// and perfPhaseRates() fields, depending on controls
|
||||
template <class State, class PrevState>
|
||||
void init(const Wells* wells, const State& state, const PrevState& prevState)
|
||||
template <class PrevWellState>
|
||||
void init(const Wells* wells, const std::vector<double>& cellPressures , const PrevWellState& prevState)
|
||||
{
|
||||
// call init on base class
|
||||
BaseType :: init(wells, state);
|
||||
BaseType :: init(wells, cellPressures);
|
||||
|
||||
// if there are no well, do nothing in init
|
||||
if (wells == 0) {
|
||||
@@ -90,7 +96,7 @@ namespace Opm
|
||||
for (int p = 0; p < np; ++p) {
|
||||
perfphaserates_[np*perf + p] = wellRates()[np*w + p] / double(num_perf_this_well);
|
||||
}
|
||||
perfPress()[perf] = state.pressure()[wells->well_cells[perf]];
|
||||
perfPress()[perf] = cellPressures[wells->well_cells[perf]];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user