Workaround: ensure properties necessary for FIP are computed.

Should only result in an extra call the first time in this function.
This commit is contained in:
Atgeirr Flø Rasmussen 2017-04-25 09:31:48 +02:00
parent c4c760ae8d
commit fff99360b3
2 changed files with 24 additions and 1 deletions

View File

@ -91,6 +91,10 @@ namespace Opm {
using Base::wellModel;
std::vector<std::vector<double> >
computeFluidInPlace(const ReservoirState& x,
const std::vector<int>& fipnum);
protected:
// --------- Types and enums ---------
@ -229,7 +233,6 @@ namespace Opm {
const ADB& so,
const ADB& sg,
const ADB& ss) const;
};

View File

@ -1087,6 +1087,26 @@ namespace Opm {
}
template <class Grid>
std::vector<std::vector<double> >
BlackoilSolventModel<Grid>::
computeFluidInPlace(const ReservoirState& x,
const std::vector<int>& fipnum)
{
if (b_eff_[0].size() == 0) {
// A hack to avoid trouble for initial fluid in place, due to usage of b_eff_.
WellState xw, xwdummy;
xw.init(&wells(), x, xwdummy);
SolutionState solstate = variableState(x, xw);
computeEffectiveProperties(solstate);
}
return Base::computeFluidInPlace(x, fipnum);
}
}