Made a (possibly wrong) adjustment to well_controls_append. Each control now has its current index set to 0, as there's only supposed to be one control per well.
This commit is contained in:
@@ -524,7 +524,7 @@ main(int argc, char** argv)
|
||||
state.pressure() = initial_pressure;
|
||||
|
||||
|
||||
psolver.solve(totmob, omega, src, bcs.c_bcs(), porevol, rc, simtimer.currentStepLength(),
|
||||
psolver.solve(totmob, omega, src, empty_vector_for_wells, bcs.c_bcs(), porevol, rc, simtimer.currentStepLength(),
|
||||
state.pressure(), state.faceflux(), empty_vector_for_wells, empty_vector_for_wells);
|
||||
double max_change = 0.0;
|
||||
for (int cell = 0; cell < num_cells; ++cell) {
|
||||
@@ -537,7 +537,7 @@ main(int argc, char** argv)
|
||||
}
|
||||
computePorevolume(*grid->c_grid(), *props, *rock_comp, state.pressure(), porevol);
|
||||
} else {
|
||||
psolver.solve(totmob, omega, src, bcs.c_bcs(), state.pressure(), state.faceflux(), empty_vector_for_wells,
|
||||
psolver.solve(totmob, omega, src, empty_vector_for_wells, bcs.c_bcs(), state.pressure(), state.faceflux(), empty_vector_for_wells,
|
||||
empty_vector_for_wells);
|
||||
}
|
||||
pressure_timer.stop();
|
||||
|
||||
@@ -62,6 +62,10 @@ int main(int argc, char** argv) {
|
||||
std::vector<double> omega;
|
||||
computeTotalMobilityOmega(incomp_properties, all_cells, state.saturation(), totmob, omega);
|
||||
|
||||
std::vector<double> wdp;
|
||||
std::vector<double> densities(incomp_properties.density(), incomp_properties.density() + incomp_properties.numPhases());
|
||||
computeWDP(*wells.c_wells(), *grid.c_grid(), state.saturation(), densities, wdp);
|
||||
|
||||
std::vector<double> src;
|
||||
Opm::FlowBCManager bcs;
|
||||
|
||||
@@ -70,7 +74,7 @@ int main(int argc, char** argv) {
|
||||
|
||||
std::vector<double> well_bhp;
|
||||
std::vector<double> well_rate;
|
||||
pressure_solver.solve(totmob, omega, src, bcs.c_bcs(), pressure, face_flux, well_bhp, well_rate);
|
||||
pressure_solver.solve(totmob, omega, src, wdp, bcs.c_bcs(), pressure, face_flux, well_bhp, well_rate);
|
||||
std::cout << "Solved" << std::endl;
|
||||
if(wells.wellCollection().conditionsMet(well_bhp, well_rate)) {
|
||||
std::cout << "Conditions met for wells!" << std::endl;
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace Opm
|
||||
// gpress_omegaweighted_ is sent to assembler always, and it dislikes
|
||||
// getting a zero pointer.
|
||||
gpress_omegaweighted_.resize(g.cell_facepos[ g.number_of_cells ], 0.0);
|
||||
h_ = ifs_tpfa_construct(gg, 0);
|
||||
h_ = ifs_tpfa_construct(gg, const_cast<struct Wells*>(wells_));
|
||||
}
|
||||
|
||||
|
||||
@@ -99,6 +99,7 @@ namespace Opm
|
||||
void IncompTpfa::solve(const std::vector<double>& totmob,
|
||||
const std::vector<double>& omega,
|
||||
const std::vector<double>& src,
|
||||
const std::vector<double>& wdp,
|
||||
const FlowBoundaryConditions* bcs,
|
||||
std::vector<double>& pressure,
|
||||
std::vector<double>& faceflux,
|
||||
@@ -125,7 +126,8 @@ namespace Opm
|
||||
if (! src.empty()) { F.src = &src[0]; }
|
||||
F.bc = bcs;
|
||||
F.totmob = &totmob[0];
|
||||
|
||||
F.wdp = &wdp[0];
|
||||
|
||||
ifs_tpfa_assemble(gg, &F, &trans_[0], &gpress_omegaweighted_[0], h_);
|
||||
|
||||
linsolver_.solve(h_->A, h_->b, h_->x);
|
||||
@@ -172,6 +174,7 @@ namespace Opm
|
||||
void IncompTpfa::solve(const std::vector<double>& totmob,
|
||||
const std::vector<double>& omega,
|
||||
const std::vector<double>& src,
|
||||
const std::vector<double>& wdp,
|
||||
const FlowBoundaryConditions* bcs,
|
||||
const std::vector<double>& porevol,
|
||||
const std::vector<double>& rock_comp,
|
||||
@@ -201,6 +204,8 @@ namespace Opm
|
||||
if (! src.empty()) { F.src = &src[0]; }
|
||||
F.bc = bcs;
|
||||
F.totmob = &totmob[0];
|
||||
F.wdp = &wdp[0];
|
||||
|
||||
ifs_tpfa_assemble(gg, &F, &trans_[0], &gpress_omegaweighted_[0], h_);
|
||||
|
||||
// TODO: this is a hack, it would be better to handle this in a
|
||||
|
||||
@@ -79,6 +79,7 @@ namespace Opm
|
||||
void solve(const std::vector<double>& totmob,
|
||||
const std::vector<double>& omega,
|
||||
const std::vector<double>& src,
|
||||
const std::vector<double>& wdp,
|
||||
const FlowBoundaryConditions* bcs,
|
||||
std::vector<double>& pressure,
|
||||
std::vector<double>& faceflux,
|
||||
@@ -110,6 +111,7 @@ namespace Opm
|
||||
void solve(const std::vector<double>& totmob,
|
||||
const std::vector<double>& omega,
|
||||
const std::vector<double>& src,
|
||||
const std::vector<double>& wdp,
|
||||
const FlowBoundaryConditions* bcs,
|
||||
const std::vector<double>& porevol,
|
||||
const std::vector<double>& rock_comp,
|
||||
|
||||
@@ -406,7 +406,7 @@ namespace Opm
|
||||
|
||||
|
||||
void computeWDP(const Wells& wells, const UnstructuredGrid& grid, const std::vector<double>& saturations,
|
||||
const std::vector<double> densities, std::vector<double>& wdp)
|
||||
const std::vector<double>& densities, std::vector<double>& wdp)
|
||||
{
|
||||
// Simple for now:
|
||||
for(int i = 0; i < wells.number_of_wells; i++) {
|
||||
|
||||
@@ -407,6 +407,9 @@ well_controls_append(enum control_type type ,
|
||||
ctrl->target[ctrl->num] = target;
|
||||
|
||||
ctrl->num += 1;
|
||||
|
||||
// TODO: Review this:
|
||||
ctrl->current = 0;
|
||||
}
|
||||
|
||||
return ok;
|
||||
|
||||
Reference in New Issue
Block a user