mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #2241 from GitPaean/fixing_non_defaulted_influx_coefficient
fixing the non-defaulted influx coefficient for AquiferFetkovich
This commit is contained in:
commit
5f979b4ec2
@ -105,46 +105,52 @@ protected:
|
|||||||
for (size_t idx = 0; idx < Base::cell_idx_.size(); ++idx) {
|
for (size_t idx = 0; idx < Base::cell_idx_.size(); ++idx) {
|
||||||
const int cell_index = Base::cartesian_to_compressed_.at(Base::cell_idx_[idx]);
|
const int cell_index = Base::cartesian_to_compressed_.at(Base::cell_idx_[idx]);
|
||||||
Base::cellToConnectionIdx_[cell_index] = idx;
|
Base::cellToConnectionIdx_[cell_index] = idx;
|
||||||
|
const auto cellCenter = grid.getCellCenter(Base::cell_idx_.at(idx));
|
||||||
const auto cellFacesRange = cell2Faces[cell_index];
|
|
||||||
for (auto cellFaceIter = cellFacesRange.begin(); cellFaceIter != cellFacesRange.end(); ++cellFaceIter) {
|
|
||||||
// The index of the face in the compressed grid
|
|
||||||
const int faceIdx = *cellFaceIter;
|
|
||||||
|
|
||||||
// the logically-Cartesian direction of the face
|
|
||||||
const int faceTag = Opm::UgGridHelpers::faceTag(ugrid, cellFaceIter);
|
|
||||||
|
|
||||||
switch (faceTag) {
|
|
||||||
case 0:
|
|
||||||
faceDirection = Opm::FaceDir::XMinus;
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
faceDirection = Opm::FaceDir::XPlus;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
faceDirection = Opm::FaceDir::YMinus;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
faceDirection = Opm::FaceDir::YPlus;
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
faceDirection = Opm::FaceDir::ZMinus;
|
|
||||||
break;
|
|
||||||
case 5:
|
|
||||||
faceDirection = Opm::FaceDir::ZPlus;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
OPM_THROW(Opm::NumericalIssue,
|
|
||||||
"Initialization of Aquifer problem. Make sure faceTag is correctly defined");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (faceDirection == connection.reservoir_face_dir.at(idx)) {
|
|
||||||
Base::faceArea_connected_.at(idx) = Base::getFaceArea(faceCells, ugrid, faceIdx, idx, connection);
|
|
||||||
denom_face_areas += (connection.influx_multiplier.at(idx) * Base::faceArea_connected_.at(idx));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
auto cellCenter = grid.getCellCenter(Base::cell_idx_.at(idx));
|
|
||||||
Base::cell_depth_.at(idx) = cellCenter[2];
|
Base::cell_depth_.at(idx) = cellCenter[2];
|
||||||
|
|
||||||
|
if (!connection.influx_coeff[idx]) { // influx_coeff is defaulted
|
||||||
|
const auto cellFacesRange = cell2Faces[cell_index];
|
||||||
|
for (auto cellFaceIter = cellFacesRange.begin(); cellFaceIter != cellFacesRange.end(); ++cellFaceIter) {
|
||||||
|
// The index of the face in the compressed grid
|
||||||
|
const int faceIdx = *cellFaceIter;
|
||||||
|
|
||||||
|
// the logically-Cartesian direction of the face
|
||||||
|
const int faceTag = Opm::UgGridHelpers::faceTag(ugrid, cellFaceIter);
|
||||||
|
|
||||||
|
switch (faceTag) {
|
||||||
|
case 0:
|
||||||
|
faceDirection = Opm::FaceDir::XMinus;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
faceDirection = Opm::FaceDir::XPlus;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
faceDirection = Opm::FaceDir::YMinus;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
faceDirection = Opm::FaceDir::YPlus;
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
faceDirection = Opm::FaceDir::ZMinus;
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
faceDirection = Opm::FaceDir::ZPlus;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
OPM_THROW(Opm::NumericalIssue,
|
||||||
|
"Initialization of Aquifer problem. Make sure faceTag is correctly defined");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (faceDirection == connection.reservoir_face_dir.at(idx)) {
|
||||||
|
Base::faceArea_connected_.at(idx)
|
||||||
|
= Base::getFaceArea(faceCells, ugrid, faceIdx, idx, connection);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Base::faceArea_connected_.at(idx) = *connection.influx_coeff[idx];
|
||||||
|
}
|
||||||
|
denom_face_areas += (connection.influx_multiplier.at(idx) * Base::faceArea_connected_.at(idx));
|
||||||
}
|
}
|
||||||
|
|
||||||
const double eps_sqrt = std::sqrt(std::numeric_limits<double>::epsilon());
|
const double eps_sqrt = std::sqrt(std::numeric_limits<double>::epsilon());
|
||||||
|
Loading…
Reference in New Issue
Block a user