WIP fix vfp in flow

This commit is contained in:
Tor Harald Sandve 2018-05-15 10:24:50 +02:00
parent ffd1f76c7c
commit 2534cc46db
3 changed files with 6 additions and 4 deletions

View File

@ -264,6 +264,7 @@ namespace Opm {
updatePerforationIntensiveQuantities();
if (iterationIdx == 0) {
calculateExplicitQuantities();
prepareTimeStep();
}
@ -272,7 +273,7 @@ namespace Opm {
initPrimaryVariablesEvaluation();
if (iterationIdx == 0) {
calculateExplicitQuantities();
//calculateExplicitQuantities();
}
if (param_.solve_welleq_initially_ && iterationIdx == 0) {
@ -281,6 +282,7 @@ namespace Opm {
if (initial_step_) {
// update the explicit quantities to get the initial fluid distribution in the well correct.
calculateExplicitQuantities();
prepareTimeStep();
last_report_ = solveWellEq(dt);
initial_step_ = false;
}

View File

@ -49,8 +49,8 @@ inline double zeroIfNan(const double& value) {
* Returns zero if input value is NaN
*/
template <class EvalWell>
inline double zeroIfNan(const EvalWell& value) {
return (std::isnan(value.value())) ? 0.0 : value.value();
inline EvalWell zeroIfNan(const EvalWell& value) {
return (std::isnan(value.value())) ? 0.0 : value;
}

View File

@ -124,7 +124,7 @@ namespace Opm
wellrates_[np*w + p] = rate_target * distr[p];
}
} else {
const double small_rate = 1e-14;
const double small_rate = 0.0; //1e-14;
const double sign = (wells->type[w] == INJECTOR) ? 1.0 : -1.0;
for (int p = 0; p < np; ++p) {
wellrates_[np*w + p] = small_rate * sign;