mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Make Action Processing Independently Accessible
This commit splits the action processing of member function FlowProblemBlackoil::endTimeStep() out into a separate member function void FlowProblemBlackoil::endStepApplyAction() for use by client code. The initial use case is to have an action-like operation that supports adding new connections to wells in parts of the formation undergoing hydraulic fracturing.
This commit is contained in:
parent
a212a1b82e
commit
f2e846a14f
@ -1704,7 +1704,6 @@ protected:
|
|||||||
BCData<int> bcindex_;
|
BCData<int> bcindex_;
|
||||||
bool nonTrivialBoundaryConditions_ = false;
|
bool nonTrivialBoundaryConditions_ = false;
|
||||||
bool first_step_ = true;
|
bool first_step_ = true;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Opm
|
} // namespace Opm
|
||||||
|
@ -80,8 +80,10 @@ template <class TypeTag>
|
|||||||
class FlowProblemBlackoil : public FlowProblem<TypeTag>
|
class FlowProblemBlackoil : public FlowProblem<TypeTag>
|
||||||
{
|
{
|
||||||
// TODO: the naming of the Types might be able to be adjusted
|
// TODO: the naming of the Types might be able to be adjusted
|
||||||
|
public:
|
||||||
using FlowProblemType = FlowProblem<TypeTag>;
|
using FlowProblemType = FlowProblem<TypeTag>;
|
||||||
|
|
||||||
|
private:
|
||||||
using typename FlowProblemType::Scalar;
|
using typename FlowProblemType::Scalar;
|
||||||
using typename FlowProblemType::Simulator;
|
using typename FlowProblemType::Simulator;
|
||||||
using typename FlowProblemType::GridView;
|
using typename FlowProblemType::GridView;
|
||||||
@ -436,18 +438,23 @@ public:
|
|||||||
void endTimeStep() override
|
void endTimeStep() override
|
||||||
{
|
{
|
||||||
FlowProblemType::endTimeStep();
|
FlowProblemType::endTimeStep();
|
||||||
|
this->endStepApplyAction();
|
||||||
|
}
|
||||||
|
|
||||||
// after the solution is updated, the values in output module needs also updated
|
void endStepApplyAction()
|
||||||
|
{
|
||||||
|
// After the solution is updated, the values in output module needs
|
||||||
|
// also updated.
|
||||||
this->eclWriter()->mutableOutputModule().invalidateLocalData();
|
this->eclWriter()->mutableOutputModule().invalidateLocalData();
|
||||||
|
|
||||||
const bool isSubStep = !this->simulator().episodeWillBeOver();
|
|
||||||
|
|
||||||
// For CpGrid with LGRs, ecl/vtk output is not supported yet.
|
// For CpGrid with LGRs, ecl/vtk output is not supported yet.
|
||||||
const auto& grid = this->simulator().vanguard().gridView().grid();
|
const auto& grid = this->simulator().vanguard().gridView().grid();
|
||||||
|
|
||||||
using GridType = std::remove_cv_t<std::remove_reference_t<decltype(grid)>>;
|
using GridType = std::remove_cv_t<std::remove_reference_t<decltype(grid)>>;
|
||||||
constexpr bool isCpGrid = std::is_same_v<GridType, Dune::CpGrid>;
|
constexpr bool isCpGrid = std::is_same_v<GridType, Dune::CpGrid>;
|
||||||
if (!isCpGrid || (grid.maxLevel() == 0)) {
|
if (!isCpGrid || (grid.maxLevel() == 0)) {
|
||||||
|
const bool isSubStep = !this->simulator().episodeWillBeOver();
|
||||||
|
|
||||||
this->eclWriter_->evalSummaryState(isSubStep);
|
this->eclWriter_->evalSummaryState(isSubStep);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user