mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
cleaning up for StandardWellsDense.
This commit is contained in:
parent
49df0c12f6
commit
f1c0e84878
@ -1539,13 +1539,10 @@ namespace Opm {
|
|||||||
const StandardWellsDense<TypeTag>&
|
const StandardWellsDense<TypeTag>&
|
||||||
wellModel() const { return well_model_; }
|
wellModel() const { return well_model_; }
|
||||||
|
|
||||||
/// return the Well struct in the StandardWells
|
|
||||||
const Wells& wells() const { return well_model_.wells(); }
|
|
||||||
|
|
||||||
/// return true if wells are available in the reservoir
|
/// return true if wells are available in the reservoir
|
||||||
bool wellsActive() const { return well_model_.wellsActive(); }
|
bool wellsActive() const { return well_model_.wellsActive(); }
|
||||||
|
|
||||||
int numWells() const { return wellsActive() ? wells().number_of_wells : 0; }
|
int numWells() const { return well_model_.numWells(); }
|
||||||
|
|
||||||
/// return true if wells are available on this process
|
/// return true if wells are available on this process
|
||||||
bool localWellsActive() const { return well_model_.localWellsActive(); }
|
bool localWellsActive() const { return well_model_.localWellsActive(); }
|
||||||
|
@ -135,7 +135,7 @@ namespace Opm {
|
|||||||
void assembleWellEq(Simulator& ebosSimulator,
|
void assembleWellEq(Simulator& ebosSimulator,
|
||||||
const double dt,
|
const double dt,
|
||||||
WellState& well_state,
|
WellState& well_state,
|
||||||
bool only_wells);
|
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;
|
||||||
@ -158,9 +158,9 @@ namespace Opm {
|
|||||||
|
|
||||||
int numCells() const;
|
int numCells() const;
|
||||||
|
|
||||||
void resetWellControlFromState(const WellState& xw) const;
|
int numWells() const;
|
||||||
|
|
||||||
const Wells& wells() const;
|
void resetWellControlFromState(const WellState& xw) const;
|
||||||
|
|
||||||
const Wells* wellsPointer() const;
|
const Wells* wellsPointer() const;
|
||||||
|
|
||||||
@ -172,26 +172,11 @@ namespace Opm {
|
|||||||
/// return true if wells are available on this process
|
/// return true if wells are available on this process
|
||||||
bool localWellsActive() const;
|
bool localWellsActive() const;
|
||||||
|
|
||||||
void setWellVariables();
|
|
||||||
|
|
||||||
void computeAccumWells();
|
|
||||||
|
|
||||||
SimulatorReport solveWellEq(Simulator& ebosSimulator,
|
|
||||||
const double dt,
|
|
||||||
WellState& well_state);
|
|
||||||
|
|
||||||
void printIf(const int c, const double x, const double y, const double eps, const std::string type) const;
|
|
||||||
|
|
||||||
std::vector<double> residual() const;
|
std::vector<double> residual() const;
|
||||||
|
|
||||||
bool getWellConvergence(Simulator& ebosSimulator,
|
bool getWellConvergence(Simulator& ebosSimulator,
|
||||||
const std::vector<Scalar>& B_avg) const;
|
const std::vector<Scalar>& B_avg) const;
|
||||||
|
|
||||||
void computeWellConnectionPressures(const Simulator& ebosSimulator,
|
|
||||||
const WellState& xw);
|
|
||||||
|
|
||||||
void updateWellControls(WellState& xw) const;
|
|
||||||
|
|
||||||
/// upate the dynamic lists related to economic limits
|
/// upate the dynamic lists related to economic limits
|
||||||
void updateListEconLimited(const Schedule& schedule,
|
void updateListEconLimited(const Schedule& schedule,
|
||||||
const int current_step,
|
const int current_step,
|
||||||
@ -199,12 +184,6 @@ namespace Opm {
|
|||||||
const WellState& well_state,
|
const WellState& well_state,
|
||||||
DynamicListEconLimited& list_econ_limited) const;
|
DynamicListEconLimited& list_econ_limited) const;
|
||||||
|
|
||||||
// Calculating well potentials for each well
|
|
||||||
// TODO: getBhp() will be refactored to reduce the duplication of the code calculating the bhp from THP.
|
|
||||||
void computeWellPotentials(const Simulator& ebosSimulator,
|
|
||||||
const WellState& well_state,
|
|
||||||
std::vector<double>& well_potentials) const;
|
|
||||||
|
|
||||||
// TODO: some preparation work, mostly related to group control and RESV,
|
// TODO: some preparation work, mostly related to group control and RESV,
|
||||||
// at the beginning of each time step (Not report step)
|
// at the beginning of each time step (Not report step)
|
||||||
void prepareTimeStep(const Simulator& ebos_simulator,
|
void prepareTimeStep(const Simulator& ebos_simulator,
|
||||||
@ -212,21 +191,6 @@ namespace Opm {
|
|||||||
|
|
||||||
WellCollection* wellCollection() const;
|
WellCollection* wellCollection() const;
|
||||||
|
|
||||||
const std::vector<double>&
|
|
||||||
wellPerfEfficiencyFactors() const;
|
|
||||||
|
|
||||||
void calculateEfficiencyFactors();
|
|
||||||
|
|
||||||
void computeWellVoidageRates(const WellState& well_state,
|
|
||||||
std::vector<double>& well_voidage_rates,
|
|
||||||
std::vector<double>& voidage_conversion_coeffs) const;
|
|
||||||
|
|
||||||
void applyVREPGroupControl(WellState& well_state) const;
|
|
||||||
|
|
||||||
void updateGroupControls(WellState& well_state) const;
|
|
||||||
|
|
||||||
/// setting the well_solutions_ based on well_state.
|
|
||||||
void setWellSolutions(const WellState& well_state) const;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool wells_active_;
|
bool wells_active_;
|
||||||
@ -265,14 +229,17 @@ namespace Opm {
|
|||||||
|
|
||||||
std::vector<double> pv_;
|
std::vector<double> pv_;
|
||||||
|
|
||||||
std::vector<double> wells_rep_radius_;
|
|
||||||
std::vector<double> wells_perf_length_;
|
|
||||||
std::vector<double> wells_bore_diameter_;
|
|
||||||
|
|
||||||
long int global_nc_;
|
long int global_nc_;
|
||||||
|
|
||||||
mutable BVector scaleAddRes_;
|
mutable BVector scaleAddRes_;
|
||||||
|
|
||||||
|
void updateWellControls(WellState& xw) const;
|
||||||
|
|
||||||
|
void updateGroupControls(WellState& well_state) const;
|
||||||
|
|
||||||
|
// setting the well_solutions_ based on well_state.
|
||||||
|
void setWellSolutions(const WellState& well_state) const;
|
||||||
|
|
||||||
void setupCompressedToCartesian(const int* global_cell, int number_of_cells, std::map<int,int>& cartesian_to_compressed ) const;
|
void setupCompressedToCartesian(const int* global_cell, int number_of_cells, std::map<int,int>& cartesian_to_compressed ) const;
|
||||||
|
|
||||||
void computeRepRadiusPerfLength(const Grid& grid);
|
void computeRepRadiusPerfLength(const Grid& grid);
|
||||||
@ -280,6 +247,34 @@ namespace Opm {
|
|||||||
|
|
||||||
void computeAverageFormationFactor(Simulator& ebosSimulator,
|
void computeAverageFormationFactor(Simulator& ebosSimulator,
|
||||||
std::vector<double>& B_avg) const;
|
std::vector<double>& B_avg) const;
|
||||||
|
|
||||||
|
void applyVREPGroupControl(WellState& well_state) const;
|
||||||
|
|
||||||
|
void computeWellVoidageRates(const WellState& well_state,
|
||||||
|
std::vector<double>& well_voidage_rates,
|
||||||
|
std::vector<double>& voidage_conversion_coeffs) const;
|
||||||
|
|
||||||
|
// Calculating well potentials for each well
|
||||||
|
// TODO: getBhp() will be refactored to reduce the duplication of the code calculating the bhp from THP.
|
||||||
|
void computeWellPotentials(const Simulator& ebosSimulator,
|
||||||
|
const WellState& well_state,
|
||||||
|
std::vector<double>& well_potentials) const;
|
||||||
|
|
||||||
|
const std::vector<double>& wellPerfEfficiencyFactors() const;
|
||||||
|
|
||||||
|
void calculateEfficiencyFactors();
|
||||||
|
|
||||||
|
void computeWellConnectionPressures(const Simulator& ebosSimulator,
|
||||||
|
const WellState& xw) const;
|
||||||
|
|
||||||
|
SimulatorReport solveWellEq(Simulator& ebosSimulator,
|
||||||
|
const double dt,
|
||||||
|
WellState& well_state) const;
|
||||||
|
|
||||||
|
void computeAccumWells() const;
|
||||||
|
|
||||||
|
void setWellVariables() const;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -102,6 +102,18 @@ namespace Opm {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
template<typename TypeTag>
|
||||||
|
int
|
||||||
|
StandardWellsDense<TypeTag>::
|
||||||
|
numWells() const
|
||||||
|
{
|
||||||
|
return number_of_wells_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
template<typename TypeTag>
|
template<typename TypeTag>
|
||||||
void
|
void
|
||||||
StandardWellsDense<TypeTag>::
|
StandardWellsDense<TypeTag>::
|
||||||
@ -168,7 +180,6 @@ namespace Opm {
|
|||||||
}
|
}
|
||||||
|
|
||||||
updateWellControls(well_state);
|
updateWellControls(well_state);
|
||||||
updateGroupControls(well_state);
|
|
||||||
// Set the primary variables for the wells
|
// Set the primary variables for the wells
|
||||||
setWellVariables();
|
setWellVariables();
|
||||||
|
|
||||||
@ -197,7 +208,7 @@ namespace Opm {
|
|||||||
assembleWellEq(Simulator& ebosSimulator,
|
assembleWellEq(Simulator& ebosSimulator,
|
||||||
const double dt,
|
const double dt,
|
||||||
WellState& well_state,
|
WellState& well_state,
|
||||||
bool only_wells)
|
bool only_wells) const
|
||||||
{
|
{
|
||||||
for (int w = 0; w < number_of_wells_; ++w) {
|
for (int w = 0; w < number_of_wells_; ++w) {
|
||||||
well_container_[w]->assembleWellEq(ebosSimulator, dt, well_state, only_wells);
|
well_container_[w]->assembleWellEq(ebosSimulator, dt, well_state, only_wells);
|
||||||
@ -362,19 +373,6 @@ namespace Opm {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template<typename TypeTag>
|
|
||||||
const Wells&
|
|
||||||
StandardWellsDense<TypeTag>::
|
|
||||||
wells() const
|
|
||||||
{
|
|
||||||
assert(wells_ != 0);
|
|
||||||
return *(wells_);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
template<typename TypeTag>
|
template<typename TypeTag>
|
||||||
const Wells*
|
const Wells*
|
||||||
StandardWellsDense<TypeTag>::
|
StandardWellsDense<TypeTag>::
|
||||||
@ -426,7 +424,7 @@ namespace Opm {
|
|||||||
template<typename TypeTag>
|
template<typename TypeTag>
|
||||||
void
|
void
|
||||||
StandardWellsDense<TypeTag>::
|
StandardWellsDense<TypeTag>::
|
||||||
setWellVariables()
|
setWellVariables() const
|
||||||
{
|
{
|
||||||
for (auto& well : well_container_) {
|
for (auto& well : well_container_) {
|
||||||
well->setWellVariables();
|
well->setWellVariables();
|
||||||
@ -440,7 +438,7 @@ namespace Opm {
|
|||||||
template<typename TypeTag>
|
template<typename TypeTag>
|
||||||
void
|
void
|
||||||
StandardWellsDense<TypeTag>::
|
StandardWellsDense<TypeTag>::
|
||||||
computeAccumWells()
|
computeAccumWells() const
|
||||||
{
|
{
|
||||||
for (auto& well : well_container_) {
|
for (auto& well : well_container_) {
|
||||||
well->computeAccumWell();
|
well->computeAccumWell();
|
||||||
@ -456,7 +454,7 @@ namespace Opm {
|
|||||||
StandardWellsDense<TypeTag>::
|
StandardWellsDense<TypeTag>::
|
||||||
solveWellEq(Simulator& ebosSimulator,
|
solveWellEq(Simulator& ebosSimulator,
|
||||||
const double dt,
|
const double dt,
|
||||||
WellState& well_state)
|
WellState& well_state) const
|
||||||
{
|
{
|
||||||
const int nw = number_of_wells_;
|
const int nw = number_of_wells_;
|
||||||
WellState well_state0 = well_state;
|
WellState well_state0 = well_state;
|
||||||
@ -494,7 +492,6 @@ namespace Opm {
|
|||||||
if( wellsActive() )
|
if( wellsActive() )
|
||||||
{
|
{
|
||||||
updateWellControls(well_state);
|
updateWellControls(well_state);
|
||||||
updateGroupControls(well_state);
|
|
||||||
setWellVariables();
|
setWellVariables();
|
||||||
}
|
}
|
||||||
} while (it < 15);
|
} while (it < 15);
|
||||||
@ -519,20 +516,6 @@ namespace Opm {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
template<typename TypeTag>
|
|
||||||
void
|
|
||||||
StandardWellsDense<TypeTag>::
|
|
||||||
printIf(const int c, const double x, const double y, const double eps, const std::string type) const
|
|
||||||
{
|
|
||||||
if (std::abs(x-y) > eps) {
|
|
||||||
std::cout << type << " " << c << ": "<<x << " " << y << std::endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
template<typename TypeTag>
|
template<typename TypeTag>
|
||||||
std::vector<double>
|
std::vector<double>
|
||||||
StandardWellsDense<TypeTag>::
|
StandardWellsDense<TypeTag>::
|
||||||
@ -630,7 +613,7 @@ namespace Opm {
|
|||||||
void
|
void
|
||||||
StandardWellsDense<TypeTag>::
|
StandardWellsDense<TypeTag>::
|
||||||
computeWellConnectionPressures(const Simulator& ebosSimulator,
|
computeWellConnectionPressures(const Simulator& ebosSimulator,
|
||||||
const WellState& xw)
|
const WellState& xw) const
|
||||||
{
|
{
|
||||||
if( ! localWellsActive() ) return ;
|
if( ! localWellsActive() ) return ;
|
||||||
|
|
||||||
@ -659,6 +642,8 @@ namespace Opm {
|
|||||||
for (const auto& well : well_container_) {
|
for (const auto& well : well_container_) {
|
||||||
well->updateWellControl(xw, logger);
|
well->updateWellControl(xw, logger);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateGroupControls(xw);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user