mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-16 20:24:48 -06:00
Merge pull request #4983 from aritorto/eclTransLookUp
Lookup NTG on Leaf Grid View
This commit is contained in:
commit
e39a60d676
@ -32,6 +32,8 @@
|
||||
#include <dune/common/fmatrix.hh>
|
||||
|
||||
#include <opm/grid/common/CartesianIndexMapper.hpp>
|
||||
#include <opm/grid/LookUpData.hh>
|
||||
|
||||
|
||||
#include <array>
|
||||
#include <functional>
|
||||
@ -48,6 +50,7 @@ class EclipseState;
|
||||
struct NNCdata;
|
||||
class TransMult;
|
||||
|
||||
|
||||
template<class Grid, class GridView, class ElementMapper, class CartesianIndexMapper, class Scalar>
|
||||
class EclTransmissibility {
|
||||
// Grid and world dimension
|
||||
@ -268,6 +271,9 @@ protected:
|
||||
bool enableDiffusivity_;
|
||||
std::unordered_map<std::uint64_t, Scalar> thermalHalfTrans_; //NB this is based on direction map size is ca 2*trans_ (diffusivity_)
|
||||
std::unordered_map<std::uint64_t, Scalar> diffusivity_;
|
||||
|
||||
const LookUpData<Grid,GridView> lookUpData_;
|
||||
const LookUpCartesianData<Grid,GridView> lookUpCartesianData_;
|
||||
};
|
||||
|
||||
} // namespace Opm
|
||||
|
@ -101,6 +101,8 @@ EclTransmissibility(const EclipseState& eclState,
|
||||
, centroids_(centroids)
|
||||
, enableEnergy_(enableEnergy)
|
||||
, enableDiffusivity_(enableDiffusivity)
|
||||
, lookUpData_(gridView)
|
||||
, lookUpCartesianData_(gridView, cartMapper)
|
||||
{
|
||||
const UnitSystem& unitSystem = eclState_.getDeckUnitSystem();
|
||||
transmissibilityThreshold_ = unitSystem.parse("Transmissibility").getSIScaling() * 1e-6;
|
||||
@ -154,10 +156,10 @@ update(bool global, const std::function<unsigned int(unsigned int)>& map, const
|
||||
const auto& comm = gridView_.comm();
|
||||
ElementMapper elemMapper(gridView_, Dune::mcmgElementLayout());
|
||||
|
||||
// get the ntg values, the ntg values are modified for the cells merged with minpv
|
||||
const std::vector<double>& ntg = eclState_.fieldProps().get_double("NTG");
|
||||
const bool updateDiffusivity = eclState_.getSimulationConfig().isDiffusive() && enableDiffusivity_;
|
||||
unsigned numElements = elemMapper.size();
|
||||
// get the ntg values, the ntg values are modified for the cells merged with minpv
|
||||
const std::vector<double>& ntg = this->lookUpData_.assignFieldPropsDoubleOnLeaf(eclState_.fieldProps(), "NTG", numElements);
|
||||
const bool updateDiffusivity = eclState_.getSimulationConfig().isDiffusive() && enableDiffusivity_;
|
||||
|
||||
if (map)
|
||||
extractPermeability_(map);
|
||||
@ -495,7 +497,7 @@ update(bool global, const std::function<unsigned int(unsigned int)>& map, const
|
||||
// Loop over all elements (global grid) and store Cartesian index
|
||||
for (const auto& elem : elements(grid_.leafGridView())) {
|
||||
int elemIdx = elemMapper.index(elem);
|
||||
int cartElemIdx = cartMapper_.cartesianIndex(elemIdx);
|
||||
int cartElemIdx = cartMapper_.cartesianIndex(elemIdx);
|
||||
globalToLocal[cartElemIdx] = elemIdx;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user