From 0961cf6e224998e11730b2ae879d6629e424795e Mon Sep 17 00:00:00 2001 From: Joakim Hove Date: Fri, 4 Oct 2019 13:20:57 +0200 Subject: [PATCH 1/2] Remove unused #include of grid quantities --- opm/core/props/satfunc/RelpermDiagnostics.hpp | 3 --- opm/core/props/satfunc/RelpermDiagnostics_impl.hpp | 1 + tests/test_wellmodel.cpp | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/opm/core/props/satfunc/RelpermDiagnostics.hpp b/opm/core/props/satfunc/RelpermDiagnostics.hpp index f89c47360..b32fbd8ca 100644 --- a/opm/core/props/satfunc/RelpermDiagnostics.hpp +++ b/opm/core/props/satfunc/RelpermDiagnostics.hpp @@ -27,9 +27,6 @@ #include "config.h" #endif // HAVE_CONFIG_H -#include -#include -#include #include #include #include diff --git a/opm/core/props/satfunc/RelpermDiagnostics_impl.hpp b/opm/core/props/satfunc/RelpermDiagnostics_impl.hpp index 69912cdd5..149f0f976 100644 --- a/opm/core/props/satfunc/RelpermDiagnostics_impl.hpp +++ b/opm/core/props/satfunc/RelpermDiagnostics_impl.hpp @@ -25,6 +25,7 @@ #include #include +#include namespace Opm { diff --git a/tests/test_wellmodel.cpp b/tests/test_wellmodel.cpp index aae6541aa..39167f198 100644 --- a/tests/test_wellmodel.cpp +++ b/tests/test_wellmodel.cpp @@ -35,7 +35,7 @@ #include #include -#include +#include #include #include #include From 2d544b87f32fa4e50fb1389bb63121fb4d3aacd4 Mon Sep 17 00:00:00 2001 From: Joakim Hove Date: Fri, 4 Oct 2019 13:22:20 +0200 Subject: [PATCH 2/2] Remove trailing whitespace --- opm/core/props/satfunc/RelpermDiagnostics.cpp | 28 +++++++++---------- opm/core/props/satfunc/RelpermDiagnostics.hpp | 10 +++---- .../props/satfunc/RelpermDiagnostics_impl.hpp | 10 +++---- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/opm/core/props/satfunc/RelpermDiagnostics.cpp b/opm/core/props/satfunc/RelpermDiagnostics.cpp index 41fb03fa3..0f93592d7 100644 --- a/opm/core/props/satfunc/RelpermDiagnostics.cpp +++ b/opm/core/props/satfunc/RelpermDiagnostics.cpp @@ -32,21 +32,21 @@ namespace Opm{ bool hasGas = phases.active( Phase::GAS ); bool hasOil = phases.active( Phase::OIL ); bool hasSolvent = phases.active( Phase::SOLVENT ); - + if (hasWater && hasGas && !hasOil && !hasSolvent) { const std::string msg = "System: Water-Gas system."; OpmLog::info(msg); fluidSystem_ = FluidSystem::WaterGas; } - if (hasWater && hasOil && !hasGas && !hasSolvent) { + if (hasWater && hasOil && !hasGas && !hasSolvent) { const std::string msg = "System: Oil-Water system."; OpmLog::info(msg); - fluidSystem_ = FluidSystem::OilWater; + fluidSystem_ = FluidSystem::OilWater; } - if (hasOil && hasGas && !hasWater && !hasSolvent) { + if (hasOil && hasGas && !hasWater && !hasSolvent) { const std::string msg = "System: Oil-Gas system."; OpmLog::info(msg); - fluidSystem_ = FluidSystem::OilGas; + fluidSystem_ = FluidSystem::OilGas; } if (hasOil && hasWater && hasGas && !hasSolvent) { const std::string msg = "System: Black-oil system."; @@ -115,7 +115,7 @@ namespace Opm{ satFamily_ = SaturationFunctionFamily::FamilyI; const std::string msg = "Relative permeability input format: Saturation Family I."; OpmLog::info(msg); - } + } if (!family1 && family2) { satFamily_ = SaturationFunctionFamily::FamilyII; const std::string msg = "Relative permeability input format: Saturation Family II."; @@ -124,7 +124,7 @@ namespace Opm{ } - + void RelpermDiagnostics::tableCheck_(const EclipseState& eclState) { @@ -147,7 +147,7 @@ namespace Opm{ const TableContainer& ssfnTables = tableManager.getSsfnTables(); const TableContainer& miscTables = tableManager.getMiscTables(); const TableContainer& msfnTables = tableManager.getMsfnTables(); - + for (int satnumIdx = 0; satnumIdx < numSatRegions; ++satnumIdx) { if (tableManager.hasTables("SWOF")) { swofTableCheck_(swofTables.getTable(satnumIdx), satnumIdx+1); @@ -203,7 +203,7 @@ namespace Opm{ - void RelpermDiagnostics::swofTableCheck_(const Opm::SwofTable& swofTables, + void RelpermDiagnostics::swofTableCheck_(const Opm::SwofTable& swofTables, const int satnumIdx) { const auto& sw = swofTables.getSwColumn(); @@ -274,7 +274,7 @@ namespace Opm{ } void RelpermDiagnostics::slgofTableCheck_(const Opm::SlgofTable& slgofTables, - const int satnumIdx) + const int satnumIdx) { const auto& sl = slgofTables.getSlColumn(); const auto& krg = slgofTables.getKrgColumn(); @@ -321,7 +321,7 @@ namespace Opm{ const std::string msg = "In SWFN table SATNUM = " + regionIdx + ", saturation should be in range [0,1]."; OpmLog::error(msg); } - + //Check krw column. if (krw.front() < 0.0 || krw.back() > 1.0) { const std::string msg = "In SWFN table SATNUM = " + regionIdx + ", krw should be in range [0,1]."; @@ -334,7 +334,7 @@ namespace Opm{ } } - + @@ -349,7 +349,7 @@ namespace Opm{ const std::string msg = "In SGFN table SATNUM = " + regionIdx + ", saturation should be in range [0,1]."; OpmLog::error(msg); } - + //Check krg column. if (krg.front() < 0.0 || krg.back() > 1.0) { const std::string msg = "In SGFN table SATNUM = " + regionIdx + ", krg should be in range [0,1]."; @@ -399,7 +399,7 @@ namespace Opm{ const std::string msg = "In SOF3 table SATNUM = " + regionIdx + ", first value of krog should be 0."; OpmLog::error(msg); } - + if (krog.back() != krow.back()) { const std::string msg = "In SOF3 table SATNUM = " + regionIdx + ", max value of krog and krow should be the same."; OpmLog::error(msg); diff --git a/opm/core/props/satfunc/RelpermDiagnostics.hpp b/opm/core/props/satfunc/RelpermDiagnostics.hpp index b32fbd8ca..cccf56882 100644 --- a/opm/core/props/satfunc/RelpermDiagnostics.hpp +++ b/opm/core/props/satfunc/RelpermDiagnostics.hpp @@ -45,11 +45,11 @@ namespace Opm { ///This class is intend to be a relpmer diganostics, to detect ///wrong input of relperm table and endpoints. - class RelpermDiagnostics + class RelpermDiagnostics { public: ///This function is used to diagnosis relperm in - ///eclipse data file. Errors and warings will be + ///eclipse data file. Errors and warings will be ///output if they're found. ///\param[in] eclState eclipse state. ///\param[in] deck ecliplise data file. @@ -67,7 +67,7 @@ namespace Opm { BlackOil, Solvent }; - + FluidSystem fluidSystem_; enum SaturationFunctionFamily { @@ -75,7 +75,7 @@ namespace Opm { FamilyII, NoFamily }; - + SaturationFunctionFamily satFamily_; std::vector > unscaledEpsInfo_; @@ -87,7 +87,7 @@ namespace Opm { ///Check saturation family I and II. void satFamilyCheck_(const EclipseState& eclState); - + ///Check saturation tables. void tableCheck_(const EclipseState& eclState); diff --git a/opm/core/props/satfunc/RelpermDiagnostics_impl.hpp b/opm/core/props/satfunc/RelpermDiagnostics_impl.hpp index 149f0f976..2e404b65e 100644 --- a/opm/core/props/satfunc/RelpermDiagnostics_impl.hpp +++ b/opm/core/props/satfunc/RelpermDiagnostics_impl.hpp @@ -55,9 +55,9 @@ namespace Opm { const auto& compressedToCartesianIdx = Opm::compressedToCartesian(nc, global_cell); scaledEpsInfo_.resize(nc); EclEpsGridProperties epsGridProperties; - epsGridProperties.initFromDeck(deck, eclState, /*imbibition=*/false); + epsGridProperties.initFromDeck(deck, eclState, /*imbibition=*/false); const auto& satnum = eclState.get3DProperties().getIntGridProperty("SATNUM"); - + const std::string tag = "Scaled endpoints"; for (int c = 0; c < nc; ++c) { const int cartIdx = compressedToCartesianIdx[c]; @@ -66,7 +66,7 @@ namespace Opm { ijk[0] = cartIdx % dims[0]; ijk[1] = (cartIdx / dims[0]) % dims[1]; ijk[2] = cartIdx / dims[0] / dims[1]; - const std::string cellIdx = "(" + std::to_string(ijk[0]) + ", " + + const std::string cellIdx = "(" + std::to_string(ijk[0]) + ", " + std::to_string(ijk[1]) + ", " + std::to_string(ijk[2]) + ")"; scaledEpsInfo_[c].extractScaled(eclState, epsGridProperties, cartIdx); @@ -76,7 +76,7 @@ namespace Opm { const std::string msg = "For scaled endpoints input, cell" + cellIdx + " SATNUM = " + satnumIdx + ", SGU exceed 1.0 - SWL"; OpmLog::warning(tag, msg); } - + // SGL <= 1.0 - SWU if (scaledEpsInfo_[c].Sgl > (1.0 - scaledEpsInfo_[c].Swu + tolerance)) { const std::string msg = "For scaled endpoints input, cell" + cellIdx + " SATNUM = " + satnumIdx + ", SGL exceed 1.0 - SWU"; @@ -95,7 +95,7 @@ namespace Opm { OpmLog::warning(tag, msg); } } - } + } } } //namespace Opm