Implement comments for PR#249

1) Add the possibility for the user to chose between local and global
coordinate permeability in the transmissibility calculations.
2) Trow for CpGrid
3) Add default for switch
This commit is contained in:
Tor Harald Sandve 2014-12-04 12:29:40 +01:00
parent b11534b137
commit 02724b7f7a
5 changed files with 26 additions and 10 deletions

View File

@ -212,7 +212,7 @@ void initOPMTrans(TransGraph& opmTrans , DeckConstPtr deck , std::shared_ptr<con
std::shared_ptr<BlackoilPropsAdInterface> props;
props.reset(new BlackoilPropsAdFromDeck(deck, eclipseState, *grid->c_grid()));
DerivedGeology geology(*grid->c_grid() , *props, eclipseState);
DerivedGeology geology(*grid->c_grid() , *props, eclipseState, false);
const double * opm_trans_data = geology.transmissibility().data();
double SIconversion = Opm::unit::cubic(Opm::unit::meter) * Opm::unit::day * Opm::unit::barsa / (Opm::prefix::centi * Opm::unit::Poise);

View File

@ -154,7 +154,7 @@ try
// With a deck, we may have more epochs etc.
WellState well_state;
Opm::TimeMapConstPtr timeMap = eclipseState->getSchedule()->getTimeMap();
Opm::DerivedGeology geology(*grid->c_grid(), *props, eclipseState);
Opm::DerivedGeology geology(*grid->c_grid(), *props, eclipseState,false);
SimulatorTimer simtimer;
for (size_t reportStepIdx = 0; reportStepIdx < timeMap->numTimesteps(); ++reportStepIdx) {

View File

@ -208,7 +208,8 @@ try
// initialize variables
simtimer.init(timeMap);
Opm::DerivedGeology geology(*grid->c_grid(), *new_props, eclipseState, grav);
bool use_local_perm = param.getDefault("use_local_perm", true);
Opm::DerivedGeology geology(*grid->c_grid(), *new_props, eclipseState, use_local_perm, grav);
std::vector<double> threshold_pressures = thresholdPressures(deck, eclipseState, *grid->c_grid());

View File

@ -61,7 +61,10 @@ namespace Opm
DerivedGeology(const Grid& grid,
const Props& props ,
Opm::EclipseStateConstPtr eclState,
const double* grav = 0)
const bool use_local_perm,
const double* grav = 0
)
: pvol_ (Opm::AutoDiffGrid::numCells(grid))
, trans_(Opm::AutoDiffGrid::numFaces(grid))
, gpot_ (Vector::Zero(Opm::AutoDiffGrid::cell2Faces(grid).noEntries(), 1))
@ -101,8 +104,18 @@ namespace Opm
Vector htrans(AutoDiffGrid::numCellFaces(grid));
Grid* ug = const_cast<Grid*>(& grid);
//tpfa_htrans_compute(ug, props.permeability(), htrans.data());
tpfa_loc_trans_compute_(grid,props.permeability(),htrans);
#ifdef HAVE_DUNE_CORNERPOINT
if (std::is_same<Grid, Dune::CpGrid>::value) {
if (use_local_perm)
OPM_THROW(std::runtime_error, "Local coordinate permeability not supported for CpGrid");
}
#endif
if (not use_local_perm)
tpfa_htrans_compute(ug, props.permeability(), htrans.data());
else
tpfa_loc_trans_compute_(grid,props.permeability(),htrans);
std::vector<double> mult;
multiplyHalfIntersections_(grid, eclState, ntg, htrans, mult);
@ -295,6 +308,8 @@ namespace Opm
case 8:
OPM_MESSAGE("Warning: negative Z-transmissibility value in cell: " << cellIdx << " replace by absolute value") ;
break;
default:
OPM_THROW(std::logic_error, "Inconsitancy in the faceTag in cell: " << cellIdx);
}
cn = -cn;

View File

@ -148,7 +148,7 @@ BOOST_AUTO_TEST_CASE(TransmissibilityMultipliersLegacyGridInterface)
auto origGridManager = std::make_shared<Opm::GridManager>(origEclipseState->getEclipseGrid());
auto origProps = std::make_shared<Opm::BlackoilPropsAdFromDeck>(origDeck, origEclipseState, *(origGridManager->c_grid()));
Opm::DerivedGeology origGeology(*(origGridManager->c_grid()), *origProps, origEclipseState);
Opm::DerivedGeology origGeology(*(origGridManager->c_grid()), *origProps, origEclipseState, false);
/////
/////
@ -159,7 +159,7 @@ BOOST_AUTO_TEST_CASE(TransmissibilityMultipliersLegacyGridInterface)
auto multGridManager = std::make_shared<Opm::GridManager>(multEclipseState->getEclipseGrid());
auto multProps = std::make_shared<Opm::BlackoilPropsAdFromDeck>(multDeck, multEclipseState, *(multGridManager->c_grid()));
Opm::DerivedGeology multGeology(*(multGridManager->c_grid()), *multProps, multEclipseState);
Opm::DerivedGeology multGeology(*(multGridManager->c_grid()), *multProps, multEclipseState, false);
/////
/////
@ -171,7 +171,7 @@ BOOST_AUTO_TEST_CASE(TransmissibilityMultipliersLegacyGridInterface)
auto multMinusGridManager = std::make_shared<Opm::GridManager>(multMinusEclipseState->getEclipseGrid());
auto multMinusProps = std::make_shared<Opm::BlackoilPropsAdFromDeck>(multMinusDeck, multMinusEclipseState, *(multMinusGridManager->c_grid()));
Opm::DerivedGeology multMinusGeology(*(multMinusGridManager->c_grid()), *multMinusProps, multMinusEclipseState);
Opm::DerivedGeology multMinusGeology(*(multMinusGridManager->c_grid()), *multMinusProps, multMinusEclipseState, false);
/////
/////
@ -182,7 +182,7 @@ BOOST_AUTO_TEST_CASE(TransmissibilityMultipliersLegacyGridInterface)
auto ntgGridManager = std::make_shared<Opm::GridManager>(ntgEclipseState->getEclipseGrid());
auto ntgProps = std::make_shared<Opm::BlackoilPropsAdFromDeck>(ntgDeck, ntgEclipseState, *(ntgGridManager->c_grid()));
Opm::DerivedGeology ntgGeology(*(ntgGridManager->c_grid()), *ntgProps, ntgEclipseState);
Opm::DerivedGeology ntgGeology(*(ntgGridManager->c_grid()), *ntgProps, ntgEclipseState, false);
/////
// compare the transmissibilities (note that for this we assume that the multipliers