mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
recovering some unecessary changes.
PR #1477 introduced different ways to improve the WellState initialization. Basically, the WellState initialization will be something challenging to handle along with the improvement of the well model.
This commit is contained in:
parent
18917b81f4
commit
f3f096dbbb
@ -272,10 +272,6 @@ namespace Opm {
|
||||
// Set the well primary variables based on the value of well solutions
|
||||
initPrimaryVariablesEvaluation();
|
||||
|
||||
if (iterationIdx == 0) {
|
||||
//calculateExplicitQuantities();
|
||||
}
|
||||
|
||||
if (param_.solve_welleq_initially_ && iterationIdx == 0) {
|
||||
// solve the well equations as a pre-processing step
|
||||
last_report_ = solveWellEq(dt);
|
||||
@ -286,6 +282,9 @@ namespace Opm {
|
||||
last_report_ = solveWellEq(dt);
|
||||
initial_step_ = false;
|
||||
}
|
||||
// TODO: should we update the explicit related here again, or even prepareTimeStep().
|
||||
// basically, this is a more updated state from the solveWellEq based on fixed
|
||||
// reservoir state, will tihs be a better place to inialize the explict information?
|
||||
}
|
||||
assembleWellEq(dt, false);
|
||||
|
||||
|
@ -285,7 +285,7 @@ namespace Opm
|
||||
const std::vector<double>& rvmax_perf,
|
||||
const std::vector<double>& surf_dens_perf);
|
||||
|
||||
|
||||
// computing the accumulation term for later use in well mass equations
|
||||
void computeAccumWell();
|
||||
|
||||
void computeWellConnectionPressures(const Simulator& ebosSimulator,
|
||||
|
@ -154,8 +154,6 @@ namespace Opm
|
||||
// TODO: using comp_frac here is dangerous, it should be changed later
|
||||
// Most likely, it should be changed to use distr, or at least, we need to update comp_frac_ based on distr
|
||||
// while solvent might complicate the situation
|
||||
//
|
||||
// TODO: it is possible that the RESV for the injector is not well handled here.
|
||||
const auto pu = phaseUsage();
|
||||
const int legacyCompIdx = ebosCompIdxToFlowCompIdx(comp_idx);
|
||||
double comp_frac = 0.0;
|
||||
@ -170,7 +168,6 @@ namespace Opm
|
||||
comp_frac = comp_frac_[legacyCompIdx];
|
||||
}
|
||||
|
||||
// testing code end
|
||||
return comp_frac * primary_variables_evaluation_[GTotal];
|
||||
} else { // producers
|
||||
return primary_variables_evaluation_[GTotal] * wellVolumeFractionScaled(comp_idx);
|
||||
@ -666,13 +663,9 @@ namespace Opm
|
||||
}
|
||||
assert(number_phases_under_control > 0);
|
||||
|
||||
const double target_rate = well_controls_get_current_target(well_controls_);
|
||||
|
||||
const double target_rate = well_controls_get_current_target(well_controls_); // surface rate target
|
||||
if (well_type_ == INJECTOR) {
|
||||
assert(number_phases_under_control == 1); // only handles single phase injection now
|
||||
// TODO: considering the solvent part here
|
||||
// Better way to cover solvent part will be getQs() - target_rate, while it turned out not correct
|
||||
// for the solvent case.
|
||||
control_eq = getGTotal() - target_rate;
|
||||
} else if (well_type_ == PRODUCER) {
|
||||
EvalWell rate_for_control(0.);
|
||||
@ -688,7 +681,7 @@ namespace Opm
|
||||
}
|
||||
case RESERVOIR_RATE:
|
||||
{
|
||||
// TODO: repeated code here
|
||||
// TODO: repeated code here, while hopefully it gives better readability
|
||||
int number_phases_under_control = 0;
|
||||
const double* distr = well_controls_get_current_distr(well_controls_);
|
||||
for (int phase = 0; phase < number_of_phases_; ++phase) {
|
||||
|
@ -112,14 +112,6 @@ namespace Opm
|
||||
if (well_controls_well_is_stopped(ctrl)) {
|
||||
// Shut well: perfphaserates_ are all zero.
|
||||
} else {
|
||||
// increasing the gas rates so that there is a better guess of the gas rate, when the well is
|
||||
// a new well
|
||||
// TODO: a better way to make good use of the events in the Schedule from parser.
|
||||
if (pu.phase_used[Gas] && is_new_well_[w]) {
|
||||
const int gaspos = pu.phase_pos[Gas];
|
||||
wellRates()[np * w + gaspos] *= 100.;
|
||||
}
|
||||
|
||||
const int num_perf_this_well = wells->well_connpos[w + 1] - wells->well_connpos[w];
|
||||
// Open well: Initialize perfphaserates_ to well
|
||||
// rates divided by the number of perforations.
|
||||
@ -416,6 +408,18 @@ namespace Opm
|
||||
const int start_perf = wells->well_connpos[w];
|
||||
const int start_perf_next_well = wells->well_connpos[w + 1];
|
||||
assert(nperf == (start_perf_next_well - start_perf)); // make sure the information from wells_ecl consistent with wells
|
||||
if (pu.phase_used[Gas]) {
|
||||
const int gaspos = pu.phase_pos[Gas];
|
||||
// scale the phase rates for Gas to avoid too bad initial guess for gas fraction
|
||||
// it will probably benefit the standard well too, while it needs to be justified
|
||||
// TODO: to see if this strategy can benefit StandardWell too
|
||||
// TODO: it might cause big problem for gas rate control or if there is a gas rate limit
|
||||
// maybe the best way is to initialize the fractions first then get the rates
|
||||
for (int perf = 0; perf < nperf; perf++) {
|
||||
const int perf_pos = start_perf + perf;
|
||||
perfPhaseRates()[np * perf_pos + gaspos] *= 100.;
|
||||
}
|
||||
}
|
||||
|
||||
const std::vector<double> perforation_rates(perfPhaseRates().begin() + np * start_perf,
|
||||
perfPhaseRates().begin() + np * start_perf_next_well); // the perforation rates for this well
|
||||
|
Loading…
Reference in New Issue
Block a user