mirror of
https://github.com/OPM/opm-simulators.git
synced 2026-09-05 04:40:19 -05:00
pass CartesianIndexMapper instead of the grid to the RelpermDiagnositics
This commit is contained in:
@@ -52,9 +52,9 @@ namespace Opm {
|
||||
///output if they're found.
|
||||
///\param[in] eclState eclipse state.
|
||||
///\param[in] grid unstructured grid.
|
||||
template <class GridT>
|
||||
template <class CartesianIndexMapper>
|
||||
void diagnosis(const EclipseState& eclState,
|
||||
const GridT& grid);
|
||||
const CartesianIndexMapper& cartesianIndexMapper);
|
||||
|
||||
private:
|
||||
enum FluidSystem {
|
||||
@@ -91,9 +91,9 @@ namespace Opm {
|
||||
///Check endpoints in the saturation tables.
|
||||
void unscaledEndPointsCheck_(const EclipseState& eclState);
|
||||
|
||||
template <class GridT>
|
||||
template <class CartesianIndexMapper>
|
||||
void scaledEndPointsCheck_(const EclipseState& eclState,
|
||||
const GridT& grid);
|
||||
const CartesianIndexMapper& cartesianIndexMapper);
|
||||
|
||||
///For every table, need to deal with case by case.
|
||||
void swofTableCheck_(const Opm::SwofTable& swofTables,
|
||||
|
||||
@@ -31,28 +31,25 @@
|
||||
|
||||
namespace Opm {
|
||||
|
||||
template <class GridT>
|
||||
template <class CartesianIndexMapper>
|
||||
void RelpermDiagnostics::diagnosis(const Opm::EclipseState& eclState,
|
||||
const GridT& grid)
|
||||
const CartesianIndexMapper& cartesianIndexMapper)
|
||||
{
|
||||
OpmLog::info("\n===============Saturation Functions Diagnostics===============\n");
|
||||
phaseCheck_(eclState);
|
||||
satFamilyCheck_(eclState);
|
||||
tableCheck_(eclState);
|
||||
unscaledEndPointsCheck_(eclState);
|
||||
scaledEndPointsCheck_(eclState, grid);
|
||||
scaledEndPointsCheck_(eclState, cartesianIndexMapper);
|
||||
}
|
||||
|
||||
template <class GridT>
|
||||
template <class CartesianIndexMapper>
|
||||
void RelpermDiagnostics::scaledEndPointsCheck_(const EclipseState& eclState,
|
||||
const GridT& grid)
|
||||
const CartesianIndexMapper& cartesianIndexMapper)
|
||||
{
|
||||
// All end points are subject to round-off errors, checks should account for it
|
||||
const float tolerance = 1e-6;
|
||||
const int nc = Opm::UgGridHelpers::numCells(grid);
|
||||
const auto& global_cell = Opm::UgGridHelpers::globalCell(grid);
|
||||
const auto dims = Opm::UgGridHelpers::cartDims(grid);
|
||||
const auto& compressedToCartesianIdx = Opm::compressedToCartesian(nc, global_cell);
|
||||
const int nc = cartesianIndexMapper.compressedSize();
|
||||
const bool threepoint = eclState.runspec().endpointScaling().threepoint();
|
||||
scaledEpsInfo_.resize(nc);
|
||||
EclEpsGridProperties epsGridProperties(eclState, false);
|
||||
@@ -62,10 +59,7 @@ namespace Opm {
|
||||
std::string cellIdx;
|
||||
{
|
||||
std::array<int, 3> ijk;
|
||||
int cartIdx = compressedToCartesianIdx[c];
|
||||
ijk[0] = cartIdx % dims[0]; cartIdx /= dims[0];
|
||||
ijk[1] = cartIdx % dims[1];
|
||||
ijk[2] = cartIdx / dims[1];
|
||||
cartesianIndexMapper.cartesianCoordinate(c, ijk);
|
||||
cellIdx = "(" + std::to_string(ijk[0]) + ", " +
|
||||
std::to_string(ijk[1]) + ", " +
|
||||
std::to_string(ijk[2]) + ")";
|
||||
|
||||
Reference in New Issue
Block a user