mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Vertical Extent: Prune Unneeded 'cellcount' Parameter
The purpose of this function is to determine the vertical extent of a set of cells. Counting the number of cells in the region is not its responsibility.
This commit is contained in:
@@ -1396,7 +1396,6 @@ invertCapPress(const double pc,
|
|||||||
template <typename Grid, typename CellRange>
|
template <typename Grid, typename CellRange>
|
||||||
void verticalExtent(const Grid& grid,
|
void verticalExtent(const Grid& grid,
|
||||||
const CellRange& cells,
|
const CellRange& cells,
|
||||||
int& cellcount,
|
|
||||||
std::array<double,2>& span)
|
std::array<double,2>& span)
|
||||||
{
|
{
|
||||||
// This code is only supported in three space dimensions
|
// This code is only supported in three space dimensions
|
||||||
@@ -1404,7 +1403,6 @@ void verticalExtent(const Grid& grid,
|
|||||||
|
|
||||||
span[0] = std::numeric_limits<double>::max();
|
span[0] = std::numeric_limits<double>::max();
|
||||||
span[1] = std::numeric_limits<double>::lowest();
|
span[1] = std::numeric_limits<double>::lowest();
|
||||||
cellcount = 0;
|
|
||||||
|
|
||||||
const int nd = Grid::dimensionworld;
|
const int nd = Grid::dimensionworld;
|
||||||
|
|
||||||
@@ -1426,7 +1424,7 @@ void verticalExtent(const Grid& grid,
|
|||||||
|
|
||||||
for (typename CellRange::const_iterator
|
for (typename CellRange::const_iterator
|
||||||
ci = cells.begin(), ce = cells.end();
|
ci = cells.begin(), ce = cells.end();
|
||||||
ci != ce; ++ci, ++cellcount)
|
ci != ce; ++ci)
|
||||||
{
|
{
|
||||||
for (auto fi = cell2Faces[*ci].begin(),
|
for (auto fi = cell2Faces[*ci].begin(),
|
||||||
fe = cell2Faces[*ci].end();
|
fe = cell2Faces[*ci].end();
|
||||||
@@ -1687,9 +1685,7 @@ private:
|
|||||||
|
|
||||||
auto ptable = Details::PressureTable<FluidSystem, EquilReg>{ grav };
|
auto ptable = Details::PressureTable<FluidSystem, EquilReg>{ grav };
|
||||||
auto psat = PhaseSat { materialLawManager, this->swatInit_ };
|
auto psat = PhaseSat { materialLawManager, this->swatInit_ };
|
||||||
|
|
||||||
auto vspan = std::array<double, 2>{};
|
auto vspan = std::array<double, 2>{};
|
||||||
auto ncell = 0;
|
|
||||||
|
|
||||||
for (const auto& r : reg.activeRegions()) {
|
for (const auto& r : reg.activeRegions()) {
|
||||||
const auto& cells = reg.cells(r);
|
const auto& cells = reg.cells(r);
|
||||||
@@ -1699,7 +1695,7 @@ private:
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
Details::verticalExtent(grid, cells, ncell, vspan);
|
Details::verticalExtent(grid, cells, vspan);
|
||||||
|
|
||||||
const EqReg eqreg(rec[r], rsFunc_[r], rvFunc_[r], regionPvtIdx_[r]);
|
const EqReg eqreg(rec[r], rsFunc_[r], rvFunc_[r], regionPvtIdx_[r]);
|
||||||
|
|
||||||
|
|||||||
@@ -192,14 +192,13 @@ void test_PhasePressure()
|
|||||||
0
|
0
|
||||||
};
|
};
|
||||||
|
|
||||||
auto numCells = 0;
|
|
||||||
auto vspan = std::array<double, 2>{};
|
auto vspan = std::array<double, 2>{};
|
||||||
{
|
{
|
||||||
auto cells = std::vector<int>(simulator->vanguard().grid().size(0));
|
auto cells = std::vector<int>(simulator->vanguard().grid().size(0));
|
||||||
std::iota(cells.begin(), cells.end(), 0);
|
std::iota(cells.begin(), cells.end(), 0);
|
||||||
|
|
||||||
Opm::EQUIL::Details::verticalExtent(simulator->vanguard().grid(),
|
Opm::EQUIL::Details::verticalExtent(simulator->vanguard().grid(),
|
||||||
cells, numCells, vspan);
|
cells, vspan);
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto grav = 10.0;
|
const auto grav = 10.0;
|
||||||
@@ -211,7 +210,7 @@ void test_PhasePressure()
|
|||||||
|
|
||||||
const auto reltol = 1.0e-8;
|
const auto reltol = 1.0e-8;
|
||||||
const auto first = centerDepth(*simulator, 0);
|
const auto first = centerDepth(*simulator, 0);
|
||||||
const auto last = centerDepth(*simulator, numCells - 1);
|
const auto last = centerDepth(*simulator, simulator->vanguard().grid().size(0) - 1);
|
||||||
|
|
||||||
CHECK_CLOSE(ptable.water(first), 90e3 , reltol);
|
CHECK_CLOSE(ptable.water(first), 90e3 , reltol);
|
||||||
CHECK_CLOSE(ptable.water(last) , 180e3 , reltol);
|
CHECK_CLOSE(ptable.water(last) , 180e3 , reltol);
|
||||||
@@ -279,14 +278,13 @@ void test_CellSubset()
|
|||||||
cells[ix].push_back(c);
|
cells[ix].push_back(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto numCells = 0;
|
|
||||||
auto vspan = std::array<double, 2>{};
|
auto vspan = std::array<double, 2>{};
|
||||||
{
|
{
|
||||||
auto vspancells = std::vector<int>(simulator->vanguard().grid().size(0));
|
auto vspancells = std::vector<int>(simulator->vanguard().grid().size(0));
|
||||||
std::iota(vspancells.begin(), vspancells.end(), 0);
|
std::iota(vspancells.begin(), vspancells.end(), 0);
|
||||||
|
|
||||||
Opm::EQUIL::Details::verticalExtent(simulator->vanguard().grid(),
|
Opm::EQUIL::Details::verticalExtent(simulator->vanguard().grid(),
|
||||||
vspancells, numCells, vspan);
|
vspancells, vspan);
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto grav = 10.0;
|
const auto grav = 10.0;
|
||||||
@@ -294,7 +292,7 @@ void test_CellSubset()
|
|||||||
FluidSystem, Opm::EQUIL::EquilReg
|
FluidSystem, Opm::EQUIL::EquilReg
|
||||||
>{ grav };
|
>{ grav };
|
||||||
|
|
||||||
auto ppress = PPress(2, PVal(numCells, 0.0));
|
auto ppress = PPress(2, PVal(simulator->vanguard().grid().size(0), 0.0));
|
||||||
for (auto r = cells.begin(), e = cells.end(); r != e; ++r) {
|
for (auto r = cells.begin(), e = cells.end(); r != e; ++r) {
|
||||||
const int rno = int(r - cells.begin());
|
const int rno = int(r - cells.begin());
|
||||||
|
|
||||||
@@ -355,14 +353,13 @@ void test_RegMapping()
|
|||||||
0)
|
0)
|
||||||
};
|
};
|
||||||
|
|
||||||
auto numCells = 0;
|
|
||||||
auto vspan = std::array<double, 2>{};
|
auto vspan = std::array<double, 2>{};
|
||||||
{
|
{
|
||||||
auto cells = std::vector<int>(simulator->vanguard().grid().size(0));
|
auto cells = std::vector<int>(simulator->vanguard().grid().size(0));
|
||||||
std::iota(cells.begin(), cells.end(), 0);
|
std::iota(cells.begin(), cells.end(), 0);
|
||||||
|
|
||||||
Opm::EQUIL::Details::verticalExtent(simulator->vanguard().grid(),
|
Opm::EQUIL::Details::verticalExtent(simulator->vanguard().grid(),
|
||||||
cells, numCells, vspan);
|
cells, vspan);
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto grav = 10.0;
|
const auto grav = 10.0;
|
||||||
@@ -393,7 +390,7 @@ void test_RegMapping()
|
|||||||
|
|
||||||
const Opm::RegionMapping<> eqlmap(eqlnum);
|
const Opm::RegionMapping<> eqlmap(eqlnum);
|
||||||
|
|
||||||
auto ppress = PPress(2, PVal(numCells, 0.0));
|
auto ppress = PPress(2, PVal(simulator->vanguard().grid().size(0), 0.0));
|
||||||
for (const auto& r : eqlmap.activeRegions()) {
|
for (const auto& r : eqlmap.activeRegions()) {
|
||||||
ptable.equilibrate(region[r], vspan);
|
ptable.equilibrate(region[r], vspan);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user