mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -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 <dune/common/fmatrix.hh>
|
||||||
|
|
||||||
#include <opm/grid/common/CartesianIndexMapper.hpp>
|
#include <opm/grid/common/CartesianIndexMapper.hpp>
|
||||||
|
#include <opm/grid/LookUpData.hh>
|
||||||
|
|
||||||
|
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
@ -48,6 +50,7 @@ class EclipseState;
|
|||||||
struct NNCdata;
|
struct NNCdata;
|
||||||
class TransMult;
|
class TransMult;
|
||||||
|
|
||||||
|
|
||||||
template<class Grid, class GridView, class ElementMapper, class CartesianIndexMapper, class Scalar>
|
template<class Grid, class GridView, class ElementMapper, class CartesianIndexMapper, class Scalar>
|
||||||
class EclTransmissibility {
|
class EclTransmissibility {
|
||||||
// Grid and world dimension
|
// Grid and world dimension
|
||||||
@ -268,6 +271,9 @@ protected:
|
|||||||
bool enableDiffusivity_;
|
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> thermalHalfTrans_; //NB this is based on direction map size is ca 2*trans_ (diffusivity_)
|
||||||
std::unordered_map<std::uint64_t, Scalar> diffusivity_;
|
std::unordered_map<std::uint64_t, Scalar> diffusivity_;
|
||||||
|
|
||||||
|
const LookUpData<Grid,GridView> lookUpData_;
|
||||||
|
const LookUpCartesianData<Grid,GridView> lookUpCartesianData_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Opm
|
} // namespace Opm
|
||||||
|
@ -101,6 +101,8 @@ EclTransmissibility(const EclipseState& eclState,
|
|||||||
, centroids_(centroids)
|
, centroids_(centroids)
|
||||||
, enableEnergy_(enableEnergy)
|
, enableEnergy_(enableEnergy)
|
||||||
, enableDiffusivity_(enableDiffusivity)
|
, enableDiffusivity_(enableDiffusivity)
|
||||||
|
, lookUpData_(gridView)
|
||||||
|
, lookUpCartesianData_(gridView, cartMapper)
|
||||||
{
|
{
|
||||||
const UnitSystem& unitSystem = eclState_.getDeckUnitSystem();
|
const UnitSystem& unitSystem = eclState_.getDeckUnitSystem();
|
||||||
transmissibilityThreshold_ = unitSystem.parse("Transmissibility").getSIScaling() * 1e-6;
|
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();
|
const auto& comm = gridView_.comm();
|
||||||
ElementMapper elemMapper(gridView_, Dune::mcmgElementLayout());
|
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();
|
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)
|
if (map)
|
||||||
extractPermeability_(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
|
// Loop over all elements (global grid) and store Cartesian index
|
||||||
for (const auto& elem : elements(grid_.leafGridView())) {
|
for (const auto& elem : elements(grid_.leafGridView())) {
|
||||||
int elemIdx = elemMapper.index(elem);
|
int elemIdx = elemMapper.index(elem);
|
||||||
int cartElemIdx = cartMapper_.cartesianIndex(elemIdx);
|
int cartElemIdx = cartMapper_.cartesianIndex(elemIdx);
|
||||||
globalToLocal[cartElemIdx] = elemIdx;
|
globalToLocal[cartElemIdx] = elemIdx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user