mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
BlackoilWellModelRestart: template Scalar type
This commit is contained in:
parent
edf4be5f79
commit
ddd61f4176
@ -210,22 +210,27 @@ initFromRestartFile(const RestartValue& restartValues,
|
||||
this->schedule(), handle_ms_well, numCells,
|
||||
this->well_perf_data_, this->summaryState_);
|
||||
|
||||
BlackoilWellModelRestart(*this).loadRestartData(restartValues.wells,
|
||||
restartValues.grp_nwrk,
|
||||
handle_ms_well,
|
||||
this->wellState(),
|
||||
this->groupState());
|
||||
BlackoilWellModelRestart<double>(*this).
|
||||
loadRestartData(restartValues.wells,
|
||||
restartValues.grp_nwrk,
|
||||
handle_ms_well,
|
||||
this->wellState(),
|
||||
this->groupState());
|
||||
|
||||
if (config.has_model()) {
|
||||
BlackoilWellModelRestart(*this).loadRestartGuideRates(report_step,
|
||||
config.model().target(),
|
||||
restartValues.wells,
|
||||
this->guideRate_);
|
||||
BlackoilWellModelRestart<double>(*this).
|
||||
loadRestartGuideRates(report_step,
|
||||
config.model().target(),
|
||||
restartValues.wells,
|
||||
this->guideRate_);
|
||||
}
|
||||
|
||||
BlackoilWellModelRestart(*this).loadRestartGuideRates(report_step,
|
||||
config,
|
||||
restartValues.grp_nwrk.groupData,
|
||||
this->guideRate_);
|
||||
if (config.has_model()) {
|
||||
BlackoilWellModelRestart<double>(*this).
|
||||
loadRestartGuideRates(report_step,
|
||||
config,
|
||||
restartValues.grp_nwrk.groupData,
|
||||
this->guideRate_);
|
||||
|
||||
this->guideRate_.updateGuideRateExpiration(this->schedule().seconds(report_step), report_step);
|
||||
}
|
||||
|
@ -67,11 +67,12 @@ namespace {
|
||||
|
||||
namespace Opm {
|
||||
|
||||
void BlackoilWellModelRestart::
|
||||
template<class Scalar>
|
||||
void BlackoilWellModelRestart<Scalar>::
|
||||
loadRestartConnectionData(const std::vector<data::Rates::opt>& phs,
|
||||
const data::Well& rst_well,
|
||||
const std::vector<PerforationData>& old_perf_data,
|
||||
SingleWellState<double>& ws) const
|
||||
SingleWellState<Scalar>& ws) const
|
||||
{
|
||||
auto& perf_data = ws.perf_data;
|
||||
auto perf_pressure = perf_data.pressure.begin();
|
||||
@ -91,11 +92,12 @@ loadRestartConnectionData(const std::vector<data::Rates::opt>& phs,
|
||||
}
|
||||
}
|
||||
|
||||
void BlackoilWellModelRestart::
|
||||
template<class Scalar>
|
||||
void BlackoilWellModelRestart<Scalar>::
|
||||
loadRestartSegmentData(const std::string& well_name,
|
||||
const std::vector<data::Rates::opt>& phs,
|
||||
const data::Well& rst_well,
|
||||
SingleWellState<double>& ws) const
|
||||
SingleWellState<Scalar>& ws) const
|
||||
{
|
||||
const auto& segment_set = wellModel_.getWellEcl(well_name).getSegments();
|
||||
const auto& rst_segments = rst_well.segments;
|
||||
@ -122,13 +124,14 @@ loadRestartSegmentData(const std::string& well_name,
|
||||
}
|
||||
}
|
||||
|
||||
void BlackoilWellModelRestart::
|
||||
template<class Scalar>
|
||||
void BlackoilWellModelRestart<Scalar>::
|
||||
loadRestartWellData(const std::string& well_name,
|
||||
const bool handle_ms_well,
|
||||
const std::vector<data::Rates::opt>& phs,
|
||||
const data::Well& rst_well,
|
||||
const std::vector<PerforationData>& old_perf_data,
|
||||
SingleWellState<double>& ws) const
|
||||
SingleWellState<Scalar>& ws) const
|
||||
{
|
||||
const auto np = phs.size();
|
||||
|
||||
@ -155,10 +158,11 @@ loadRestartWellData(const std::string& well_name,
|
||||
}
|
||||
}
|
||||
|
||||
void BlackoilWellModelRestart::
|
||||
template<class Scalar>
|
||||
void BlackoilWellModelRestart<Scalar>::
|
||||
loadRestartGroupData(const std::string& group,
|
||||
const data::GroupData& value,
|
||||
GroupState<double>& grpState) const
|
||||
GroupState<Scalar>& grpState) const
|
||||
{
|
||||
using GPMode = Group::ProductionCMode;
|
||||
using GIMode = Group::InjectionCMode;
|
||||
@ -180,7 +184,8 @@ loadRestartGroupData(const std::string& group,
|
||||
}
|
||||
}
|
||||
|
||||
void BlackoilWellModelRestart::
|
||||
template<class Scalar>
|
||||
void BlackoilWellModelRestart<Scalar>::
|
||||
loadRestartGuideRates(const int report_step,
|
||||
const GuideRateModel::Target target,
|
||||
const data::Wells& rst_wells,
|
||||
@ -196,7 +201,8 @@ loadRestartGuideRates(const int report_step,
|
||||
}
|
||||
}
|
||||
|
||||
void BlackoilWellModelRestart::
|
||||
template<class Scalar>
|
||||
void BlackoilWellModelRestart<Scalar>::
|
||||
loadRestartGuideRates(const int report_step,
|
||||
const GuideRateConfig& config,
|
||||
const std::map<std::string, data::GroupData>& rst_groups,
|
||||
@ -219,12 +225,13 @@ loadRestartGuideRates(const int report_step,
|
||||
}
|
||||
}
|
||||
|
||||
void BlackoilWellModelRestart::
|
||||
template<class Scalar>
|
||||
void BlackoilWellModelRestart<Scalar>::
|
||||
loadRestartData(const data::Wells& rst_wells,
|
||||
const data::GroupAndNetworkValues& grpNwrkValues,
|
||||
const bool handle_ms_well,
|
||||
WellState<double>& well_state,
|
||||
GroupState<double>& grpState) const
|
||||
WellState<Scalar>& well_state,
|
||||
GroupState<Scalar>& grpState) const
|
||||
{
|
||||
using rt = data::Rates::opt;
|
||||
const auto& phases = wellModel_.phaseUsage();
|
||||
@ -260,4 +267,6 @@ loadRestartData(const data::Wells& rst_wells,
|
||||
}
|
||||
}
|
||||
|
||||
template class BlackoilWellModelRestart<double>;
|
||||
|
||||
} // namespace Opm
|
||||
|
@ -44,6 +44,7 @@ template<class Scalar> class SingleWellState;
|
||||
template<class Scalar> class WellState;
|
||||
|
||||
/// Class for restarting the blackoil well model.
|
||||
template<class Scalar>
|
||||
class BlackoilWellModelRestart
|
||||
{
|
||||
public:
|
||||
@ -68,21 +69,21 @@ public:
|
||||
void loadRestartData(const data::Wells& rst_wells,
|
||||
const data::GroupAndNetworkValues& grpNwrkValues,
|
||||
const bool handle_ms_well,
|
||||
WellState<double>& well_state,
|
||||
GroupState<double>& grpState) const;
|
||||
WellState<Scalar>& well_state,
|
||||
GroupState<Scalar>& grpState) const;
|
||||
|
||||
private:
|
||||
//! \brief Loads per-connection data from restart structures.
|
||||
void loadRestartConnectionData(const std::vector<data::Rates::opt>& phs,
|
||||
const data::Well& rst_well,
|
||||
const std::vector<PerforationData>& old_perf_data,
|
||||
SingleWellState<double>& ws) const;
|
||||
SingleWellState<Scalar>& ws) const;
|
||||
|
||||
//! \brief Loads per-segment data from restart structures.
|
||||
void loadRestartSegmentData(const std::string& well_name,
|
||||
const std::vector<data::Rates::opt>& phs,
|
||||
const data::Well& rst_well,
|
||||
SingleWellState<double>& ws) const;
|
||||
SingleWellState<Scalar>& ws) const;
|
||||
|
||||
//! \brief Loads per-well data from restart structures.
|
||||
void loadRestartWellData(const std::string& well_name,
|
||||
@ -90,12 +91,12 @@ private:
|
||||
const std::vector<data::Rates::opt>& phs,
|
||||
const data::Well& rst_well,
|
||||
const std::vector<PerforationData>& old_perf_data,
|
||||
SingleWellState<double>& ws) const;
|
||||
SingleWellState<Scalar>& ws) const;
|
||||
|
||||
//! \brief Loads per-group data from restart structures.
|
||||
void loadRestartGroupData(const std::string& group,
|
||||
const data::GroupData& value,
|
||||
GroupState<double>& grpState) const;
|
||||
GroupState<Scalar>& grpState) const;
|
||||
|
||||
const BlackoilWellModelGeneric& wellModel_; //!< Reference to well model
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user