mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
GeoProps: fix the use_local_perm implementation for flow_cp. The problem that the
faceNormals are scaled differently remains.
This commit is contained in:
parent
8cd014f937
commit
bdb30ec023
@ -323,15 +323,7 @@ try
|
|||||||
bool use_gravity = (gravity[0] != 0.0 || gravity[1] != 0.0 || gravity[2] != 0.0);
|
bool use_gravity = (gravity[0] != 0.0 || gravity[1] != 0.0 || gravity[2] != 0.0);
|
||||||
const double *grav = use_gravity ? &gravity[0] : 0;
|
const double *grav = use_gravity ? &gravity[0] : 0;
|
||||||
|
|
||||||
#if USE_DUNE_CORNERPOINTGRID
|
|
||||||
if(output_cout)
|
|
||||||
{
|
|
||||||
std::cout << std::endl << "Warning: use of local perm is not yet implemented for CpGrid!" << std::endl << std::endl;
|
|
||||||
}
|
|
||||||
const bool use_local_perm = false;
|
|
||||||
#else
|
|
||||||
const bool use_local_perm = param.getDefault("use_local_perm", true);
|
const bool use_local_perm = param.getDefault("use_local_perm", true);
|
||||||
#endif
|
|
||||||
|
|
||||||
DerivedGeology geoprops(grid, new_props, eclipseState, use_local_perm, grav);
|
DerivedGeology geoprops(grid, new_props, eclipseState, use_local_perm, grav);
|
||||||
boost::any parallel_information;
|
boost::any parallel_information;
|
||||||
|
@ -366,17 +366,41 @@ namespace Opm
|
|||||||
|
|
||||||
// d = 0: XPERM d = 4: YPERM d = 8: ZPERM ignores off-diagonal permeability values.
|
// d = 0: XPERM d = 4: YPERM d = 8: ZPERM ignores off-diagonal permeability values.
|
||||||
const int d = std::floor(faceTag/2) * 4;
|
const int d = std::floor(faceTag/2) * 4;
|
||||||
|
//std::cout << d << " d value | faceTag " << faceTag << std::endl;
|
||||||
|
|
||||||
// compute the half transmissibility
|
// compute the half transmissibility
|
||||||
double dist = 0.0;
|
double dist = 0.0;
|
||||||
double cn = 0.0;
|
double cn = 0.0;
|
||||||
double sgn = 2.0 * (faceCells(faceIdx, 0) == cellIdx) - 1;
|
double sgn = 2.0 * (faceCells(faceIdx, 0) == cellIdx) - 1;
|
||||||
const int dim = Opm::UgGridHelpers::dimensions(grid);
|
const int dim = Opm::UgGridHelpers::dimensions(grid);
|
||||||
|
/*
|
||||||
|
std::cout << "faceNormal ";
|
||||||
|
Dune::DynamicVector< double > normal( dim );
|
||||||
|
for (int indx = 0; indx < dim; ++indx) {
|
||||||
|
normal[ indx ] = Opm::UgGridHelpers::faceNormal(grid,faceIdx)[indx];
|
||||||
|
}
|
||||||
|
|
||||||
|
if( ! ( std::abs( normal.two_norm() - Opm::UgGridHelpers::faceArea(grid, faceIdx) ) < 1e-12 ) )
|
||||||
|
normal *=
|
||||||
|
std::abort();
|
||||||
|
std::cout << std::endl;
|
||||||
|
*/
|
||||||
|
const double* faceNormal = Opm::UgGridHelpers::faceNormal(grid, faceIdx);
|
||||||
|
assert( dim <= 3 );
|
||||||
|
Dune::FieldVector< double, 3 > scaledFaceNormal;
|
||||||
|
for (int indx = 0; indx < dim; ++indx) {
|
||||||
|
scaledFaceNormal[ indx ] = faceNormal[ indx ];
|
||||||
|
}
|
||||||
|
// compute unit normal incase the normal is already scaled
|
||||||
|
scaledFaceNormal /= scaledFaceNormal.two_norm();
|
||||||
|
// compute proper normal scaled with face area
|
||||||
|
scaledFaceNormal *= Opm::UgGridHelpers::faceArea(grid, faceIdx);
|
||||||
|
|
||||||
for (int indx = 0; indx < dim; ++indx) {
|
for (int indx = 0; indx < dim; ++indx) {
|
||||||
const double Ci = Opm::UgGridHelpers::faceCentroid(grid, faceIdx)[indx] -
|
const double Ci = Opm::UgGridHelpers::faceCentroid(grid, faceIdx)[indx] -
|
||||||
Opm::UgGridHelpers::cellCentroidCoordinate(grid, cellIdx, indx);
|
Opm::UgGridHelpers::cellCentroidCoordinate(grid, cellIdx, indx);
|
||||||
dist += Ci*Ci;
|
dist += Ci*Ci;
|
||||||
cn += sgn * Ci * Opm::UgGridHelpers::faceNormal(grid, faceIdx)[indx];
|
cn += sgn * Ci * scaledFaceNormal[ indx ]; //Opm::UgGridHelpers::faceNormal(grid, faceIdx)[indx];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cn < 0){
|
if (cn < 0){
|
||||||
|
Loading…
Reference in New Issue
Block a user