Merge pull request #3298 from akva2/no_opm_in_opm

fixed: do not use Opm:: prefix when inside namespace Opm
This commit is contained in:
Joakim Hove 2021-05-26 10:15:46 +02:00 committed by GitHub
commit 86c75ee4fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 250 additions and 249 deletions

View File

@ -269,15 +269,15 @@ private:
class PackUnPackCellData : public P2PCommunicatorType::DataHandleInterface
{
const Opm::data::Solution& localCellData_;
Opm::data::Solution& globalCellData_;
const data::Solution& localCellData_;
data::Solution& globalCellData_;
const IndexMapType& localIndexMap_;
const IndexMapStorageType& indexMaps_;
public:
PackUnPackCellData(const Opm::data::Solution& localCellData,
Opm::data::Solution& globalCellData,
PackUnPackCellData(const data::Solution& localCellData,
data::Solution& globalCellData,
const IndexMapType& localIndexMap,
const IndexMapStorageType& indexMaps,
size_t globalSize,
@ -378,12 +378,12 @@ protected:
class PackUnPackWellData : public P2PCommunicatorType::DataHandleInterface
{
const Opm::data::Wells& localWellData_;
Opm::data::Wells& globalWellData_;
const data::Wells& localWellData_;
data::Wells& globalWellData_;
public:
PackUnPackWellData(const Opm::data::Wells& localWellData,
Opm::data::Wells& globalWellData,
PackUnPackWellData(const data::Wells& localWellData,
data::Wells& globalWellData,
bool isIORank)
: localWellData_(localWellData)
, globalWellData_(globalWellData)
@ -416,12 +416,12 @@ public:
class PackUnPackGroupAndNetworkValues : public P2PCommunicatorType::DataHandleInterface
{
const Opm::data::GroupAndNetworkValues& localGroupAndNetworkData_;
Opm::data::GroupAndNetworkValues& globalGroupAndNetworkData_;
const data::GroupAndNetworkValues& localGroupAndNetworkData_;
data::GroupAndNetworkValues& globalGroupAndNetworkData_;
public:
PackUnPackGroupAndNetworkValues(const Opm::data::GroupAndNetworkValues& localGroupAndNetworkData,
Opm::data::GroupAndNetworkValues& globalGroupAndNetworkData,
PackUnPackGroupAndNetworkValues(const data::GroupAndNetworkValues& localGroupAndNetworkData,
data::GroupAndNetworkValues& globalGroupAndNetworkData,
const bool isIORank)
: localGroupAndNetworkData_ (localGroupAndNetworkData)
, globalGroupAndNetworkData_(globalGroupAndNetworkData)
@ -568,12 +568,12 @@ public:
class PackUnPackAquiferData : public P2PCommunicatorType::DataHandleInterface
{
const Opm::data::Aquifers& localAquiferData_;
const data::Aquifers& localAquiferData_;
data::Aquifers& globalAquiferData_;
public:
PackUnPackAquiferData(const Opm::data::Aquifers& localAquiferData,
Opm::data::Aquifers& globalAquiferData,
PackUnPackAquiferData(const data::Aquifers& localAquiferData,
data::Aquifers& globalAquiferData,
bool isIORank)
: localAquiferData_(localAquiferData)
, globalAquiferData_(globalAquiferData)
@ -791,12 +791,12 @@ CollectDataToIORank(const Grid& grid, const EquilGrid* equilGrid,
template <class Grid, class EquilGrid, class GridView>
void CollectDataToIORank<Grid,EquilGrid,GridView>::
collect(const Opm::data::Solution& localCellData,
collect(const data::Solution& localCellData,
const std::map<std::pair<std::string, int>, double>& localBlockData,
const std::map<std::size_t, double>& localWBPData,
const Opm::data::Wells& localWellData,
const Opm::data::GroupAndNetworkValues& localGroupAndNetworkData,
const Opm::data::Aquifers& localAquiferData)
const data::Wells& localWellData,
const data::GroupAndNetworkValues& localGroupAndNetworkData,
const data::Aquifers& localAquiferData)
{
globalCellData_ = {};
globalBlockData_.clear();

View File

@ -64,12 +64,12 @@ public:
const Dune::CartesianIndexMapper<EquilGrid>* equilCartMapper);
// gather solution to rank 0 for EclipseWriter
void collect(const Opm::data::Solution& localCellData,
void collect(const data::Solution& localCellData,
const std::map<std::pair<std::string, int>, double>& localBlockData,
const std::map<std::size_t, double>& localWBPData,
const Opm::data::Wells& localWellData,
const Opm::data::GroupAndNetworkValues& localGroupAndNetworkData,
const Opm::data::Aquifers& localAquiferData);
const data::Wells& localWellData,
const data::GroupAndNetworkValues& localGroupAndNetworkData,
const data::Aquifers& localAquiferData);
const std::map<std::size_t, double>& globalWBPData() const
{ return this->globalWBPData_; }
@ -77,16 +77,16 @@ public:
const std::map<std::pair<std::string, int>, double>& globalBlockData() const
{ return globalBlockData_; }
const Opm::data::Solution& globalCellData() const
const data::Solution& globalCellData() const
{ return globalCellData_; }
const Opm::data::Wells& globalWellData() const
const data::Wells& globalWellData() const
{ return globalWellData_; }
const Opm::data::GroupAndNetworkValues& globalGroupAndNetworkData() const
const data::GroupAndNetworkValues& globalGroupAndNetworkData() const
{ return globalGroupAndNetworkData_; }
const Opm::data::Aquifers& globalAquiferData() const
const data::Aquifers& globalAquiferData() const
{ return globalAquiferData_; }
bool isIORank() const
@ -111,12 +111,12 @@ protected:
IndexMapType localIndexMap_;
IndexMapStorageType indexMaps_;
std::vector<int> globalRanks_;
Opm::data::Solution globalCellData_;
data::Solution globalCellData_;
std::map<std::pair<std::string, int>, double> globalBlockData_;
std::map<std::size_t, double> globalWBPData_;
Opm::data::Wells globalWellData_;
Opm::data::GroupAndNetworkValues globalGroupAndNetworkData_;
Opm::data::Aquifers globalAquiferData_;
data::Wells globalWellData_;
data::GroupAndNetworkValues globalGroupAndNetworkData_;
data::Aquifers globalAquiferData_;
std::vector<int> localIdxToGlobalIdx_;
/// \brief sorted list of cartesian indices present-
///

View File

@ -78,14 +78,13 @@ class EclEquilInitializer
public:
// NB: setting the enableEnergy argument to true enables storage of enthalpy and
// internal energy!
typedef Opm::BlackOilFluidState<Scalar,
FluidSystem,
enableTemperature,
enableEnergy,
Indices::gasEnabled,
enableBrine,
Indices::numPhases
> ScalarFluidState;
using ScalarFluidState = BlackOilFluidState<Scalar,
FluidSystem,
enableTemperature,
enableEnergy,
Indices::gasEnabled,
enableBrine,
Indices::numPhases>;
template <class EclMaterialLawManager>

View File

@ -93,7 +93,7 @@ class EclPeacemanWell : public BaseAuxiliaryModule<TypeTag>
using RateVector = GetPropType<TypeTag, Properties::RateVector>;
using GridView = GetPropType<TypeTag, Properties::GridView>;
typedef Opm::MathToolbox<Evaluation> Toolbox;
typedef MathToolbox<Evaluation> Toolbox;
typedef typename GridView::template Codim<0>::Entity Element;
typedef Element ElementStorage;
@ -125,7 +125,7 @@ class EclPeacemanWell : public BaseAuxiliaryModule<TypeTag>
static constexpr bool enableEnergy = getPropValue<TypeTag, Properties::EnableEnergy>();
typedef Opm::CompositionalFluidState<Scalar, FluidSystem, /*storeEnthalpy=*/true> FluidState;
typedef CompositionalFluidState<Scalar, FluidSystem, /*storeEnthalpy=*/true> FluidState;
typedef Dune::FieldMatrix<Scalar, dimWorld, dimWorld> DimMatrix;
// all quantities that need to be stored per degree of freedom that intersects the
@ -329,7 +329,7 @@ public:
// make valgrind shut up about the DOFs for the well even if the PrimaryVariables
// class contains some "holes" due to alignment
Opm::Valgrind::SetDefined(sol[wellGlobalDof]);
Valgrind::SetDefined(sol[wellGlobalDof]);
// also apply the initial solution of the well to the "old" time steps
for (unsigned timeIdx = 1; timeIdx < historySize; ++timeIdx) {
@ -468,10 +468,10 @@ public:
// rate for each component as its first conservation equation, but we require
// the black-oil model for now anyway, so this should not be too much of a
// problem...
Opm::Valgrind::CheckDefined(q);
Valgrind::CheckDefined(q);
block = 0.0;
for (unsigned eqIdx = 0; eqIdx < numModelEq; ++ eqIdx)
block[eqIdx][0] = - Opm::getValue(q[eqIdx])/dofVars.totalVolume;
block[eqIdx][0] = - getValue(q[eqIdx])/dofVars.totalVolume;
matrix.setBlock(gridDofIdx, wellGlobalDofIdx, block);
@ -1220,7 +1220,7 @@ public:
q[conti0EqIdx + eqIdx] += modelRate[conti0EqIdx + eqIdx];
}
Opm::Valgrind::CheckDefined(q);
Valgrind::CheckDefined(q);
}
protected:
@ -1259,7 +1259,7 @@ protected:
const BhpEval& bottomHolePressure,
const DofVariables& dofVars) const
{
typedef Opm::MathToolbox<Evaluation> DofVarsToolbox;
typedef MathToolbox<Evaluation> DofVarsToolbox;
typedef typename std::conditional<std::is_same<BhpEval, Scalar>::value,
ResultEval,
Scalar>::type DofEval;
@ -1312,13 +1312,13 @@ protected:
else
throw std::logic_error("Type of well \""+name()+"\" is undefined");
Opm::Valgrind::CheckDefined(pbh);
Opm::Valgrind::CheckDefined(p);
Opm::Valgrind::CheckDefined(g);
Opm::Valgrind::CheckDefined(rho);
Opm::Valgrind::CheckDefined(lambda);
Opm::Valgrind::CheckDefined(depth);
Opm::Valgrind::CheckDefined(refDepth_);
Valgrind::CheckDefined(pbh);
Valgrind::CheckDefined(p);
Valgrind::CheckDefined(g);
Valgrind::CheckDefined(rho);
Valgrind::CheckDefined(lambda);
Valgrind::CheckDefined(depth);
Valgrind::CheckDefined(refDepth_);
// pressure in the borehole ("hole pressure") at the given location
ResultEval ph = pbh + rho*g*(depth - refDepth_);
@ -1326,9 +1326,9 @@ protected:
// volumetric reservoir rate for the phase
volRates[phaseIdx] = Twj*lambda*(ph - p);
Opm::Valgrind::CheckDefined(g);
Opm::Valgrind::CheckDefined(ph);
Opm::Valgrind::CheckDefined(volRates[phaseIdx]);
Valgrind::CheckDefined(g);
Valgrind::CheckDefined(ph);
Valgrind::CheckDefined(volRates[phaseIdx]);
}
}
@ -1577,7 +1577,7 @@ protected:
bool onBail = false;
// Newton-Raphson method
typedef Opm::DenseAd::Evaluation<Scalar, 1> BhpEval;
typedef DenseAd::Evaluation<Scalar, 1> BhpEval;
BhpEval bhpEval(bhpScalar);
bhpEval.setDerivative(0, 1.0);
@ -1587,8 +1587,8 @@ protected:
const auto& f = wellResidual_<BhpEval>(bhpEval);
if (std::abs(f.derivative(0)) < 1e-20)
throw Opm::NumericalIssue("Cannot determine the bottom hole pressure for well "+name()
+": Derivative of the well residual is too small");
throw NumericalIssue("Cannot determine the bottom hole pressure for well "+name()
+": Derivative of the well residual is too small");
Scalar delta = f.value()/f.derivative(0);
bhpEval.setValue(bhpEval.value() - delta);
@ -1606,8 +1606,8 @@ protected:
return bhpEval.value();
}
throw Opm::NumericalIssue("Could not determine the bottom hole pressure of well '"+name()
+"' within " + std::to_string(maxIter) + " iterations.");
throw NumericalIssue("Could not determine the bottom hole pressure of well '"+name()
+"' within " + std::to_string(maxIter) + " iterations.");
}
template <class BhpEval>
@ -1615,7 +1615,7 @@ protected:
const DofVariables *replacementDofVars = 0,
int replacedGridIdx = -1) const
{
typedef Opm::MathToolbox<BhpEval> BhpEvalToolbox;
typedef MathToolbox<BhpEval> BhpEvalToolbox;
// compute the volumetric reservoir and surface rates for the complete well
BhpEval resvRate = 0.0;
@ -1652,10 +1652,10 @@ protected:
// injectors. (i.e., the target bottom hole pressure is an upper limit for
// injectors and a lower limit for producers.) Note that with this approach, one
// of the limits must always be reached to get the well equation to zero...
Opm::Valgrind::CheckDefined(maximumSurfaceRate_);
Opm::Valgrind::CheckDefined(maximumReservoirRate_);
Opm::Valgrind::CheckDefined(surfaceRate);
Opm::Valgrind::CheckDefined(resvRate);
Valgrind::CheckDefined(maximumSurfaceRate_);
Valgrind::CheckDefined(maximumReservoirRate_);
Valgrind::CheckDefined(surfaceRate);
Valgrind::CheckDefined(resvRate);
BhpEval result = 1e30;
@ -1701,7 +1701,7 @@ protected:
std::string name_;
std::vector<DofVariables, Opm::aligned_allocator<DofVariables, alignof(DofVariables)> > dofVarsStore_;
std::vector<DofVariables, aligned_allocator<DofVariables, alignof(DofVariables)> > dofVarsStore_;
std::map<int, DofVariables*> dofVariables_;
// the number of times beginIteration*() was called for the current time step

View File

@ -84,9 +84,9 @@ class EclWellManager
typedef typename GridView::template Codim<0>::Entity Element;
typedef Opm::EclPeacemanWell<TypeTag> Well;
using Well = EclPeacemanWell<TypeTag>;
typedef std::map<int, std::pair<const Opm::Connection*, std::shared_ptr<Well> > > WellConnectionsMap;
typedef std::map<int, std::pair<const Connection*, std::shared_ptr<Well> > > WellConnectionsMap;
typedef Dune::FieldVector<Evaluation, numEq> EvalEqVector;
@ -102,12 +102,12 @@ public:
*/
void init()
{
const Opm::Schedule& deckSchedule = simulator_.vanguard().schedule();
const Schedule& deckSchedule = simulator_.vanguard().schedule();
const auto& summaryState = simulator_.vanguard().summaryState();
// create the wells which intersect with the current process' grid
for (size_t deckWellIdx = 0; deckWellIdx < deckSchedule.numWells(); ++deckWellIdx)
{
const Opm::Well deckWell = deckSchedule.getWellsatEnd()[deckWellIdx];
const auto& deckWell = deckSchedule.getWellsatEnd()[deckWellIdx];
const std::string& wellName = deckWell.name();
Scalar wellTemperature = 273.15 + 15.56; // [K]
if (deckWell.isInjector())
@ -132,8 +132,8 @@ public:
*/
void beginEpisode(bool wasRestarted=false)
{
const Opm::EclipseState& eclState = simulator_.vanguard().eclState();
const Opm::Schedule& deckSchedule = simulator_.vanguard().schedule();
const EclipseState& eclState = simulator_.vanguard().eclState();
const Schedule& deckSchedule = simulator_.vanguard().schedule();
const auto& summaryState = simulator_.vanguard().summaryState();
unsigned episodeIdx = simulator_.episodeIndex();
WellConnectionsMap wellCompMap;
@ -146,7 +146,7 @@ public:
// linearized system of equations
updateWellParameters_(episodeIdx, wellCompMap);
const std::vector<Opm::Well>& deckWells = deckSchedule.getWells(episodeIdx);
const auto& deckWells = deckSchedule.getWells(episodeIdx);
// set the injection data for the respective wells.
for (const auto& deckWell : deckWells) {
if (!hasWell(deckWell.name()))
@ -159,15 +159,15 @@ public:
auto deckWellStatus = deckWell.getStatus( );
switch (deckWellStatus) {
case Opm::Well::Status::AUTO:
case ::Opm::Well::Status::AUTO:
// TODO: for now, auto means open...
case Opm::Well::Status::OPEN:
case ::Opm::Well::Status::OPEN:
well->setWellStatus(Well::Open);
break;
case Opm::Well::Status::STOP:
case ::Opm::Well::Status::STOP:
well->setWellStatus(Well::Closed);
break;
case Opm::Well::Status::SHUT:
case ::Opm::Well::Status::SHUT:
well->setWellStatus(Well::Shut);
break;
}
@ -182,40 +182,41 @@ public:
well->setWellType(Well::Injector);
const auto controls = deckWell.injectionControls(summaryState);
switch (controls.injector_type) {
case Opm::InjectorType::WATER:
case InjectorType::WATER:
well->setInjectedPhaseIndex(FluidSystem::waterPhaseIdx);
break;
case Opm::InjectorType::GAS:
case InjectorType::GAS:
well->setInjectedPhaseIndex(FluidSystem::gasPhaseIdx);
break;
case Opm::InjectorType::OIL:
case InjectorType::OIL:
well->setInjectedPhaseIndex(FluidSystem::oilPhaseIdx);
break;
case Opm::InjectorType::MULTI:
case InjectorType::MULTI:
throw std::runtime_error("Not implemented: Multi-phase injector wells");
}
using InjectorCMode = ::Opm::Well::InjectorCMode;
switch (controls.cmode) {
case Opm::Well::InjectorCMode::RATE:
case InjectorCMode::RATE:
well->setControlMode(Well::ControlMode::VolumetricSurfaceRate);
break;
case Opm::Well::InjectorCMode::RESV:
case InjectorCMode::RESV:
well->setControlMode(Well::ControlMode::VolumetricReservoirRate);
break;
case Opm::Well::InjectorCMode::BHP:
case InjectorCMode::BHP:
well->setControlMode(Well::ControlMode::BottomHolePressure);
break;
case Opm::Well::InjectorCMode::THP:
case InjectorCMode::THP:
well->setControlMode(Well::ControlMode::TubingHeadPressure);
break;
case Opm::Well::InjectorCMode::GRUP:
case InjectorCMode::GRUP:
throw std::runtime_error("Not implemented: Well groups");
case Opm::Well::InjectorCMode::CMODE_UNDEFINED:
case InjectorCMode::CMODE_UNDEFINED:
std::cout << "Warning: Control mode of injection well " << well->name()
<< " is undefined. Assuming well to be shut.\n";
well->setWellStatus(Well::WellStatus::Shut);
@ -223,19 +224,19 @@ public:
}
switch (controls.injector_type) {
case Opm::InjectorType::WATER:
case InjectorType::WATER:
well->setVolumetricPhaseWeights(/*oil=*/0.0, /*gas=*/0.0, /*water=*/1.0);
break;
case Opm::InjectorType::OIL:
case InjectorType::OIL:
well->setVolumetricPhaseWeights(/*oil=*/1.0, /*gas=*/0.0, /*water=*/0.0);
break;
case Opm::InjectorType::GAS:
case InjectorType::GAS:
well->setVolumetricPhaseWeights(/*oil=*/0.0, /*gas=*/1.0, /*water=*/0.0);
break;
case Opm::InjectorType::MULTI:
case InjectorType::MULTI:
throw std::runtime_error("Not implemented: Multi-phase injection wells");
}
@ -252,54 +253,55 @@ public:
well->setWellType(Well::Producer);
const auto controls = deckWell.productionControls(summaryState);
using ProducerCMode = ::Opm::Well::ProducerCMode;
switch (controls.cmode) {
case Opm::Well::ProducerCMode::ORAT:
case ProducerCMode::ORAT:
well->setControlMode(Well::ControlMode::VolumetricSurfaceRate);
well->setVolumetricPhaseWeights(/*oil=*/1.0, /*gas=*/0.0, /*water=*/0.0);
well->setMaximumSurfaceRate(controls.oil_rate);
break;
case Opm::Well::ProducerCMode::GRAT:
case ProducerCMode::GRAT:
well->setControlMode(Well::ControlMode::VolumetricSurfaceRate);
well->setVolumetricPhaseWeights(/*oil=*/0.0, /*gas=*/1.0, /*water=*/0.0);
well->setMaximumSurfaceRate(controls.gas_rate);
break;
case Opm::Well::ProducerCMode::WRAT:
case ProducerCMode::WRAT:
well->setControlMode(Well::ControlMode::VolumetricSurfaceRate);
well->setVolumetricPhaseWeights(/*oil=*/0.0, /*gas=*/0.0, /*water=*/1.0);
well->setMaximumSurfaceRate(controls.water_rate);
break;
case Opm::Well::ProducerCMode::LRAT:
case ProducerCMode::LRAT:
well->setControlMode(Well::ControlMode::VolumetricSurfaceRate);
well->setVolumetricPhaseWeights(/*oil=*/1.0, /*gas=*/0.0, /*water=*/1.0);
well->setMaximumSurfaceRate(controls.liquid_rate);
break;
case Opm::Well::ProducerCMode::CRAT:
case ProducerCMode::CRAT:
throw std::runtime_error("Not implemented: Linearly combined rates");
case Opm::Well::ProducerCMode::RESV:
case ProducerCMode::RESV:
well->setControlMode(Well::ControlMode::VolumetricReservoirRate);
well->setVolumetricPhaseWeights(/*oil=*/1.0, /*gas=*/1.0, /*water=*/1.0);
well->setMaximumSurfaceRate(controls.resv_rate);
break;
case Opm::Well::ProducerCMode::BHP:
case ProducerCMode::BHP:
well->setControlMode(Well::ControlMode::BottomHolePressure);
break;
case Opm::Well::ProducerCMode::THP:
case ProducerCMode::THP:
well->setControlMode(Well::ControlMode::TubingHeadPressure);
break;
case Opm::Well::ProducerCMode::GRUP:
case ProducerCMode::GRUP:
throw std::runtime_error("Not implemented: Well groups");
case Opm::Well::ProducerCMode::NONE:
case ProducerCMode::NONE:
// fall-through
case Opm::Well::ProducerCMode::CMODE_UNDEFINED:
case ProducerCMode::CMODE_UNDEFINED:
std::cout << "Warning: Control mode of production well " << well->name()
<< " is undefined. Assuming well to be shut.";
well->setWellStatus(Well::WellStatus::Shut);
@ -531,11 +533,11 @@ public:
}
}
Opm::data::Wells wellData() const
data::Wells wellData() const
{
Opm::data::Wells wellDat;
data::Wells wellDat;
using rt = Opm::data::Rates::opt;
using rt = data::Rates::opt;
for (unsigned wellIdx = 0; wellIdx < numWells(); ++wellIdx) {
const auto& ebosWell = well(wellIdx);
auto& wellOut = wellDat[ebosWell->name()];
@ -564,9 +566,9 @@ public:
return wellDat;
}
Opm::data::GroupAndNetworkValues
data::GroupAndNetworkValues
groupAndNetworkData(const int /* reportStepIdx */,
const Opm::Schedule& /* sched */) const
const Schedule& /* sched */) const
{
return {};
}
@ -601,8 +603,8 @@ public:
* "Something" can either be the well topology (i.e., which grid blocks are contained
* in which well) or it can be a well parameter like the bottom hole pressure...
*/
bool wellsChanged(const Opm::EclipseState& eclState,
const Opm::Schedule& schedule,
bool wellsChanged(const EclipseState& eclState,
const Schedule& schedule,
unsigned reportStepIdx) const
{
if (wellTopologyChanged_(eclState, reportStepIdx))
@ -612,10 +614,10 @@ public:
// for the "until the universe dies" episode, the wells don't change
return false;
const Opm::Events& events = schedule[reportStepIdx].events();
return events.hasEvent(Opm::ScheduleEvents::PRODUCTION_UPDATE |
Opm::ScheduleEvents::INJECTION_UPDATE |
Opm::ScheduleEvents::WELL_STATUS_CHANGE );
const Events& events = schedule[reportStepIdx].events();
return events.hasEvent(ScheduleEvents::PRODUCTION_UPDATE |
ScheduleEvents::INJECTION_UPDATE |
ScheduleEvents::WELL_STATUS_CHANGE );
}
void initFromRestartFile(const RestartValue& restartValues OPM_UNUSED){
@ -682,8 +684,8 @@ public:
protected:
bool wellTopologyChanged_(const Opm::EclipseState& eclState OPM_UNUSED,
const Opm::Schedule& schedule,
bool wellTopologyChanged_(const EclipseState& eclState OPM_UNUSED,
const Schedule& schedule,
unsigned reportStepIdx) const
{
if (reportStepIdx == 0) {
@ -696,9 +698,9 @@ protected:
// for the "until the universe dies" episode, the wells don't change
return false;
const Opm::Events& events = schedule[reportStepIdx].events();
return events.hasEvent(Opm::ScheduleEvents::NEW_WELL |
Opm::ScheduleEvents::COMPLETION_CHANGE);
const Events& events = schedule[reportStepIdx].events();
return events.hasEvent(ScheduleEvents::NEW_WELL |
ScheduleEvents::COMPLETION_CHANGE);
}
void updateWellTopology_(unsigned reportStepIdx OPM_UNUSED,
@ -856,7 +858,7 @@ protected:
continue;
const auto& connInfo = wellConnections.at(cartesianDofIdx);
const Opm::Connection* connection = connInfo.first;
const Connection* connection = connInfo.first;
std::shared_ptr<Well> eclWell = connInfo.second;
eclWell->addDof(elemCtx, dofIdx);
eclWell->setConnectionTransmissibilityFactor(elemCtx, dofIdx, connection->CF());

View File

@ -91,21 +91,21 @@ namespace Opm {
namespace EQUIL {
typedef Opm::BlackOilFluidSystem<double> FluidSystemSimple;
using FluidSystemSimple = BlackOilFluidSystem<double>;
// Adjust oil pressure according to gas saturation and cap pressure
typedef Opm::SimpleModularFluidState<double,
/*numPhases=*/3,
/*numComponents=*/3,
FluidSystemSimple,
/*storePressure=*/false,
/*storeTemperature=*/false,
/*storeComposition=*/false,
/*storeFugacity=*/false,
/*storeSaturation=*/true,
/*storeDensity=*/false,
/*storeViscosity=*/false,
/*storeEnthalpy=*/false> SatOnlyFluidState;
using SatOnlyFluidState = SimpleModularFluidState<double,
/*numPhases=*/3,
/*numComponents=*/3,
FluidSystemSimple,
/*storePressure=*/false,
/*storeTemperature=*/false,
/*storeComposition=*/false,
/*storeFugacity=*/false,
/*storeSaturation=*/true,
/*storeDensity=*/false,
/*storeViscosity=*/false,
/*storeEnthalpy=*/false>;
/**
* Types and routines relating to phase mixing in
@ -236,7 +236,7 @@ public:
}
private:
typedef Opm::Tabulated1DFunction<double> RsVsDepthFunc;
using RsVsDepthFunc = Tabulated1DFunction<double>;
const int pvtRegionIdx_;
RsVsDepthFunc rsVsDepth_;
@ -304,7 +304,7 @@ public:
}
private:
typedef Opm::Tabulated1DFunction<double> PbubVsDepthFunc;
using PbubVsDepthFunc = Tabulated1DFunction<double>;
const int pvtRegionIdx_;
PbubVsDepthFunc pbubVsDepth_;
@ -372,7 +372,7 @@ public:
}
private:
typedef Opm::Tabulated1DFunction<double> PdewVsDepthFunc;
using PdewVsDepthFunc = Tabulated1DFunction<double>;
const int pvtRegionIdx_;
PdewVsDepthFunc pdewVsDepth_;
@ -440,7 +440,7 @@ public:
}
private:
typedef Opm::Tabulated1DFunction<double> RvVsDepthFunc;
using RvVsDepthFunc = Tabulated1DFunction<double>;
const int pvtRegionIdx_;
RvVsDepthFunc rvVsDepth_;
@ -614,7 +614,7 @@ private:
*/
class EquilReg
{
using TabulatedFunction = Opm::Tabulated1DFunction<double>;
using TabulatedFunction = Tabulated1DFunction<double>;
public:
/**
@ -625,7 +625,7 @@ public:
* \param[in] rv Calculator of vapourised oil-gas ratio.
* \param[in] pvtRegionIdx The pvt region index
*/
EquilReg(const Opm::EquilRecord& rec,
EquilReg(const EquilRecord& rec,
std::shared_ptr<Miscibility::RsFunction> rs,
std::shared_ptr<Miscibility::RsFunction> rv,
const TabulatedFunction& saltVdTable,
@ -715,7 +715,7 @@ public:
int pvtIdx() const { return this->pvtIdx_; }
private:
Opm::EquilRecord rec_; /**< Equilibration data */
EquilRecord rec_; /**< Equilibration data */
std::shared_ptr<Miscibility::RsFunction> rs_; /**< RS calculator */
std::shared_ptr<Miscibility::RsFunction> rv_; /**< RV calculator */
const TabulatedFunction& saltVdTable_;

View File

@ -150,7 +150,7 @@ namespace PhasePressODE {
template <class FluidSystem>
class Water
{
using TabulatedFunction = Opm::Tabulated1DFunction<double>;
using TabulatedFunction = Tabulated1DFunction<double>;
public:
Water(const double temp,
const TabulatedFunction& saltVdTable,
@ -1532,8 +1532,8 @@ std::pair<double,double> cellZMinMax(const Element& element)
} // namespace Details
namespace DeckDependent {
inline std::vector<Opm::EquilRecord>
getEquil(const Opm::EclipseState& state)
inline std::vector<EquilRecord>
getEquil(const EclipseState& state)
{
const auto& init = state.getInitConfig();
@ -1547,7 +1547,7 @@ getEquil(const Opm::EclipseState& state)
template<class GridView>
std::vector<int>
equilnum(const Opm::EclipseState& eclipseState,
equilnum(const EclipseState& eclipseState,
const GridView& gridview)
{
std::vector<int> eqlnum(gridview.size(0), 0);
@ -1573,10 +1573,10 @@ class InitialStateComputer
public:
template<class MaterialLawManager>
InitialStateComputer(MaterialLawManager& materialLawManager,
const Opm::EclipseState& eclipseState,
const EclipseState& eclipseState,
const GridView& gridView,
const CartesianIndexMapper& cartMapper,
const double grav = Opm::unit::gravity,
const double grav = unit::gravity,
const bool applySwatInit = true)
: temperature_(gridView.size(/*codim=*/0)),
saltConcentration_(gridView.size(/*codim=*/0)),
@ -1601,10 +1601,10 @@ public:
updateCellProps_(gridView, num_aquifers);
// Get the equilibration records.
const std::vector<Opm::EquilRecord> rec = getEquil(eclipseState);
const std::vector<EquilRecord> rec = getEquil(eclipseState);
const auto& tables = eclipseState.getTableManager();
// Create (inverse) region mapping.
const Opm::RegionMapping<> eqlmap(equilnum(eclipseState, gridView));
const RegionMapping<> eqlmap(equilnum(eclipseState, gridView));
const int invalidRegion = -1;
regionPvtIdx_.resize(rec.size(), invalidRegion);
setRegionPvtIdx(eclipseState, eqlmap);
@ -1619,17 +1619,17 @@ public:
}
const int pvtIdx = regionPvtIdx_[i];
if (!rec[i].liveOilInitConstantRs()) {
const Opm::TableContainer& rsvdTables = tables.getRsvdTables();
const Opm::TableContainer& pbvdTables = tables.getPbvdTables();
const TableContainer& rsvdTables = tables.getRsvdTables();
const TableContainer& pbvdTables = tables.getPbvdTables();
if (rsvdTables.size() > 0) {
const Opm::RsvdTable& rsvdTable = rsvdTables.getTable<Opm::RsvdTable>(i);
const RsvdTable& rsvdTable = rsvdTables.getTable<RsvdTable>(i);
std::vector<double> depthColumn = rsvdTable.getColumn("DEPTH").vectorCopy();
std::vector<double> rsColumn = rsvdTable.getColumn("RS").vectorCopy();
rsFunc_.push_back(std::make_shared<Miscibility::RsVD<FluidSystem>>(pvtIdx,
depthColumn, rsColumn));
} else if (pbvdTables.size() > 0) {
const Opm::PbvdTable& pbvdTable = pbvdTables.getTable<Opm::PbvdTable>(i);
const PbvdTable& pbvdTable = pbvdTables.getTable<PbvdTable>(i);
std::vector<double> depthColumn = pbvdTable.getColumn("DEPTH").vectorCopy();
std::vector<double> pbubColumn = pbvdTable.getColumn("PBUB").vectorCopy();
rsFunc_.push_back(std::make_shared<Miscibility::PBVD<FluidSystem>>(pvtIdx,
@ -1667,17 +1667,17 @@ public:
}
const int pvtIdx = regionPvtIdx_[i];
if (!rec[i].wetGasInitConstantRv()) {
const Opm::TableContainer& rvvdTables = tables.getRvvdTables();
const Opm::TableContainer& pdvdTables = tables.getPdvdTables();
const TableContainer& rvvdTables = tables.getRvvdTables();
const TableContainer& pdvdTables = tables.getPdvdTables();
if (rvvdTables.size() > 0) {
const Opm::RvvdTable& rvvdTable = rvvdTables.getTable<Opm::RvvdTable>(i);
const RvvdTable& rvvdTable = rvvdTables.getTable<RvvdTable>(i);
std::vector<double> depthColumn = rvvdTable.getColumn("DEPTH").vectorCopy();
std::vector<double> rvColumn = rvvdTable.getColumn("RV").vectorCopy();
rvFunc_.push_back(std::make_shared<Miscibility::RvVD<FluidSystem>>(pvtIdx,
depthColumn, rvColumn));
} else if (pdvdTables.size() > 0) {
const Opm::PdvdTable& pdvdTable = pdvdTables.getTable<Opm::PdvdTable>(i);
const PdvdTable& pdvdTable = pdvdTables.getTable<PdvdTable>(i);
std::vector<double> depthColumn = pdvdTable.getColumn("DEPTH").vectorCopy();
std::vector<double> pdewColumn = pdvdTable.getColumn("PDEW").vectorCopy();
rvFunc_.push_back(std::make_shared<Miscibility::PDVD<FluidSystem>>(pvtIdx,
@ -1734,18 +1734,18 @@ public:
private:
void updateInitialTemperature_(const Opm::EclipseState& eclState)
void updateInitialTemperature_(const EclipseState& eclState)
{
this->temperature_ = eclState.fieldProps().get_double("TEMPI");
}
template <class RMap>
void updateInitialSaltConcentration_(const Opm::EclipseState& eclState, const RMap& reg)
void updateInitialSaltConcentration_(const EclipseState& eclState, const RMap& reg)
{
const int numEquilReg = rsFunc_.size();
saltVdTable_.resize(numEquilReg);
const auto& tables = eclState.getTableManager();
const Opm::TableContainer& saltvdTables = tables.getSaltvdTables();
const TableContainer& saltvdTables = tables.getSaltvdTables();
// If no saltvd table is given, we create a trivial table for the density calculations
if (saltvdTables.empty()) {
@ -1756,7 +1756,7 @@ private:
}
} else {
for (size_t i = 0; i < saltvdTables.size(); ++i) {
const Opm::SaltvdTable& saltvdTable = saltvdTables.getTable<Opm::SaltvdTable>(i);
const SaltvdTable& saltvdTable = saltvdTables.getTable<SaltvdTable>(i);
saltVdTable_[i].setXYContainers(saltvdTable.getDepthColumn(), saltvdTable.getSaltColumn());
const auto& cells = reg.cells(i);
@ -1770,7 +1770,7 @@ private:
std::vector< std::shared_ptr<Miscibility::RsFunction> > rsFunc_;
std::vector< std::shared_ptr<Miscibility::RsFunction> > rvFunc_;
using TabulatedFunction = Opm::Tabulated1DFunction<double>;
using TabulatedFunction = Tabulated1DFunction<double>;
std::vector<TabulatedFunction> saltVdTable_;
std::vector<int> regionPvtIdx_;
Vec temperature_;
@ -1868,7 +1868,7 @@ private:
}
}
template<class RMap>
void setRegionPvtIdx(const Opm::EclipseState& eclState, const RMap& reg)
void setRegionPvtIdx(const EclipseState& eclState, const RMap& reg)
{
const auto& pvtnumData = eclState.fieldProps().get_int("PVTNUM");
@ -1880,7 +1880,7 @@ private:
template <class RMap, class MaterialLawManager, class Comm>
void calcPressSatRsRv(const RMap& reg,
const std::vector<Opm::EquilRecord>& rec,
const std::vector<EquilRecord>& rec,
MaterialLawManager& materialLawManager,
const Comm& comm,
const double grav)
@ -1942,8 +1942,8 @@ private:
if (comm.rank() == 0) {
for (size_t r = 0; r < rec.size(); ++r) {
if (regionIsEmpty[r]) //region is empty on all partitions
Opm::OpmLog::warning("Equilibration region " + std::to_string(r + 1)
+ " has no active cells");
OpmLog::warning("Equilibration region " + std::to_string(r + 1)
+ " has no active cells");
}
}
}

View File

@ -46,7 +46,7 @@ namespace detail {
std::vector<bool>
activePhases(const PU& pu)
{
const int maxnp = Opm::BlackoilPhases::MaxNumPhases;
const int maxnp = BlackoilPhases::MaxNumPhases;
std::vector<bool> active(maxnp, false);
for (int p = 0; p < pu.MaxNumPhases; ++p) {
@ -62,7 +62,7 @@ namespace detail {
std::vector<int>
active2Canonical(const PU& pu)
{
const int maxnp = Opm::BlackoilPhases::MaxNumPhases;
const int maxnp = BlackoilPhases::MaxNumPhases;
std::vector<int> act2can(maxnp, -1);
for (int phase = 0; phase < maxnp; ++phase) {
@ -110,7 +110,7 @@ namespace detail {
auto component_container =
boost::make_iterator_range(it, end);
info.computeReduction(component_container,
Opm::Reduction::makeInnerProductFunctor<double>(),
Reduction::makeInnerProductFunctor<double>(),
product);
}
else

View File

@ -88,7 +88,7 @@ enum ExcEnum {
private:
std::vector<Message> messages_;
friend Opm::DeferredLogger gatherDeferredLogger(const Opm::DeferredLogger& local_deferredlogger);
friend DeferredLogger gatherDeferredLogger(const DeferredLogger& local_deferredlogger);
};
} // namespace Opm

View File

@ -91,9 +91,9 @@ namespace Opm
using Base::has_brine;
using Base::has_energy;
using PolymerModule = Opm::BlackOilPolymerModule<TypeTag>;
using FoamModule = Opm::BlackOilFoamModule<TypeTag>;
using BrineModule = Opm::BlackOilBrineModule<TypeTag>;
using PolymerModule = BlackOilPolymerModule<TypeTag>;
using FoamModule = BlackOilFoamModule<TypeTag>;
using BrineModule = BlackOilBrineModule<TypeTag>;
static const int numSolventEq = Indices::numSolvents;
@ -183,12 +183,12 @@ namespace Opm
void updateWellStateWithTarget(const Simulator& ebos_simulator,
WellState& well_state,
Opm::DeferredLogger& deferred_logger) const;
DeferredLogger& deferred_logger) const;
/// check whether the well equations get converged for this well
virtual ConvergenceReport getWellConvergence(const WellState& well_state,
const std::vector<double>& B_avg,
Opm::DeferredLogger& deferred_logger,
DeferredLogger& deferred_logger,
const bool relax_tolerance = false) const override;
/// Ax = Ax - C D^-1 B x
@ -208,21 +208,21 @@ namespace Opm
/// xw to update Well State
virtual void recoverWellSolutionAndUpdateWellState(const BVector& x,
WellState& well_state,
Opm::DeferredLogger& deferred_logger) const override;
DeferredLogger& deferred_logger) const override;
/// computing the well potentials for group control
virtual void computeWellPotentials(const Simulator& ebosSimulator,
const WellState& well_state,
std::vector<double>& well_potentials,
Opm::DeferredLogger& deferred_logger) /* const */ override;
DeferredLogger& deferred_logger) /* const */ override;
virtual void updatePrimaryVariables(const WellState& well_state, Opm::DeferredLogger& deferred_logger) const override;
virtual void updatePrimaryVariables(const WellState& well_state, DeferredLogger& deferred_logger) const override;
virtual void solveEqAndUpdateWellState(WellState& well_state, Opm::DeferredLogger& deferred_logger) override;
virtual void solveEqAndUpdateWellState(WellState& well_state, DeferredLogger& deferred_logger) override;
virtual void calculateExplicitQuantities(const Simulator& ebosSimulator,
const WellState& well_state,
Opm::DeferredLogger& deferred_logger) override; // should be const?
DeferredLogger& deferred_logger) override; // should be const?
virtual void updateProductivityIndex(const Simulator& ebosSimulator,
const WellProdIndexCalculator& wellPICalc,
@ -238,7 +238,7 @@ namespace Opm
const Well::ProductionControls& prod_controls,
WellState& well_state,
const GroupState& group_state,
Opm::DeferredLogger& deferred_logger) override;
DeferredLogger& deferred_logger) override;
/// \brief Wether the Jacobian will also have well contributions in it.
virtual bool jacobianContainsWellContributions() const override
@ -268,7 +268,7 @@ namespace Opm
void gliftDebug(
const std::string &msg,
Opm::DeferredLogger& deferred_logger) const;
DeferredLogger& deferred_logger) const;
void gasLiftOptimizeProduction(
const Simulator& ebosSimulator,
@ -303,7 +303,7 @@ namespace Opm
const Simulator& ebosSimulator,
const double& bhp,
std::vector<double>& well_flux,
Opm::DeferredLogger& deferred_logger) const;
DeferredLogger& deferred_logger) const;
// NOTE: These cannot be protected since they are used by GasLiftRuntime
using Base::phaseUsage;
@ -435,7 +435,7 @@ namespace Opm
// updating the well_state based on well solution dwells
void updateWellState(const BVectorWell& dwells,
WellState& well_state,
Opm::DeferredLogger& deferred_logger) const;
DeferredLogger& deferred_logger) const;
// calculate the properties for the well connections
// to calulate the pressure difference between well connections.
@ -478,20 +478,20 @@ namespace Opm
std::vector<EvalWell>& cq_s,
double& perf_dis_gas_rate,
double& perf_vap_oil_rate,
Opm::DeferredLogger& deferred_logger) const;
DeferredLogger& deferred_logger) const;
void computeWellRatesWithBhpPotential(const Simulator& ebosSimulator,
const double& bhp,
std::vector<double>& well_flux,
Opm::DeferredLogger& deferred_logger);
DeferredLogger& deferred_logger);
std::vector<double> computeWellPotentialWithTHP(
const Simulator& ebosSimulator,
Opm::DeferredLogger& deferred_logger,
DeferredLogger& deferred_logger,
const WellState &well_state) const;
double calculateThpFromBhp(const WellState &well_state, const std::vector<double>& rates, const double bhp, Opm::DeferredLogger& deferred_logger) const;
double calculateThpFromBhp(const WellState &well_state, const std::vector<double>& rates, const double bhp, DeferredLogger& deferred_logger) const;
virtual double getRefDensity() const override;
@ -499,12 +499,12 @@ namespace Opm
void getMobility(const Simulator& ebosSimulator,
const int perf,
std::vector<EvalWell>& mob,
Opm::DeferredLogger& deferred_logger) const;
DeferredLogger& deferred_logger) const;
void updateWaterMobilityWithPolymer(const Simulator& ebos_simulator,
const int perf,
std::vector<EvalWell>& mob_water,
Opm::DeferredLogger& deferred_logger) const;
DeferredLogger& deferred_logger) const;
void updatePrimaryVariablesNewton(const BVectorWell& dwells,
const WellState& well_state) const;
@ -513,16 +513,16 @@ namespace Opm
void updateExtraPrimaryVariables(const BVectorWell& dwells) const;
void updateWellStateFromPrimaryVariables(WellState& well_state, Opm::DeferredLogger& deferred_logger) const;
void updateWellStateFromPrimaryVariables(WellState& well_state, DeferredLogger& deferred_logger) const;
void updateThp(WellState& well_state, Opm::DeferredLogger& deferred_logger) const;
void updateThp(WellState& well_state, DeferredLogger& deferred_logger) const;
void assembleControlEq(const WellState& well_state,
const GroupState& group_state,
const Opm::Schedule& schedule,
const Schedule& schedule,
const SummaryState& summaryState,
Opm::DeferredLogger& deferred_logger);
DeferredLogger& deferred_logger);
// handle the non reasonable fractions due to numerical overshoot
void processFractions() const;
@ -534,13 +534,13 @@ namespace Opm
const Well::ProductionControls& prod_controls,
WellState& well_state,
const GroupState& group_state,
Opm::DeferredLogger& deferred_logger) override;
DeferredLogger& deferred_logger) override;
void assembleWellEqWithoutIterationImpl(const Simulator& ebosSimulator,
const double dt,
WellState& well_state,
const GroupState& group_state,
Opm::DeferredLogger& deferred_logger);
DeferredLogger& deferred_logger);
void calculateSinglePerf(const Simulator& ebosSimulator,
const int perf,
@ -549,16 +549,16 @@ namespace Opm
std::vector<EvalWell>& cq_s,
EvalWell& water_flux_s,
EvalWell& cq_s_zfrac_effective,
Opm::DeferredLogger& deferred_logger) const;
DeferredLogger& deferred_logger) const;
// check whether the well is operable under BHP limit with current reservoir condition
virtual void checkOperabilityUnderBHPLimitProducer(const WellState& well_state, const Simulator& ebos_simulator, Opm::DeferredLogger& deferred_logger) override;
virtual void checkOperabilityUnderBHPLimitProducer(const WellState& well_state, const Simulator& ebos_simulator, DeferredLogger& deferred_logger) override;
// check whether the well is operable under THP limit with current reservoir condition
virtual void checkOperabilityUnderTHPLimitProducer(const Simulator& ebos_simulator, const WellState& well_state, Opm::DeferredLogger& deferred_logger) override;
virtual void checkOperabilityUnderTHPLimitProducer(const Simulator& ebos_simulator, const WellState& well_state, DeferredLogger& deferred_logger) override;
// updating the inflow based on the current reservoir condition
virtual void updateIPR(const Simulator& ebos_simulator, Opm::DeferredLogger& deferred_logger) const override;
virtual void updateIPR(const Simulator& ebos_simulator, DeferredLogger& deferred_logger) const override;
// for a well, when all drawdown are in the wrong direction, then this well will not
// be able to produce/inject .
@ -567,7 +567,7 @@ namespace Opm
// whether the well can produce / inject based on the current well state (bhp)
bool canProduceInjectWithCurrentBhp(const Simulator& ebos_simulator,
const WellState& well_state,
Opm::DeferredLogger& deferred_logger);
DeferredLogger& deferred_logger);
// turn on crossflow to avoid singular well equations
// when the well is banned from cross-flow and the BHP is not properly initialized,
@ -596,17 +596,17 @@ namespace Opm
EvalWell pskin(const double throuhgput,
const EvalWell& water_velocity,
const EvalWell& poly_inj_conc,
Opm::DeferredLogger& deferred_logger) const;
DeferredLogger& deferred_logger) const;
// calculate the skin pressure based on water velocity, throughput during water injection.
EvalWell pskinwater(const double throughput,
const EvalWell& water_velocity,
Opm::DeferredLogger& deferred_logger) const;
DeferredLogger& deferred_logger) const;
// calculate the injecting polymer molecular weight based on the througput and water velocity
EvalWell wpolymermw(const double throughput,
const EvalWell& water_velocity,
Opm::DeferredLogger& deferred_logger) const;
DeferredLogger& deferred_logger) const;
// modify the water rate for polymer injectivity study
void handleInjectivityRate(const Simulator& ebosSimulator,
@ -618,7 +618,7 @@ namespace Opm
const WellState& well_state,
const int perf,
const EvalWell& water_flux_s,
Opm::DeferredLogger& deferred_logger);
DeferredLogger& deferred_logger);
virtual void updateWaterThroughput(const double dt, WellState& well_state) const override;

View File

@ -376,7 +376,7 @@ namespace Opm
std::vector<EvalWell>& cq_s,
double& perf_dis_gas_rate,
double& perf_vap_oil_rate,
Opm::DeferredLogger& deferred_logger) const
DeferredLogger& deferred_logger) const
{
const auto& fs = intQuants.fluidState();
@ -486,7 +486,7 @@ namespace Opm
const EvalWell d = EvalWell(numWellEq_ + numEq, 1.0) - rv * rs;
if (d.value() == 0.0) {
OPM_DEFLOG_THROW(Opm::NumericalIssue, "Zero d value obtained for well " << name() << " during flux calcuation"
OPM_DEFLOG_THROW(NumericalIssue, "Zero d value obtained for well " << name() << " during flux calcuation"
<< " with rs " << rs << " and rv " << rv, deferred_logger);
}
@ -552,7 +552,7 @@ namespace Opm
const Well::ProductionControls& /*prod_controls*/,
WellState& well_state,
const GroupState& group_state,
Opm::DeferredLogger& deferred_logger)
DeferredLogger& deferred_logger)
{
// TODO: only_wells should be put back to save some computation
// for example, the matrices B C does not need to update if only_wells
@ -577,7 +577,7 @@ namespace Opm
const double dt,
WellState& well_state,
const GroupState& group_state,
Opm::DeferredLogger& deferred_logger)
DeferredLogger& deferred_logger)
{
// TODO: it probably can be static member for StandardWell
@ -664,7 +664,7 @@ namespace Opm
}
const auto& summaryState = ebosSimulator.vanguard().summaryState();
const Opm::Schedule& schedule = ebosSimulator.vanguard().schedule();
const Schedule& schedule = ebosSimulator.vanguard().schedule();
assembleControlEq(well_state, group_state, schedule, summaryState, deferred_logger);
@ -672,7 +672,7 @@ namespace Opm
try {
Dune::ISTLUtility::invertMatrix(invDuneD_[0][0]);
} catch( ... ) {
OPM_DEFLOG_THROW(Opm::NumericalIssue,"Error when inverting local well equations for well " + name(), deferred_logger);
OPM_DEFLOG_THROW(NumericalIssue,"Error when inverting local well equations for well " + name(), deferred_logger);
}
}
@ -689,7 +689,7 @@ namespace Opm
std::vector<EvalWell>& cq_s,
EvalWell& water_flux_s,
EvalWell& cq_s_zfrac_effective,
Opm::DeferredLogger& deferred_logger) const
DeferredLogger& deferred_logger) const
{
const bool allow_cf = getAllowCrossFlow() || openCrossFlowAvoidSingularity(ebosSimulator);
const EvalWell& bhp = getBhp();
@ -863,9 +863,9 @@ namespace Opm
void
StandardWell<TypeTag>::assembleControlEq(const WellState& well_state,
const GroupState& group_state,
const Opm::Schedule& schedule,
const Schedule& schedule,
const SummaryState& summaryState,
Opm::DeferredLogger& deferred_logger)
DeferredLogger& deferred_logger)
{
EvalWell control_eq(numWellEq_ + numEq, 0.0);
@ -927,7 +927,7 @@ namespace Opm
getMobility(const Simulator& ebosSimulator,
const int perf,
std::vector<EvalWell>& mob,
Opm::DeferredLogger& deferred_logger) const
DeferredLogger& deferred_logger) const
{
const int cell_idx = well_cells_[perf];
assert (int(mob.size()) == num_components_);
@ -999,7 +999,7 @@ namespace Opm
StandardWell<TypeTag>::
updateWellState(const BVectorWell& dwells,
WellState& well_state,
Opm::DeferredLogger& deferred_logger) const
DeferredLogger& deferred_logger) const
{
if (!this->isOperable() && !this->wellIsStopped()) return;
@ -1068,7 +1068,7 @@ namespace Opm
#ifndef NDEBUG
for (double v : primary_variables_) {
assert(Opm::isfinite(v));
assert(isfinite(v));
}
#endif
@ -1207,7 +1207,7 @@ namespace Opm
template<typename TypeTag>
void
StandardWell<TypeTag>::
updateWellStateFromPrimaryVariables(WellState& well_state, Opm::DeferredLogger& deferred_logger) const
updateWellStateFromPrimaryVariables(WellState& well_state, DeferredLogger& deferred_logger) const
{
const PhaseUsage& pu = phaseUsage();
std::vector<double> F(number_of_phases_, 0.0);
@ -1321,7 +1321,7 @@ namespace Opm
template<typename TypeTag>
void
StandardWell<TypeTag>::
updateThp(WellState& well_state, Opm::DeferredLogger& deferred_logger) const
updateThp(WellState& well_state, DeferredLogger& deferred_logger) const
{
// When there is no vaild VFP table provided, we set the thp to be zero.
if (!this->isVFPActive(deferred_logger) || this->wellIsStopped()) {
@ -1332,7 +1332,7 @@ namespace Opm
// the well is under other control types, we calculate the thp based on bhp and rates
std::vector<double> rates(3, 0.0);
const Opm::PhaseUsage& pu = phaseUsage();
const PhaseUsage& pu = phaseUsage();
if (FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx)) {
rates[ Water ] = well_state.wellRates(index_of_well_)[pu.phase_pos[ Water ] ];
}
@ -1358,7 +1358,7 @@ namespace Opm
StandardWell<TypeTag>::
updateWellStateWithTarget(const Simulator& ebos_simulator,
WellState& well_state,
Opm::DeferredLogger& deferred_logger) const
DeferredLogger& deferred_logger) const
{
Base::updateWellStateWithTarget(ebos_simulator, well_state, deferred_logger);
}
@ -1370,7 +1370,7 @@ namespace Opm
template<typename TypeTag>
void
StandardWell<TypeTag>::
updateIPR(const Simulator& ebos_simulator, Opm::DeferredLogger& deferred_logger) const
updateIPR(const Simulator& ebos_simulator, DeferredLogger& deferred_logger) const
{
// TODO: not handling solvent related here for now
@ -1466,7 +1466,7 @@ namespace Opm
template<typename TypeTag>
void
StandardWell<TypeTag>::
checkOperabilityUnderBHPLimitProducer(const WellState& well_state, const Simulator& ebos_simulator, Opm::DeferredLogger& deferred_logger)
checkOperabilityUnderBHPLimitProducer(const WellState& well_state, const Simulator& ebos_simulator, DeferredLogger& deferred_logger)
{
const auto& summaryState = ebos_simulator.vanguard().summaryState();
const double bhp_limit = mostStrictBhpFromBhpLimits(summaryState);
@ -1520,7 +1520,7 @@ namespace Opm
template<typename TypeTag>
void
StandardWell<TypeTag>::
checkOperabilityUnderTHPLimitProducer(const Simulator& ebos_simulator, const WellState& well_state, Opm::DeferredLogger& deferred_logger)
checkOperabilityUnderTHPLimitProducer(const Simulator& ebos_simulator, const WellState& well_state, DeferredLogger& deferred_logger)
{
const auto& summaryState = ebos_simulator.vanguard().summaryState();
const auto obtain_bhp = computeBhpAtThpLimitProd(well_state, ebos_simulator, summaryState, deferred_logger);
@ -1602,7 +1602,7 @@ namespace Opm
StandardWell<TypeTag>::
canProduceInjectWithCurrentBhp(const Simulator& ebos_simulator,
const WellState& well_state,
Opm::DeferredLogger& deferred_logger)
DeferredLogger& deferred_logger)
{
const double bhp = well_state.bhp(index_of_well_);
std::vector<double> well_rates;
@ -1960,7 +1960,7 @@ namespace Opm
StandardWell<TypeTag>::
getWellConvergence(const WellState& well_state,
const std::vector<double>& B_avg,
Opm::DeferredLogger& deferred_logger,
DeferredLogger& deferred_logger,
const bool /*relax_tolerance*/) const
{
// the following implementation assume that the polymer is always after the w-o-g phases
@ -2185,7 +2185,7 @@ namespace Opm
template<typename TypeTag>
void
StandardWell<TypeTag>::
solveEqAndUpdateWellState(WellState& well_state, Opm::DeferredLogger& deferred_logger)
solveEqAndUpdateWellState(WellState& well_state, DeferredLogger& deferred_logger)
{
if (!this->isOperable() && !this->wellIsStopped()) return;
@ -2207,7 +2207,7 @@ namespace Opm
StandardWell<TypeTag>::
calculateExplicitQuantities(const Simulator& ebosSimulator,
const WellState& well_state,
Opm::DeferredLogger& deferred_logger)
DeferredLogger& deferred_logger)
{
updatePrimaryVariables(well_state, deferred_logger);
initPrimaryVariablesEvaluation();
@ -2361,7 +2361,7 @@ namespace Opm
StandardWell<TypeTag>::
recoverWellSolutionAndUpdateWellState(const BVector& x,
WellState& well_state,
Opm::DeferredLogger& deferred_logger) const
DeferredLogger& deferred_logger) const
{
if (!this->isOperable() && !this->wellIsStopped()) return;
@ -2381,7 +2381,7 @@ namespace Opm
computeWellRatesWithBhp(const Simulator& ebosSimulator,
const double& bhp,
std::vector<double>& well_flux,
Opm::DeferredLogger& deferred_logger) const
DeferredLogger& deferred_logger) const
{
const int np = number_of_phases_;
@ -2419,7 +2419,7 @@ namespace Opm
computeWellRatesWithBhpPotential(const Simulator& ebosSimulator,
const double& bhp,
std::vector<double>& well_flux,
Opm::DeferredLogger& deferred_logger)
DeferredLogger& deferred_logger)
{
// iterate to get a more accurate well density
@ -2459,7 +2459,7 @@ namespace Opm
std::vector<double>
StandardWell<TypeTag>::
computeWellPotentialWithTHP(const Simulator& ebos_simulator,
Opm::DeferredLogger& deferred_logger,
DeferredLogger& deferred_logger,
const WellState &well_state) const
{
std::vector<double> potentials(number_of_phases_, 0.0);
@ -2499,7 +2499,7 @@ namespace Opm
bool
StandardWell<TypeTag>::
doGasLiftOptimize(const WellState &well_state, const Simulator &ebos_simulator,
Opm::DeferredLogger& deferred_logger) const
DeferredLogger& deferred_logger) const
{
gliftDebug("checking if GLIFT should be done..", deferred_logger);
@ -2524,7 +2524,7 @@ namespace Opm
return false;
}
const int report_step_idx = ebos_simulator.episodeIndex();
const Opm::Schedule& schedule = ebos_simulator.vanguard().schedule();
const Schedule& schedule = ebos_simulator.vanguard().schedule();
const GasLiftOpt& glo = schedule.glo(report_step_idx);
if (!glo.has_well(name())) {
gliftDebug("Gas Lift not activated: WLIFTOPT is probably missing",
@ -2559,7 +2559,7 @@ namespace Opm
DeferredLogger& deferred_logger ) const
{
const int report_step_idx = ebos_simulator.episodeIndex();
const Opm::Schedule& schedule = ebos_simulator.vanguard().schedule();
const Schedule& schedule = ebos_simulator.vanguard().schedule();
const GasLiftOpt& glo = schedule.glo(report_step_idx);
const int iteration_idx = ebos_simulator.model().newtonMethod().numIterations();
if (glo.all_newton()) {
@ -2647,7 +2647,7 @@ namespace Opm
gasLiftOptimizationStage1(
WellState& well_state,
const Simulator& ebos_simulator,
Opm::DeferredLogger& deferred_logger,
DeferredLogger& deferred_logger,
GLiftProdWells &prod_wells,
GLiftOptWells &glift_wells,
GLiftWellStateMap &glift_state_map
@ -2681,7 +2681,7 @@ namespace Opm
computeWellPotentials(const Simulator& ebosSimulator,
const WellState& well_state,
std::vector<double>& well_potentials,
Opm::DeferredLogger& deferred_logger) // const
DeferredLogger& deferred_logger) // const
{
const int np = number_of_phases_;
well_potentials.resize(np, 0.0);
@ -2716,7 +2716,7 @@ namespace Opm
template<typename TypeTag>
void
StandardWell<TypeTag>::
updatePrimaryVariables(const WellState& well_state, Opm::DeferredLogger& deferred_logger) const
updatePrimaryVariables(const WellState& well_state, DeferredLogger& deferred_logger) const
{
if (!this->isOperable() && !this->wellIsStopped()) return;
@ -2821,7 +2821,7 @@ namespace Opm
}
#ifndef NDEBUG
for (double v : primary_variables_) {
assert(Opm::isfinite(v));
assert(isfinite(v));
}
#endif
}
@ -2834,7 +2834,7 @@ namespace Opm
StandardWell<TypeTag>::
calculateThpFromBhp(const WellState &well_state, const std::vector<double>& rates,
const double bhp,
Opm::DeferredLogger& deferred_logger) const
DeferredLogger& deferred_logger) const
{
assert(int(rates.size()) == 3); // the vfp related only supports three phases now.
@ -2886,7 +2886,7 @@ namespace Opm
updateWaterMobilityWithPolymer(const Simulator& ebos_simulator,
const int perf,
std::vector<EvalWell>& mob,
Opm::DeferredLogger& deferred_logger) const
DeferredLogger& deferred_logger) const
{
const int cell_idx = well_cells_[perf];
const auto& int_quant = *(ebos_simulator.model().cachedIntensiveQuantities(cell_idx, /*timeIdx=*/ 0));
@ -2928,7 +2928,7 @@ namespace Opm
const EvalWell poro = extendEval(int_quant.porosity());
const EvalWell sw = extendEval(int_quant.fluidState().saturation(FluidSystem::waterPhaseIdx));
// guard against zero porosity and no water
const EvalWell denom = Opm::max( (area * poro * (sw - swcr)), 1e-12);
const EvalWell denom = max( (area * poro * (sw - swcr)), 1e-12);
const unsigned waterCompIdx = Indices::canonicalToActiveComponentIndex(FluidSystem::waterCompIdx);
EvalWell water_velocity = cq_s[waterCompIdx] / denom * extendEval(int_quant.fluidState().invB(FluidSystem::waterPhaseIdx));
@ -3082,7 +3082,7 @@ namespace Opm
StandardWell<TypeTag>::
pskinwater(const double throughput,
const EvalWell& water_velocity,
Opm::DeferredLogger& deferred_logger) const
DeferredLogger& deferred_logger) const
{
if constexpr (Base::has_polymermw) {
const int water_table_id = well_ecl_.getPolymerProperties().m_skprwattable;
@ -3111,11 +3111,11 @@ namespace Opm
pskin(const double throughput,
const EvalWell& water_velocity,
const EvalWell& poly_inj_conc,
Opm::DeferredLogger& deferred_logger) const
DeferredLogger& deferred_logger) const
{
if constexpr (Base::has_polymermw) {
const double sign = water_velocity >= 0. ? 1.0 : -1.0;
const EvalWell water_velocity_abs = Opm::abs(water_velocity);
const EvalWell water_velocity_abs = abs(water_velocity);
if (poly_inj_conc == 0.) {
return sign * pskinwater(throughput, water_velocity_abs, deferred_logger);
}
@ -3151,7 +3151,7 @@ namespace Opm
StandardWell<TypeTag>::
wpolymermw(const double throughput,
const EvalWell& water_velocity,
Opm::DeferredLogger& deferred_logger) const
DeferredLogger& deferred_logger) const
{
if constexpr (Base::has_polymermw) {
const int table_id = well_ecl_.getPolymerProperties().m_plymwinjtable;
@ -3161,7 +3161,7 @@ namespace Opm
if (wpolymer() == 0.) { // not injecting polymer
return molecular_weight;
}
molecular_weight = table_func.eval(throughput_eval, Opm::abs(water_velocity));
molecular_weight = table_func.eval(throughput_eval, abs(water_velocity));
return molecular_weight;
} else {
OPM_DEFLOG_THROW(std::runtime_error, "Polymermw is not activated, "
@ -3226,7 +3226,7 @@ namespace Opm
const WellState& well_state,
const int perf,
const EvalWell& water_flux_s,
Opm::DeferredLogger& deferred_logger)
DeferredLogger& deferred_logger)
{
const int cell_idx = well_cells_[perf];
const auto& int_quants = *(ebosSimulator.model().cachedIntensiveQuantities(cell_idx, /*timeIdx=*/ 0));
@ -3875,7 +3875,7 @@ namespace Opm
const Well::ProductionControls& prod_controls,
WellState& well_state,
const GroupState& group_state,
Opm::DeferredLogger& deferred_logger)
DeferredLogger& deferred_logger)
{
const int max_iter = param_.max_inner_iter_wells_;
int it = 0;
@ -4009,7 +4009,7 @@ namespace Opm
phase_pos = pu.phase_pos[Water];
}
else {
OPM_DEFLOG_THROW(Opm::NotImplemented,
OPM_DEFLOG_THROW(NotImplemented,
"Unsupported Injector Type ("
<< static_cast<int>(preferred_phase)
<< ") for well " << this->name()