Move function to WellInterfaceGeneric

This commit is contained in:
Stein Krogstad
2023-07-03 10:37:37 +02:00
parent 252d08f1bd
commit b1c11f6d88
4 changed files with 13 additions and 18 deletions

View File

@@ -313,10 +313,7 @@ public:
/// to the rates returned by computeCurrentWellRates().
void updateWellStateRates(const Simulator& ebosSimulator,
WellState& well_state,
DeferredLogger& deferred_logger) const;
void setPrevSurfaceRates(WellState& well_state,
const WellState& prev_well_state) const;
DeferredLogger& deferred_logger) const;
void solveWellEquation(const Simulator& ebosSimulator,
WellState& well_state,

View File

@@ -347,6 +347,17 @@ void WellInterfaceGeneric::setVFPProperties(const VFPProperties* vfp_properties_
vfp_properties_ = vfp_properties_arg;
}
void WellInterfaceGeneric::setPrevSurfaceRates(WellState& well_state,
const WellState& prev_well_state) const
{
auto& ws = well_state.well(this->index_of_well_);
if (!this->changedToOpenThisStep()){
ws.prev_surface_rates = prev_well_state.well(this->index_of_well_).surface_rates;
} else {
ws.prev_surface_rates = ws.surface_rates;
}
}
void WellInterfaceGeneric::setGuideRate(const GuideRate* guide_rate_arg)
{
guide_rate_ = guide_rate_arg;

View File

@@ -94,6 +94,7 @@ public:
void closeCompletions(const WellTestState& wellTestState);
void setVFPProperties(const VFPProperties* vfp_properties_arg);
void setPrevSurfaceRates(WellState& well_state, const WellState& prev_well_state) const;
void setGuideRate(const GuideRate* guide_rate_arg);
void setWellEfficiencyFactor(const double efficiency_factor);
void setRepRadiusPerfLength();

View File

@@ -1192,20 +1192,6 @@ namespace Opm
}
}
template <typename TypeTag>
void
WellInterface<TypeTag>::
setPrevSurfaceRates(WellState& well_state,
const WellState& prev_well_state) const
{
auto& ws = well_state.well(this->index_of_well_);
if (!this->changedToOpenThisStep()){
ws.prev_surface_rates = prev_well_state.well(this->index_of_well_).surface_rates;
} else {
ws.prev_surface_rates = ws.surface_rates;
}
}
template<typename TypeTag>
typename WellInterface<TypeTag>::Eval
WellInterface<TypeTag>::getPerfCellPressure(const typename WellInterface<TypeTag>::FluidState& fs) const