Rename WellStateFullyImplicitBlackoil -> WellState

This commit is contained in:
Joakim Hove
2021-05-20 13:32:18 +02:00
parent fc3c044a4e
commit 23180e06d2
27 changed files with 153 additions and 155 deletions

View File

@@ -63,7 +63,7 @@ list (APPEND MAIN_SOURCE_FILES
opm/simulators/wells/WellGroupHelpers.cpp opm/simulators/wells/WellGroupHelpers.cpp
opm/simulators/wells/WellInterfaceGeneric.cpp opm/simulators/wells/WellInterfaceGeneric.cpp
opm/simulators/wells/WellProdIndexCalculator.cpp opm/simulators/wells/WellProdIndexCalculator.cpp
opm/simulators/wells/WellStateFullyImplicitBlackoil.cpp opm/simulators/wells/WellState.cpp
opm/simulators/wells/WGState.cpp opm/simulators/wells/WGState.cpp
) )
@@ -122,7 +122,7 @@ list (APPEND TEST_SOURCE_FILES
tests/test_relpermdiagnostics.cpp tests/test_relpermdiagnostics.cpp
tests/test_norne_pvt.cpp tests/test_norne_pvt.cpp
tests/test_wellprodindexcalculator.cpp tests/test_wellprodindexcalculator.cpp
tests/test_wellstatefullyimplicitblackoil.cpp tests/test_wellstate.cpp
tests/test_parallelwellinfo.cpp tests/test_parallelwellinfo.cpp
tests/test_glift1.cpp tests/test_glift1.cpp
tests/test_keyword_validator.cpp tests/test_keyword_validator.cpp
@@ -273,7 +273,7 @@ list (APPEND PUBLIC_HEADER_FILES
opm/simulators/utils/readDeck.hpp opm/simulators/utils/readDeck.hpp
opm/simulators/wells/TargetCalculator.hpp opm/simulators/wells/TargetCalculator.hpp
opm/simulators/wells/WellConnectionAuxiliaryModule.hpp opm/simulators/wells/WellConnectionAuxiliaryModule.hpp
opm/simulators/wells/WellStateFullyImplicitBlackoil.hpp opm/simulators/wells/WellState.hpp
opm/simulators/wells/GlobalWellInfo.hpp opm/simulators/wells/GlobalWellInfo.hpp
opm/simulators/wells/GroupState.hpp opm/simulators/wells/GroupState.hpp
opm/simulators/wells/ALQState.hpp opm/simulators/wells/ALQState.hpp

View File

@@ -33,7 +33,7 @@
#include <opm/models/utils/propertysystem.hh> #include <opm/models/utils/propertysystem.hh>
#include <opm/models/utils/alignedallocator.hh> #include <opm/models/utils/alignedallocator.hh>
#include <opm/simulators/wells/WellStateFullyImplicitBlackoil.hpp> #include <opm/simulators/wells/WellState.hpp>
#include <opm/simulators/wells/WGState.hpp> #include <opm/simulators/wells/WGState.hpp>
#include <opm/material/fluidstates/CompositionalFluidState.hpp> #include <opm/material/fluidstates/CompositionalFluidState.hpp>
#include <opm/material/densead/Evaluation.hpp> #include <opm/material/densead/Evaluation.hpp>
@@ -1413,12 +1413,12 @@ protected:
/ rhoWaterSurface; / rhoWaterSurface;
} }
const WellStateFullyImplicitBlackoil& wellState() const const WellState& wellState() const
{ {
throw std::logic_error("wellState() method not implemented for class eclpeacemanwell"); throw std::logic_error("wellState() method not implemented for class eclpeacemanwell");
} }
WellStateFullyImplicitBlackoil& wellState() WellState& wellState()
{ {
throw std::logic_error("wellState() method not implemented for class eclpeacemanwell"); throw std::logic_error("wellState() method not implemented for class eclpeacemanwell");
} }

View File

@@ -36,7 +36,7 @@
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp> #include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp> #include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Events.hpp> #include <opm/parser/eclipse/EclipseState/Schedule/Events.hpp>
#include <opm/simulators/wells/WellStateFullyImplicitBlackoil.hpp> #include <opm/simulators/wells/WellState.hpp>
#include <opm/simulators/wells/WGState.hpp> #include <opm/simulators/wells/WGState.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Well/WellConnections.hpp> #include <opm/parser/eclipse/EclipseState/Schedule/Well/WellConnections.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well.hpp> #include <opm/parser/eclipse/EclipseState/Schedule/Well/Well.hpp>
@@ -622,12 +622,12 @@ public:
throw std::logic_error("initFromRestartFile() method not implemented for class eclwellmanager"); throw std::logic_error("initFromRestartFile() method not implemented for class eclwellmanager");
} }
const WellStateFullyImplicitBlackoil& wellState() const const WellState& wellState() const
{ {
throw std::logic_error("wellState() method not implemented for class eclwellmanager"); throw std::logic_error("wellState() method not implemented for class eclwellmanager");
} }
WellStateFullyImplicitBlackoil& wellState() WellState& wellState()
{ {
throw std::logic_error("wellState() method not implemented for class eclwellmanager"); throw std::logic_error("wellState() method not implemented for class eclwellmanager");
} }

View File

@@ -149,7 +149,6 @@ namespace Opm {
{ {
public: public:
// --------- Types and enums --------- // --------- Types and enums ---------
typedef WellStateFullyImplicitBlackoil WellState;
typedef BlackoilModelParametersEbos<TypeTag> ModelParameters; typedef BlackoilModelParametersEbos<TypeTag> ModelParameters;
using Simulator = GetPropType<TypeTag, Properties::Simulator>; using Simulator = GetPropType<TypeTag, Properties::Simulator>;

View File

@@ -80,6 +80,7 @@ struct NewtonRelaxationType<TypeTag, TTag::FlowNonLinearSolver> {
namespace Opm { namespace Opm {
class WellState;
/// A nonlinear solver class suitable for general fully-implicit models, /// A nonlinear solver class suitable for general fully-implicit models,
/// as well as pressure, transport and sequential models. /// as well as pressure, transport and sequential models.
@@ -147,7 +148,7 @@ namespace Opm {
}; };
// Forwarding types from PhysicalModel. // Forwarding types from PhysicalModel.
typedef typename PhysicalModel::WellState WellState; //typedef typename PhysicalModel::WellState WellState;
// --------- Public methods --------- // --------- Public methods ---------

View File

@@ -25,7 +25,7 @@
#include <opm/simulators/flow/NonlinearSolverEbos.hpp> #include <opm/simulators/flow/NonlinearSolverEbos.hpp>
#include <opm/simulators/flow/BlackoilModelEbos.hpp> #include <opm/simulators/flow/BlackoilModelEbos.hpp>
#include <opm/simulators/flow/BlackoilModelParametersEbos.hpp> #include <opm/simulators/flow/BlackoilModelParametersEbos.hpp>
#include <opm/simulators/wells/WellStateFullyImplicitBlackoil.hpp> #include <opm/simulators/wells/WellState.hpp>
#include <opm/simulators/aquifers/BlackoilAquiferModel.hpp> #include <opm/simulators/aquifers/BlackoilAquiferModel.hpp>
#include <opm/simulators/utils/moduleVersion.hpp> #include <opm/simulators/utils/moduleVersion.hpp>
#include <opm/simulators/timestepping/AdaptiveTimeSteppingEbos.hpp> #include <opm/simulators/timestepping/AdaptiveTimeSteppingEbos.hpp>
@@ -80,7 +80,6 @@ public:
typedef AdaptiveTimeSteppingEbos<TypeTag> TimeStepper; typedef AdaptiveTimeSteppingEbos<TypeTag> TimeStepper;
typedef BlackOilPolymerModule<TypeTag> PolymerModule; typedef BlackOilPolymerModule<TypeTag> PolymerModule;
typedef WellStateFullyImplicitBlackoil WellState;
typedef BlackoilModelEbos<TypeTag> Model; typedef BlackoilModelEbos<TypeTag> Model;
typedef NonlinearSolverEbos<TypeTag, Model> Solver; typedef NonlinearSolverEbos<TypeTag, Model> Solver;
typedef typename Model::ModelParameters ModelParameters; typedef typename Model::ModelParameters ModelParameters;

View File

@@ -58,7 +58,7 @@
#include <opm/simulators/wells/PerforationData.hpp> #include <opm/simulators/wells/PerforationData.hpp>
#include <opm/simulators/wells/VFPInjProperties.hpp> #include <opm/simulators/wells/VFPInjProperties.hpp>
#include <opm/simulators/wells/VFPProdProperties.hpp> #include <opm/simulators/wells/VFPProdProperties.hpp>
#include <opm/simulators/wells/WellStateFullyImplicitBlackoil.hpp> #include <opm/simulators/wells/WellState.hpp>
#include <opm/simulators/wells/WGState.hpp> #include <opm/simulators/wells/WGState.hpp>
#include <opm/simulators/wells/RateConverter.hpp> #include <opm/simulators/wells/RateConverter.hpp>
#include <opm/simulators/wells/WellInterface.hpp> #include <opm/simulators/wells/WellInterface.hpp>
@@ -93,7 +93,6 @@ namespace Opm {
{ {
public: public:
// --------- Types --------- // --------- Types ---------
typedef WellStateFullyImplicitBlackoil WellState;
typedef BlackoilModelParametersEbos<TypeTag> ModelParameters; typedef BlackoilModelParametersEbos<TypeTag> ModelParameters;
using Grid = GetPropType<TypeTag, Properties::Grid>; using Grid = GetPropType<TypeTag, Properties::Grid>;
@@ -231,7 +230,7 @@ namespace Opm {
/* /*
The dynamic state of the well model is maintained with an instance The dynamic state of the well model is maintained with an instance
of the WellStateFullyImplicitBlackoil class. Currently we have of the WellState class. Currently we have
three different wellstate instances: three different wellstate instances:
1. The currently active wellstate is in the active_well_state_ 1. The currently active wellstate is in the active_well_state_
@@ -253,7 +252,7 @@ namespace Opm {
/* /*
Immutable version of the currently active wellstate. Immutable version of the currently active wellstate.
*/ */
const WellStateFullyImplicitBlackoil& wellState() const const WellState& wellState() const
{ {
return this->active_wgstate_.well_state; return this->active_wgstate_.well_state;
} }
@@ -261,7 +260,7 @@ namespace Opm {
/* /*
Mutable version of the currently active wellstate. Mutable version of the currently active wellstate.
*/ */
WellStateFullyImplicitBlackoil& wellState() WellState& wellState()
{ {
return this->active_wgstate_.well_state; return this->active_wgstate_.well_state;
} }
@@ -273,7 +272,7 @@ namespace Opm {
prevWellState() must have been stored with the commitWellState() prevWellState() must have been stored with the commitWellState()
function first. function first.
*/ */
const WellStateFullyImplicitBlackoil& prevWellState() const const WellState& prevWellState() const
{ {
return this->last_valid_wgstate_.well_state; return this->last_valid_wgstate_.well_state;
} }
@@ -286,7 +285,7 @@ namespace Opm {
Will return the currently active nupcolWellState; must initialize Will return the currently active nupcolWellState; must initialize
the internal nupcol wellstate with initNupcolWellState() first. the internal nupcol wellstate with initNupcolWellState() first.
*/ */
const WellStateFullyImplicitBlackoil& nupcolWellState() const const WellState& nupcolWellState() const
{ {
return this->nupcol_wgstate_.well_state; return this->nupcol_wgstate_.well_state;
} }
@@ -590,7 +589,7 @@ namespace Opm {
const data::GroupAndNetworkValues& grpNwrkValues, const data::GroupAndNetworkValues& grpNwrkValues,
const PhaseUsage& phases, const PhaseUsage& phases,
const bool handle_ms_well, const bool handle_ms_well,
WellStateFullyImplicitBlackoil& state ); WellState& state );
// whether there exists any multisegment well open on this process // whether there exists any multisegment well open on this process
bool anyMSWellOpenLocal() const; bool anyMSWellOpenLocal() const;
@@ -611,7 +610,7 @@ namespace Opm {
void actionOnBrokenConstraints(const Group& group, const Group::InjectionCMode& newControl, const Phase& topUpPhase, DeferredLogger& deferred_logger); void actionOnBrokenConstraints(const Group& group, const Group::InjectionCMode& newControl, const Phase& topUpPhase, DeferredLogger& deferred_logger);
void updateWsolvent(const Group& group, const Schedule& schedule, const int reportStepIdx, const WellStateFullyImplicitBlackoil& wellState); void updateWsolvent(const Group& group, const Schedule& schedule, const int reportStepIdx, const WellState& wellState);
void setWsolvent(const Group& group, const Schedule& schedule, const int reportStepIdx, double wsolvent); void setWsolvent(const Group& group, const Schedule& schedule, const int reportStepIdx, double wsolvent);

View File

@@ -812,13 +812,13 @@ namespace Opm {
// TODO: more checking here, to make sure this standard more specific and complete // TODO: more checking here, to make sure this standard more specific and complete
// maybe there is some WCON keywords will not open the well // maybe there is some WCON keywords will not open the well
auto& events = this->wellState().events(w); auto& events = this->wellState().events(w);
if (events.hasEvent(WellStateFullyImplicitBlackoil::event_mask)) { if (events.hasEvent(WellState::event_mask)) {
if (wellTestState_.lastTestTime(well_name) == ebosSimulator_.time()) { if (wellTestState_.lastTestTime(well_name) == ebosSimulator_.time()) {
// The well was shut this timestep, we are most likely retrying // The well was shut this timestep, we are most likely retrying
// a timestep without the well in question, after it caused // a timestep without the well in question, after it caused
// repeated timestep cuts. It should therefore not be opened, // repeated timestep cuts. It should therefore not be opened,
// even if it was new or received new targets this report step. // even if it was new or received new targets this report step.
events.clearEvent(WellStateFullyImplicitBlackoil::event_mask); events.clearEvent(WellState::event_mask);
} else { } else {
wellTestState_.openWell(well_name); wellTestState_.openWell(well_name);
} }
@@ -1700,11 +1700,11 @@ namespace Opm {
if (!well->isOperable() ) continue; if (!well->isOperable() ) continue;
auto& events = this->wellState().events(well->indexOfWell()); auto& events = this->wellState().events(well->indexOfWell());
if (events.hasEvent(WellStateFullyImplicitBlackoil::event_mask)) { if (events.hasEvent(WellState::event_mask)) {
well->updateWellStateWithTarget(ebosSimulator_, this->wellState(), deferred_logger); well->updateWellStateWithTarget(ebosSimulator_, this->wellState(), deferred_logger);
// There is no new well control change input within a report step, // There is no new well control change input within a report step,
// so next time step, the well does not consider to have effective events anymore. // so next time step, the well does not consider to have effective events anymore.
events.clearEvent(WellStateFullyImplicitBlackoil::event_mask); events.clearEvent(WellState::event_mask);
} }
// solve the well equation initially to improve the initial solution of the well model // solve the well equation initially to improve the initial solution of the well model
@@ -1951,7 +1951,7 @@ namespace Opm {
const data::GroupAndNetworkValues& grpNwrkValues, const data::GroupAndNetworkValues& grpNwrkValues,
const PhaseUsage& phases, const PhaseUsage& phases,
const bool handle_ms_well, const bool handle_ms_well,
WellStateFullyImplicitBlackoil& well_state) WellState& well_state)
{ {
using GPMode = Group::ProductionCMode; using GPMode = Group::ProductionCMode;
using GIMode = Group::InjectionCMode; using GIMode = Group::InjectionCMode;
@@ -2948,7 +2948,7 @@ namespace Opm {
template<typename TypeTag> template<typename TypeTag>
void void
BlackoilWellModel<TypeTag>:: BlackoilWellModel<TypeTag>::
updateWsolvent(const Group& group, const Schedule& schedule, const int reportStepIdx, const WellStateFullyImplicitBlackoil& wellState) { updateWsolvent(const Group& group, const Schedule& schedule, const int reportStepIdx, const WellState& wellState) {
for (const std::string& groupName : group.groups()) { for (const std::string& groupName : group.groups()) {
const Group& groupTmp = schedule.getGroup(groupName, reportStepIdx); const Group& groupTmp = schedule.getGroup(groupName, reportStepIdx);
updateWsolvent(groupTmp, schedule, reportStepIdx, wellState); updateWsolvent(groupTmp, schedule, reportStepIdx, wellState);

View File

@@ -26,7 +26,6 @@ namespace Opm {
template<typename TypeTag> class StandardWell; template<typename TypeTag> class StandardWell;
} }
#include <opm/simulators/wells/StandardWell.hpp> #include <opm/simulators/wells/StandardWell.hpp>
#include <opm/simulators/wells/GasLiftSingleWellGeneric.hpp> #include <opm/simulators/wells/GasLiftSingleWellGeneric.hpp>
#include <optional> #include <optional>
@@ -40,7 +39,6 @@ namespace Opm
class GasLiftSingleWell : public GasLiftSingleWellGeneric class GasLiftSingleWell : public GasLiftSingleWellGeneric
{ {
using Simulator = GetPropType<TypeTag, Properties::Simulator>; using Simulator = GetPropType<TypeTag, Properties::Simulator>;
using WellState = WellStateFullyImplicitBlackoil;
using StdWell = StandardWell<TypeTag>; using StdWell = StandardWell<TypeTag>;
public: public:

View File

@@ -25,7 +25,7 @@
#include <opm/simulators/utils/DeferredLogger.hpp> #include <opm/simulators/utils/DeferredLogger.hpp>
#include <opm/simulators/wells/GasLiftWellState.hpp> #include <opm/simulators/wells/GasLiftWellState.hpp>
#include <opm/simulators/wells/WellStateFullyImplicitBlackoil.hpp> #include <opm/simulators/wells/WellState.hpp>
#include <fmt/format.h> #include <fmt/format.h>

View File

@@ -39,7 +39,7 @@ class DeferredLogger;
class GasLiftWellState; class GasLiftWellState;
class Schedule; class Schedule;
class SummaryState; class SummaryState;
class WellStateFullyImplicitBlackoil; class WellState;
class GasLiftSingleWellGeneric class GasLiftSingleWellGeneric
{ {
@@ -49,8 +49,6 @@ class GasLiftSingleWellGeneric
static constexpr double ALQ_EPSILON = 1e-8; static constexpr double ALQ_EPSILON = 1e-8;
public: public:
using WellState = WellStateFullyImplicitBlackoil;
struct GradInfo struct GradInfo
{ {
GradInfo() { } GradInfo() { }

View File

@@ -18,6 +18,16 @@
*/ */
namespace Opm { namespace Opm {
#include <opm/simulators/wells/StandardWell.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well.hpp>
#include <opm/simulators/utils/DeferredLogger.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/SummaryState.hpp>
#include <opm/simulators/wells/WellState.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/GasLiftOpt.hpp>
#include <optional>
#include <string>
template<typename TypeTag> template<typename TypeTag>
GasLiftSingleWell<TypeTag>:: GasLiftSingleWell<TypeTag>::

View File

@@ -33,7 +33,7 @@
#include <opm/simulators/wells/GasLiftSingleWell.hpp> #include <opm/simulators/wells/GasLiftSingleWell.hpp>
#include <opm/simulators/wells/GasLiftWellState.hpp> #include <opm/simulators/wells/GasLiftWellState.hpp>
#include <opm/simulators/utils/DeferredLogger.hpp> #include <opm/simulators/utils/DeferredLogger.hpp>
#include <opm/simulators/wells/WellStateFullyImplicitBlackoil.hpp> #include <opm/simulators/wells/WellState.hpp>
// NOTE: BlackoilWellModel.hpp includes ourself (GasLiftStage2.hpp), so we need // NOTE: BlackoilWellModel.hpp includes ourself (GasLiftStage2.hpp), so we need
// to forward declare BlackoilWellModel for it to be defined in this file. // to forward declare BlackoilWellModel for it to be defined in this file.
namespace Opm { namespace Opm {
@@ -58,7 +58,6 @@ namespace Opm
template<class TypeTag> template<class TypeTag>
class GasLiftStage2 { class GasLiftStage2 {
using Simulator = GetPropType<TypeTag, Properties::Simulator>; using Simulator = GetPropType<TypeTag, Properties::Simulator>;
using WellState = WellStateFullyImplicitBlackoil;
using BlackoilWellModel = ::Opm::BlackoilWellModel<TypeTag>; using BlackoilWellModel = ::Opm::BlackoilWellModel<TypeTag>;
using GasLiftSingleWell = ::Opm::GasLiftSingleWell<TypeTag>; using GasLiftSingleWell = ::Opm::GasLiftSingleWell<TypeTag>;
using GLiftWellState = GasLiftWellState; using GLiftWellState = GasLiftWellState;

View File

@@ -22,7 +22,7 @@
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well.hpp> #include <opm/parser/eclipse/EclipseState/Schedule/Well/Well.hpp>
#include <opm/simulators/utils/DeferredLogger.hpp> #include <opm/simulators/utils/DeferredLogger.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/SummaryState.hpp> #include <opm/parser/eclipse/EclipseState/Schedule/SummaryState.hpp>
#include <opm/simulators/wells/WellStateFullyImplicitBlackoil.hpp> #include <opm/simulators/wells/WellState.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/GasLiftOpt.hpp> #include <opm/parser/eclipse/EclipseState/Schedule/GasLiftOpt.hpp>
#include <cmath> #include <cmath>

View File

@@ -36,7 +36,6 @@ namespace Opm
public: public:
typedef WellInterface<TypeTag> Base; typedef WellInterface<TypeTag> Base;
using typename Base::WellState;
using typename Base::Simulator; using typename Base::Simulator;
using typename Base::IntensiveQuantities; using typename Base::IntensiveQuantities;
using typename Base::FluidSystem; using typename Base::FluidSystem;

View File

@@ -67,7 +67,6 @@ namespace Opm
// dealing with derivatives. It can be beneficial to make functions can work with either AD or scalar value. // dealing with derivatives. It can be beneficial to make functions can work with either AD or scalar value.
// And also, it can also be beneficial to make these functions hanle different types of AD variables. // And also, it can also be beneficial to make these functions hanle different types of AD variables.
using typename Base::Simulator; using typename Base::Simulator;
using typename Base::WellState;
using typename Base::IntensiveQuantities; using typename Base::IntensiveQuantities;
using typename Base::FluidSystem; using typename Base::FluidSystem;
using typename Base::MaterialLaw; using typename Base::MaterialLaw;

View File

@@ -20,7 +20,7 @@
#ifndef OPM_WGSTATE_HEADER_INCLUDED #ifndef OPM_WGSTATE_HEADER_INCLUDED
#define OPM_WGSTATE_HEADER_INCLUDED #define OPM_WGSTATE_HEADER_INCLUDED
#include <opm/simulators/wells/WellStateFullyImplicitBlackoil.hpp> #include <opm/simulators/wells/WellState.hpp>
#include <opm/simulators/wells/GroupState.hpp> #include <opm/simulators/wells/GroupState.hpp>
namespace Opm { namespace Opm {
@@ -34,7 +34,7 @@ struct PhaseUsage;
struct WGState { struct WGState {
WGState(const PhaseUsage& pu); WGState(const PhaseUsage& pu);
WellStateFullyImplicitBlackoil well_state; WellState well_state;
GroupState group_state; GroupState group_state;
}; };

View File

@@ -36,7 +36,7 @@ namespace Opm {
can also be accessed and updated with the name. can also be accessed and updated with the name.
The class is created to facilitate safe and piecewise refactoring of the The class is created to facilitate safe and piecewise refactoring of the
WellStateFullyImplicitBlackOil class, and might have a short life in the WellState class, and might have a short life in the
development timeline. development timeline.
*/ */

View File

@@ -30,7 +30,7 @@
#include <opm/simulators/wells/GroupState.hpp> #include <opm/simulators/wells/GroupState.hpp>
#include <opm/simulators/wells/TargetCalculator.hpp> #include <opm/simulators/wells/TargetCalculator.hpp>
#include <opm/simulators/wells/VFPProdProperties.hpp> #include <opm/simulators/wells/VFPProdProperties.hpp>
#include <opm/simulators/wells/WellStateFullyImplicitBlackoil.hpp> #include <opm/simulators/wells/WellState.hpp>
#include <opm/simulators/wells/WellContainer.hpp> #include <opm/simulators/wells/WellContainer.hpp>
#include <algorithm> #include <algorithm>
@@ -72,7 +72,7 @@ namespace WellGroupHelpers
const Schedule& schedule, const Schedule& schedule,
const SummaryState& summaryState, const SummaryState& summaryState,
const int reportStepIdx, const int reportStepIdx,
WellStateFullyImplicitBlackoil& wellState, WellState& wellState,
GroupState& group_state) GroupState& group_state)
{ {
@@ -129,7 +129,7 @@ namespace WellGroupHelpers
double sumWellPhaseRates(const WellContainer<std::vector<double>>& rates, double sumWellPhaseRates(const WellContainer<std::vector<double>>& rates,
const Group& group, const Group& group,
const Schedule& schedule, const Schedule& schedule,
const WellStateFullyImplicitBlackoil& wellState, const WellState& wellState,
const int reportStepIdx, const int reportStepIdx,
const int phasePos, const int phasePos,
const bool injector) const bool injector)
@@ -175,7 +175,7 @@ namespace WellGroupHelpers
double sumWellRates(const Group& group, double sumWellRates(const Group& group,
const Schedule& schedule, const Schedule& schedule,
const WellStateFullyImplicitBlackoil& wellState, const WellState& wellState,
const int reportStepIdx, const int reportStepIdx,
const int phasePos, const int phasePos,
const bool injector) const bool injector)
@@ -185,7 +185,7 @@ namespace WellGroupHelpers
double sumWellResRates(const Group& group, double sumWellResRates(const Group& group,
const Schedule& schedule, const Schedule& schedule,
const WellStateFullyImplicitBlackoil& wellState, const WellState& wellState,
const int reportStepIdx, const int reportStepIdx,
const int phasePos, const int phasePos,
const bool injector) const bool injector)
@@ -196,7 +196,7 @@ namespace WellGroupHelpers
double sumSolventRates(const Group& group, double sumSolventRates(const Group& group,
const Schedule& schedule, const Schedule& schedule,
const WellStateFullyImplicitBlackoil& wellState, const WellState& wellState,
const int reportStepIdx, const int reportStepIdx,
const bool injector) const bool injector)
{ {
@@ -242,7 +242,7 @@ namespace WellGroupHelpers
const SummaryState& summaryState, const SummaryState& summaryState,
const Opm::PhaseUsage& pu, const Opm::PhaseUsage& pu,
const int reportStepIdx, const int reportStepIdx,
const WellStateFullyImplicitBlackoil& wellState, const WellState& wellState,
const GroupState& group_state, const GroupState& group_state,
GuideRate* guideRate, GuideRate* guideRate,
Opm::DeferredLogger& deferred_logger) Opm::DeferredLogger& deferred_logger)
@@ -300,8 +300,8 @@ namespace WellGroupHelpers
const bool isInjector, const bool isInjector,
const PhaseUsage& pu, const PhaseUsage& pu,
const GuideRate& guide_rate, const GuideRate& guide_rate,
const WellStateFullyImplicitBlackoil& wellStateNupcol, const WellState& wellStateNupcol,
WellStateFullyImplicitBlackoil& wellState, WellState& wellState,
GroupState& group_state, GroupState& group_state,
std::vector<double>& groupTargetReduction) std::vector<double>& groupTargetReduction)
{ {
@@ -420,8 +420,8 @@ namespace WellGroupHelpers
void updateVREPForGroups(const Group& group, void updateVREPForGroups(const Group& group,
const Schedule& schedule, const Schedule& schedule,
const int reportStepIdx, const int reportStepIdx,
const WellStateFullyImplicitBlackoil& wellStateNupcol, const WellState& wellStateNupcol,
WellStateFullyImplicitBlackoil& wellState, WellState& wellState,
GroupState& group_state) GroupState& group_state)
{ {
for (const std::string& groupName : group.groups()) { for (const std::string& groupName : group.groups()) {
@@ -445,8 +445,8 @@ namespace WellGroupHelpers
void updateReservoirRatesInjectionGroups(const Group& group, void updateReservoirRatesInjectionGroups(const Group& group,
const Schedule& schedule, const Schedule& schedule,
const int reportStepIdx, const int reportStepIdx,
const WellStateFullyImplicitBlackoil& wellStateNupcol, const WellState& wellStateNupcol,
WellStateFullyImplicitBlackoil& wellState, WellState& wellState,
GroupState& group_state) GroupState& group_state)
{ {
for (const std::string& groupName : group.groups()) { for (const std::string& groupName : group.groups()) {
@@ -470,8 +470,8 @@ namespace WellGroupHelpers
void updateWellRates(const Group& group, void updateWellRates(const Group& group,
const Schedule& schedule, const Schedule& schedule,
const int reportStepIdx, const int reportStepIdx,
const WellStateFullyImplicitBlackoil& wellStateNupcol, const WellState& wellStateNupcol,
WellStateFullyImplicitBlackoil& wellState) WellState& wellState)
{ {
for (const std::string& groupName : group.groups()) { for (const std::string& groupName : group.groups()) {
const Group& groupTmp = schedule.getGroup(groupName, reportStepIdx); const Group& groupTmp = schedule.getGroup(groupName, reportStepIdx);
@@ -501,8 +501,8 @@ namespace WellGroupHelpers
void updateGroupProductionRates(const Group& group, void updateGroupProductionRates(const Group& group,
const Schedule& schedule, const Schedule& schedule,
const int reportStepIdx, const int reportStepIdx,
const WellStateFullyImplicitBlackoil& wellStateNupcol, const WellState& wellStateNupcol,
WellStateFullyImplicitBlackoil& wellState, WellState& wellState,
GroupState& group_state) GroupState& group_state)
{ {
for (const std::string& groupName : group.groups()) { for (const std::string& groupName : group.groups()) {
@@ -524,8 +524,8 @@ namespace WellGroupHelpers
const int reportStepIdx, const int reportStepIdx,
const PhaseUsage& pu, const PhaseUsage& pu,
const SummaryState& st, const SummaryState& st,
const WellStateFullyImplicitBlackoil& wellStateNupcol, const WellState& wellStateNupcol,
WellStateFullyImplicitBlackoil& wellState, WellState& wellState,
GroupState& group_state) GroupState& group_state)
{ {
const int np = wellState.numPhases(); const int np = wellState.numPhases();
@@ -557,7 +557,7 @@ namespace WellGroupHelpers
std::map<std::string, double> std::map<std::string, double>
computeNetworkPressures(const Opm::Network::ExtNetwork& network, computeNetworkPressures(const Opm::Network::ExtNetwork& network,
const WellStateFullyImplicitBlackoil& well_state, const WellState& well_state,
const GroupState& group_state, const GroupState& group_state,
const VFPProdProperties& vfp_prod_props, const VFPProdProperties& vfp_prod_props,
const Schedule& schedule, const Schedule& schedule,
@@ -677,7 +677,7 @@ namespace WellGroupHelpers
GuideRate::RateVector GuideRate::RateVector
getWellRateVector(const WellStateFullyImplicitBlackoil& well_state, const PhaseUsage& pu, const std::string& name) getWellRateVector(const WellState& well_state, const PhaseUsage& pu, const std::string& name)
{ {
return getGuideRateVector(well_state.currentWellRates(name), pu); return getGuideRateVector(well_state.currentWellRates(name), pu);
} }
@@ -690,7 +690,7 @@ namespace WellGroupHelpers
double getGuideRate(const std::string& name, double getGuideRate(const std::string& name,
const Schedule& schedule, const Schedule& schedule,
const WellStateFullyImplicitBlackoil& wellState, const WellState& wellState,
const GroupState& group_state, const GroupState& group_state,
const int reportStepIdx, const int reportStepIdx,
const GuideRate* guideRate, const GuideRate* guideRate,
@@ -738,7 +738,7 @@ namespace WellGroupHelpers
double getGuideRateInj(const std::string& name, double getGuideRateInj(const std::string& name,
const Schedule& schedule, const Schedule& schedule,
const WellStateFullyImplicitBlackoil& wellState, const WellState& wellState,
const GroupState& group_state, const GroupState& group_state,
const int reportStepIdx, const int reportStepIdx,
const GuideRate* guideRate, const GuideRate* guideRate,
@@ -788,7 +788,7 @@ namespace WellGroupHelpers
int groupControlledWells(const Schedule& schedule, int groupControlledWells(const Schedule& schedule,
const WellStateFullyImplicitBlackoil& well_state, const WellState& well_state,
const GroupState& group_state, const GroupState& group_state,
const int report_step, const int report_step,
const std::string& group_name, const std::string& group_name,
@@ -829,7 +829,7 @@ namespace WellGroupHelpers
} }
FractionCalculator::FractionCalculator(const Schedule& schedule, FractionCalculator::FractionCalculator(const Schedule& schedule,
const WellStateFullyImplicitBlackoil& well_state, const WellState& well_state,
const GroupState& group_state, const GroupState& group_state,
const int report_step, const int report_step,
const GuideRate* guide_rate, const GuideRate* guide_rate,
@@ -975,7 +975,7 @@ namespace WellGroupHelpers
std::pair<bool, double> checkGroupConstraintsProd(const std::string& name, std::pair<bool, double> checkGroupConstraintsProd(const std::string& name,
const std::string& parent, const std::string& parent,
const Group& group, const Group& group,
const WellStateFullyImplicitBlackoil& wellState, const WellState& wellState,
const GroupState& group_state, const GroupState& group_state,
const int reportStepIdx, const int reportStepIdx,
const GuideRate* guideRate, const GuideRate* guideRate,
@@ -1099,7 +1099,7 @@ namespace WellGroupHelpers
std::pair<bool, double> checkGroupConstraintsInj(const std::string& name, std::pair<bool, double> checkGroupConstraintsInj(const std::string& name,
const std::string& parent, const std::string& parent,
const Group& group, const Group& group,
const WellStateFullyImplicitBlackoil& wellState, const WellState& wellState,
const GroupState& group_state, const GroupState& group_state,
const int reportStepIdx, const int reportStepIdx,
const GuideRate* guideRate, const GuideRate* guideRate,
@@ -1226,7 +1226,7 @@ namespace WellGroupHelpers
const PhaseUsage& pu, const PhaseUsage& pu,
const int reportStepIdx, const int reportStepIdx,
const double& simTime, const double& simTime,
WellStateFullyImplicitBlackoil& wellState, WellState& wellState,
const GroupState& group_state, const GroupState& group_state,
const Comm& comm, const Comm& comm,
GuideRate* guideRate, GuideRate* guideRate,
@@ -1309,7 +1309,7 @@ namespace WellGroupHelpers
const PhaseUsage& pu, const PhaseUsage& pu,
const int reportStepIdx, const int reportStepIdx,
const double& simTime, const double& simTime,
const WellStateFullyImplicitBlackoil& wellState, const WellState& wellState,
const Comm& comm, const Comm& comm,
GuideRate* guideRate) GuideRate* guideRate)
{ {
@@ -1349,7 +1349,7 @@ namespace WellGroupHelpers
const PhaseUsage& pu, \ const PhaseUsage& pu, \
const int reportStepIdx, \ const int reportStepIdx, \
const double& simTime, \ const double& simTime, \
WellStateFullyImplicitBlackoil& wellState, \ WellState& wellState, \
const GroupState& group_state, \ const GroupState& group_state, \
const Dune::CollectiveCommunication<__VA_ARGS__>& comm, \ const Dune::CollectiveCommunication<__VA_ARGS__>& comm, \
GuideRate* guideRate, \ GuideRate* guideRate, \
@@ -1359,7 +1359,7 @@ namespace WellGroupHelpers
const PhaseUsage& pu, \ const PhaseUsage& pu, \
const int reportStepIdx, \ const int reportStepIdx, \
const double& simTime, \ const double& simTime, \
const WellStateFullyImplicitBlackoil& wellState, \ const WellState& wellState, \
const Dune::CollectiveCommunication<__VA_ARGS__>& comm, \ const Dune::CollectiveCommunication<__VA_ARGS__>& comm, \
GuideRate* guideRate); GuideRate* guideRate);

View File

@@ -37,7 +37,7 @@ namespace Network { class ExtNetwork; }
struct PhaseUsage; struct PhaseUsage;
class Schedule; class Schedule;
class VFPProdProperties; class VFPProdProperties;
class WellStateFullyImplicitBlackoil; class WellState;
template <typename> template <typename>
class WellContainer; class WellContainer;
@@ -53,7 +53,7 @@ namespace WellGroupHelpers
const Schedule& schedule, const Schedule& schedule,
const SummaryState& summaryState, const SummaryState& summaryState,
const int reportStepIdx, const int reportStepIdx,
WellStateFullyImplicitBlackoil& wellState, WellState& wellState,
GroupState& group_state); GroupState& group_state);
void accumulateGroupEfficiencyFactor(const Group& group, void accumulateGroupEfficiencyFactor(const Group& group,
@@ -64,28 +64,28 @@ namespace WellGroupHelpers
double sumWellPhaseRates(const WellContainer<std::vector<double>>& rates, double sumWellPhaseRates(const WellContainer<std::vector<double>>& rates,
const Group& group, const Group& group,
const Schedule& schedule, const Schedule& schedule,
const WellStateFullyImplicitBlackoil& wellState, const WellState& wellState,
const int reportStepIdx, const int reportStepIdx,
const int phasePos, const int phasePos,
const bool injector); const bool injector);
double sumWellRates(const Group& group, double sumWellRates(const Group& group,
const Schedule& schedule, const Schedule& schedule,
const WellStateFullyImplicitBlackoil& wellState, const WellState& wellState,
const int reportStepIdx, const int reportStepIdx,
const int phasePos, const int phasePos,
const bool injector); const bool injector);
double sumWellResRates(const Group& group, double sumWellResRates(const Group& group,
const Schedule& schedule, const Schedule& schedule,
const WellStateFullyImplicitBlackoil& wellState, const WellState& wellState,
const int reportStepIdx, const int reportStepIdx,
const int phasePos, const int phasePos,
const bool injector); const bool injector);
double sumSolventRates(const Group& group, double sumSolventRates(const Group& group,
const Schedule& schedule, const Schedule& schedule,
const WellStateFullyImplicitBlackoil& wellState, const WellState& wellState,
const int reportStepIdx, const int reportStepIdx,
const bool injector); const bool injector);
@@ -95,8 +95,8 @@ namespace WellGroupHelpers
const bool isInjector, const bool isInjector,
const PhaseUsage& pu, const PhaseUsage& pu,
const GuideRate& guide_rate, const GuideRate& guide_rate,
const WellStateFullyImplicitBlackoil& wellStateNupcol, const WellState& wellStateNupcol,
WellStateFullyImplicitBlackoil& wellState, WellState& wellState,
GroupState& group_state, GroupState& group_state,
std::vector<double>& groupTargetReduction); std::vector<double>& groupTargetReduction);
@@ -106,7 +106,7 @@ namespace WellGroupHelpers
const PhaseUsage& pu, const PhaseUsage& pu,
const int reportStepIdx, const int reportStepIdx,
const double& simTime, const double& simTime,
WellStateFullyImplicitBlackoil& wellState, WellState& wellState,
const GroupState& group_state, const GroupState& group_state,
const Comm& comm, const Comm& comm,
GuideRate* guideRate, GuideRate* guideRate,
@@ -117,7 +117,7 @@ namespace WellGroupHelpers
const PhaseUsage& pu, const PhaseUsage& pu,
const int reportStepIdx, const int reportStepIdx,
const double& simTime, const double& simTime,
const WellStateFullyImplicitBlackoil& wellState, const WellState& wellState,
const Comm& comm, const Comm& comm,
GuideRate* guideRate); GuideRate* guideRate);
@@ -126,7 +126,7 @@ namespace WellGroupHelpers
const SummaryState& summaryState, const SummaryState& summaryState,
const Opm::PhaseUsage& pu, const Opm::PhaseUsage& pu,
const int reportStepIdx, const int reportStepIdx,
const WellStateFullyImplicitBlackoil& wellState, const WellState& wellState,
const GroupState& group_state, const GroupState& group_state,
GuideRate* guideRate, GuideRate* guideRate,
Opm::DeferredLogger& deferred_logger); Opm::DeferredLogger& deferred_logger);
@@ -134,28 +134,28 @@ namespace WellGroupHelpers
void updateVREPForGroups(const Group& group, void updateVREPForGroups(const Group& group,
const Schedule& schedule, const Schedule& schedule,
const int reportStepIdx, const int reportStepIdx,
const WellStateFullyImplicitBlackoil& wellStateNupcol, const WellState& wellStateNupcol,
WellStateFullyImplicitBlackoil& wellState, WellState& wellState,
GroupState& group_state); GroupState& group_state);
void updateReservoirRatesInjectionGroups(const Group& group, void updateReservoirRatesInjectionGroups(const Group& group,
const Schedule& schedule, const Schedule& schedule,
const int reportStepIdx, const int reportStepIdx,
const WellStateFullyImplicitBlackoil& wellStateNupcol, const WellState& wellStateNupcol,
WellStateFullyImplicitBlackoil& wellState, WellState& wellState,
GroupState& group_state); GroupState& group_state);
void updateWellRates(const Group& group, void updateWellRates(const Group& group,
const Schedule& schedule, const Schedule& schedule,
const int reportStepIdx, const int reportStepIdx,
const WellStateFullyImplicitBlackoil& wellStateNupcol, const WellState& wellStateNupcol,
WellStateFullyImplicitBlackoil& wellState); WellState& wellState);
void updateGroupProductionRates(const Group& group, void updateGroupProductionRates(const Group& group,
const Schedule& schedule, const Schedule& schedule,
const int reportStepIdx, const int reportStepIdx,
const WellStateFullyImplicitBlackoil& wellStateNupcol, const WellState& wellStateNupcol,
WellStateFullyImplicitBlackoil& wellState, WellState& wellState,
GroupState& group_state); GroupState& group_state);
void updateREINForGroups(const Group& group, void updateREINForGroups(const Group& group,
@@ -163,27 +163,27 @@ namespace WellGroupHelpers
const int reportStepIdx, const int reportStepIdx,
const PhaseUsage& pu, const PhaseUsage& pu,
const SummaryState& st, const SummaryState& st,
const WellStateFullyImplicitBlackoil& wellStateNupcol, const WellState& wellStateNupcol,
WellStateFullyImplicitBlackoil& wellState, WellState& wellState,
GroupState& group_state); GroupState& group_state);
std::map<std::string, double> std::map<std::string, double>
computeNetworkPressures(const Opm::Network::ExtNetwork& network, computeNetworkPressures(const Opm::Network::ExtNetwork& network,
const WellStateFullyImplicitBlackoil& well_state, const WellState& well_state,
const GroupState& group_state, const GroupState& group_state,
const VFPProdProperties& vfp_prod_props, const VFPProdProperties& vfp_prod_props,
const Schedule& schedule, const Schedule& schedule,
const int report_time_step); const int report_time_step);
GuideRate::RateVector GuideRate::RateVector
getWellRateVector(const WellStateFullyImplicitBlackoil& well_state, const PhaseUsage& pu, const std::string& name); getWellRateVector(const WellState& well_state, const PhaseUsage& pu, const std::string& name);
GuideRate::RateVector GuideRate::RateVector
getProductionGroupRateVector(const GroupState& group_state, const PhaseUsage& pu, const std::string& group_name); getProductionGroupRateVector(const GroupState& group_state, const PhaseUsage& pu, const std::string& group_name);
double getGuideRate(const std::string& name, double getGuideRate(const std::string& name,
const Schedule& schedule, const Schedule& schedule,
const WellStateFullyImplicitBlackoil& wellState, const WellState& wellState,
const GroupState& group_state, const GroupState& group_state,
const int reportStepIdx, const int reportStepIdx,
const GuideRate* guideRate, const GuideRate* guideRate,
@@ -193,7 +193,7 @@ namespace WellGroupHelpers
double getGuideRateInj(const std::string& name, double getGuideRateInj(const std::string& name,
const Schedule& schedule, const Schedule& schedule,
const WellStateFullyImplicitBlackoil& wellState, const WellState& wellState,
const GroupState& group_state, const GroupState& group_state,
const int reportStepIdx, const int reportStepIdx,
const GuideRate* guideRate, const GuideRate* guideRate,
@@ -202,7 +202,7 @@ namespace WellGroupHelpers
const PhaseUsage& pu); const PhaseUsage& pu);
int groupControlledWells(const Schedule& schedule, int groupControlledWells(const Schedule& schedule,
const WellStateFullyImplicitBlackoil& well_state, const WellState& well_state,
const GroupState& group_state, const GroupState& group_state,
const int report_step, const int report_step,
const std::string& group_name, const std::string& group_name,
@@ -215,7 +215,7 @@ namespace WellGroupHelpers
{ {
public: public:
FractionCalculator(const Schedule& schedule, FractionCalculator(const Schedule& schedule,
const WellStateFullyImplicitBlackoil& well_state, const WellState& well_state,
const GroupState& group_state, const GroupState& group_state,
const int report_step, const int report_step,
const GuideRate* guide_rate, const GuideRate* guide_rate,
@@ -233,7 +233,7 @@ namespace WellGroupHelpers
int groupControlledWells(const std::string& group_name, const std::string& always_included_child); int groupControlledWells(const std::string& group_name, const std::string& always_included_child);
GuideRate::RateVector getGroupRateVector(const std::string& group_name); GuideRate::RateVector getGroupRateVector(const std::string& group_name);
const Schedule& schedule_; const Schedule& schedule_;
const WellStateFullyImplicitBlackoil& well_state_; const WellState& well_state_;
const GroupState& group_state_; const GroupState& group_state_;
int report_step_; int report_step_;
const GuideRate* guide_rate_; const GuideRate* guide_rate_;
@@ -247,7 +247,7 @@ namespace WellGroupHelpers
std::pair<bool, double> checkGroupConstraintsInj(const std::string& name, std::pair<bool, double> checkGroupConstraintsInj(const std::string& name,
const std::string& parent, const std::string& parent,
const Group& group, const Group& group,
const WellStateFullyImplicitBlackoil& wellState, const WellState& wellState,
const GroupState& group_state, const GroupState& group_state,
const int reportStepIdx, const int reportStepIdx,
const GuideRate* guideRate, const GuideRate* guideRate,
@@ -276,7 +276,7 @@ namespace WellGroupHelpers
std::pair<bool, double> checkGroupConstraintsProd(const std::string& name, std::pair<bool, double> checkGroupConstraintsProd(const std::string& name,
const std::string& parent, const std::string& parent,
const Group& group, const Group& group,
const WellStateFullyImplicitBlackoil& wellState, const WellState& wellState,
const GroupState& group_state, const GroupState& group_state,
const int reportStepIdx, const int reportStepIdx,
const GuideRate* guideRate, const GuideRate* guideRate,

View File

@@ -39,7 +39,7 @@
#include <opm/simulators/wells/WellHelpers.hpp> #include <opm/simulators/wells/WellHelpers.hpp>
#include <opm/simulators/wells/WellGroupHelpers.hpp> #include <opm/simulators/wells/WellGroupHelpers.hpp>
#include <opm/simulators/wells/WellProdIndexCalculator.hpp> #include <opm/simulators/wells/WellProdIndexCalculator.hpp>
#include <opm/simulators/wells/WellStateFullyImplicitBlackoil.hpp> #include <opm/simulators/wells/WellState.hpp>
// NOTE: GasLiftSingleWell.hpp includes StandardWell.hpp which includes ourself // NOTE: GasLiftSingleWell.hpp includes StandardWell.hpp which includes ourself
// (WellInterface.hpp), so we need to forward declare GasLiftSingleWell // (WellInterface.hpp), so we need to forward declare GasLiftSingleWell
// for it to be defined in this file. Similar for BlackoilWellModel // for it to be defined in this file. Similar for BlackoilWellModel
@@ -76,8 +76,6 @@ namespace Opm
{ {
public: public:
using WellState = WellStateFullyImplicitBlackoil;
using ModelParameters = BlackoilModelParametersEbos<TypeTag>; using ModelParameters = BlackoilModelParametersEbos<TypeTag>;
static const int Water = BlackoilPhases::Aqua; static const int Water = BlackoilPhases::Aqua;

View File

@@ -28,7 +28,7 @@
#include <opm/simulators/wells/PerforationData.hpp> #include <opm/simulators/wells/PerforationData.hpp>
#include <opm/simulators/wells/ParallelWellInfo.hpp> #include <opm/simulators/wells/ParallelWellInfo.hpp>
#include <opm/simulators/wells/VFPProperties.hpp> #include <opm/simulators/wells/VFPProperties.hpp>
#include <opm/simulators/wells/WellStateFullyImplicitBlackoil.hpp> #include <opm/simulators/wells/WellState.hpp>
#include <cassert> #include <cassert>
#include <cmath> #include <cmath>

View File

@@ -42,11 +42,10 @@ struct PhaseUsage;
class SummaryState; class SummaryState;
class VFPProperties; class VFPProperties;
class WellTestState; class WellTestState;
class WellStateFullyImplicitBlackoil; class WellState;
class WellInterfaceGeneric { class WellInterfaceGeneric {
public: public:
using WellState = WellStateFullyImplicitBlackoil;
WellInterfaceGeneric(const Well& well, WellInterfaceGeneric(const Well& well,
const ParallelWellInfo& parallel_well_info, const ParallelWellInfo& parallel_well_info,

View File

@@ -19,7 +19,7 @@
*/ */
#include <config.h> #include <config.h>
#include <opm/simulators/wells/WellStateFullyImplicitBlackoil.hpp> #include <opm/simulators/wells/WellState.hpp>
#include <opm/common/ErrorMacros.hpp> #include <opm/common/ErrorMacros.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp> #include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
@@ -32,7 +32,7 @@
namespace Opm namespace Opm
{ {
void WellStateFullyImplicitBlackoil::base_init(const std::vector<double>& cellPressures, void WellState::base_init(const std::vector<double>& cellPressures,
const std::vector<Well>& wells_ecl, const std::vector<Well>& wells_ecl,
const std::vector<ParallelWellInfo*>& parallel_well_info, const std::vector<ParallelWellInfo*>& parallel_well_info,
const std::vector<std::vector<PerforationData>>& well_perf_data, const std::vector<std::vector<PerforationData>>& well_perf_data,
@@ -77,7 +77,7 @@ void WellStateFullyImplicitBlackoil::base_init(const std::vector<double>& cellPr
void WellStateFullyImplicitBlackoil::initSingleWell(const std::vector<double>& cellPressures, void WellState::initSingleWell(const std::vector<double>& cellPressures,
const int w, const int w,
const Well& well, const Well& well,
const std::vector<PerforationData>& well_perf_data, const std::vector<PerforationData>& well_perf_data,
@@ -224,12 +224,12 @@ void WellStateFullyImplicitBlackoil::initSingleWell(const std::vector<double>& c
void WellStateFullyImplicitBlackoil::init(const std::vector<double>& cellPressures, void WellState::init(const std::vector<double>& cellPressures,
const Schedule& schedule, const Schedule& schedule,
const std::vector<Well>& wells_ecl, const std::vector<Well>& wells_ecl,
const std::vector<ParallelWellInfo*>& parallel_well_info, const std::vector<ParallelWellInfo*>& parallel_well_info,
const int report_step, const int report_step,
const WellStateFullyImplicitBlackoil* prevState, const WellState* prevState,
const std::vector<std::vector<PerforationData>>& well_perf_data, const std::vector<std::vector<PerforationData>>& well_perf_data,
const SummaryState& summary_state) const SummaryState& summary_state)
{ {
@@ -391,7 +391,7 @@ void WellStateFullyImplicitBlackoil::init(const std::vector<double>& cellPressur
this->update_thp( newIndex, prevState->thp( oldIndex )); this->update_thp( newIndex, prevState->thp( oldIndex ));
// If new target is set using WCONPROD, WCONINJE etc. we use the new control // If new target is set using WCONPROD, WCONINJE etc. we use the new control
if (!this->events_[w].hasEvent(WellStateFullyImplicitBlackoil::event_mask)) { if (!this->events_[w].hasEvent(WellState::event_mask)) {
current_injection_controls_[ newIndex ] = prevState->currentInjectionControl(oldIndex); current_injection_controls_[ newIndex ] = prevState->currentInjectionControl(oldIndex);
current_production_controls_[ newIndex ] = prevState->currentProductionControl(oldIndex); current_production_controls_[ newIndex ] = prevState->currentProductionControl(oldIndex);
} }
@@ -412,7 +412,7 @@ void WellStateFullyImplicitBlackoil::init(const std::vector<double>& cellPressur
if (new_iter == this->wellMap().end()) { if (new_iter == this->wellMap().end()) {
throw std::logic_error { throw std::logic_error {
well.name() + " is not in internal well map - " well.name() + " is not in internal well map - "
"Bug in WellStateFullyImplicitBlackoil" "Bug in WellState"
}; };
} }
@@ -536,7 +536,7 @@ void WellStateFullyImplicitBlackoil::init(const std::vector<double>& cellPressur
do_glift_optimization_ = true; do_glift_optimization_ = true;
} }
void WellStateFullyImplicitBlackoil::resize(const std::vector<Well>& wells_ecl, void WellState::resize(const std::vector<Well>& wells_ecl,
const std::vector<ParallelWellInfo*>& parallel_well_info, const std::vector<ParallelWellInfo*>& parallel_well_info,
const Schedule& schedule, const Schedule& schedule,
const bool handle_ms_well, const bool handle_ms_well,
@@ -553,7 +553,7 @@ void WellStateFullyImplicitBlackoil::resize(const std::vector<Well>& wells_ecl,
} }
const std::vector<double>& const std::vector<double>&
WellStateFullyImplicitBlackoil::currentWellRates(const std::string& wellName) const WellState::currentWellRates(const std::string& wellName) const
{ {
auto it = well_rates.find(wellName); auto it = well_rates.find(wellName);
@@ -564,7 +564,7 @@ WellStateFullyImplicitBlackoil::currentWellRates(const std::string& wellName) co
} }
template<class Communication> template<class Communication>
void WellStateFullyImplicitBlackoil::gatherVectorsOnRoot(const std::vector<data::Connection>& from_connections, void WellState::gatherVectorsOnRoot(const std::vector<data::Connection>& from_connections,
std::vector<data::Connection>& to_connections, std::vector<data::Connection>& to_connections,
const Communication& comm) const const Communication& comm) const
{ {
@@ -586,7 +586,7 @@ void WellStateFullyImplicitBlackoil::gatherVectorsOnRoot(const std::vector<data:
} }
data::Wells data::Wells
WellStateFullyImplicitBlackoil::report(const int* globalCellIdxMap, WellState::report(const int* globalCellIdxMap,
const std::function<bool(const int)>& wasDynamicallyClosed) const const std::function<bool(const int)>& wasDynamicallyClosed) const
{ {
if (this->numWells() == 0) if (this->numWells() == 0)
@@ -735,7 +735,7 @@ WellStateFullyImplicitBlackoil::report(const int* globalCellIdxMap,
return res; return res;
} }
void WellStateFullyImplicitBlackoil::reportConnections(data::Well& well, void WellState::reportConnections(data::Well& well,
const PhaseUsage &pu, const PhaseUsage &pu,
const WellMapType::value_type& wt, const WellMapType::value_type& wt,
const int* globalCellIdxMap) const const int* globalCellIdxMap) const
@@ -802,8 +802,8 @@ void WellStateFullyImplicitBlackoil::reportConnections(data::Well& well,
assert(local_comp_index == this->well_perf_data_[wt.second[0]].size()); assert(local_comp_index == this->well_perf_data_[wt.second[0]].size());
} }
void WellStateFullyImplicitBlackoil::initWellStateMSWell(const std::vector<Well>& wells_ecl, void WellState::initWellStateMSWell(const std::vector<Well>& wells_ecl,
const WellStateFullyImplicitBlackoil* prev_well_state) const WellState* prev_well_state)
{ {
// still using the order in wells // still using the order in wells
const int nw = wells_ecl.size(); const int nw = wells_ecl.size();
@@ -981,7 +981,7 @@ void WellStateFullyImplicitBlackoil::initWellStateMSWell(const std::vector<Well>
} }
void void
WellStateFullyImplicitBlackoil::calculateSegmentRates(const std::vector<std::vector<int>>& segment_inlets, WellState::calculateSegmentRates(const std::vector<std::vector<int>>& segment_inlets,
const std::vector<std::vector<int>>&segment_perforations, const std::vector<std::vector<int>>&segment_perforations,
const std::vector<double>& perforation_rates, const std::vector<double>& perforation_rates,
const int np, const int segment, const int np, const int segment,
@@ -1008,38 +1008,38 @@ WellStateFullyImplicitBlackoil::calculateSegmentRates(const std::vector<std::vec
} }
} }
double WellStateFullyImplicitBlackoil::solventWellRate(const int w) const double WellState::solventWellRate(const int w) const
{ {
return parallel_well_info_[w]->sumPerfValues(&perfRateSolvent_[0] + first_perf_index_[w], return parallel_well_info_[w]->sumPerfValues(&perfRateSolvent_[0] + first_perf_index_[w],
&perfRateSolvent_[0] + first_perf_index_[w] + num_perf_[w]); &perfRateSolvent_[0] + first_perf_index_[w] + num_perf_[w]);
} }
double WellStateFullyImplicitBlackoil::polymerWellRate(const int w) const double WellState::polymerWellRate(const int w) const
{ {
return parallel_well_info_[w]->sumPerfValues(&perfRatePolymer_[0] + first_perf_index_[w], return parallel_well_info_[w]->sumPerfValues(&perfRatePolymer_[0] + first_perf_index_[w],
&perfRatePolymer_[0] + first_perf_index_[w] + num_perf_[w]); &perfRatePolymer_[0] + first_perf_index_[w] + num_perf_[w]);
} }
double WellStateFullyImplicitBlackoil::brineWellRate(const int w) const double WellState::brineWellRate(const int w) const
{ {
return parallel_well_info_[w]->sumPerfValues(&perfRateBrine_[0] + first_perf_index_[w], return parallel_well_info_[w]->sumPerfValues(&perfRateBrine_[0] + first_perf_index_[w],
&perfRateBrine_[0] + first_perf_index_[w] + num_perf_[w]); &perfRateBrine_[0] + first_perf_index_[w] + num_perf_[w]);
} }
int WellStateFullyImplicitBlackoil::topSegmentIndex(const int w) const int WellState::topSegmentIndex(const int w) const
{ {
assert(w < int(top_segment_index_.size()) ); assert(w < int(top_segment_index_.size()) );
return top_segment_index_[w]; return top_segment_index_[w];
} }
void WellStateFullyImplicitBlackoil::stopWell(int well_index) void WellState::stopWell(int well_index)
{ {
this->status_[well_index] = Well::Status::STOP; this->status_[well_index] = Well::Status::STOP;
this->thp_[well_index] = 0; this->thp_[well_index] = 0;
} }
void WellStateFullyImplicitBlackoil::shutWell(int well_index) void WellState::shutWell(int well_index)
{ {
this->status_[well_index] = Well::Status::SHUT; this->status_[well_index] = Well::Status::SHUT;
this->thp_[well_index] = 0; this->thp_[well_index] = 0;
@@ -1061,7 +1061,7 @@ void WellStateFullyImplicitBlackoil::shutWell(int well_index)
this->conn_productivity_index_.begin() + last, 0.0); this->conn_productivity_index_.begin() + last, 0.0);
} }
void WellStateFullyImplicitBlackoil::updateStatus(int well_index, Well::Status status) void WellState::updateStatus(int well_index, Well::Status status)
{ {
switch (status) { switch (status) {
case Well::Status::OPEN: case Well::Status::OPEN:
@@ -1081,7 +1081,7 @@ void WellStateFullyImplicitBlackoil::updateStatus(int well_index, Well::Status s
template<class Comm> template<class Comm>
void WellStateFullyImplicitBlackoil::communicateGroupRates(const Comm& comm) void WellState::communicateGroupRates(const Comm& comm)
{ {
// Note that injection_group_vrep_rates is handled separate from // Note that injection_group_vrep_rates is handled separate from
// the forAllGroupData() function, since it contains single doubles, // the forAllGroupData() function, since it contains single doubles,
@@ -1144,14 +1144,14 @@ void WellStateFullyImplicitBlackoil::communicateGroupRates(const Comm& comm)
} }
template<class Comm> template<class Comm>
void WellStateFullyImplicitBlackoil::updateGlobalIsGrup(const Comm& comm) void WellState::updateGlobalIsGrup(const Comm& comm)
{ {
this->global_well_info.value().update_group(this->status_.data(), this->current_injection_controls_.data(), this->current_production_controls_.data()); this->global_well_info.value().update_group(this->status_.data(), this->current_injection_controls_.data(), this->current_production_controls_.data());
this->global_well_info.value().communicate(comm); this->global_well_info.value().communicate(comm);
} }
data::Segment data::Segment
WellStateFullyImplicitBlackoil::reportSegmentResults(const PhaseUsage& pu, WellState::reportSegmentResults(const PhaseUsage& pu,
const int well_id, const int well_id,
const int seg_ix, const int seg_ix,
const int seg_no) const const int seg_no) const
@@ -1194,7 +1194,7 @@ WellStateFullyImplicitBlackoil::reportSegmentResults(const PhaseUsage& pu,
return seg_res; return seg_res;
} }
bool WellStateFullyImplicitBlackoil::wellIsOwned(std::size_t well_index, bool WellState::wellIsOwned(std::size_t well_index,
[[maybe_unused]] const std::string& wellName) const [[maybe_unused]] const std::string& wellName) const
{ {
const auto& well_info = parallelWellInfo(well_index); const auto& well_info = parallelWellInfo(well_index);
@@ -1203,7 +1203,7 @@ bool WellStateFullyImplicitBlackoil::wellIsOwned(std::size_t well_index,
return well_info.isOwner(); return well_info.isOwner();
} }
bool WellStateFullyImplicitBlackoil::wellIsOwned(const std::string& wellName) const bool WellState::wellIsOwned(const std::string& wellName) const
{ {
const auto& it = this->wellMap_.find( wellName ); const auto& it = this->wellMap_.find( wellName );
if (it == this->wellMap_.end()) { if (it == this->wellMap_.end()) {
@@ -1213,7 +1213,7 @@ bool WellStateFullyImplicitBlackoil::wellIsOwned(const std::string& wellName) co
return wellIsOwned(well_index, wellName); return wellIsOwned(well_index, wellName);
} }
int WellStateFullyImplicitBlackoil::numSegments(const int well_id) const int WellState::numSegments(const int well_id) const
{ {
const auto topseg = this->topSegmentIndex(well_id); const auto topseg = this->topSegmentIndex(well_id);
@@ -1222,14 +1222,14 @@ int WellStateFullyImplicitBlackoil::numSegments(const int well_id) const
: (this->topSegmentIndex(well_id + 1) - topseg); : (this->topSegmentIndex(well_id + 1) - topseg);
} }
int WellStateFullyImplicitBlackoil::segmentNumber(const int well_id, const int seg_id) const int WellState::segmentNumber(const int well_id, const int seg_id) const
{ {
const auto top_offset = this->topSegmentIndex(well_id); const auto top_offset = this->topSegmentIndex(well_id);
return this->seg_number_[top_offset + seg_id]; return this->seg_number_[top_offset + seg_id];
} }
void WellStateFullyImplicitBlackoil::updateWellsDefaultALQ( const std::vector<Well>& wells_ecl ) void WellState::updateWellsDefaultALQ( const std::vector<Well>& wells_ecl )
{ {
const int nw = wells_ecl.size(); const int nw = wells_ecl.size();
for (int i = 0; i<nw; i++) { for (int i = 0; i<nw; i++) {
@@ -1242,7 +1242,7 @@ void WellStateFullyImplicitBlackoil::updateWellsDefaultALQ( const std::vector<We
} }
} }
void WellStateFullyImplicitBlackoil::resetConnectionTransFactors(const int well_index, void WellState::resetConnectionTransFactors(const int well_index,
const std::vector<PerforationData>& well_perf_data) const std::vector<PerforationData>& well_perf_data)
{ {
if (this->well_perf_data_[well_index].size() != well_perf_data.size()) { if (this->well_perf_data_[well_index].size() != well_perf_data.size()) {
@@ -1282,11 +1282,11 @@ void WellStateFullyImplicitBlackoil::resetConnectionTransFactors(const int well_
} }
const ParallelWellInfo& const ParallelWellInfo&
WellStateFullyImplicitBlackoil::parallelWellInfo(std::size_t well_index) const WellState::parallelWellInfo(std::size_t well_index) const
{ {
return *parallel_well_info_[well_index]; return *parallel_well_info_[well_index];
} }
template void WellStateFullyImplicitBlackoil::updateGlobalIsGrup<ParallelWellInfo::Communication>(const ParallelWellInfo::Communication& comm); template void WellState::updateGlobalIsGrup<ParallelWellInfo::Communication>(const ParallelWellInfo::Communication& comm);
template void WellStateFullyImplicitBlackoil::communicateGroupRates<ParallelWellInfo::Communication>(const ParallelWellInfo::Communication& comm); template void WellState::communicateGroupRates<ParallelWellInfo::Communication>(const ParallelWellInfo::Communication& comm);
} // namespace Opm } // namespace Opm

View File

@@ -46,7 +46,7 @@ class Schedule;
/// The state of a set of wells, tailored for use by the fully /// The state of a set of wells, tailored for use by the fully
/// implicit blackoil simulator. /// implicit blackoil simulator.
class WellStateFullyImplicitBlackoil class WellState
{ {
public: public:
using mapentry_t = std::array<int, 3>; using mapentry_t = std::array<int, 3>;
@@ -54,14 +54,14 @@ public:
static const uint64_t event_mask = ScheduleEvents::WELL_STATUS_CHANGE + ScheduleEvents::PRODUCTION_UPDATE + ScheduleEvents::INJECTION_UPDATE; static const uint64_t event_mask = ScheduleEvents::WELL_STATUS_CHANGE + ScheduleEvents::PRODUCTION_UPDATE + ScheduleEvents::INJECTION_UPDATE;
virtual ~WellStateFullyImplicitBlackoil() = default; virtual ~WellState() = default;
// TODO: same definition with WellInterface, eventually they should go to a common header file. // TODO: same definition with WellInterface, eventually they should go to a common header file.
static const int Water = BlackoilPhases::Aqua; static const int Water = BlackoilPhases::Aqua;
static const int Oil = BlackoilPhases::Liquid; static const int Oil = BlackoilPhases::Liquid;
static const int Gas = BlackoilPhases::Vapour; static const int Gas = BlackoilPhases::Vapour;
explicit WellStateFullyImplicitBlackoil(const PhaseUsage& pu) explicit WellState(const PhaseUsage& pu)
{ {
this->phase_usage_ = pu; this->phase_usage_ = pu;
} }
@@ -86,7 +86,7 @@ public:
const std::vector<Well>& wells_ecl, const std::vector<Well>& wells_ecl,
const std::vector<ParallelWellInfo*>& parallel_well_info, const std::vector<ParallelWellInfo*>& parallel_well_info,
const int report_step, const int report_step,
const WellStateFullyImplicitBlackoil* prevState, const WellState* prevState,
const std::vector<std::vector<PerforationData>>& well_perf_data, const std::vector<std::vector<PerforationData>>& well_perf_data,
const SummaryState& summary_state); const SummaryState& summary_state);
@@ -135,7 +135,7 @@ public:
/// init the MS well related. /// init the MS well related.
void initWellStateMSWell(const std::vector<Well>& wells_ecl, void initWellStateMSWell(const std::vector<Well>& wells_ecl,
const WellStateFullyImplicitBlackoil* prev_well_state); const WellState* prev_well_state);
static void calculateSegmentRates(const std::vector<std::vector<int>>& segment_inlets, const std::vector<std::vector<int>>&segment_perforations, static void calculateSegmentRates(const std::vector<std::vector<int>>& segment_inlets, const std::vector<std::vector<int>>&segment_perforations,
const std::vector<double>& perforation_rates, const int np, const int segment, std::vector<double>& segment_rates); const std::vector<double>& perforation_rates, const int np, const int segment, std::vector<double>& segment_rates);

View File

@@ -40,7 +40,7 @@
#include <opm/simulators/wells/GasLiftSingleWell.hpp> #include <opm/simulators/wells/GasLiftSingleWell.hpp>
//#include <opm/simulators/flow/SimulatorFullyImplicitBlackoilEbos.hpp> //#include <opm/simulators/flow/SimulatorFullyImplicitBlackoilEbos.hpp>
//#include <flow/flow_ebos_blackoil.hpp> //#include <flow/flow_ebos_blackoil.hpp>
#include <opm/simulators/wells/WellStateFullyImplicitBlackoil.hpp> #include <opm/simulators/wells/WellState.hpp>
/// #include <opm/simulators/flow/Main.hpp> /// #include <opm/simulators/flow/Main.hpp>
#if HAVE_DUNE_FEM #if HAVE_DUNE_FEM
@@ -119,7 +119,7 @@ BOOST_AUTO_TEST_CASE(G1)
//using EclProblem = Opm::EclProblem<TypeTag>; //using EclProblem = Opm::EclProblem<TypeTag>;
//using EclWellModel = typename EclProblem::EclWellModel; //using EclWellModel = typename EclProblem::EclWellModel;
using WellModel = Opm::BlackoilWellModel<TypeTag>; using WellModel = Opm::BlackoilWellModel<TypeTag>;
using WellState = Opm::WellStateFullyImplicitBlackoil; using WellState = Opm::WellState;
using StdWell = Opm::StandardWell<TypeTag>; using StdWell = Opm::StandardWell<TypeTag>;
using GasLiftSingleWell = Opm::GasLiftSingleWell<TypeTag>; using GasLiftSingleWell = Opm::GasLiftSingleWell<TypeTag>;
const std::string filename = "GLIFT1.DATA"; const std::string filename = "GLIFT1.DATA";

View File

@@ -25,7 +25,7 @@
#include <opm/common/ErrorMacros.hpp> #include <opm/common/ErrorMacros.hpp>
#include <opm/simulators/wells/GlobalWellInfo.hpp> #include <opm/simulators/wells/GlobalWellInfo.hpp>
#include <opm/simulators/wells/ParallelWellInfo.hpp> #include <opm/simulators/wells/ParallelWellInfo.hpp>
#include <opm/simulators/wells/WellStateFullyImplicitBlackoil.hpp> #include <opm/simulators/wells/WellState.hpp>
#include <opm/simulators/wells/WellContainer.hpp> #include <opm/simulators/wells/WellContainer.hpp>
#include <opm/parser/eclipse/Python/Python.hpp> #include <opm/parser/eclipse/Python/Python.hpp>
@@ -123,11 +123,11 @@ struct Setup
}; };
namespace { namespace {
Opm::WellStateFullyImplicitBlackoil Opm::WellState
buildWellState(const Setup& setup, const std::size_t timeStep, buildWellState(const Setup& setup, const std::size_t timeStep,
std::vector<Opm::ParallelWellInfo>& pinfos) std::vector<Opm::ParallelWellInfo>& pinfos)
{ {
auto state = Opm::WellStateFullyImplicitBlackoil{setup.pu}; auto state = Opm::WellState{setup.pu};
const auto cpress = const auto cpress =
std::vector<double>(setup.grid.c_grid()->number_of_cells, std::vector<double>(setup.grid.c_grid()->number_of_cells,
@@ -160,7 +160,7 @@ namespace {
void setSegPress(const std::vector<Opm::Well>& wells, void setSegPress(const std::vector<Opm::Well>& wells,
Opm::WellStateFullyImplicitBlackoil& wstate) Opm::WellState& wstate)
{ {
const auto nWell = wells.size(); const auto nWell = wells.size();
@@ -193,7 +193,7 @@ namespace {
void setSegRates(const std::vector<Opm::Well>& wells, void setSegRates(const std::vector<Opm::Well>& wells,
const Opm::PhaseUsage& pu, const Opm::PhaseUsage& pu,
Opm::WellStateFullyImplicitBlackoil& wstate) Opm::WellState& wstate)
{ {
const auto wat = pu.phase_used[Opm::BlackoilPhases::Aqua]; const auto wat = pu.phase_used[Opm::BlackoilPhases::Aqua];
const auto iw = wat ? pu.phase_pos[Opm::BlackoilPhases::Aqua] : -1; const auto iw = wat ? pu.phase_pos[Opm::BlackoilPhases::Aqua] : -1;