mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Changes to solver approach configuration:
1. Added new parameter group string: "solver_approach" which can take the values {direct, cpr, interleaved}. 2. Hierarchy: i If a value is set in the parameter group that takes absolute presedence. ii If the Eclipse input deck asks for CPR - you get CPR. iii You get the flow default - currently interleaved.
This commit is contained in:
parent
a106ef0636
commit
0a7c778c36
@ -371,12 +371,33 @@ try
|
||||
|
||||
// Solver for Newton iterations.
|
||||
std::unique_ptr<NewtonIterationBlackoilInterface> fis_solver;
|
||||
if (param.getDefault("use_interleaved", true)) {
|
||||
fis_solver.reset(new NewtonIterationBlackoilInterleaved(param, parallel_information));
|
||||
} else if (param.getDefault("use_cpr", true)) {
|
||||
fis_solver.reset(new NewtonIterationBlackoilCPR(param, parallel_information));
|
||||
{
|
||||
const std::string cprSolver = "cpr";
|
||||
const std::string interleavedSolver = "interleaved";
|
||||
const std::string directSolver = "direct";
|
||||
const std::string flowDefaultSolver = interleavedSolver;
|
||||
|
||||
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();
|
||||
|
Loading…
Reference in New Issue
Block a user