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:
Halvor M Nilsen 2025-01-31 18:16:19 +01:00 committed by Bård Skaflestad
parent a212a1b82e
commit f2e846a14f
2 changed files with 10 additions and 4 deletions

View File

@ -1704,7 +1704,6 @@ protected:
BCData<int> bcindex_;
bool nonTrivialBoundaryConditions_ = false;
bool first_step_ = true;
};
} // namespace Opm

View File

@ -80,8 +80,10 @@ template <class TypeTag>
class FlowProblemBlackoil : public FlowProblem<TypeTag>
{
// TODO: the naming of the Types might be able to be adjusted
public:
using FlowProblemType = FlowProblem<TypeTag>;
private:
using typename FlowProblemType::Scalar;
using typename FlowProblemType::Simulator;
using typename FlowProblemType::GridView;
@ -436,18 +438,23 @@ public:
void endTimeStep() override
{
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();
const bool isSubStep = !this->simulator().episodeWillBeOver();
// For CpGrid with LGRs, ecl/vtk output is not supported yet.
const auto& grid = this->simulator().vanguard().gridView().grid();
using GridType = std::remove_cv_t<std::remove_reference_t<decltype(grid)>>;
constexpr bool isCpGrid = std::is_same_v<GridType, Dune::CpGrid>;
if (!isCpGrid || (grid.maxLevel() == 0)) {
const bool isSubStep = !this->simulator().episodeWillBeOver();
this->eclWriter_->evalSummaryState(isSubStep);
}