mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Use cell centroid from EclipseGrid
The cell center in EclipseGrid is computed based on averaging the corners of the cells as in Eclipse and not computing the centroid of the cell as in the unstructured grid in opm.
This commit is contained in:
@@ -125,7 +125,7 @@ namespace Opm
|
||||
tpfa_htrans_compute(ug, props.permeability(), htrans.data());
|
||||
}
|
||||
else {
|
||||
tpfa_loc_trans_compute_(grid,props.permeability(),htrans);
|
||||
tpfa_loc_trans_compute_(grid,eclgrid, props.permeability(),htrans);
|
||||
}
|
||||
|
||||
std::vector<double> mult;
|
||||
@@ -191,6 +191,7 @@ namespace Opm
|
||||
|
||||
template <class Grid>
|
||||
void tpfa_loc_trans_compute_(const Grid &grid,
|
||||
Opm::EclipseGridConstPtr eclGrid,
|
||||
const double* perm,
|
||||
Vector &hTrans);
|
||||
|
||||
@@ -338,6 +339,7 @@ namespace Opm
|
||||
|
||||
template <class GridType>
|
||||
inline void DerivedGeology::tpfa_loc_trans_compute_(const GridType& grid,
|
||||
Opm::EclipseGridConstPtr eclGrid,
|
||||
const double* perm,
|
||||
Vector& hTrans){
|
||||
|
||||
@@ -358,6 +360,7 @@ namespace Opm
|
||||
for(auto cellFaceIter = cellFacesRange.begin(), cellFaceEnd = cellFacesRange.end();
|
||||
cellFaceIter != cellFaceEnd; ++cellFaceIter, ++cellFaceIdx)
|
||||
{
|
||||
|
||||
// The index of the face in the compressed grid
|
||||
const int faceIdx = *cellFaceIter;
|
||||
|
||||
@@ -388,11 +391,26 @@ namespace Opm
|
||||
const double* scaledFaceNormal = faceNormal;
|
||||
#endif
|
||||
|
||||
int cartesianCellIdx = AutoDiffGrid::globalCell(grid)[cellIdx];
|
||||
auto cellCentroid = eclGrid->getCellCenter(cartesianCellIdx);
|
||||
|
||||
for (int indx = 0; indx < dim; ++indx) {
|
||||
const double Ci = Opm::UgGridHelpers::faceCentroid(grid, faceIdx)[indx] -
|
||||
Opm::UgGridHelpers::cellCentroidCoordinate(grid, cellIdx, indx);
|
||||
|
||||
double Ci = Opm::UgGridHelpers::faceCentroid(grid, faceIdx)[indx];
|
||||
switch (indx) {
|
||||
case 0:
|
||||
Ci -= std::get<0>(cellCentroid);
|
||||
break;
|
||||
case 1:
|
||||
Ci -= std::get<1>(cellCentroid);
|
||||
break;
|
||||
case 2:
|
||||
Ci -= std::get<2>(cellCentroid);
|
||||
break;
|
||||
|
||||
}
|
||||
dist += Ci*Ci;
|
||||
cn += sgn * Ci * scaledFaceNormal[ indx ]; //Opm::UgGridHelpers::faceNormal(grid, faceIdx)[indx];
|
||||
cn += sgn * Ci * scaledFaceNormal[ indx ];
|
||||
}
|
||||
|
||||
if (cn < 0){
|
||||
|
||||
Reference in New Issue
Block a user