Support Oil/Water case

The updatePrimalVariableFromState is now only called when
the gas phase is active.
This commit is contained in:
Tor Harald Sandve
2014-06-03 13:30:35 +02:00
parent 3e3b39df07
commit 02ce468c01
2 changed files with 16 additions and 12 deletions

View File

@@ -285,6 +285,9 @@ namespace Opm {
void
classifyCondition(const BlackoilState& state);
/// update the primal variable for Sg, Rv or Rs. The Gas phase must
/// be active to call this method.
void
updatePrimalVariableFromState(const BlackoilState& state);

View File

@@ -276,7 +276,8 @@ namespace {
{
const V pvdt = geo_.poreVolume() / dt;
updatePrimalVariableFromState(x);
if (active_[Gas]) { updatePrimalVariableFromState(x); }
{
const SolutionState state = constantState(x, xw);
computeAccum(state, 0);
@@ -469,7 +470,6 @@ namespace {
V isSg = V::Zero(nc,1);
if (active_[ Gas ]){
for (int c = 0; c < nc ; c++ ) {
if ( primalVariable_[c] == PrimalVariables::RS ) {
isRs[c] = 1;
@@ -1224,16 +1224,17 @@ namespace {
V isRs = V::Zero(nc,1);
V isRv = V::Zero(nc,1);
V isSg = V::Zero(nc,1);
for (int c = 0; c < nc ; c++ ) {
if ( primalVariable_[c] == PrimalVariables::RS ) {
isRs[c] = 1;
}
else if ( primalVariable_[c] == PrimalVariables::RV ) {
isRv[c] = 1;
}
else {
isSg[c] = 1;
if (active_[Gas]) {
for (int c = 0; c < nc ; c++ ) {
if ( primalVariable_[c] == PrimalVariables::RS ) {
isRs[c] = 1;
}
else if ( primalVariable_[c] == PrimalVariables::RV ) {
isRv[c] = 1;
}
else {
isSg[c] = 1;
}
}
}