mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-12-26 01:01:00 -06:00
Merge pull request #3028 from totto82/quarryPerfLengthAndRadius
get connection length and radius from the connection object
This commit is contained in:
commit
d8f8b9f0cc
@ -394,7 +394,7 @@ namespace Opm {
|
||||
|
||||
void setupCartesianToCompressed_(const int* global_cell, int local_num__cells);
|
||||
|
||||
void computeRepRadiusPerfLength(const Grid& grid, Opm::DeferredLogger& deferred_logger);
|
||||
void setRepRadiusPerfLength(Opm::DeferredLogger& deferred_logger);
|
||||
|
||||
|
||||
void computeAverageFormationFactor(std::vector<Scalar>& B_avg) const;
|
||||
|
@ -361,9 +361,8 @@ namespace Opm {
|
||||
|
||||
if (has_polymer_)
|
||||
{
|
||||
const Grid& grid = ebosSimulator_.vanguard().grid();
|
||||
if (PolymerModule::hasPlyshlog() || getPropValue<TypeTag, Properties::EnablePolymerMW>() ) {
|
||||
computeRepRadiusPerfLength(grid, local_deferredLogger);
|
||||
setRepRadiusPerfLength(local_deferredLogger);
|
||||
}
|
||||
}
|
||||
} catch (std::exception& e) {
|
||||
@ -1580,10 +1579,10 @@ namespace Opm {
|
||||
template<typename TypeTag>
|
||||
void
|
||||
BlackoilWellModel<TypeTag>::
|
||||
computeRepRadiusPerfLength(const Grid& grid, Opm::DeferredLogger& deferred_logger)
|
||||
setRepRadiusPerfLength(Opm::DeferredLogger& deferred_logger)
|
||||
{
|
||||
for (const auto& well : well_container_) {
|
||||
well->computeRepRadiusPerfLength(grid, cartesian_to_compressed_, deferred_logger);
|
||||
well->setRepRadiusPerfLength(cartesian_to_compressed_, deferred_logger);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -189,7 +189,7 @@ namespace Opm
|
||||
|
||||
void setWellEfficiencyFactor(const double efficiency_factor);
|
||||
|
||||
void computeRepRadiusPerfLength(const Grid& grid, const std::vector<int>& cartesian_to_compressed, Opm::DeferredLogger& deferred_logger);
|
||||
void setRepRadiusPerfLength(const std::vector<int>& cartesian_to_compressed, Opm::DeferredLogger& deferred_logger);
|
||||
|
||||
/// using the solution x to recover the solution xw for wells and applying
|
||||
/// xw to update Well State
|
||||
|
@ -1195,14 +1195,10 @@ namespace Opm
|
||||
template<typename TypeTag>
|
||||
void
|
||||
WellInterface<TypeTag>::
|
||||
computeRepRadiusPerfLength(const Grid& grid,
|
||||
const std::vector<int>& cartesian_to_compressed,
|
||||
setRepRadiusPerfLength(const std::vector<int>& cartesian_to_compressed,
|
||||
Opm::DeferredLogger& deferred_logger
|
||||
)
|
||||
{
|
||||
auto cell_to_faces = Opm::UgGridHelpers::cell2Faces(grid);
|
||||
auto begin_face_centroids = Opm::UgGridHelpers::beginFaceCentroids(grid);
|
||||
|
||||
const int nperf = number_of_perforations_;
|
||||
|
||||
perf_rep_radius_.clear();
|
||||
@ -1228,29 +1224,8 @@ namespace Opm
|
||||
|
||||
if (cell >= 0) {
|
||||
double radius = connection.rw();
|
||||
const std::array<double, 3> cubical =
|
||||
wellhelpers::getCubeDim<3>(cell_to_faces, begin_face_centroids, cell);
|
||||
|
||||
double re; // area equivalent radius of the grid block
|
||||
double perf_length; // the length of the well perforation
|
||||
|
||||
switch (connection.dir()) {
|
||||
case Opm::Connection::Direction::X:
|
||||
re = std::sqrt(cubical[1] * cubical[2] / M_PI);
|
||||
perf_length = cubical[0];
|
||||
break;
|
||||
case Opm::Connection::Direction::Y:
|
||||
re = std::sqrt(cubical[0] * cubical[2] / M_PI);
|
||||
perf_length = cubical[1];
|
||||
break;
|
||||
case Opm::Connection::Direction::Z:
|
||||
re = std::sqrt(cubical[0] * cubical[1] / M_PI);
|
||||
perf_length = cubical[2];
|
||||
break;
|
||||
default:
|
||||
OPM_DEFLOG_THROW(std::runtime_error, " Dirtecion of well is not supported ", deferred_logger);
|
||||
}
|
||||
|
||||
double re = connection.re(); // area equivalent radius of the grid block
|
||||
double perf_length = connection.connectionLength(); // the length of the well perforation
|
||||
const double repR = std::sqrt(re * radius);
|
||||
perf_rep_radius_.push_back(repR);
|
||||
perf_length_.push_back(perf_length);
|
||||
|
Loading…
Reference in New Issue
Block a user