mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
BlackoilWellModelGuideRates: template Scalar type
This commit is contained in:
@@ -263,7 +263,7 @@ namespace Opm {
|
|||||||
this->assignWellTracerRates(wsrpt, tracerRates);
|
this->assignWellTracerRates(wsrpt, tracerRates);
|
||||||
|
|
||||||
|
|
||||||
BlackoilWellModelGuideRates(*this).assignWellGuideRates(wsrpt, this->reportStepIndex());
|
BlackoilWellModelGuideRates<double>(*this).assignWellGuideRates(wsrpt, this->reportStepIndex());
|
||||||
this->assignShutConnections(wsrpt, this->reportStepIndex());
|
this->assignShutConnections(wsrpt, this->reportStepIndex());
|
||||||
|
|
||||||
return wsrpt;
|
return wsrpt;
|
||||||
|
|||||||
@@ -971,14 +971,14 @@ assignGroupValues(const int reportStepIdx,
|
|||||||
std::map<std::string, data::GroupData>& gvalues) const
|
std::map<std::string, data::GroupData>& gvalues) const
|
||||||
{
|
{
|
||||||
const auto groupGuideRates =
|
const auto groupGuideRates =
|
||||||
BlackoilWellModelGuideRates(*this).calculateAllGroupGuideRates(reportStepIdx);
|
BlackoilWellModelGuideRates<double>(*this).calculateAllGroupGuideRates(reportStepIdx);
|
||||||
|
|
||||||
for (const auto& gname : schedule_.groupNames(reportStepIdx)) {
|
for (const auto& gname : schedule_.groupNames(reportStepIdx)) {
|
||||||
const auto& grup = schedule_.getGroup(gname, reportStepIdx);
|
const auto& grup = schedule_.getGroup(gname, reportStepIdx);
|
||||||
|
|
||||||
auto& gdata = gvalues[gname];
|
auto& gdata = gvalues[gname];
|
||||||
this->assignGroupControl(grup, gdata);
|
this->assignGroupControl(grup, gdata);
|
||||||
BlackoilWellModelGuideRates(*this).assignGroupGuideRates(grup, groupGuideRates, gdata);
|
BlackoilWellModelGuideRates<double>(*this).assignGroupGuideRates(grup, groupGuideRates, gdata);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -283,8 +283,8 @@ const Opm::Well& GroupTreeWalker::getWell(std::string_view well) const
|
|||||||
|
|
||||||
namespace Opm {
|
namespace Opm {
|
||||||
|
|
||||||
void
|
template<class Scalar>
|
||||||
BlackoilWellModelGuideRates::
|
void BlackoilWellModelGuideRates<Scalar>::
|
||||||
getGuideRateValues(const GuideRate::RateVector& qs,
|
getGuideRateValues(const GuideRate::RateVector& qs,
|
||||||
const bool is_inj,
|
const bool is_inj,
|
||||||
const std::string& wgname,
|
const std::string& wgname,
|
||||||
@@ -309,8 +309,9 @@ getGuideRateValues(const GuideRate::RateVector& qs,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<class Scalar>
|
||||||
data::GuideRateValue
|
data::GuideRateValue
|
||||||
BlackoilWellModelGuideRates::
|
BlackoilWellModelGuideRates<Scalar>::
|
||||||
getGuideRateValues(const Well& well) const
|
getGuideRateValues(const Well& well) const
|
||||||
{
|
{
|
||||||
auto grval = data::GuideRateValue{};
|
auto grval = data::GuideRateValue{};
|
||||||
@@ -328,7 +329,7 @@ getGuideRateValues(const Well& well) const
|
|||||||
return grval;
|
return grval;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto qs = WellGroupHelpers<double>::
|
const auto qs = WellGroupHelpers<Scalar>::
|
||||||
getWellRateVector(wellModel_.wellState(), wellModel_.phaseUsage(), wname);
|
getWellRateVector(wellModel_.wellState(), wellModel_.phaseUsage(), wname);
|
||||||
|
|
||||||
this->getGuideRateValues(qs, well.isInjector(), wname, grval);
|
this->getGuideRateValues(qs, well.isInjector(), wname, grval);
|
||||||
@@ -336,8 +337,9 @@ getGuideRateValues(const Well& well) const
|
|||||||
return grval;
|
return grval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<class Scalar>
|
||||||
data::GuideRateValue
|
data::GuideRateValue
|
||||||
BlackoilWellModelGuideRates::
|
BlackoilWellModelGuideRates<Scalar>::
|
||||||
getGuideRateValues(const Group& group) const
|
getGuideRateValues(const Group& group) const
|
||||||
{
|
{
|
||||||
auto grval = data::GuideRateValue{};
|
auto grval = data::GuideRateValue{};
|
||||||
@@ -355,7 +357,7 @@ getGuideRateValues(const Group& group) const
|
|||||||
return grval;
|
return grval;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto qs = WellGroupHelpers<double>::
|
const auto qs = WellGroupHelpers<Scalar>::
|
||||||
getProductionGroupRateVector(wellModel_.groupState(), wellModel_.phaseUsage(), gname);
|
getProductionGroupRateVector(wellModel_.groupState(), wellModel_.phaseUsage(), gname);
|
||||||
|
|
||||||
const auto is_inj = false; // This procedure only applies to G*PGR.
|
const auto is_inj = false; // This procedure only applies to G*PGR.
|
||||||
@@ -364,8 +366,9 @@ getGuideRateValues(const Group& group) const
|
|||||||
return grval;
|
return grval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<class Scalar>
|
||||||
data::GuideRateValue
|
data::GuideRateValue
|
||||||
BlackoilWellModelGuideRates::
|
BlackoilWellModelGuideRates<Scalar>::
|
||||||
getGuideRateInjectionGroupValues(const Group& group) const
|
getGuideRateInjectionGroupValues(const Group& group) const
|
||||||
{
|
{
|
||||||
auto grval = data::GuideRateValue{};
|
auto grval = data::GuideRateValue{};
|
||||||
@@ -384,7 +387,8 @@ getGuideRateInjectionGroupValues(const Group& group) const
|
|||||||
return grval;
|
return grval;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BlackoilWellModelGuideRates::
|
template<class Scalar>
|
||||||
|
void BlackoilWellModelGuideRates<Scalar>::
|
||||||
assignWellGuideRates(data::Wells& wsrpt,
|
assignWellGuideRates(data::Wells& wsrpt,
|
||||||
const int reportStepIdx) const
|
const int reportStepIdx) const
|
||||||
{
|
{
|
||||||
@@ -433,7 +437,7 @@ assignWellGuideRates(data::Wells& wsrpt,
|
|||||||
const auto get_gr = parent
|
const auto get_gr = parent
|
||||||
|| RetrieveWellGuideRate{wellModel_.guideRate(), wname};
|
|| RetrieveWellGuideRate{wellModel_.guideRate(), wname};
|
||||||
|
|
||||||
const auto qs = WellGroupHelpers<double>::
|
const auto qs = WellGroupHelpers<Scalar>::
|
||||||
getWellRateVector(wellModel_.wellState(), wellModel_.phaseUsage(), wname);
|
getWellRateVector(wellModel_.wellState(), wellModel_.phaseUsage(), wname);
|
||||||
|
|
||||||
auto getGR = [this, &wname, &qs](const GuideRateModel::Target t)
|
auto getGR = [this, &wname, &qs](const GuideRateModel::Target t)
|
||||||
@@ -482,8 +486,9 @@ assignWellGuideRates(data::Wells& wsrpt,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<class Scalar>
|
||||||
std::unordered_map<std::string, data::GroupGuideRates>
|
std::unordered_map<std::string, data::GroupGuideRates>
|
||||||
BlackoilWellModelGuideRates::
|
BlackoilWellModelGuideRates<Scalar>::
|
||||||
calculateAllGroupGuideRates(const int reportStepIdx) const
|
calculateAllGroupGuideRates(const int reportStepIdx) const
|
||||||
{
|
{
|
||||||
auto gr = std::unordered_map<std::string, data::GroupGuideRates>{};
|
auto gr = std::unordered_map<std::string, data::GroupGuideRates>{};
|
||||||
@@ -542,7 +547,8 @@ calculateAllGroupGuideRates(const int reportStepIdx) const
|
|||||||
return gr;
|
return gr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BlackoilWellModelGuideRates::
|
template<class Scalar>
|
||||||
|
void BlackoilWellModelGuideRates<Scalar>::
|
||||||
assignGroupGuideRates(const Group& group,
|
assignGroupGuideRates(const Group& group,
|
||||||
const std::unordered_map<std::string, data::GroupGuideRates>& groupGuideRates,
|
const std::unordered_map<std::string, data::GroupGuideRates>& groupGuideRates,
|
||||||
data::GroupData& gdata) const
|
data::GroupData& gdata) const
|
||||||
@@ -569,7 +575,8 @@ assignGroupGuideRates(const Group& group,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BlackoilWellModelGuideRates::
|
template<class Scalar>
|
||||||
|
bool BlackoilWellModelGuideRates<Scalar>::
|
||||||
guideRateUpdateIsNeeded(const int reportStepIdx) const
|
guideRateUpdateIsNeeded(const int reportStepIdx) const
|
||||||
{
|
{
|
||||||
const auto& genWells = wellModel_.genericWells();
|
const auto& genWells = wellModel_.genericWells();
|
||||||
@@ -595,4 +602,6 @@ guideRateUpdateIsNeeded(const int reportStepIdx) const
|
|||||||
return wellModel_.comm().max(static_cast<int>(need_update));
|
return wellModel_.comm().max(static_cast<int>(need_update));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template class BlackoilWellModelGuideRates<double>;
|
||||||
|
|
||||||
} // namespace Opm
|
} // namespace Opm
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ class Group;
|
|||||||
class Well;
|
class Well;
|
||||||
|
|
||||||
/// Class for handling the guide rates in the blackoil well model.
|
/// Class for handling the guide rates in the blackoil well model.
|
||||||
|
template<class Scalar>
|
||||||
class BlackoilWellModelGuideRates
|
class BlackoilWellModelGuideRates
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -1211,8 +1211,8 @@ namespace Opm {
|
|||||||
|
|
||||||
//update guide rates
|
//update guide rates
|
||||||
const int reportStepIdx = simulator_.episodeIndex();
|
const int reportStepIdx = simulator_.episodeIndex();
|
||||||
if (alq_updated || BlackoilWellModelGuideRates(*this).
|
if (alq_updated || BlackoilWellModelGuideRates<double>(*this).
|
||||||
guideRateUpdateIsNeeded(reportStepIdx)) {
|
guideRateUpdateIsNeeded(reportStepIdx)) {
|
||||||
const double simulationTime = simulator_.time();
|
const double simulationTime = simulator_.time();
|
||||||
const auto& comm = simulator_.vanguard().grid().comm();
|
const auto& comm = simulator_.vanguard().grid().comm();
|
||||||
const auto& summaryState = simulator_.vanguard().summaryState();
|
const auto& summaryState = simulator_.vanguard().summaryState();
|
||||||
|
|||||||
Reference in New Issue
Block a user