mirror of
https://github.com/OPM/opm-simulators.git
synced 2026-07-29 21:27:57 -05:00
Merge pull request #2464 from joakim-hove/relperm-diag-no-deck
Relperm diag no deck
This commit is contained in:
@@ -564,7 +564,7 @@ protected:
|
|||||||
|
|
||||||
if (enableExperiments) {
|
if (enableExperiments) {
|
||||||
Opm::RelpermDiagnostics relpermDiagnostics;
|
Opm::RelpermDiagnostics relpermDiagnostics;
|
||||||
relpermDiagnostics.diagnosis(*eclState_, *deck_, asImp_().grid());
|
relpermDiagnostics.diagnosis(*eclState_, asImp_().grid());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -29,7 +29,6 @@
|
|||||||
|
|
||||||
#include <opm/common/utility/numeric/linearInterpolation.hpp>
|
#include <opm/common/utility/numeric/linearInterpolation.hpp>
|
||||||
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
|
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
|
||||||
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
|
||||||
#include <opm/common/OpmLog/OpmLog.hpp>
|
#include <opm/common/OpmLog/OpmLog.hpp>
|
||||||
#include <opm/parser/eclipse/EclipseState/Tables/SsfnTable.hpp>
|
#include <opm/parser/eclipse/EclipseState/Tables/SsfnTable.hpp>
|
||||||
#include <opm/parser/eclipse/EclipseState/Tables/MiscTable.hpp>
|
#include <opm/parser/eclipse/EclipseState/Tables/MiscTable.hpp>
|
||||||
@@ -52,11 +51,9 @@ namespace Opm {
|
|||||||
///eclipse data file. Errors and warings will be
|
///eclipse data file. Errors and warings will be
|
||||||
///output if they're found.
|
///output if they're found.
|
||||||
///\param[in] eclState eclipse state.
|
///\param[in] eclState eclipse state.
|
||||||
///\param[in] deck ecliplise data file.
|
|
||||||
///\param[in] grid unstructured grid.
|
///\param[in] grid unstructured grid.
|
||||||
template <class GridT>
|
template <class GridT>
|
||||||
void diagnosis(const EclipseState& eclState,
|
void diagnosis(const EclipseState& eclState,
|
||||||
const Deck& deck,
|
|
||||||
const GridT& grid);
|
const GridT& grid);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -95,8 +92,7 @@ namespace Opm {
|
|||||||
void unscaledEndPointsCheck_(const EclipseState& eclState);
|
void unscaledEndPointsCheck_(const EclipseState& eclState);
|
||||||
|
|
||||||
template <class GridT>
|
template <class GridT>
|
||||||
void scaledEndPointsCheck_(const Deck& deck,
|
void scaledEndPointsCheck_(const EclipseState& eclState,
|
||||||
const EclipseState& eclState,
|
|
||||||
const GridT& grid);
|
const GridT& grid);
|
||||||
|
|
||||||
///For every table, need to deal with case by case.
|
///For every table, need to deal with case by case.
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ namespace Opm {
|
|||||||
|
|
||||||
template <class GridT>
|
template <class GridT>
|
||||||
void RelpermDiagnostics::diagnosis(const Opm::EclipseState& eclState,
|
void RelpermDiagnostics::diagnosis(const Opm::EclipseState& eclState,
|
||||||
const Opm::Deck& deck,
|
|
||||||
const GridT& grid)
|
const GridT& grid)
|
||||||
{
|
{
|
||||||
OpmLog::info("\n===============Saturation Functions Diagnostics===============\n");
|
OpmLog::info("\n===============Saturation Functions Diagnostics===============\n");
|
||||||
@@ -41,12 +40,11 @@ namespace Opm {
|
|||||||
satFamilyCheck_(eclState);
|
satFamilyCheck_(eclState);
|
||||||
tableCheck_(eclState);
|
tableCheck_(eclState);
|
||||||
unscaledEndPointsCheck_(eclState);
|
unscaledEndPointsCheck_(eclState);
|
||||||
scaledEndPointsCheck_(deck, eclState, grid);
|
scaledEndPointsCheck_(eclState, grid);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class GridT>
|
template <class GridT>
|
||||||
void RelpermDiagnostics::scaledEndPointsCheck_(const Deck& deck,
|
void RelpermDiagnostics::scaledEndPointsCheck_(const EclipseState& eclState,
|
||||||
const EclipseState& eclState,
|
|
||||||
const GridT& grid)
|
const GridT& grid)
|
||||||
{
|
{
|
||||||
// All end points are subject to round-off errors, checks should account for it
|
// All end points are subject to round-off errors, checks should account for it
|
||||||
@@ -55,6 +53,7 @@ namespace Opm {
|
|||||||
const auto& global_cell = Opm::UgGridHelpers::globalCell(grid);
|
const auto& global_cell = Opm::UgGridHelpers::globalCell(grid);
|
||||||
const auto dims = Opm::UgGridHelpers::cartDims(grid);
|
const auto dims = Opm::UgGridHelpers::cartDims(grid);
|
||||||
const auto& compressedToCartesianIdx = Opm::compressedToCartesian(nc, global_cell);
|
const auto& compressedToCartesianIdx = Opm::compressedToCartesian(nc, global_cell);
|
||||||
|
const bool threepoint = eclState.runspec().endpointScaling().threepoint();
|
||||||
scaledEpsInfo_.resize(nc);
|
scaledEpsInfo_.resize(nc);
|
||||||
EclEpsGridProperties epsGridProperties(eclState, false);
|
EclEpsGridProperties epsGridProperties(eclState, false);
|
||||||
const std::string tag = "Scaled endpoints";
|
const std::string tag = "Scaled endpoints";
|
||||||
@@ -85,7 +84,7 @@ namespace Opm {
|
|||||||
OpmLog::warning(tag, msg);
|
OpmLog::warning(tag, msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (deck.hasKeyword("SCALECRS") && fluidSystem_ == FluidSystem::BlackOil) {
|
if (threepoint && fluidSystem_ == FluidSystem::BlackOil) {
|
||||||
// Mobilility check.
|
// Mobilility check.
|
||||||
if ((scaledEpsInfo_[c].Sowcr + scaledEpsInfo_[c].Swcr) >= (1.0 + tolerance)) {
|
if ((scaledEpsInfo_[c].Sowcr + scaledEpsInfo_[c].Swcr) >= (1.0 + tolerance)) {
|
||||||
const std::string msg = "For scaled endpoints input, cell" + cellIdx + " SATNUM = " + satnumIdx + ", SOWCR + SWCR exceed 1.0";
|
const std::string msg = "For scaled endpoints input, cell" + cellIdx + " SATNUM = " + satnumIdx + ", SOWCR + SWCR exceed 1.0";
|
||||||
|
|||||||
@@ -456,7 +456,7 @@ namespace Opm
|
|||||||
static_cast<ParallelEclipseState&>(this->eclState()).switchToGlobalProps();
|
static_cast<ParallelEclipseState&>(this->eclState()).switchToGlobalProps();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
diagnostic.diagnosis(eclState(), deck(), this->grid());
|
diagnostic.diagnosis(eclState(), this->grid());
|
||||||
if (mpi_size_ > 1) {
|
if (mpi_size_ > 1) {
|
||||||
#if HAVE_MPI
|
#if HAVE_MPI
|
||||||
this->grid().switchToDistributedView();
|
this->grid().switchToDistributedView();
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ BOOST_AUTO_TEST_CASE(diagnosis)
|
|||||||
std::shared_ptr<CounterLog> counterLog = std::make_shared<CounterLog>(Log::DefaultMessageTypes);
|
std::shared_ptr<CounterLog> counterLog = std::make_shared<CounterLog>(Log::DefaultMessageTypes);
|
||||||
OpmLog::addBackend( "COUNTERLOG" , counterLog );
|
OpmLog::addBackend( "COUNTERLOG" , counterLog );
|
||||||
RelpermDiagnostics diagnostics;
|
RelpermDiagnostics diagnostics;
|
||||||
diagnostics.diagnosis(eclState, deck, grid);
|
diagnostics.diagnosis(eclState, grid);
|
||||||
BOOST_CHECK_EQUAL(1, counterLog->numMessages(Log::MessageType::Warning));
|
BOOST_CHECK_EQUAL(1, counterLog->numMessages(Log::MessageType::Warning));
|
||||||
}
|
}
|
||||||
BOOST_AUTO_TEST_SUITE_END()
|
BOOST_AUTO_TEST_SUITE_END()
|
||||||
|
|||||||
Reference in New Issue
Block a user