mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #1638 from trinemykk/addtracer
add method for getting the surfacevolume well connection rate
This commit is contained in:
commit
cb06770b54
@ -194,6 +194,10 @@ namespace Opm {
|
|||||||
unsigned spaceIdx,
|
unsigned spaceIdx,
|
||||||
unsigned timeIdx) const;
|
unsigned timeIdx) const;
|
||||||
|
|
||||||
|
|
||||||
|
using WellInterfacePtr = std::shared_ptr<WellInterface<TypeTag> >;
|
||||||
|
WellInterfacePtr well(const std::string& wellName) const;
|
||||||
|
|
||||||
void initFromRestartFile(const RestartValue& restartValues);
|
void initFromRestartFile(const RestartValue& restartValues);
|
||||||
|
|
||||||
Opm::data::Wells wellData() const
|
Opm::data::Wells wellData() const
|
||||||
@ -276,7 +280,6 @@ namespace Opm {
|
|||||||
|
|
||||||
bool wells_active_;
|
bool wells_active_;
|
||||||
|
|
||||||
using WellInterfacePtr = std::unique_ptr<WellInterface<TypeTag> >;
|
|
||||||
// a vector of all the wells.
|
// a vector of all the wells.
|
||||||
std::vector<WellInterfacePtr > well_container_;
|
std::vector<WellInterfacePtr > well_container_;
|
||||||
|
|
||||||
|
@ -401,6 +401,22 @@ namespace Opm {
|
|||||||
well->addCellRates(rate, elemIdx);
|
well->addCellRates(rate, elemIdx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
template<typename TypeTag>
|
||||||
|
typename BlackoilWellModel<TypeTag>::WellInterfacePtr
|
||||||
|
BlackoilWellModel<TypeTag>::
|
||||||
|
well(const std::string& wellName) const
|
||||||
|
{
|
||||||
|
for (const auto& well : well_container_) {
|
||||||
|
if (well->name() == wellName) {
|
||||||
|
return well;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
OPM_THROW(std::invalid_argument, "The well with name " + wellName + " is not in the well Container");
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
template<typename TypeTag>
|
template<typename TypeTag>
|
||||||
void
|
void
|
||||||
BlackoilWellModel<TypeTag>::
|
BlackoilWellModel<TypeTag>::
|
||||||
|
@ -199,6 +199,9 @@ namespace Opm
|
|||||||
|
|
||||||
void addCellRates(RateVector& rates, int cellIdx) const;
|
void addCellRates(RateVector& rates, int cellIdx) const;
|
||||||
|
|
||||||
|
Scalar volumetricSurfaceRateForConnection(int cellIdx, int phaseIdx) const;
|
||||||
|
|
||||||
|
|
||||||
template <class EvalWell>
|
template <class EvalWell>
|
||||||
Eval restrictEval(const EvalWell& in) const
|
Eval restrictEval(const EvalWell& in) const
|
||||||
{
|
{
|
||||||
|
@ -1287,6 +1287,20 @@ namespace Opm
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename TypeTag>
|
||||||
|
typename WellInterface<TypeTag>::Scalar
|
||||||
|
WellInterface<TypeTag>::volumetricSurfaceRateForConnection(int cellIdx, int phaseIdx) const {
|
||||||
|
for (int perfIdx = 0; perfIdx < number_of_perforations_; ++perfIdx) {
|
||||||
|
if (cells()[perfIdx] == cellIdx) {
|
||||||
|
const unsigned activeCompIdx = Indices::canonicalToActiveComponentIndex(FluidSystem::solventComponentIndex(phaseIdx));
|
||||||
|
return connectionRates_[perfIdx][activeCompIdx].value();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
OPM_THROW(std::invalid_argument, "The well with name " + name()
|
||||||
|
+ " does not perforate cell " + std::to_string(cellIdx));
|
||||||
|
return 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user