diff --git a/opm/material/common/Tabulated1DFunction.hpp b/opm/material/common/Tabulated1DFunction.hpp index f49664c11..b2fa517e0 100644 --- a/opm/material/common/Tabulated1DFunction.hpp +++ b/opm/material/common/Tabulated1DFunction.hpp @@ -129,16 +129,17 @@ public: bool sortInputs = true) { assert(x.size() == y.size()); - assert(x.size() > 1); resizeArrays_(x.size()); - std::copy(x.begin(), x.end(), xValues_.begin()); - std::copy(y.begin(), y.end(), yValues_.begin()); + if (x.size() > 0) { + std::copy(x.begin(), x.end(), xValues_.begin()); + std::copy(y.begin(), y.end(), yValues_.begin()); - if (sortInputs) - sortInput_(); - else if (xValues_[0] > xValues_[numSamples() - 1]) - reverseSamplingPoints_(); + if (sortInputs) + sortInput_(); + else if (xValues_[0] > xValues_[numSamples() - 1]) + reverseSamplingPoints_(); + } } /*! diff --git a/opm/material/fluidmatrixinteractions/EclMaterialLawManager.hpp b/opm/material/fluidmatrixinteractions/EclMaterialLawManager.hpp index 7b4f8d454..7e313bb4e 100644 --- a/opm/material/fluidmatrixinteractions/EclMaterialLawManager.hpp +++ b/opm/material/fluidmatrixinteractions/EclMaterialLawManager.hpp @@ -1099,9 +1099,9 @@ private: GasOilEffectiveParamVector gasOilEffectiveParamVector_; OilWaterEffectiveParamVector oilWaterEffectiveParamVector_; - Opm::EclMultiplexerApproach threePhaseApproach_; + Opm::EclMultiplexerApproach threePhaseApproach_ = EclMultiplexerApproach::EclDefaultApproach; // this attribute only makes sense for twophase simulations! - enum EclTwoPhaseApproach twoPhaseApproach_; + enum EclTwoPhaseApproach twoPhaseApproach_ = EclTwoPhaseApproach::EclTwoPhaseGasOil; std::vector > materialLawParams_; diff --git a/opm/material/fluidsystems/blackoilpvt/WaterPvtMultiplexer.hpp b/opm/material/fluidsystems/blackoilpvt/WaterPvtMultiplexer.hpp index 0be51bacb..97680df53 100644 --- a/opm/material/fluidsystems/blackoilpvt/WaterPvtMultiplexer.hpp +++ b/opm/material/fluidsystems/blackoilpvt/WaterPvtMultiplexer.hpp @@ -81,7 +81,7 @@ public: , realWaterPvt_(realWaterPvt) { } - WaterPvtMultiplexer(const WaterPvtMultiplexer& data) + WaterPvtMultiplexer(const WaterPvtMultiplexer& data) { *this = data; } @@ -274,7 +274,7 @@ public: const void* realWaterPvt() const { return realWaterPvt_; } - bool operator==(const WaterPvtMultiplexer& data) const + bool operator==(const WaterPvtMultiplexer& data) const { if (this->approach() != data.approach()) return false; @@ -294,7 +294,7 @@ public: } } - WaterPvtMultiplexer& operator=(const WaterPvtMultiplexer& data) + WaterPvtMultiplexer& operator=(const WaterPvtMultiplexer& data) { approach_ = data.approach_; switch (approach_) { diff --git a/opm/material/thermal/EclThermalLawManager.hpp b/opm/material/thermal/EclThermalLawManager.hpp index 34cdb0f9d..e1df26b3c 100644 --- a/opm/material/thermal/EclThermalLawManager.hpp +++ b/opm/material/thermal/EclThermalLawManager.hpp @@ -69,29 +69,28 @@ public: thermalConductivityApproach_ = ThermalConductionLawParams::undefinedApproach; } - void initFromDeck(const Opm::Deck& deck, - const Opm::EclipseState& eclState, - const std::vector& compressedToCartesianElemIdx) + void initParamsForElements(const Opm::EclipseState& eclState, + const std::vector& compressedToCartesianElemIdx) { const auto& fp = eclState.fieldProps(); + const auto& tableManager = eclState.getTableManager(); bool has_heatcr = fp.has_double("HEATCR"); bool has_thconr = fp.has_double("THCONR"); bool has_thc = fp.has_double("THCROCK") || fp.has_double("THCOIL") || fp.has_double("THCGAS") || fp.has_double("THCWATER"); if (has_heatcr) - initHeatcr_(deck, eclState, compressedToCartesianElemIdx); - else if (deck.hasKeyword("SPECROCK")) - initSpecrock_(deck, eclState, compressedToCartesianElemIdx); + initHeatcr_(eclState, compressedToCartesianElemIdx); + else if (tableManager.hasTables("SPECROCK")) + initSpecrock_(eclState, compressedToCartesianElemIdx); else - initNullRockEnergy_(deck, eclState, compressedToCartesianElemIdx); - + initNullRockEnergy_(); if (has_thconr) - initThconr_(deck, eclState, compressedToCartesianElemIdx); + initThconr_(eclState, compressedToCartesianElemIdx); else if (has_thc) - initThc_(deck, eclState, compressedToCartesianElemIdx); + initThc_(eclState, compressedToCartesianElemIdx); else - initNullCond_(deck, eclState, compressedToCartesianElemIdx); + initNullCond_(); } const SolidEnergyLawParams& solidEnergyLawParams(unsigned elemIdx) const @@ -139,8 +138,7 @@ private: /*! * \brief Initialize the parameters for the solid energy law using using HEATCR and friends. */ - void initHeatcr_(const Opm::Deck& deck OPM_UNUSED, - const Opm::EclipseState& eclState, + void initHeatcr_(const Opm::EclipseState& eclState, const std::vector& compressedToCartesianElemIdx) { solidEnergyApproach_ = SolidEnergyLawParams::heatcrApproach; @@ -168,8 +166,7 @@ private: /*! * \brief Initialize the parameters for the solid energy law using using SPECROCK and friends. */ - void initSpecrock_(const Opm::Deck& deck OPM_UNUSED, - const Opm::EclipseState& eclState, + void initSpecrock_(const Opm::EclipseState& eclState, const std::vector& compressedToCartesianElemIdx) { solidEnergyApproach_ = SolidEnergyLawParams::specrockApproach; @@ -209,9 +206,7 @@ private: /*! * \brief Specify the solid energy law by setting heat capacity of rock to 0 */ - void initNullRockEnergy_(const Opm::Deck& deck OPM_UNUSED, - const Opm::EclipseState& eclState OPM_UNUSED, - const std::vector& compressedToCartesianElemIdx OPM_UNUSED) + void initNullRockEnergy_() { solidEnergyApproach_ = SolidEnergyLawParams::nullApproach; @@ -222,8 +217,7 @@ private: /*! * \brief Initialize the parameters for the thermal conduction law using THCONR and friends. */ - void initThconr_(const Opm::Deck& deck OPM_UNUSED, - const Opm::EclipseState& eclState, + void initThconr_(const Opm::EclipseState& eclState, const std::vector& compressedToCartesianElemIdx) { thermalConductivityApproach_ = ThermalConductionLawParams::thconrApproach; @@ -257,8 +251,7 @@ private: /*! * \brief Initialize the parameters for the thermal conduction law using THCROCK and friends. */ - void initThc_(const Opm::Deck& deck OPM_UNUSED, - const Opm::EclipseState& eclState, + void initThc_(const Opm::EclipseState& eclState, const std::vector& compressedToCartesianElemIdx) { thermalConductivityApproach_ = ThermalConductionLawParams::thcApproach; @@ -306,9 +299,7 @@ private: /*! * \brief Disable thermal conductivity */ - void initNullCond_(const Opm::Deck& deck OPM_UNUSED, - const Opm::EclipseState& eclState OPM_UNUSED, - const std::vector& compressedToCartesianElemIdx OPM_UNUSED) + void initNullCond_() { thermalConductivityApproach_ = ThermalConductionLawParams::nullApproach;