mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-01-27 21:16:26 -06:00
EclTransmissibility: calculate them like flow does
this may not be the nicest way to calculate transmissibilities (because the coordinate of the cell center can be located outside of the cell) but at least the results are the same as the ones obtained by flow on Norne.
This commit is contained in:
parent
3f9970cc2a
commit
09cbc253f5
@ -91,9 +91,17 @@ public:
|
|||||||
*/
|
*/
|
||||||
void finishInit()
|
void finishInit()
|
||||||
{
|
{
|
||||||
const auto& elementMapper = simulator_.model().elementMapper();
|
|
||||||
const auto& gridView = simulator_.gridView();
|
|
||||||
const auto& problem = simulator_.problem();
|
const auto& problem = simulator_.problem();
|
||||||
|
const auto& gridManager = simulator_.gridManager();
|
||||||
|
const auto& gridView = simulator_.gridView();
|
||||||
|
const auto& elementMapper = simulator_.model().elementMapper();
|
||||||
|
const auto& cartMapper = gridManager.cartesianIndexMapper();
|
||||||
|
const auto eclState = gridManager.eclState();
|
||||||
|
const auto eclGrid = eclState->getInputGrid();
|
||||||
|
const auto transMult = eclState->getTransMult();
|
||||||
|
|
||||||
|
const std::vector<double>& ntg =
|
||||||
|
eclState->get3DProperties().getDoubleGridProperty("NTG").getData();
|
||||||
|
|
||||||
unsigned numElements = elementMapper.size();
|
unsigned numElements = elementMapper.size();
|
||||||
|
|
||||||
@ -119,32 +127,16 @@ public:
|
|||||||
unsigned elemIdx = elementMapper.map(elem);
|
unsigned elemIdx = elementMapper.map(elem);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// get the geometry of the current element
|
// compute the axis specific "centroids" used for the transmissibilities. for
|
||||||
const auto& geom = elem.geometry();
|
// consistency with the flow simulator, we use the element centers as
|
||||||
|
// computed by opm-parser's Opm::EclipseGrid class for all axes.
|
||||||
// compute the axis specific "centroids" used for the
|
unsigned cartesianCellIdx = cartMapper.cartesianIndex(elemIdx);
|
||||||
// transmissibilities
|
const auto& centroid = eclGrid->getCellCenter(cartesianCellIdx);
|
||||||
for (unsigned dimIdx = 0; dimIdx < dimWorld; ++dimIdx) {
|
for (unsigned axisIdx = 0; axisIdx < dimWorld; ++axisIdx)
|
||||||
DimVector x0Local(0.5);
|
for (unsigned dimIdx = 0; dimIdx < dimWorld; ++dimIdx)
|
||||||
DimVector x1Local(0.5);
|
axisCentroids[axisIdx][elemIdx][dimIdx] = centroid[dimIdx];
|
||||||
|
|
||||||
x0Local[dimIdx] = 0.0;
|
|
||||||
x1Local[dimIdx] = 1.0;
|
|
||||||
|
|
||||||
DimVector x = geom.global(x0Local);
|
|
||||||
x += geom.global(x1Local);
|
|
||||||
x /= 2;
|
|
||||||
|
|
||||||
axisCentroids[dimIdx][elemIdx] = x;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto& gridManager = simulator_.gridManager();
|
|
||||||
Opm::EclipseStateConstPtr eclState = gridManager.eclState();
|
|
||||||
std::shared_ptr<const Opm::TransMult> transMult = eclState->getTransMult();
|
|
||||||
const std::vector<double>& ntg =
|
|
||||||
eclState->get3DProperties().getDoubleGridProperty("NTG").getData();
|
|
||||||
|
|
||||||
// reserving some space in the hashmap upfront saves quite a bit of time because
|
// reserving some space in the hashmap upfront saves quite a bit of time because
|
||||||
// resizes are costly for hashmaps and there would be quite a few of them if we
|
// resizes are costly for hashmaps and there would be quite a few of them if we
|
||||||
// would not have a rough idea of how large the final map will be (the rough idea
|
// would not have a rough idea of how large the final map will be (the rough idea
|
||||||
@ -184,8 +176,8 @@ public:
|
|||||||
if (insideElemIdx > outsideElemIdx)
|
if (insideElemIdx > outsideElemIdx)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
unsigned insideCartElemIdx = gridManager.cartesianIndex(insideElemIdx);
|
unsigned insideCartElemIdx = cartMapper.cartesianIndex(insideElemIdx);
|
||||||
unsigned outsideCartElemIdx = gridManager.cartesianIndex(outsideElemIdx);
|
unsigned outsideCartElemIdx = cartMapper.cartesianIndex(outsideElemIdx);
|
||||||
|
|
||||||
// local indices of the faces of the inside and
|
// local indices of the faces of the inside and
|
||||||
// outside elements which contain the intersection
|
// outside elements which contain the intersection
|
||||||
@ -283,11 +275,12 @@ private:
|
|||||||
{
|
{
|
||||||
Scalar isArea = is.geometry().volume();
|
Scalar isArea = is.geometry().volume();
|
||||||
DimVector n = is.centerUnitOuterNormal();
|
DimVector n = is.centerUnitOuterNormal();
|
||||||
|
n *= isArea;
|
||||||
|
|
||||||
unsigned dimIdx = faceIdx/2;
|
unsigned dimIdx = faceIdx/2;
|
||||||
assert(dimIdx < dimWorld);
|
assert(dimIdx < dimWorld);
|
||||||
halfTrans = perm[dimIdx][dimIdx];
|
halfTrans = perm[dimIdx][dimIdx];
|
||||||
halfTrans *= isArea;
|
//halfTrans *= isArea;
|
||||||
|
|
||||||
Scalar val = 0;
|
Scalar val = 0;
|
||||||
for (unsigned i = 0; i < n.size(); ++i)
|
for (unsigned i = 0; i < n.size(); ++i)
|
||||||
|
Loading…
Reference in New Issue
Block a user