mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
BlackoilWellModel: move assignWellTracerRates to generic class
This commit is contained in:
parent
815bb7a493
commit
7ab8d94215
@ -256,7 +256,9 @@ namespace Opm {
|
||||
return this->wasDynamicallyShutThisTimeStep(well_index);
|
||||
});
|
||||
|
||||
this->assignWellTracerRates(wsrpt);
|
||||
const auto& tracerRates = ebosSimulator_.problem().tracerModel().getWellTracerRates();
|
||||
this->assignWellTracerRates(wsrpt, tracerRates);
|
||||
|
||||
|
||||
BlackoilWellModelGuideRates(*this).assignWellGuideRates(wsrpt, this->reportStepIndex());
|
||||
this->assignShutConnections(wsrpt, this->reportStepIndex());
|
||||
@ -512,8 +514,6 @@ namespace Opm {
|
||||
|
||||
void computeWellTemperature();
|
||||
|
||||
void assignWellTracerRates(data::Wells& wsrpt) const;
|
||||
|
||||
int compressedIndexForInterior(int cartesian_cell_idx) const override {
|
||||
return ebosSimulator_.vanguard().compressedIndexForInterior(cartesian_cell_idx);
|
||||
}
|
||||
|
@ -1349,4 +1349,24 @@ BlackoilWellModelGeneric::getWellsForTesting(const int timeStepIdx,
|
||||
return {};
|
||||
}
|
||||
|
||||
void
|
||||
BlackoilWellModelGeneric::
|
||||
assignWellTracerRates(data::Wells& wsrpt,
|
||||
const WellTracerRates& wellTracerRates) const
|
||||
{
|
||||
if (wellTracerRates.empty())
|
||||
return; // no tracers
|
||||
|
||||
for (const auto& wTR : wellTracerRates) {
|
||||
std::string wellName = wTR.first.first;
|
||||
auto xwPos = wsrpt.find(wellName);
|
||||
if (xwPos == wsrpt.end()) { // No well results.
|
||||
continue;
|
||||
}
|
||||
std::string tracerName = wTR.first.second;
|
||||
double rate = wTR.second;
|
||||
xwPos->second.rates.set(data::Rates::opt::tracer, rate, tracerName);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -386,6 +386,10 @@ protected:
|
||||
std::vector<std::string> getWellsForTesting(const int timeStepIdx,
|
||||
const double simulationTime);
|
||||
|
||||
using WellTracerRates = std::map<std::pair<std::string, std::string>, double>;
|
||||
void assignWellTracerRates(data::Wells& wsrpt,
|
||||
const WellTracerRates& wellTracerRates) const;
|
||||
|
||||
Schedule& schedule_;
|
||||
const SummaryState& summaryState_;
|
||||
const EclipseState& eclState_;
|
||||
|
@ -1330,7 +1330,7 @@ namespace Opm {
|
||||
template<typename TypeTag>
|
||||
void
|
||||
BlackoilWellModel<TypeTag>::
|
||||
apply( BVector& r) const
|
||||
apply(BVector& r) const
|
||||
{
|
||||
for (auto& well : well_container_) {
|
||||
well->apply(r);
|
||||
@ -2311,29 +2311,6 @@ namespace Opm {
|
||||
|
||||
|
||||
|
||||
template <typename TypeTag>
|
||||
void
|
||||
BlackoilWellModel<TypeTag>::
|
||||
assignWellTracerRates(data::Wells& wsrpt) const
|
||||
{
|
||||
const auto & wellTracerRates = ebosSimulator_.problem().tracerModel().getWellTracerRates();
|
||||
|
||||
if (wellTracerRates.empty())
|
||||
return; // no tracers
|
||||
|
||||
for (const auto& wTR : wellTracerRates) {
|
||||
std::string wellName = wTR.first.first;
|
||||
auto xwPos = wsrpt.find(wellName);
|
||||
if (xwPos == wsrpt.end()) { // No well results.
|
||||
continue;
|
||||
}
|
||||
std::string tracerName = wTR.first.second;
|
||||
double rate = wTR.second;
|
||||
xwPos->second.rates.set(data::Rates::opt::tracer, rate, tracerName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template <typename TypeTag>
|
||||
void
|
||||
BlackoilWellModel<TypeTag>::
|
||||
|
Loading…
Reference in New Issue
Block a user