mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Only deal with concentration if has_polymer_ is true.
This commit is contained in:
parent
2539fb935d
commit
2cd5b672bf
@ -177,12 +177,14 @@ namespace Opm {
|
||||
{
|
||||
std::vector<int> ind = Base::variableStateIndices();
|
||||
assert(int.size() == 5);
|
||||
ind.resize(6);
|
||||
// Concentration belongs after other reservoir vars but before well vars.
|
||||
ind[Concentration] = fluid_.numPhases();
|
||||
// Concentration is pushing back the well vars.
|
||||
++ind[Qs];
|
||||
++ind[Bhp];
|
||||
if (has_polymer_) {
|
||||
ind.resize(6);
|
||||
// Concentration belongs after other reservoir vars but before well vars.
|
||||
ind[Concentration] = fluid_.numPhases();
|
||||
// Concentration is pushing back the well vars.
|
||||
++ind[Qs];
|
||||
++ind[Bhp];
|
||||
}
|
||||
return ind;
|
||||
}
|
||||
|
||||
@ -196,7 +198,9 @@ namespace Opm {
|
||||
std::vector<ADB>& vars) const
|
||||
{
|
||||
SolutionState state = Base::variableStateExtractVars(x, indices, vars);
|
||||
state.concentration = std::move(vars[indices[Concentration]]);
|
||||
if (has_polymer_) {
|
||||
state.concentration = std::move(vars[indices[Concentration]]);
|
||||
}
|
||||
return state;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user