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->schedule(), handle_ms_well, numCells,
|
||||||
this->well_perf_data_, this->summaryState_);
|
this->well_perf_data_, this->summaryState_);
|
||||||
|
|
||||||
BlackoilWellModelRestart(*this).loadRestartData(restartValues.wells,
|
BlackoilWellModelRestart<double>(*this).
|
||||||
restartValues.grp_nwrk,
|
loadRestartData(restartValues.wells,
|
||||||
handle_ms_well,
|
restartValues.grp_nwrk,
|
||||||
this->wellState(),
|
handle_ms_well,
|
||||||
this->groupState());
|
this->wellState(),
|
||||||
|
this->groupState());
|
||||||
|
|
||||||
if (config.has_model()) {
|
if (config.has_model()) {
|
||||||
BlackoilWellModelRestart(*this).loadRestartGuideRates(report_step,
|
BlackoilWellModelRestart<double>(*this).
|
||||||
config.model().target(),
|
loadRestartGuideRates(report_step,
|
||||||
restartValues.wells,
|
config.model().target(),
|
||||||
this->guideRate_);
|
restartValues.wells,
|
||||||
|
this->guideRate_);
|
||||||
|
}
|
||||||
|
|
||||||
BlackoilWellModelRestart(*this).loadRestartGuideRates(report_step,
|
if (config.has_model()) {
|
||||||
config,
|
BlackoilWellModelRestart<double>(*this).
|
||||||
restartValues.grp_nwrk.groupData,
|
loadRestartGuideRates(report_step,
|
||||||
this->guideRate_);
|
config,
|
||||||
|
restartValues.grp_nwrk.groupData,
|
||||||
|
this->guideRate_);
|
||||||
|
|
||||||
this->guideRate_.updateGuideRateExpiration(this->schedule().seconds(report_step), report_step);
|
this->guideRate_.updateGuideRateExpiration(this->schedule().seconds(report_step), report_step);
|
||||||
}
|
}
|
||||||
|
@ -67,11 +67,12 @@ namespace {
|
|||||||
|
|
||||||
namespace Opm {
|
namespace Opm {
|
||||||
|
|
||||||
void BlackoilWellModelRestart::
|
template<class Scalar>
|
||||||
|
void BlackoilWellModelRestart<Scalar>::
|
||||||
loadRestartConnectionData(const std::vector<data::Rates::opt>& phs,
|
loadRestartConnectionData(const std::vector<data::Rates::opt>& phs,
|
||||||
const data::Well& rst_well,
|
const data::Well& rst_well,
|
||||||
const std::vector<PerforationData>& old_perf_data,
|
const std::vector<PerforationData>& old_perf_data,
|
||||||
SingleWellState<double>& ws) const
|
SingleWellState<Scalar>& ws) const
|
||||||
{
|
{
|
||||||
auto& perf_data = ws.perf_data;
|
auto& perf_data = ws.perf_data;
|
||||||
auto perf_pressure = perf_data.pressure.begin();
|
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,
|
loadRestartSegmentData(const std::string& well_name,
|
||||||
const std::vector<data::Rates::opt>& phs,
|
const std::vector<data::Rates::opt>& phs,
|
||||||
const data::Well& rst_well,
|
const data::Well& rst_well,
|
||||||
SingleWellState<double>& ws) const
|
SingleWellState<Scalar>& ws) const
|
||||||
{
|
{
|
||||||
const auto& segment_set = wellModel_.getWellEcl(well_name).getSegments();
|
const auto& segment_set = wellModel_.getWellEcl(well_name).getSegments();
|
||||||
const auto& rst_segments = rst_well.segments;
|
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,
|
loadRestartWellData(const std::string& well_name,
|
||||||
const bool handle_ms_well,
|
const bool handle_ms_well,
|
||||||
const std::vector<data::Rates::opt>& phs,
|
const std::vector<data::Rates::opt>& phs,
|
||||||
const data::Well& rst_well,
|
const data::Well& rst_well,
|
||||||
const std::vector<PerforationData>& old_perf_data,
|
const std::vector<PerforationData>& old_perf_data,
|
||||||
SingleWellState<double>& ws) const
|
SingleWellState<Scalar>& ws) const
|
||||||
{
|
{
|
||||||
const auto np = phs.size();
|
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,
|
loadRestartGroupData(const std::string& group,
|
||||||
const data::GroupData& value,
|
const data::GroupData& value,
|
||||||
GroupState<double>& grpState) const
|
GroupState<Scalar>& grpState) const
|
||||||
{
|
{
|
||||||
using GPMode = Group::ProductionCMode;
|
using GPMode = Group::ProductionCMode;
|
||||||
using GIMode = Group::InjectionCMode;
|
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,
|
loadRestartGuideRates(const int report_step,
|
||||||
const GuideRateModel::Target target,
|
const GuideRateModel::Target target,
|
||||||
const data::Wells& rst_wells,
|
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,
|
loadRestartGuideRates(const int report_step,
|
||||||
const GuideRateConfig& config,
|
const GuideRateConfig& config,
|
||||||
const std::map<std::string, data::GroupData>& rst_groups,
|
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,
|
loadRestartData(const data::Wells& rst_wells,
|
||||||
const data::GroupAndNetworkValues& grpNwrkValues,
|
const data::GroupAndNetworkValues& grpNwrkValues,
|
||||||
const bool handle_ms_well,
|
const bool handle_ms_well,
|
||||||
WellState<double>& well_state,
|
WellState<Scalar>& well_state,
|
||||||
GroupState<double>& grpState) const
|
GroupState<Scalar>& grpState) const
|
||||||
{
|
{
|
||||||
using rt = data::Rates::opt;
|
using rt = data::Rates::opt;
|
||||||
const auto& phases = wellModel_.phaseUsage();
|
const auto& phases = wellModel_.phaseUsage();
|
||||||
@ -260,4 +267,6 @@ loadRestartData(const data::Wells& rst_wells,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template class BlackoilWellModelRestart<double>;
|
||||||
|
|
||||||
} // namespace Opm
|
} // namespace Opm
|
||||||
|
@ -44,6 +44,7 @@ template<class Scalar> class SingleWellState;
|
|||||||
template<class Scalar> class WellState;
|
template<class Scalar> class WellState;
|
||||||
|
|
||||||
/// Class for restarting the blackoil well model.
|
/// Class for restarting the blackoil well model.
|
||||||
|
template<class Scalar>
|
||||||
class BlackoilWellModelRestart
|
class BlackoilWellModelRestart
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -68,21 +69,21 @@ public:
|
|||||||
void loadRestartData(const data::Wells& rst_wells,
|
void loadRestartData(const data::Wells& rst_wells,
|
||||||
const data::GroupAndNetworkValues& grpNwrkValues,
|
const data::GroupAndNetworkValues& grpNwrkValues,
|
||||||
const bool handle_ms_well,
|
const bool handle_ms_well,
|
||||||
WellState<double>& well_state,
|
WellState<Scalar>& well_state,
|
||||||
GroupState<double>& grpState) const;
|
GroupState<Scalar>& grpState) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
//! \brief Loads per-connection data from restart structures.
|
//! \brief Loads per-connection data from restart structures.
|
||||||
void loadRestartConnectionData(const std::vector<data::Rates::opt>& phs,
|
void loadRestartConnectionData(const std::vector<data::Rates::opt>& phs,
|
||||||
const data::Well& rst_well,
|
const data::Well& rst_well,
|
||||||
const std::vector<PerforationData>& old_perf_data,
|
const std::vector<PerforationData>& old_perf_data,
|
||||||
SingleWellState<double>& ws) const;
|
SingleWellState<Scalar>& ws) const;
|
||||||
|
|
||||||
//! \brief Loads per-segment data from restart structures.
|
//! \brief Loads per-segment data from restart structures.
|
||||||
void loadRestartSegmentData(const std::string& well_name,
|
void loadRestartSegmentData(const std::string& well_name,
|
||||||
const std::vector<data::Rates::opt>& phs,
|
const std::vector<data::Rates::opt>& phs,
|
||||||
const data::Well& rst_well,
|
const data::Well& rst_well,
|
||||||
SingleWellState<double>& ws) const;
|
SingleWellState<Scalar>& ws) const;
|
||||||
|
|
||||||
//! \brief Loads per-well data from restart structures.
|
//! \brief Loads per-well data from restart structures.
|
||||||
void loadRestartWellData(const std::string& well_name,
|
void loadRestartWellData(const std::string& well_name,
|
||||||
@ -90,12 +91,12 @@ private:
|
|||||||
const std::vector<data::Rates::opt>& phs,
|
const std::vector<data::Rates::opt>& phs,
|
||||||
const data::Well& rst_well,
|
const data::Well& rst_well,
|
||||||
const std::vector<PerforationData>& old_perf_data,
|
const std::vector<PerforationData>& old_perf_data,
|
||||||
SingleWellState<double>& ws) const;
|
SingleWellState<Scalar>& ws) const;
|
||||||
|
|
||||||
//! \brief Loads per-group data from restart structures.
|
//! \brief Loads per-group data from restart structures.
|
||||||
void loadRestartGroupData(const std::string& group,
|
void loadRestartGroupData(const std::string& group,
|
||||||
const data::GroupData& value,
|
const data::GroupData& value,
|
||||||
GroupState<double>& grpState) const;
|
GroupState<Scalar>& grpState) const;
|
||||||
|
|
||||||
const BlackoilWellModelGeneric& wellModel_; //!< Reference to well model
|
const BlackoilWellModelGeneric& wellModel_; //!< Reference to well model
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user