From 7c6ac0bf09ff4eceb38e01290a8058777284374a Mon Sep 17 00:00:00 2001 From: Kjetil Olsen Lye Date: Wed, 25 Apr 2012 16:14:40 +0200 Subject: [PATCH] Completly revamped the way group control is checked --- examples/wells_example.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/examples/wells_example.cpp b/examples/wells_example.cpp index ef2fb6ed3..6c253129b 100644 --- a/examples/wells_example.cpp +++ b/examples/wells_example.cpp @@ -76,9 +76,17 @@ int main(int argc, char** argv) { std::vector well_rate; computeFlowRatePerWell(*wells.c_wells(), well_rate_per_cell, well_rate); - WellControlResult well_control_results; - wells.wellCollection().conditionsMet(well_bhp, well_rate, *grid.c_grid(), well_control_results ); - wells.applyControl(well_control_results); + + while (!wells.conditionsMet(well_bhp, well_rate)) { + std::cout << "Conditions not met for well, trying again" << std::endl; + pressure_solver.solve(totmob, omega, src, wdp, bcs.c_bcs(), pressure, face_flux, well_bhp, well_rate_per_cell); + std::cout << "Solved" << std::endl; + + for (size_t i = 0; i < well_rate_per_cell.size(); i++) { + std::cout << well_rate_per_cell[i] << std::endl; + } + computeFlowRatePerWell(*wells.c_wells(), well_rate_per_cell, well_rate); + } #if 0 std::vector porevol;