From 980a6191b2a04a89bc69e58302e00007c8461996 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Fri, 24 Feb 2017 10:56:44 +0100 Subject: [PATCH 1/2] Bugfix: make viscosity output conditional. --- opm/autodiff/SimulatorFullyImplicitBlackoilOutput.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/opm/autodiff/SimulatorFullyImplicitBlackoilOutput.hpp b/opm/autodiff/SimulatorFullyImplicitBlackoilOutput.hpp index 2acf6f594..80556168f 100644 --- a/opm/autodiff/SimulatorFullyImplicitBlackoilOutput.hpp +++ b/opm/autodiff/SimulatorFullyImplicitBlackoilOutput.hpp @@ -628,21 +628,21 @@ namespace Opm const bool has_voil = (rstKeywords["VISC"] > 0) || (rstKeywords["VOIL"] > 0); const bool has_vgas = (rstKeywords["VISC"] > 0) || (rstKeywords["VGAS"] > 0); rstKeywords["VISC"] = 0; - if (aqua_active) { + if (aqua_active && has_vwat) { output.insert("WAT_VISC", Opm::UnitSystem::measure::viscosity, std::move( sd.getCellData("WAT_VISC") ), data::TargetType::RESTART_AUXILIARY); rstKeywords["VWAT"] = 0; } - if (liquid_active) { + if (liquid_active && has_voil) { output.insert("OIL_VISC", Opm::UnitSystem::measure::viscosity, std::move( sd.getCellData("OIL_VISC") ), data::TargetType::RESTART_AUXILIARY); rstKeywords["VOIL"] = 0; } - if (vapour_active) { + if (vapour_active && has_vgas) { output.insert("GAS_VISC", Opm::UnitSystem::measure::viscosity, std::move( sd.getCellData("GAS_VISC") ), From cef4f5d9e5eefb4199f18008b0ed386199e7a441 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Fri, 24 Feb 2017 10:57:17 +0100 Subject: [PATCH 2/2] Avoid signed/unsigned comparison. --- opm/autodiff/BlackoilModelEbos.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opm/autodiff/BlackoilModelEbos.hpp b/opm/autodiff/BlackoilModelEbos.hpp index efca6a432..4672a7a6b 100644 --- a/opm/autodiff/BlackoilModelEbos.hpp +++ b/opm/autodiff/BlackoilModelEbos.hpp @@ -1351,7 +1351,7 @@ namespace Opm { errlog << "Finding the dew point pressure failed for " << failed_cells_pb.size() << " cells ["; errlog << failed_cells_pb[0]; const int max_elems = std::min(max_num_cells_faillog, failed_cells_pb.size()); - for (size_t i = 1; i < max_elems; ++i) { + for (int i = 1; i < max_elems; ++i) { errlog << ", " << failed_cells_pb[i]; } if (failed_cells_pb.size() > max_num_cells_faillog) { @@ -1365,7 +1365,7 @@ namespace Opm { errlog << "Finding the dew point pressure failed for " << failed_cells_pd.size() << " cells ["; errlog << failed_cells_pd[0]; const int max_elems = std::min(max_num_cells_faillog, failed_cells_pd.size()); - for (size_t i = 1; i < max_elems; ++i) { + for (int i = 1; i < max_elems; ++i) { errlog << ", " << failed_cells_pd[i]; } if (failed_cells_pd.size() > max_num_cells_faillog) {