mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
ebos: make it work in parallel
This commit is contained in:
parent
2c97fa302f
commit
ed0542b53b
@ -47,13 +47,10 @@ BEGIN_PROPERTIES
|
|||||||
|
|
||||||
NEW_TYPE_TAG(EclCpGridVanguard, INHERITS_FROM(EclBaseVanguard));
|
NEW_TYPE_TAG(EclCpGridVanguard, INHERITS_FROM(EclBaseVanguard));
|
||||||
|
|
||||||
NEW_PROP_TAG(ExportGlobalTransmissibility);
|
|
||||||
|
|
||||||
// declare the properties
|
// declare the properties
|
||||||
SET_TYPE_PROP(EclCpGridVanguard, Vanguard, Ewoms::EclCpGridVanguard<TypeTag>);
|
SET_TYPE_PROP(EclCpGridVanguard, Vanguard, Ewoms::EclCpGridVanguard<TypeTag>);
|
||||||
SET_TYPE_PROP(EclCpGridVanguard, Grid, Dune::CpGrid);
|
SET_TYPE_PROP(EclCpGridVanguard, Grid, Dune::CpGrid);
|
||||||
SET_TYPE_PROP(EclCpGridVanguard, EquilGrid, typename GET_PROP_TYPE(TypeTag, Grid));
|
SET_TYPE_PROP(EclCpGridVanguard, EquilGrid, typename GET_PROP_TYPE(TypeTag, Grid));
|
||||||
SET_BOOL_PROP(EclCpGridVanguard, ExportGlobalTransmissibility, false);
|
|
||||||
|
|
||||||
END_PROPERTIES
|
END_PROPERTIES
|
||||||
|
|
||||||
@ -201,11 +198,6 @@ public:
|
|||||||
|
|
||||||
delete cartesianIndexMapper_;
|
delete cartesianIndexMapper_;
|
||||||
cartesianIndexMapper_ = nullptr;
|
cartesianIndexMapper_ = nullptr;
|
||||||
|
|
||||||
if (!GET_PROP_VALUE(TypeTag, ExportGlobalTransmissibility)) {
|
|
||||||
delete globalTrans_;
|
|
||||||
globalTrans_ = nullptr;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -214,6 +206,17 @@ public:
|
|||||||
this->updateGridView_();
|
this->updateGridView_();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Free the memory occupied by the global transmissibility object.
|
||||||
|
*
|
||||||
|
* After writing the initial solution, this array should not be necessary anymore.
|
||||||
|
*/
|
||||||
|
void releaseGlobalTransmissibilities()
|
||||||
|
{
|
||||||
|
delete globalTrans_;
|
||||||
|
globalTrans_ = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Returns the object which maps a global element index of the simulation grid
|
* \brief Returns the object which maps a global element index of the simulation grid
|
||||||
* to the corresponding element index of the logically Cartesian index.
|
* to the corresponding element index of the logically Cartesian index.
|
||||||
|
@ -360,8 +360,15 @@ public:
|
|||||||
for (; wellDofIt != wellDofEndIt; ++ wellDofIt) {
|
for (; wellDofIt != wellDofEndIt; ++ wellDofIt) {
|
||||||
matrix[wellGlobalDofIdx][wellDofIt->first] = 0.0;
|
matrix[wellGlobalDofIdx][wellDofIt->first] = 0.0;
|
||||||
matrix[wellDofIt->first][wellGlobalDofIdx] = 0.0;
|
matrix[wellDofIt->first][wellGlobalDofIdx] = 0.0;
|
||||||
residual[wellGlobalDofIdx] = 0.0;
|
|
||||||
}
|
}
|
||||||
|
matrix[wellGlobalDofIdx][wellGlobalDofIdx] = diagBlock;
|
||||||
|
residual[wellGlobalDofIdx] = 0.0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if (dofVariables_.empty()) {
|
||||||
|
// the well does not feature any perforations on the local process
|
||||||
|
matrix[wellGlobalDofIdx][wellGlobalDofIdx] = diagBlock;
|
||||||
|
residual[wellGlobalDofIdx] = 0.0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -701,11 +708,14 @@ public:
|
|||||||
{
|
{
|
||||||
const auto& comm = simulator_.gridView().comm();
|
const auto& comm = simulator_.gridView().comm();
|
||||||
|
|
||||||
if (dofVariables_.size() == 0) {
|
int nTotal = dofVariables_.size();
|
||||||
|
nTotal = comm.sum(nTotal);
|
||||||
|
if (nTotal == 0) {
|
||||||
|
// well does not penetrate any active cell on any process. notify the
|
||||||
|
// user about this.
|
||||||
std::cout << "Well " << name() << " does not penetrate any active cell."
|
std::cout << "Well " << name() << " does not penetrate any active cell."
|
||||||
<< " Assuming it to be shut!\n";
|
<< " Assuming it to be shut!\n";
|
||||||
setWellStatus(WellStatus::Shut);
|
setWellStatus(WellStatus::Shut);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// determine the maximum depth of the well over all processes
|
// determine the maximum depth of the well over all processes
|
||||||
@ -1038,9 +1048,14 @@ public:
|
|||||||
auto& sol = const_cast<SolutionVector&>(simulator_.model().solution(/*timeIdx=*/0));
|
auto& sol = const_cast<SolutionVector&>(simulator_.model().solution(/*timeIdx=*/0));
|
||||||
int wellGlobalDof = AuxModule::localToGlobalDof(/*localDofIdx=*/0);
|
int wellGlobalDof = AuxModule::localToGlobalDof(/*localDofIdx=*/0);
|
||||||
|
|
||||||
|
if (!dofVariables_.empty()) {
|
||||||
// retrieve the bottom hole pressure from the global system of equations
|
// retrieve the bottom hole pressure from the global system of equations
|
||||||
actualBottomHolePressure_ = Toolbox::value(dofVariables_.begin()->second->pressure[0]);
|
actualBottomHolePressure_ = Toolbox::value(dofVariables_.begin()->second->pressure[0]);
|
||||||
actualBottomHolePressure_ = computeRateEquivalentBhp_();
|
actualBottomHolePressure_ = computeRateEquivalentBhp_();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
// start with 300 bars if we don't have anything better
|
||||||
|
actualBottomHolePressure_ = 300 * 1e5;
|
||||||
|
|
||||||
sol[wellGlobalDof][0] = actualBottomHolePressure_;
|
sol[wellGlobalDof][0] = actualBottomHolePressure_;
|
||||||
|
|
||||||
|
@ -558,8 +558,10 @@ public:
|
|||||||
maxPolymerAdsorption_.resize(numElements, 0.0);
|
maxPolymerAdsorption_.resize(numElements, 0.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (eclWriter_)
|
if (eclWriter_) {
|
||||||
eclWriter_->writeInit();
|
eclWriter_->writeInit();
|
||||||
|
this->simulator().vanguard().releaseGlobalTransmissibilities();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void prefetch(const Element& elem) const
|
void prefetch(const Element& elem) const
|
||||||
|
Loading…
Reference in New Issue
Block a user