mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-01-24 12:36:25 -06:00
Start using face geometry computed the Ecl way
Face centers are computed using the cell corners. With this implementation the face center seen from a cell may be different from the face center seen from its neighbour. Face normals with area lenghts are calculated using the face corners directly not using a triangulation point in the center of the face. This gives transmissibility almost equal to eclipse.
This commit is contained in:
parent
0c8355d2ad
commit
ef9966b188
@ -184,21 +184,26 @@ public:
|
|||||||
unsigned insideFaceIdx = intersection.indexInInside();
|
unsigned insideFaceIdx = intersection.indexInInside();
|
||||||
unsigned outsideFaceIdx = intersection.indexInOutside();
|
unsigned outsideFaceIdx = intersection.indexInOutside();
|
||||||
|
|
||||||
|
int faceIdx = intersection.id();
|
||||||
|
DimVector faceCenterInside = gridManager_.grid().faceCenterEcl(insideElemIdx,insideFaceIdx);
|
||||||
|
DimVector faceCenterOutside = gridManager_.grid().faceCenterEcl(outsideElemIdx,outsideFaceIdx);
|
||||||
|
DimVector faceAreaNormal = gridManager_.grid().faceAreaNormalEcl(faceIdx);
|
||||||
|
|
||||||
Scalar halfTrans1;
|
Scalar halfTrans1;
|
||||||
Scalar halfTrans2;
|
Scalar halfTrans2;
|
||||||
|
|
||||||
computeHalfTrans_(halfTrans1,
|
computeHalfTrans_(halfTrans1,
|
||||||
intersection,
|
faceAreaNormal,
|
||||||
insideFaceIdx,
|
insideFaceIdx,
|
||||||
distanceVector_(intersection,
|
distanceVector_(faceCenterInside,
|
||||||
intersection.indexInInside(),
|
intersection.indexInInside(),
|
||||||
insideElemIdx,
|
insideElemIdx,
|
||||||
axisCentroids),
|
axisCentroids),
|
||||||
permeability_[insideElemIdx]);
|
permeability_[insideElemIdx]);
|
||||||
computeHalfTrans_(halfTrans2,
|
computeHalfTrans_(halfTrans2,
|
||||||
intersection,
|
faceAreaNormal,
|
||||||
outsideFaceIdx,
|
outsideFaceIdx,
|
||||||
distanceVector_(intersection,
|
distanceVector_(faceCenterOutside,
|
||||||
intersection.indexInOutside(),
|
intersection.indexInOutside(),
|
||||||
outsideElemIdx,
|
outsideElemIdx,
|
||||||
axisCentroids),
|
axisCentroids),
|
||||||
@ -308,36 +313,31 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void computeHalfTrans_(Scalar& halfTrans,
|
void computeHalfTrans_(Scalar& halfTrans,
|
||||||
const Intersection& is,
|
const DimVector& areaNormal,
|
||||||
unsigned faceIdx, // in the reference element that contains the intersection
|
unsigned faceIdx, // in the reference element that contains the intersection
|
||||||
const DimVector& distance,
|
const DimVector& distance,
|
||||||
const DimMatrix& perm) const
|
const DimMatrix& perm) const
|
||||||
{
|
{
|
||||||
Scalar isArea = is.geometry().volume();
|
|
||||||
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;
|
|
||||||
|
|
||||||
Scalar val = 0;
|
Scalar val = 0;
|
||||||
for (unsigned i = 0; i < n.size(); ++i)
|
for (unsigned i = 0; i < areaNormal.size(); ++i)
|
||||||
val += n[i]*distance[i];
|
val += areaNormal[i]*distance[i];
|
||||||
|
|
||||||
halfTrans *= std::abs<Scalar>(val);
|
halfTrans *= std::abs<Scalar>(val);
|
||||||
halfTrans /= distance.two_norm2();
|
halfTrans /= distance.two_norm2();
|
||||||
}
|
}
|
||||||
|
|
||||||
DimVector distanceVector_(const Intersection& is,
|
DimVector distanceVector_(const DimVector& center,
|
||||||
unsigned faceIdx, // in the reference element that contains the intersection
|
unsigned faceIdx, // in the reference element that contains the intersection
|
||||||
unsigned elemIdx,
|
unsigned elemIdx,
|
||||||
const std::array<std::vector<DimVector>, dimWorld>& axisCentroids) const
|
const std::array<std::vector<DimVector>, dimWorld>& axisCentroids) const
|
||||||
{
|
{
|
||||||
unsigned dimIdx = faceIdx/2;
|
unsigned dimIdx = faceIdx/2;
|
||||||
assert(dimIdx < dimWorld);
|
assert(dimIdx < dimWorld);
|
||||||
DimVector x = is.geometry().center();
|
DimVector x = center;
|
||||||
x -= axisCentroids[dimIdx][elemIdx];
|
x -= axisCentroids[dimIdx][elemIdx];
|
||||||
|
|
||||||
return x;
|
return x;
|
||||||
|
Loading…
Reference in New Issue
Block a user