mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
fixed: do not use Opm:: prefix when inside namespace Opm
This commit is contained in:
@@ -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();
|
||||
|
@@ -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-
|
||||
///
|
||||
|
@@ -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>
|
||||
|
@@ -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
|
||||
|
@@ -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());
|
||||
|
@@ -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_;
|
||||
|
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user