mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
more cleaning up of StandardWellsDense.
not functional change.
This commit is contained in:
@@ -141,7 +141,6 @@ public:
|
|||||||
ExtraData extra;
|
ExtraData extra;
|
||||||
|
|
||||||
failureReport_ = SimulatorReport();
|
failureReport_ = SimulatorReport();
|
||||||
extractLegacyPoreVolume_();
|
|
||||||
extractLegacyDepth_();
|
extractLegacyDepth_();
|
||||||
|
|
||||||
// communicate the initial solution to ebos
|
// communicate the initial solution to ebos
|
||||||
@@ -480,7 +479,6 @@ protected:
|
|||||||
activePhases,
|
activePhases,
|
||||||
gravity,
|
gravity,
|
||||||
legacyDepth_,
|
legacyDepth_,
|
||||||
legacyPoreVolume_,
|
|
||||||
globalNumCells,
|
globalNumCells,
|
||||||
grid());
|
grid());
|
||||||
auto model = std::unique_ptr<Model>(new Model(ebosSimulator_,
|
auto model = std::unique_ptr<Model>(new Model(ebosSimulator_,
|
||||||
@@ -867,22 +865,6 @@ protected:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void extractLegacyPoreVolume_()
|
|
||||||
{
|
|
||||||
const auto& grid = ebosSimulator_.gridManager().grid();
|
|
||||||
const unsigned numCells = grid.size(/*codim=*/0);
|
|
||||||
const auto& ebosProblem = ebosSimulator_.problem();
|
|
||||||
const auto& ebosModel = ebosSimulator_.model();
|
|
||||||
|
|
||||||
legacyPoreVolume_.resize(numCells);
|
|
||||||
for (unsigned cellIdx = 0; cellIdx < numCells; ++cellIdx) {
|
|
||||||
// todo (?): respect rock compressibility
|
|
||||||
legacyPoreVolume_[cellIdx] =
|
|
||||||
ebosModel.dofTotalVolume(cellIdx)
|
|
||||||
*ebosProblem.porosity(cellIdx);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void extractLegacyDepth_()
|
void extractLegacyDepth_()
|
||||||
{
|
{
|
||||||
const auto& grid = ebosSimulator_.gridManager().grid();
|
const auto& grid = ebosSimulator_.gridManager().grid();
|
||||||
@@ -1009,7 +991,6 @@ protected:
|
|||||||
Simulator& ebosSimulator_;
|
Simulator& ebosSimulator_;
|
||||||
|
|
||||||
std::vector<int> legacyCellPvtRegionIdx_;
|
std::vector<int> legacyCellPvtRegionIdx_;
|
||||||
std::vector<double> legacyPoreVolume_;
|
|
||||||
std::vector<double> legacyDepth_;
|
std::vector<double> legacyDepth_;
|
||||||
typedef typename Solver::SolverParameters SolverParameters;
|
typedef typename Solver::SolverParameters SolverParameters;
|
||||||
|
|
||||||
|
|||||||
@@ -104,37 +104,17 @@ namespace Opm {
|
|||||||
const std::vector<bool>& active_arg,
|
const std::vector<bool>& active_arg,
|
||||||
const double gravity_arg,
|
const double gravity_arg,
|
||||||
const std::vector<double>& depth_arg,
|
const std::vector<double>& depth_arg,
|
||||||
const std::vector<double>& pv_arg,
|
|
||||||
long int global_nc,
|
long int global_nc,
|
||||||
const Grid& grid);
|
const Grid& grid);
|
||||||
|
|
||||||
void setVFPProperties(const VFPProperties* vfp_properties_arg);
|
void setVFPProperties(const VFPProperties* vfp_properties_arg);
|
||||||
|
|
||||||
/// The number of components in the model.
|
|
||||||
int numComponents() const
|
|
||||||
{
|
|
||||||
if (numPhases() == 2) {
|
|
||||||
return 2;
|
|
||||||
}
|
|
||||||
int numComp = FluidSystem::numComponents;
|
|
||||||
if (has_solvent_) {
|
|
||||||
numComp ++;
|
|
||||||
}
|
|
||||||
|
|
||||||
return numComp;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
SimulatorReport assemble(Simulator& ebosSimulator,
|
SimulatorReport assemble(Simulator& ebosSimulator,
|
||||||
const int iterationIdx,
|
const int iterationIdx,
|
||||||
const double dt,
|
const double dt,
|
||||||
WellState& well_state);
|
WellState& well_state);
|
||||||
|
|
||||||
void assembleWellEq(Simulator& ebosSimulator,
|
|
||||||
const double dt,
|
|
||||||
WellState& well_state,
|
|
||||||
bool only_wells) const;
|
|
||||||
|
|
||||||
// substract Binv(D)rw from r;
|
// substract Binv(D)rw from r;
|
||||||
void apply( BVector& r) const;
|
void apply( BVector& r) const;
|
||||||
|
|
||||||
@@ -148,16 +128,8 @@ namespace Opm {
|
|||||||
// xw to update Well State
|
// xw to update Well State
|
||||||
void applySolutionWellState(const BVector& x, WellState& well_state) const;
|
void applySolutionWellState(const BVector& x, WellState& well_state) const;
|
||||||
|
|
||||||
int flowPhaseToEbosPhaseIdx( const int phaseIdx ) const;
|
|
||||||
|
|
||||||
int numPhases() const;
|
|
||||||
|
|
||||||
int numCells() const;
|
|
||||||
|
|
||||||
int numWells() const;
|
int numWells() const;
|
||||||
|
|
||||||
void resetWellControlFromState(const WellState& xw) const;
|
|
||||||
|
|
||||||
const Wells* wellsPointer() const;
|
const Wells* wellsPointer() const;
|
||||||
|
|
||||||
/// return true if wells are available in the reservoir
|
/// return true if wells are available in the reservoir
|
||||||
@@ -221,7 +193,8 @@ namespace Opm {
|
|||||||
std::vector<bool> active_;
|
std::vector<bool> active_;
|
||||||
const RateConverterType& rate_converter_;
|
const RateConverterType& rate_converter_;
|
||||||
|
|
||||||
std::vector<double> pv_;
|
// the number of the cells in the local grid
|
||||||
|
int number_of_cells_;
|
||||||
|
|
||||||
long int global_nc_;
|
long int global_nc_;
|
||||||
|
|
||||||
@@ -269,6 +242,30 @@ namespace Opm {
|
|||||||
|
|
||||||
void setWellVariables() const;
|
void setWellVariables() const;
|
||||||
|
|
||||||
|
// The number of components in the model.
|
||||||
|
int numComponents() const
|
||||||
|
{
|
||||||
|
if (numPhases() == 2) {
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
int numComp = FluidSystem::numComponents;
|
||||||
|
if (has_solvent_) {
|
||||||
|
numComp ++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return numComp;
|
||||||
|
}
|
||||||
|
|
||||||
|
int numPhases() const;
|
||||||
|
|
||||||
|
int flowPhaseToEbosPhaseIdx( const int phaseIdx ) const;
|
||||||
|
|
||||||
|
void resetWellControlFromState(const WellState& xw) const;
|
||||||
|
|
||||||
|
void assembleWellEq(Simulator& ebosSimulator,
|
||||||
|
const double dt,
|
||||||
|
WellState& well_state,
|
||||||
|
bool only_wells) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,6 @@ namespace Opm {
|
|||||||
const std::vector<bool>& active_arg,
|
const std::vector<bool>& active_arg,
|
||||||
const double gravity_arg,
|
const double gravity_arg,
|
||||||
const std::vector<double>& depth_arg,
|
const std::vector<double>& depth_arg,
|
||||||
const std::vector<double>& pv_arg,
|
|
||||||
long int global_nc,
|
long int global_nc,
|
||||||
const Grid& grid)
|
const Grid& grid)
|
||||||
{
|
{
|
||||||
@@ -52,12 +51,9 @@ namespace Opm {
|
|||||||
|
|
||||||
phase_usage_ = phase_usage_arg;
|
phase_usage_ = phase_usage_arg;
|
||||||
active_ = active_arg;
|
active_ = active_arg;
|
||||||
pv_ = pv_arg;
|
|
||||||
|
|
||||||
calculateEfficiencyFactors();
|
calculateEfficiencyFactors();
|
||||||
|
|
||||||
const int nc = numCells();
|
|
||||||
|
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
const auto& pu = phase_usage_;
|
const auto& pu = phase_usage_;
|
||||||
const int np = pu.num_phases;
|
const int np = pu.num_phases;
|
||||||
@@ -74,11 +70,12 @@ namespace Opm {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
number_of_cells_ = Opm::UgGridHelpers::numCells(grid);
|
||||||
// do the initialization for all the wells
|
// do the initialization for all the wells
|
||||||
// TODO: to see whether we can postpone of the intialization of the well containers to
|
// TODO: to see whether we can postpone of the intialization of the well containers to
|
||||||
// optimize the usage of the following several member variables
|
// optimize the usage of the following several member variables
|
||||||
for (auto& well : well_container_) {
|
for (auto& well : well_container_) {
|
||||||
well->init(&phase_usage_, &active_, depth_arg, gravity_arg, nc);
|
well->init(&phase_usage_, &active_, depth_arg, gravity_arg, number_of_cells_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -323,18 +320,6 @@ namespace Opm {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template<typename TypeTag>
|
|
||||||
int
|
|
||||||
StandardWellsDense<TypeTag>::
|
|
||||||
numCells() const
|
|
||||||
{
|
|
||||||
return pv_.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
template<typename TypeTag>
|
template<typename TypeTag>
|
||||||
void
|
void
|
||||||
StandardWellsDense<TypeTag>::
|
StandardWellsDense<TypeTag>::
|
||||||
@@ -668,6 +653,8 @@ namespace Opm {
|
|||||||
computeWellPotentials(ebos_simulator, well_state, well_potentials);
|
computeWellPotentials(ebos_simulator, well_state, well_potentials);
|
||||||
|
|
||||||
// update/setup guide rates for each well based on the well_potentials
|
// update/setup guide rates for each well based on the well_potentials
|
||||||
|
// TODO: this is one of two places that still need Wells struct. In this function, only the well names
|
||||||
|
// well types are used, probably the order of the wells to locate the correct values in well_potentials.
|
||||||
well_collection_->setGuideRatesWithPotentials(wellsPointer(), phase_usage_, well_potentials);
|
well_collection_->setGuideRatesWithPotentials(wellsPointer(), phase_usage_, well_potentials);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -894,11 +881,10 @@ namespace Opm {
|
|||||||
{
|
{
|
||||||
// TODO, the function does not work for parallel running
|
// TODO, the function does not work for parallel running
|
||||||
// to be fixed later.
|
// to be fixed later.
|
||||||
int number_of_cells = Opm::UgGridHelpers::numCells(grid);
|
|
||||||
const int* global_cell = Opm::UgGridHelpers::globalCell(grid);
|
const int* global_cell = Opm::UgGridHelpers::globalCell(grid);
|
||||||
|
|
||||||
std::map<int,int> cartesian_to_compressed;
|
std::map<int,int> cartesian_to_compressed;
|
||||||
setupCompressedToCartesian(global_cell, number_of_cells,
|
setupCompressedToCartesian(global_cell, number_of_cells_,
|
||||||
cartesian_to_compressed);
|
cartesian_to_compressed);
|
||||||
|
|
||||||
for (const auto& well : well_container_) {
|
for (const auto& well : well_container_) {
|
||||||
|
|||||||
Reference in New Issue
Block a user