diff --git a/opm/simulators/flow/BlackoilModel.hpp b/opm/simulators/flow/BlackoilModel.hpp index f4c1957a5..dd1607091 100644 --- a/opm/simulators/flow/BlackoilModel.hpp +++ b/opm/simulators/flow/BlackoilModel.hpp @@ -925,7 +925,7 @@ namespace Opm { // We also use relaxed tolerances for cells with total poro volume less than relaxed_max_pv_fraction_ // Default value of relaxed_max_pv_fraction_ is 0.03 const bool relax_final_iteration_cnv = (param_.min_strict_cnv_iter_ < 0) && (iteration == maxIter); - const bool relax_iter_cnv = param_.min_strict_mb_iter_ >= 0 && iteration >= param_.min_strict_mb_iter_; + const bool relax_iter_cnv = param_.min_strict_cnv_iter_ >= 0 && iteration >= param_.min_strict_cnv_iter_; const bool relax_pv_fraction_cnv = cnvErrorPvFraction < param_.relaxed_max_pv_fraction_; const bool use_relaxed_cnv = relax_final_iteration_cnv || relax_pv_fraction_cnv || relax_iter_cnv; diff --git a/opm/simulators/flow/BlackoilModelParameters.hpp b/opm/simulators/flow/BlackoilModelParameters.hpp index 8ea67381a..977e27a7a 100644 --- a/opm/simulators/flow/BlackoilModelParameters.hpp +++ b/opm/simulators/flow/BlackoilModelParameters.hpp @@ -228,7 +228,7 @@ template struct ToleranceMb { using type = GetPropType; - static constexpr type value = 1e-6; + static constexpr type value = 1e-7; }; template @@ -283,7 +283,7 @@ struct MaxSinglePrecisionDays template struct MinStrictCnvIter -{ static constexpr int value = 0; }; +{ static constexpr int value = -1; }; template struct MinStrictMbIter @@ -390,11 +390,11 @@ struct UseAverageDensityMsWells template struct LocalWellSolveControlSwitching -{ static constexpr bool value = false; }; +{ static constexpr bool value = true; }; template struct UseImplicitIpr -{ static constexpr bool value = false; }; +{ static constexpr bool value = true; }; // Network solver parameters template diff --git a/opm/simulators/flow/FlowProblemProperties.hpp b/opm/simulators/flow/FlowProblemProperties.hpp index a0ec30d5d..7f831f8f2 100644 --- a/opm/simulators/flow/FlowProblemProperties.hpp +++ b/opm/simulators/flow/FlowProblemProperties.hpp @@ -371,7 +371,7 @@ struct EnableDebuggingChecks // as default if experimental mode is enabled. template struct EnableDriftCompensation -{ static constexpr bool value = true; }; +{ static constexpr bool value = false; }; // enable the ECL output by default template diff --git a/opm/simulators/linalg/FlowLinearSolverParameters.hpp b/opm/simulators/linalg/FlowLinearSolverParameters.hpp index a9dd35c21..78414de08 100644 --- a/opm/simulators/linalg/FlowLinearSolverParameters.hpp +++ b/opm/simulators/linalg/FlowLinearSolverParameters.hpp @@ -182,7 +182,7 @@ struct ScaleLinearSystem template struct LinearSolver -{ static constexpr auto value = "ilu0"; }; +{ static constexpr auto value = "cprw"; }; template struct LinearSolverPrintJsonDefinition @@ -367,7 +367,7 @@ struct FlowLinearSolverParameters newton_use_gmres_ = false; ignoreConvergenceFailure_ = false; scale_linear_system_ = false; - linsolver_ = "ilu0"; + linsolver_ = "cprw"; linear_solver_print_json_definition_ = true; cpr_reuse_setup_ = 4; cpr_reuse_interval_ = 30; diff --git a/opm/simulators/wells/BlackoilWellModelGeneric.cpp b/opm/simulators/wells/BlackoilWellModelGeneric.cpp index d9b030724..f78f634a0 100644 --- a/opm/simulators/wells/BlackoilWellModelGeneric.cpp +++ b/opm/simulators/wells/BlackoilWellModelGeneric.cpp @@ -62,6 +62,10 @@ #include #include +#if HAVE_MPI +#include +#endif + #include #include #include @@ -1749,11 +1753,26 @@ getMaxWellConnections() const schedule_wells.erase(std::remove_if(schedule_wells.begin(), schedule_wells.end(), not_on_process_), schedule_wells.end()); wells.reserve(schedule_wells.size()); + auto possibleFutureConnections = schedule().getPossibleFutureConnections(); +#if HAVE_MPI + // Communicate Map to other processes, since it is only available on rank 0 + Parallel::MpiSerializer ser(comm_); + ser.broadcast(possibleFutureConnections); +#endif // initialize the additional cell connections introduced by wells. for (const auto& well : schedule_wells) { std::vector compressed_well_perforations = this->getCellsForConnections(well); + const auto possibleFutureConnectionSetIt = possibleFutureConnections.find(well.name()); + if (possibleFutureConnectionSetIt != possibleFutureConnections.end()) { + for (auto& global_index : possibleFutureConnectionSetIt->second) { + int compressed_idx = compressedIndexForInterior(global_index); + if (compressed_idx >= 0) { // Ignore connections in inactive/remote cells. + compressed_well_perforations.push_back(compressed_idx); + } + } + } // also include wells with no perforations in case std::sort(compressed_well_perforations.begin(), compressed_well_perforations.end()); diff --git a/python/test/test_fluidstate_variables.py b/python/test/test_fluidstate_variables.py index d03449eed..78605075d 100644 --- a/python/test/test_fluidstate_variables.py +++ b/python/test/test_fluidstate_variables.py @@ -20,26 +20,26 @@ class TestBasic(unittest.TestCase): sim.step_init() sim.step() oil_pressure = sim.get_fluidstate_variable(name='po') - self.assertAlmostEqual(oil_pressure[0], 35795160.67, places=2, msg='value of oil pressure') + self.assertAlmostEqual(oil_pressure[0], 35795160.67, delta=1e4, msg='value of oil pressure') gas_pressure = sim.get_fluidstate_variable(name='pg') - self.assertAlmostEqual(gas_pressure[0], 35795160.67, places=2, msg='value of gas pressure') + self.assertAlmostEqual(gas_pressure[0], 35795160.67, delta=1e4, msg='value of gas pressure') water_pressure = sim.get_fluidstate_variable(name='pw') - self.assertAlmostEqual(water_pressure[0], 35795160.67, places=2, msg='value of water pressure') + self.assertAlmostEqual(water_pressure[0], 35795160.67, delta=1e4, msg='value of water pressure') rho_w = sim.get_fluidstate_variable(name='rho_w') - self.assertAlmostEqual(rho_w[0], 998.9822355, places=6, msg='value of water density') + self.assertAlmostEqual(rho_w[0], 998.9822355, places=3, msg='value of water density') rho_g = sim.get_fluidstate_variable(name='rho_g') - self.assertAlmostEqual(rho_g[0], 241.36955087, places=7, msg='value of gas density') + self.assertAlmostEqual(rho_g[0], 241.36955087, places=2, msg='value of gas density') rho_o = sim.get_fluidstate_variable(name='rho_o') - self.assertAlmostEqual(rho_o[0], 631.78611238, places=7, msg='value of oil density') + self.assertAlmostEqual(rho_o[0], 631.78611238, places=3, msg='value of oil density') Rs = sim.get_fluidstate_variable(name='Rs') - self.assertAlmostEqual(Rs[0], 226.19666048, places=7, msg='value of solution gas-oil ratio') + self.assertAlmostEqual(Rs[0], 226.19666048, places=5, msg='value of solution gas-oil ratio') Rv = sim.get_fluidstate_variable(name='Rv') - self.assertAlmostEqual(Rv[0], 0.0, places=7, msg='value of volatile gas-oil ratio') + self.assertAlmostEqual(Rv[0], 0.0, places=5, msg='value of volatile gas-oil ratio') Sw = sim.get_fluidstate_variable(name='Sw') - self.assertAlmostEqual(Sw[0], 0.11969486712, places=10, msg='value of water saturation') + self.assertAlmostEqual(Sw[0], 0.11969486712, places=5, msg='value of water saturation') So = sim.get_fluidstate_variable(name='So') - self.assertAlmostEqual(So[0], 0.825166164326, places=10, msg='value of oil saturation') + self.assertAlmostEqual(So[0], 0.825166164326, places=5, msg='value of oil saturation') Sg = sim.get_fluidstate_variable(name='Sg') - self.assertAlmostEqual(Sg[0], 0.055138968544, places=10, msg='value of gas saturation') + self.assertAlmostEqual(Sg[0], 0.055138968544, places=5, msg='value of gas saturation') T = sim.get_fluidstate_variable(name='T') self.assertAlmostEqual(T[0], 288.705, places=3, msg='value of temperature') diff --git a/python/test/test_primary_variables.py b/python/test/test_primary_variables.py index ce8b51eaf..3f48e53c5 100644 --- a/python/test/test_primary_variables.py +++ b/python/test/test_primary_variables.py @@ -20,7 +20,7 @@ class TestBasic(unittest.TestCase): sim.step_init() sim.step() pressure = sim.get_primary_variable(variable='pressure') - self.assertAlmostEqual(pressure[0], 35795160.67, places=2, msg='value of pressure') + self.assertAlmostEqual(pressure[0], 35795160.67, delta=1e4, msg='value of pressure') pressure_meaning = sim.get_primary_variable_meaning( variable='pressure') pressure_meaning_map = sim.get_primary_variable_meaning_map(