mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-11 09:55:34 -06:00
using B_avg for the inner iteration for multisegment wells
This commit is contained in:
parent
1df65913d7
commit
e9c0bdba06
@ -358,7 +358,7 @@ namespace Opm {
|
||||
void computeRepRadiusPerfLength(const Grid& grid, Opm::DeferredLogger& deferred_logger);
|
||||
|
||||
|
||||
void computeAverageFormationFactor(std::vector<double>& B_avg) const;
|
||||
void computeAverageFormationFactor(std::vector<Scalar>& B_avg) const;
|
||||
|
||||
void applyVREPGroupControl();
|
||||
|
||||
|
@ -687,15 +687,20 @@ namespace Opm {
|
||||
// Set the well primary variables based on the value of well solutions
|
||||
initPrimaryVariablesEvaluation();
|
||||
|
||||
|
||||
std::vector< Scalar > B_avg(numComponents(), Scalar() );
|
||||
computeAverageFormationFactor(B_avg);
|
||||
|
||||
if (param_.solve_welleq_initially_ && iterationIdx == 0) {
|
||||
// solve the well equations as a pre-processing step
|
||||
last_report_ = solveWellEq(dt, local_deferredLogger);
|
||||
last_report_ = solveWellEq(B_avg, dt, local_deferredLogger);
|
||||
|
||||
|
||||
if (initial_step_) {
|
||||
// update the explicit quantities to get the initial fluid distribution in the well correct.
|
||||
calculateExplicitQuantities(local_deferredLogger);
|
||||
prepareTimeStep(local_deferredLogger);
|
||||
last_report_ = solveWellEq(dt, local_deferredLogger);
|
||||
last_report_ = solveWellEq(B_avg, dt, local_deferredLogger);
|
||||
initial_step_ = false;
|
||||
}
|
||||
// TODO: should we update the explicit related here again, or even prepareTimeStep().
|
||||
@ -877,10 +882,6 @@ namespace Opm {
|
||||
{
|
||||
WellState well_state0 = well_state_;
|
||||
|
||||
const int numComp = numComponents();
|
||||
std::vector< Scalar > B_avg( numComp, Scalar() );
|
||||
computeAverageFormationFactor(B_avg);
|
||||
|
||||
const int max_iter = param_.max_welleq_iter_;
|
||||
|
||||
int it = 0;
|
||||
@ -1443,7 +1444,7 @@ namespace Opm {
|
||||
template<typename TypeTag>
|
||||
void
|
||||
BlackoilWellModel<TypeTag>::
|
||||
computeAverageFormationFactor(std::vector<double>& B_avg) const
|
||||
computeAverageFormationFactor(std::vector<Scalar>& B_avg) const
|
||||
{
|
||||
const auto& grid = ebosSimulator_.vanguard().grid();
|
||||
const auto& gridView = grid.leafGridView();
|
||||
|
@ -113,6 +113,7 @@ namespace Opm
|
||||
virtual void initPrimaryVariablesEvaluation() const override;
|
||||
|
||||
virtual void assembleWellEq(const Simulator& ebosSimulator,
|
||||
const std::vector<Scalar>& B_avg,
|
||||
const double dt,
|
||||
WellState& well_state,
|
||||
Opm::DeferredLogger& deferred_logger) override;
|
||||
@ -352,6 +353,7 @@ namespace Opm
|
||||
|
||||
// TODO: try to make ebosSimulator const, as it should be
|
||||
void iterateWellEquations(const Simulator& ebosSimulator,
|
||||
const std::vector<Scalar>& B_avg,
|
||||
const double dt,
|
||||
WellState& well_state,
|
||||
Opm::DeferredLogger& deferred_logger);
|
||||
|
@ -237,6 +237,7 @@ namespace Opm
|
||||
void
|
||||
MultisegmentWell<TypeTag>::
|
||||
assembleWellEq(const Simulator& ebosSimulator,
|
||||
const std::vector<Scalar>& B_avg,
|
||||
const double dt,
|
||||
WellState& well_state,
|
||||
Opm::DeferredLogger& deferred_logger)
|
||||
@ -244,7 +245,8 @@ namespace Opm
|
||||
|
||||
const bool use_inner_iterations = param_.use_inner_iterations_ms_wells_;
|
||||
if (use_inner_iterations) {
|
||||
iterateWellEquations(ebosSimulator, dt, well_state, deferred_logger);
|
||||
|
||||
iterateWellEquations(ebosSimulator, B_avg, dt, well_state, deferred_logger);
|
||||
}
|
||||
|
||||
assembleWellEqWithoutIteration(ebosSimulator, dt, well_state, deferred_logger);
|
||||
@ -1763,6 +1765,7 @@ namespace Opm
|
||||
void
|
||||
MultisegmentWell<TypeTag>::
|
||||
iterateWellEquations(const Simulator& ebosSimulator,
|
||||
const std::vector<Scalar>& B_avg,
|
||||
const double dt,
|
||||
WellState& well_state,
|
||||
Opm::DeferredLogger& deferred_logger)
|
||||
@ -1780,14 +1783,8 @@ namespace Opm
|
||||
|
||||
const BVectorWell dx_well = mswellhelpers::invDXDirect(duneD_, resWell_);
|
||||
|
||||
// TODO: use these small values for now, not intend to reach the convergence
|
||||
// in this stage, but, should we?
|
||||
// We should try to avoid hard-code values in the code.
|
||||
// If we want to use the real one, we need to find a way to get them.
|
||||
// const std::vector<double> B {0.8, 0.8, 0.008};
|
||||
const std::vector<double> B {0.5, 0.5, 0.005};
|
||||
|
||||
const auto report = getWellConvergence(B, deferred_logger);
|
||||
const auto report = getWellConvergence(B_avg, deferred_logger);
|
||||
if (report.converged()) {
|
||||
break;
|
||||
}
|
||||
@ -1831,8 +1828,8 @@ namespace Opm
|
||||
const int nseg = numberOfSegments();
|
||||
|
||||
for (int seg = 0; seg < nseg; ++seg) {
|
||||
// calculating the accumulation term // TODO: without considering the efficiencty factor for now
|
||||
// volume of the segment
|
||||
// calculating the accumulation term
|
||||
// TODO: without considering the efficiencty factor for now
|
||||
{
|
||||
const EvalWell segment_surface_volume = getSegmentSurfaceVolume(ebosSimulator, seg);
|
||||
// for each component
|
||||
|
@ -142,6 +142,7 @@ namespace Opm
|
||||
virtual void initPrimaryVariablesEvaluation() const override;
|
||||
|
||||
virtual void assembleWellEq(const Simulator& ebosSimulator,
|
||||
const std::vector<Scalar>& B_avg,
|
||||
const double dt,
|
||||
WellState& well_state,
|
||||
Opm::DeferredLogger& deferred_logger) override;
|
||||
|
@ -143,6 +143,7 @@ namespace Opm
|
||||
virtual void initPrimaryVariablesEvaluation() const override;
|
||||
|
||||
virtual void assembleWellEq(const Simulator& ebosSimulator,
|
||||
const std::vector<Scalar>& B_avg,
|
||||
const double dt,
|
||||
WellState& well_state,
|
||||
Opm::DeferredLogger& deferred_logger) override;
|
||||
|
@ -480,6 +480,7 @@ namespace Opm
|
||||
void
|
||||
StandardWellV<TypeTag>::
|
||||
assembleWellEq(const Simulator& ebosSimulator,
|
||||
const std::vector<Scalar>& /* B_avg */,
|
||||
const double dt,
|
||||
WellState& well_state,
|
||||
Opm::DeferredLogger& deferred_logger
|
||||
|
@ -445,6 +445,7 @@ namespace Opm
|
||||
void
|
||||
StandardWell<TypeTag>::
|
||||
assembleWellEq(const Simulator& ebosSimulator,
|
||||
const std::vector<Scalar>& /* B_avg */,
|
||||
const double dt,
|
||||
WellState& well_state,
|
||||
Opm::DeferredLogger& deferred_logger)
|
||||
|
@ -152,6 +152,7 @@ namespace Opm
|
||||
virtual void solveEqAndUpdateWellState(WellState& well_state, Opm::DeferredLogger& deferred_logger) = 0;
|
||||
|
||||
virtual void assembleWellEq(const Simulator& ebosSimulator,
|
||||
const std::vector<Scalar>& B_avg,
|
||||
const double dt,
|
||||
WellState& well_state,
|
||||
Opm::DeferredLogger& deferred_logger
|
||||
|
Loading…
Reference in New Issue
Block a user