mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
changed: move StandardWellConnections out of inheritance hierarchy
instead hold a member in StandardWellEval
This commit is contained in:
parent
b08c165384
commit
7cadeb5206
@ -49,11 +49,11 @@ namespace Opm
|
||||
template<class FluidSystem, class Indices, class Scalar>
|
||||
StandardWellEval<FluidSystem,Indices,Scalar>::
|
||||
StandardWellEval(const WellInterfaceIndices<FluidSystem,Indices,Scalar>& baseif)
|
||||
: StandardWellConnections<Scalar>(baseif)
|
||||
, baseif_(baseif)
|
||||
: baseif_(baseif)
|
||||
, primary_variables_(baseif_)
|
||||
, F0_(numWellConservationEq)
|
||||
, linSys_(baseif_.parallelWellInfo())
|
||||
, connections_(baseif)
|
||||
{
|
||||
}
|
||||
|
||||
@ -78,7 +78,7 @@ updateWellStateFromPrimaryVariables(WellState& well_state,
|
||||
this->primary_variables_.copyToWellState(well_state, deferred_logger);
|
||||
|
||||
WellBhpThpCalculator(baseif_).
|
||||
updateThp(this->getRho(),
|
||||
updateThp(connections_.getRho(),
|
||||
[this,&well_state]() { return this->baseif_.getALQ(well_state); },
|
||||
{FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx),
|
||||
FluidSystem::phaseIsActive(FluidSystem::oilPhaseIdx),
|
||||
@ -343,7 +343,7 @@ computeConnectionDensities(const std::vector<double>& perfComponentRates,
|
||||
}
|
||||
|
||||
// Compute segment density.
|
||||
this->perf_densities_[perf] = std::inner_product(surf_dens.begin(), surf_dens.end(), mix.begin(), 0.0) / volrat;
|
||||
this->connections_.perf_densities_[perf] = std::inner_product(surf_dens.begin(), surf_dens.end(), mix.begin(), 0.0) / volrat;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,7 @@ template<class FluidSystem, class Indices, class Scalar> class WellInterfaceIndi
|
||||
class WellState;
|
||||
|
||||
template<class FluidSystem, class Indices, class Scalar>
|
||||
class StandardWellEval : public StandardWellConnections<Scalar>
|
||||
class StandardWellEval
|
||||
{
|
||||
protected:
|
||||
using PrimaryVariables = StandardWellPrimaryVariables<FluidSystem,Indices,Scalar>;
|
||||
@ -111,6 +111,7 @@ protected:
|
||||
std::vector<double> F0_;
|
||||
|
||||
StandardWellEquations<Scalar,Indices::numEq> linSys_; //!< Linear equation system
|
||||
StandardWellConnections<Scalar> connections_; //!< Connection level values
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -255,7 +255,7 @@ namespace Opm
|
||||
DeferredLogger& deferred_logger) const
|
||||
{
|
||||
// Pressure drawdown (also used to determine direction of flow)
|
||||
const Value well_pressure = bhp + this->perf_pressure_diffs_[perf];
|
||||
const Value well_pressure = bhp + this->connections_.perf_pressure_diffs_[perf];
|
||||
Value drawdown = pressure - well_pressure;
|
||||
if (this->isInjector()) {
|
||||
drawdown += skin_pressure;
|
||||
@ -546,7 +546,7 @@ namespace Opm
|
||||
assembleControlEq(well_state, group_state,
|
||||
schedule, summaryState,
|
||||
this->primary_variables_,
|
||||
this->getRho(),
|
||||
this->connections_.getRho(),
|
||||
this->linSys_,
|
||||
deferred_logger);
|
||||
|
||||
@ -777,7 +777,7 @@ namespace Opm
|
||||
}
|
||||
|
||||
// Store the perforation pressure for later usage.
|
||||
perf_data.pressure[perf] = ws.bhp + this->perf_pressure_diffs_[perf];
|
||||
perf_data.pressure[perf] = ws.bhp + this->connections_.perf_pressure_diffs_[perf];
|
||||
}
|
||||
|
||||
|
||||
@ -1021,7 +1021,7 @@ namespace Opm
|
||||
}
|
||||
|
||||
// the pressure difference between the connection and BHP
|
||||
const double h_perf = this->perf_pressure_diffs_[perf];
|
||||
const double h_perf = this->connections_.perf_pressure_diffs_[perf];
|
||||
const double pressure_diff = p_r - h_perf;
|
||||
|
||||
// Let us add a check, since the pressure is calculated based on zero value BHP
|
||||
@ -1117,7 +1117,7 @@ namespace Opm
|
||||
this->adaptRatesForVFP(well_rates_bhp_limit);
|
||||
const double thp = WellBhpThpCalculator(*this).calculateThpFromBhp(well_rates_bhp_limit,
|
||||
bhp_limit,
|
||||
this->getRho(),
|
||||
this->connections_.getRho(),
|
||||
this->getALQ(well_state),
|
||||
deferred_logger);
|
||||
const double thp_limit = this->getTHPConstraint(summaryState);
|
||||
@ -1204,7 +1204,7 @@ namespace Opm
|
||||
const double bhp = this->primary_variables_.eval(Bhp).value();
|
||||
|
||||
// Pressure drawdown (also used to determine direction of flow)
|
||||
const double well_pressure = bhp + this->perf_pressure_diffs_[perf];
|
||||
const double well_pressure = bhp + this->connections_.perf_pressure_diffs_[perf];
|
||||
const double drawdown = pressure - well_pressure;
|
||||
|
||||
// for now, if there is one perforation can produce/inject in the correct
|
||||
@ -1627,7 +1627,7 @@ namespace Opm
|
||||
|
||||
this->computeConnectionDensities(perfRates, b_perf, rsmax_perf, rvmax_perf, rvwmax_perf, surf_dens_perf, deferred_logger);
|
||||
|
||||
this->computeConnectionPressureDelta();
|
||||
this->connections_.computeConnectionPressureDelta();
|
||||
}
|
||||
|
||||
|
||||
@ -2032,7 +2032,7 @@ namespace Opm
|
||||
StandardWell<TypeTag>::
|
||||
getRefDensity() const
|
||||
{
|
||||
return this->perf_densities_[0];
|
||||
return this->connections_.getRho();
|
||||
}
|
||||
|
||||
|
||||
@ -2430,7 +2430,7 @@ namespace Opm
|
||||
auto bhpAtLimit = WellBhpThpCalculator(*this).computeBhpAtThpLimitProd(frates,
|
||||
summary_state,
|
||||
max_pressure,
|
||||
this->getRho(),
|
||||
this->connections_.getRho(),
|
||||
alq_value,
|
||||
deferred_logger);
|
||||
auto v = frates(*bhpAtLimit);
|
||||
@ -2450,7 +2450,7 @@ namespace Opm
|
||||
bhpAtLimit = WellBhpThpCalculator(*this).computeBhpAtThpLimitProd(fratesIter,
|
||||
summary_state,
|
||||
max_pressure,
|
||||
this->getRho(),
|
||||
this->connections_.getRho(),
|
||||
alq_value,
|
||||
deferred_logger);
|
||||
v = frates(*bhpAtLimit);
|
||||
@ -2484,7 +2484,7 @@ namespace Opm
|
||||
|
||||
return WellBhpThpCalculator(*this).computeBhpAtThpLimitInj(frates,
|
||||
summary_state,
|
||||
this->getRho(),
|
||||
this->connections_.getRho(),
|
||||
1e-6,
|
||||
50,
|
||||
true,
|
||||
|
Loading…
Reference in New Issue
Block a user