mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
port the RateConverter to use the FluidSystem instead of the old fluid property API
this makes the RateConverter stuff independent of Eigen and it simplifies some things because the the old PVT API is designed as a "bulk-with-derivatives" API while the rate converter code used it in "single shot" mode without derivatives.
This commit is contained in:
@@ -117,15 +117,11 @@ public:
|
||||
defunct_well_names_( defunct_well_names ),
|
||||
is_parallel_run_( false )
|
||||
{
|
||||
DUNE_UNUSED_PARAMETER(eclState);
|
||||
// Misc init.
|
||||
const int num_cells = AutoDiffGrid::numCells(grid());
|
||||
allcells_.resize(num_cells);
|
||||
for (int cell = 0; cell < num_cells; ++cell) {
|
||||
allcells_[cell] = cell;
|
||||
}
|
||||
|
||||
rateConverter_.reset(new RateConverterType(props_, std::vector<int>(AutoDiffGrid::numCells(grid()), 0)));
|
||||
extractLegacyCellPvtRegionIndex_();
|
||||
rateConverter_.reset(new RateConverterType(props.phaseUsage(),
|
||||
legacyCellPvtRegionIdx_.data(),
|
||||
AutoDiffGrid::numCells(grid()),
|
||||
std::vector<int>(AutoDiffGrid::numCells(grid()), 0)));
|
||||
|
||||
#if HAVE_MPI
|
||||
if ( solver_.parallelInformation().type() == typeid(ParallelISTLInformation) )
|
||||
@@ -708,15 +704,24 @@ protected:
|
||||
const EclipseState& eclState() const
|
||||
{ return ebosSimulator_.gridManager().eclState(); }
|
||||
|
||||
EclipseState& eclState()
|
||||
{ return ebosSimulator_.gridManager().eclState(); }
|
||||
void extractLegacyCellPvtRegionIndex_()
|
||||
{
|
||||
const auto& grid = ebosSimulator_.gridManager().grid();
|
||||
const auto& eclProblem = ebosSimulator_.problem();
|
||||
const unsigned numCells = grid.size(/*codim=*/0);
|
||||
|
||||
legacyCellPvtRegionIdx_.resize(numCells);
|
||||
for (unsigned cellIdx = 0; cellIdx < numCells; ++cellIdx) {
|
||||
legacyCellPvtRegionIdx_[cellIdx] =
|
||||
eclProblem.pvtRegionIndex(cellIdx);
|
||||
}
|
||||
}
|
||||
|
||||
// Data.
|
||||
Simulator& ebosSimulator_;
|
||||
|
||||
typedef RateConverter::
|
||||
SurfaceToReservoirVoidage< BlackoilPropsAdFromDeck,
|
||||
std::vector<int> > RateConverterType;
|
||||
std::vector<int> legacyCellPvtRegionIdx_;
|
||||
typedef RateConverter::SurfaceToReservoirVoidage<FluidSystem, std::vector<int> > RateConverterType;
|
||||
typedef typename Solver::SolverParameters SolverParameters;
|
||||
|
||||
const parameter::ParameterGroup param_;
|
||||
|
||||
Reference in New Issue
Block a user