mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #508 from joakim-hove/cpr-config
Changes to solver approach configuration:
This commit is contained in:
commit
f15be17d14
@ -371,12 +371,33 @@ try
|
|||||||
|
|
||||||
// Solver for Newton iterations.
|
// Solver for Newton iterations.
|
||||||
std::unique_ptr<NewtonIterationBlackoilInterface> fis_solver;
|
std::unique_ptr<NewtonIterationBlackoilInterface> fis_solver;
|
||||||
if (param.getDefault("use_interleaved", true)) {
|
{
|
||||||
fis_solver.reset(new NewtonIterationBlackoilInterleaved(param, parallel_information));
|
const std::string cprSolver = "cpr";
|
||||||
} else if (param.getDefault("use_cpr", true)) {
|
const std::string interleavedSolver = "interleaved";
|
||||||
fis_solver.reset(new NewtonIterationBlackoilCPR(param, parallel_information));
|
const std::string directSolver = "direct";
|
||||||
} else {
|
const std::string flowDefaultSolver = interleavedSolver;
|
||||||
fis_solver.reset(new NewtonIterationBlackoilSimple(param, parallel_information));
|
|
||||||
|
std::shared_ptr<const Opm::SimulationConfig> simCfg = eclipseState->getSimulationConfig();
|
||||||
|
std::string solver_approach = flowDefaultSolver;
|
||||||
|
|
||||||
|
if (param.has("solver_approach")) {
|
||||||
|
solver_approach = param.get<std::string>("solver_approach");
|
||||||
|
} else {
|
||||||
|
if (simCfg->useCPR()) {
|
||||||
|
solver_approach = cprSolver;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (solver_approach == cprSolver) {
|
||||||
|
fis_solver.reset(new NewtonIterationBlackoilCPR(param, parallel_information));
|
||||||
|
} else if (solver_approach == interleavedSolver) {
|
||||||
|
fis_solver.reset(new NewtonIterationBlackoilInterleaved(param, parallel_information));
|
||||||
|
} else if (solver_approach == directSolver) {
|
||||||
|
fis_solver.reset(new NewtonIterationBlackoilSimple(param, parallel_information));
|
||||||
|
} else {
|
||||||
|
OPM_THROW( std::runtime_error , "Internal error - solver approach " << solver_approach << " not recognized.");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Opm::ScheduleConstPtr schedule = eclipseState->getSchedule();
|
Opm::ScheduleConstPtr schedule = eclipseState->getSchedule();
|
||||||
|
Loading…
Reference in New Issue
Block a user