mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #2131 from blattms/fix-wellmodel-numcomponents
Fix BlackoilWellModel::numComponents for parallel runs.
This commit is contained in:
commit
f95718a3c5
@ -337,7 +337,7 @@ namespace Opm {
|
|||||||
// The number of components in the model.
|
// The number of components in the model.
|
||||||
int numComponents() const;
|
int numComponents() const;
|
||||||
|
|
||||||
int numWells() const;
|
int numLocalWells() const;
|
||||||
|
|
||||||
int numPhases() const;
|
int numPhases() const;
|
||||||
|
|
||||||
|
@ -620,7 +620,7 @@ namespace Opm {
|
|||||||
{
|
{
|
||||||
std::vector<WellInterfacePtr> well_container;
|
std::vector<WellInterfacePtr> well_container;
|
||||||
|
|
||||||
const int nw = numWells();
|
const int nw = numLocalWells();
|
||||||
|
|
||||||
if (nw > 0) {
|
if (nw > 0) {
|
||||||
well_container.reserve(nw);
|
well_container.reserve(nw);
|
||||||
@ -732,7 +732,7 @@ namespace Opm {
|
|||||||
const Well2& well_ecl = wells_ecl_[index_well_ecl];
|
const Well2& well_ecl = wells_ecl_[index_well_ecl];
|
||||||
|
|
||||||
// Finding the location of the well in wells struct.
|
// Finding the location of the well in wells struct.
|
||||||
const int nw = numWells();
|
const int nw = numLocalWells();
|
||||||
int well_index_wells = -999;
|
int well_index_wells = -999;
|
||||||
for (int w = 0; w < nw; ++w) {
|
for (int w = 0; w < nw; ++w) {
|
||||||
if (well_name == std::string(wells()->name[w])) {
|
if (well_name == std::string(wells()->name[w])) {
|
||||||
@ -944,7 +944,7 @@ namespace Opm {
|
|||||||
BlackoilWellModel<TypeTag>::
|
BlackoilWellModel<TypeTag>::
|
||||||
localWellsActive() const
|
localWellsActive() const
|
||||||
{
|
{
|
||||||
return numWells() > 0;
|
return numLocalWells() > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1148,7 +1148,7 @@ namespace Opm {
|
|||||||
computeWellPotentials(std::vector<double>& well_potentials, const int reportStepIdx, Opm::DeferredLogger& deferred_logger)
|
computeWellPotentials(std::vector<double>& well_potentials, const int reportStepIdx, Opm::DeferredLogger& deferred_logger)
|
||||||
{
|
{
|
||||||
// number of wells and phases
|
// number of wells and phases
|
||||||
const int nw = numWells();
|
const int nw = numLocalWells();
|
||||||
const int np = numPhases();
|
const int np = numPhases();
|
||||||
well_potentials.resize(nw * np, 0.0);
|
well_potentials.resize(nw * np, 0.0);
|
||||||
|
|
||||||
@ -1380,7 +1380,7 @@ namespace Opm {
|
|||||||
int
|
int
|
||||||
BlackoilWellModel<TypeTag>::numComponents() const
|
BlackoilWellModel<TypeTag>::numComponents() const
|
||||||
{
|
{
|
||||||
if (numWells() > 0 && numPhases() < 3) {
|
if (wellsActive() && numPhases() < 3) {
|
||||||
return numPhases();
|
return numPhases();
|
||||||
}
|
}
|
||||||
int numComp = FluidSystem::numComponents;
|
int numComp = FluidSystem::numComponents;
|
||||||
@ -1393,7 +1393,7 @@ namespace Opm {
|
|||||||
|
|
||||||
template<typename TypeTag>
|
template<typename TypeTag>
|
||||||
int
|
int
|
||||||
BlackoilWellModel<TypeTag>:: numWells() const
|
BlackoilWellModel<TypeTag>:: numLocalWells() const
|
||||||
{
|
{
|
||||||
return wells() ? wells()->number_of_wells : 0;
|
return wells() ? wells()->number_of_wells : 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user