ExtBoModule: Don't Overload on Scalar and Evaluation

The two types may be the same, in which case this is a build
failure.
This commit is contained in:
Bård Skaflestad 2020-11-18 19:00:47 +01:00
parent 5d9783f9b1
commit fb001a04c4

View File

@ -98,8 +98,6 @@ class BlackOilExtboModule
static constexpr unsigned waterPhaseIdx = FluidSystem::waterPhaseIdx; static constexpr unsigned waterPhaseIdx = FluidSystem::waterPhaseIdx;
static constexpr bool blackoilConserveSurfaceVolume = getPropValue<TypeTag, Properties::BlackoilConserveSurfaceVolume>(); static constexpr bool blackoilConserveSurfaceVolume = getPropValue<TypeTag, Properties::BlackoilConserveSurfaceVolume>();
public: public:
#if HAVE_ECL_INPUT #if HAVE_ECL_INPUT
/*! /*!
@ -499,136 +497,75 @@ public:
priVars1 = priVars0[zFractionIdx]; priVars1 = priVars0[zFractionIdx];
} }
static const Scalar xVolume(unsigned pvtRegionIdx, const Scalar& pressure, const Scalar& z) { template <typename Value>
const auto& xVolumeTable = X_[pvtRegionIdx]; static Value xVolume(unsigned pvtRegionIdx, const Value& pressure, const Value& z) {
return xVolumeTable.eval(z, pressure); return X_[pvtRegionIdx].eval(z, pressure);
} }
static const Evaluation xVolume(unsigned pvtRegionIdx, const Evaluation& pressure, const Evaluation& z) { template <typename Value>
const auto& xVolumeTable = X_[pvtRegionIdx]; static Value yVolume(unsigned pvtRegionIdx, const Value& pressure, const Value& z) {
return xVolumeTable.eval(z, pressure); return Y_[pvtRegionIdx].eval(z, pressure);
} }
static const Scalar yVolume(unsigned pvtRegionIdx, const Scalar& pressure, const Scalar& z) { template <typename Value>
const auto& yVolumeTable = Y_[pvtRegionIdx]; static Value pbubRs(unsigned pvtRegionIdx, const Value& z, const Value& rs) {
return yVolumeTable.eval(z, pressure); return PBUB_RS_[pvtRegionIdx].eval(z, rs);
} }
static const Evaluation yVolume(unsigned pvtRegionIdx, const Evaluation& pressure, const Evaluation& z) { template <typename Value>
const auto& yVolumeTable = Y_[pvtRegionIdx]; static Value pbubRv(unsigned pvtRegionIdx, const Value& z, const Value& rv) {
return yVolumeTable.eval(z, pressure); return PBUB_RV_[pvtRegionIdx].eval(z, rv);
} }
static const Scalar pbubRs(unsigned pvtRegionIdx, const Scalar& z, const Scalar& rs) { template <typename Value>
const auto& pbubRsTable = PBUB_RS_[pvtRegionIdx]; static Value oilViscosity(unsigned pvtRegionIdx, const Value& pressure, const Value& z) {
return pbubRsTable.eval(z, rs); return VISCO_[pvtRegionIdx].eval(z, pressure);
} }
static const Evaluation pbubRs(unsigned pvtRegionIdx, const Evaluation& z, const Evaluation& rs) { template <typename Value>
const auto& pbubRsTable = PBUB_RS_[pvtRegionIdx]; static Value gasViscosity(unsigned pvtRegionIdx, const Value& pressure, const Value& z) {
return pbubRsTable.eval(z, rs); return VISCG_[pvtRegionIdx].eval(z, pressure);
} }
static const Scalar pbubRv(unsigned pvtRegionIdx, const Scalar& z, const Scalar& rv) { template <typename Value>
const auto& pbubRvTable = PBUB_RV_[pvtRegionIdx]; static Value bo(unsigned pvtRegionIdx, const Value& pressure, const Value& z) {
return pbubRvTable.eval(z, rv); return BO_[pvtRegionIdx].eval(z, pressure);
} }
static const Evaluation pbubRv(unsigned pvtRegionIdx, const Evaluation& z, const Evaluation& rv) { template <typename Value>
const auto& pbubRvTable = PBUB_RV_[pvtRegionIdx]; static Value bg(unsigned pvtRegionIdx, const Value& pressure, const Value& z) {
return pbubRvTable.eval(z, rv); return BG_[pvtRegionIdx].eval(z, pressure);
} }
static const Scalar oilViscosity(unsigned pvtRegionIdx, const Scalar& pressure, const Scalar& z) { template <typename Value>
const auto& oilViscosityTable = VISCO_[pvtRegionIdx]; static Value rs(unsigned pvtRegionIdx, const Value& pressure, const Value& z) {
return oilViscosityTable.eval(z, pressure); return RS_[pvtRegionIdx].eval(z, pressure);
} }
static const Evaluation oilViscosity(unsigned pvtRegionIdx, const Evaluation& pressure, const Evaluation& z) { template <typename Value>
const auto& oilViscosityTable = VISCO_[pvtRegionIdx]; static Value rv(unsigned pvtRegionIdx, const Value& pressure, const Value& z) {
return oilViscosityTable.eval(z, pressure); return RV_[pvtRegionIdx].eval(z, pressure);
} }
static const Scalar gasViscosity(unsigned pvtRegionIdx, const Scalar& pressure, const Scalar& z) { static Scalar referenceDensity(unsigned regionIdx) {
const auto& gasViscosityTable = VISCG_[pvtRegionIdx];
return gasViscosityTable.eval(z, pressure);
}
static const Evaluation gasViscosity(unsigned pvtRegionIdx, const Evaluation& pressure, const Evaluation& z) {
const auto& gasViscosityTable = VISCG_[pvtRegionIdx];
return gasViscosityTable.eval(z, pressure);
}
static const Scalar bo(unsigned pvtRegionIdx, const Scalar& pressure, const Scalar& z) {
const auto& boTable = BO_[pvtRegionIdx];
return boTable.eval(z, pressure);
}
static const Evaluation bo(unsigned pvtRegionIdx, const Evaluation& pressure, const Evaluation& z) {
const auto& boTable = BO_[pvtRegionIdx];
return boTable.eval(z, pressure);
}
static const Scalar bg(unsigned pvtRegionIdx, const Scalar& pressure, const Scalar& z) {
const auto& bgTable = BG_[pvtRegionIdx];
return bgTable.eval(z, pressure);
}
static const Evaluation bg(unsigned pvtRegionIdx, const Evaluation& pressure, const Evaluation& z) {
const auto& bgTable = BG_[pvtRegionIdx];
return bgTable.eval(z, pressure);
}
static const Scalar rs(unsigned pvtRegionIdx, const Scalar& pressure, const Scalar& z) {
const auto& rsTable = RS_[pvtRegionIdx];
return rsTable.eval(z, pressure);
}
static const Evaluation rs(unsigned pvtRegionIdx, const Evaluation& pressure, const Evaluation& z) {
const auto& rsTable = RS_[pvtRegionIdx];
return rsTable.eval(z, pressure);
}
static const Scalar rv(unsigned pvtRegionIdx, const Scalar& pressure, const Scalar& z) {
const auto& rvTable = RV_[pvtRegionIdx];
return rvTable.eval(z, pressure);
}
static const Evaluation rv(unsigned pvtRegionIdx, const Evaluation& pressure, const Evaluation& z) {
const auto& rvTable = RV_[pvtRegionIdx];
return rvTable.eval(z, pressure);
}
static const Scalar referenceDensity(unsigned regionIdx) {
return zReferenceDensity_[regionIdx]; return zReferenceDensity_[regionIdx];
} }
static const Scalar zLim(unsigned regionIdx) { static Scalar zLim(unsigned regionIdx) {
return zLim_[regionIdx]; return zLim_[regionIdx];
} }
static const Scalar oilCmp(unsigned pvtRegionIdx, const Scalar& z) { template <typename Value>
const auto& oilCmpTable = oilCmp_[pvtRegionIdx]; static Value oilCmp(unsigned pvtRegionIdx, const Value& z) {
return oilCmpTable.eval(z); return oilCmp_[pvtRegionIdx].eval(z);
} }
static const Evaluation oilCmp(unsigned pvtRegionIdx, const Evaluation& z) { template <typename Value>
const auto& oilCmpTable = oilCmp_[pvtRegionIdx]; static Value gasCmp(unsigned pvtRegionIdx, const Value& z) {
return oilCmpTable.eval(z); return gasCmp_[pvtRegionIdx].eval(z);
}
static const Scalar gasCmp(unsigned pvtRegionIdx, const Scalar& z) {
const auto& gasCmpTable = gasCmp_[pvtRegionIdx];
return gasCmpTable.eval(z);
}
static const Evaluation gasCmp(unsigned pvtRegionIdx, const Evaluation& z) {
const auto& gasCmpTable = gasCmp_[pvtRegionIdx];
return gasCmpTable.eval(z);
} }
private: private:
static std::vector<Tabulated2DFunction> X_; static std::vector<Tabulated2DFunction> X_;
static std::vector<Tabulated2DFunction> Y_; static std::vector<Tabulated2DFunction> Y_;
static std::vector<Tabulated2DFunction> PBUB_RS_; static std::vector<Tabulated2DFunction> PBUB_RS_;
@ -755,7 +692,7 @@ public:
bo_ = ExtboModule::bo(pvtRegionIdx, fs.pressure(oilPhaseIdx), zFraction_); bo_ = ExtboModule::bo(pvtRegionIdx, fs.pressure(oilPhaseIdx), zFraction_);
bg_ = ExtboModule::bg(pvtRegionIdx, fs.pressure(gasPhaseIdx), zFraction_); bg_ = ExtboModule::bg(pvtRegionIdx, fs.pressure(gasPhaseIdx), zFraction_);
bz_ = ExtboModule::bg(pvtRegionIdx, fs.pressure(oilPhaseIdx), 0.99); bz_ = ExtboModule::bg(pvtRegionIdx, fs.pressure(oilPhaseIdx), Evaluation{0.99});
if (FluidSystem::enableDissolvedGas()) if (FluidSystem::enableDissolvedGas())
rs_ = ExtboModule::rs(pvtRegionIdx, fs.pressure(oilPhaseIdx), zFraction_); rs_ = ExtboModule::rs(pvtRegionIdx, fs.pressure(oilPhaseIdx), zFraction_);