mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
trying to make the numerical aquifer runs in parallel
the current approach is not necessarily correct. When aquifer cells are on the overlap layers, things are much more complicated. But it mostly affects only the summary output of the numerical aquifers. The well data should be fine.
This commit is contained in:
parent
ab9b43249c
commit
5e408ad71b
@ -1713,7 +1713,7 @@ public:
|
||||
|
||||
// Compute pressures, saturations, rs and rv factors.
|
||||
const auto& comm = gridView.comm();
|
||||
calcPressSatRsRv(eqlmap, rec, materialLawManager, gridView, num_aquifers, comm, grav);
|
||||
calcPressSatRsRv(eqlmap, rec, materialLawManager, num_aquifers, comm, grav);
|
||||
|
||||
// Modify oil pressure in no-oil regions so that the pressures of present phases can
|
||||
// be recovered from the oil pressure and capillary relations.
|
||||
@ -1824,9 +1824,8 @@ private:
|
||||
|
||||
template <class RMap, class MaterialLawManager, class Comm>
|
||||
void calcPressSatRsRv(const RMap& reg,
|
||||
const std::vector< Opm::EquilRecord >& rec,
|
||||
const std::vector<Opm::EquilRecord>& rec,
|
||||
MaterialLawManager& materialLawManager,
|
||||
const GridView& gridView,
|
||||
const NumericalAquifers& aquifer,
|
||||
const Comm& comm,
|
||||
const double grav)
|
||||
@ -1864,7 +1863,7 @@ private:
|
||||
const auto acc = eqreg.equilibrationAccuracy();
|
||||
if (acc == 0) {
|
||||
// Centre-point method
|
||||
this->equilibrateCellCentres(cells, eqreg, ptable, gridView, aquifer, psat);
|
||||
this->equilibrateCellCentres(cells, eqreg, ptable, aquifer, psat);
|
||||
}
|
||||
else if (acc < 0) {
|
||||
// Horizontal subdivision
|
||||
@ -1925,12 +1924,11 @@ private:
|
||||
}
|
||||
|
||||
template <class CellRange, class PressTable, class PhaseSat>
|
||||
void equilibrateCellCentres(const CellRange& cells,
|
||||
const EquilReg& eqreg,
|
||||
const PressTable& ptable,
|
||||
const GridView& gridView,
|
||||
void equilibrateCellCentres(const CellRange& cells,
|
||||
const EquilReg& eqreg,
|
||||
const PressTable& ptable,
|
||||
const NumericalAquifers& aquifer,
|
||||
PhaseSat& psat)
|
||||
PhaseSat& psat)
|
||||
{
|
||||
using CellPos = typename PhaseSat::Position;
|
||||
using CellID = std::remove_cv_t<std::remove_reference_t<
|
||||
|
@ -64,12 +64,16 @@ public:
|
||||
for (size_t idx = 0; idx < aquifer.numCells(); ++idx) {
|
||||
const auto& cell = *(aquifer.getCellPrt(idx));
|
||||
const int global_idx = cell.global_index;
|
||||
const int cell_idx = cartesian_to_compressed.at(global_idx);
|
||||
this->cell_to_aquifer_cell_idx_[cell_idx] = idx;
|
||||
const auto search = cartesian_to_compressed.find(global_idx);
|
||||
// Due to parallelisation, the cell might not exist in the current process
|
||||
if (search != cartesian_to_compressed.end()) {
|
||||
const int cell_idx = cartesian_to_compressed.at(global_idx);
|
||||
this->cell_to_aquifer_cell_idx_[cell_idx] = idx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void initFromRestart(const std::vector<data::AquiferData>& aquiferSoln)
|
||||
void initFromRestart([[maybe_unused]]const std::vector<data::AquiferData>& aquiferSoln)
|
||||
{
|
||||
// NOT handling Restart for now
|
||||
}
|
||||
@ -148,6 +152,9 @@ private:
|
||||
sum_watervolume += water_volume;
|
||||
}
|
||||
|
||||
const auto& comm = this->ebos_simulator_.vanguard().grid().comm();
|
||||
comm.sum(&sum_pressure_watervolume, 1);
|
||||
comm.sum(&sum_watervolume, 1);
|
||||
return sum_pressure_watervolume / sum_watervolume;
|
||||
}
|
||||
|
||||
@ -208,6 +215,8 @@ private:
|
||||
break;
|
||||
}
|
||||
|
||||
const auto& comm = this->ebos_simulator_.vanguard().grid().comm();
|
||||
comm.sum(&aquifer_flux, 1);
|
||||
return aquifer_flux;
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user