Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report Connection Level Fracturing Statistics to I/O Layer #5811

Draft
wants to merge 15 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 45 additions & 4 deletions CMakeLists_files.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -574,9 +574,40 @@ list (APPEND TEST_DATA_FILES
# originally generated with the command:
# find opm -name '*.h*' -a ! -name '*-pch.hpp' -printf '\t%p\n' | sort
list (APPEND PUBLIC_HEADER_FILES
flow/flow_blackoil.hpp
flow/flow_blackoil_legacyassembly.hpp
flow/flow_brine.hpp
flow/flow_brine_precsalt_vapwat.hpp
flow/flow_brine_saltprecipitation.hpp
flow/flow_energy.hpp
flow/flow_extbo.hpp
flow/flow_foam.hpp
flow/flow_gasoil.hpp
flow/flow_gasoil_energy.hpp
flow/flow_gasoildiffuse.hpp
flow/flow_gaswater.hpp
flow/flow_gaswater_brine.hpp
flow/flow_gaswater_dissolution.hpp
flow/flow_gaswater_dissolution_diffuse.hpp
flow/flow_gaswater_energy.hpp
flow/flow_gaswater_saltprec_energy.hpp
flow/flow_gaswater_saltprec_vapwat.hpp
flow/flow_gaswater_solvent.hpp
flow/flow_micp.hpp
flow/flow_oilwater.hpp
flow/flow_oilwater_brine.hpp
flow/flow_oilwater_polymer.hpp
flow/flow_oilwater_polymer_injectivity.hpp
flow/flow_onephase.hpp
flow/flow_onephase_energy.hpp
flow/flow_polymer.hpp
flow/flow_solvent.hpp
flow/flow_solvent_foam.hpp

opm/models/blackoil/blackoilboundaryratevector.hh
opm/models/blackoil/blackoilbrinemodules.hh
opm/models/blackoil/blackoilbrineparams.hpp
opm/models/blackoil/blackoilconvectivemixingmodule.hh
opm/models/blackoil/blackoildarcyfluxmodule.hh
opm/models/blackoil/blackoildiffusionmodule.hh
opm/models/blackoil/blackoildispersionmodule.hh
Expand Down Expand Up @@ -905,17 +936,21 @@ list (APPEND PUBLIC_HEADER_FILES
opm/simulators/linalg/overlaptypes.hh
opm/simulators/linalg/OwningBlockPreconditioner.hpp
opm/simulators/linalg/OwningTwoLevelPreconditioner.hpp
opm/simulators/linalg/MILU.hpp
opm/simulators/linalg/parallelamgbackend.hh
opm/simulators/linalg/parallelbasebackend.hh
opm/simulators/linalg/parallelbicgstabbackend.hh
opm/simulators/linalg/parallelistlbackend.hh
opm/simulators/linalg/ParallelIstlInformation.hpp
opm/simulators/linalg/ParallelOverlappingILU0.hpp
opm/simulators/linalg/ParallelRestrictedAdditiveSchwarz.hpp
opm/simulators/linalg/PressureSolverPolicy.hpp
opm/simulators/linalg/PressureTransferPolicy.hpp
opm/simulators/linalg/PreconditionerFactoryGPUIncludeWrapper.hpp
opm/simulators/linalg/PreconditionerFactory.hpp
opm/simulators/linalg/PreconditionerFactory_impl.hpp
opm/simulators/linalg/PreconditionerWithUpdate.hpp
opm/simulators/linalg/PressureBhpTransferPolicy.hpp
opm/simulators/linalg/PressureSolverPolicy.hpp
opm/simulators/linalg/PressureTransferPolicy.hpp
opm/simulators/linalg/PropertyTree.hpp
opm/simulators/linalg/residreductioncriterion.hh
opm/simulators/linalg/SmallDenseMatrixUtils.hpp
Expand Down Expand Up @@ -952,6 +987,8 @@ list (APPEND PUBLIC_HEADER_FILES
opm/simulators/utils/gatherDeferredLogger.hpp
opm/simulators/utils/moduleVersion.hpp
opm/simulators/utils/phaseUsageFromDeck.hpp
opm/simulators/utils/ParallelCommunication.hpp
opm/simulators/utils/ParallelSerialization.hpp
opm/simulators/utils/readDeck.hpp
opm/simulators/utils/satfunc/RelpermDiagnostics.hpp
opm/simulators/wells/ALQState.hpp
Expand All @@ -962,6 +999,7 @@ list (APPEND PUBLIC_HEADER_FILES
opm/simulators/wells/BlackoilWellModelGuideRates.hpp
opm/simulators/wells/BlackoilWellModelRestart.hpp
opm/simulators/wells/ConnFiltrateData.hpp
opm/simulators/wells/ConnFracStatistics.hpp
opm/simulators/wells/FractionCalculator.hpp
opm/simulators/wells/GasLiftCommon.hpp
opm/simulators/wells/GasLiftGroupInfo.hpp
Expand Down Expand Up @@ -992,6 +1030,7 @@ list (APPEND PUBLIC_HEADER_FILES
opm/simulators/wells/RatioCalculator.hpp
opm/simulators/wells/RegionAttributeHelpers.hpp
opm/simulators/wells/RegionAverageCalculator.hpp
opm/simulators/wells/RunningStatistics.hpp
opm/simulators/wells/SingleWellState.hpp
opm/simulators/wells/StandardWell.hpp
opm/simulators/wells/StandardWell_impl.hpp
Expand All @@ -1015,14 +1054,16 @@ list (APPEND PUBLIC_HEADER_FILES
opm/simulators/wells/WellGroupControls.hpp
opm/simulators/wells/WellGroupHelpers.hpp
opm/simulators/wells/WellHelpers.hpp
opm/simulators/wells/WellInterface.hpp
opm/simulators/wells/WellInterfaceFluidSystem.hpp
opm/simulators/wells/WellInterfaceGeneric.hpp
opm/simulators/wells/WellInterface.hpp
opm/simulators/wells/WellInterface_impl.hpp
opm/simulators/wells/WellInterfaceIndices.hpp
opm/simulators/wells/WellProdIndexCalculator.hpp
opm/simulators/wells/WellState.hpp
opm/simulators/wells/WellTest.hpp
opm/simulators/wells/WGState.hpp
)
)
if (USE_GPU_BRIDGE)
list (APPEND PUBLIC_HEADER_FILES
opm/simulators/linalg/gpubridge/amgclSolverBackend.hpp
Expand Down
2 changes: 0 additions & 2 deletions opm/models/blackoil/blackoilintensivequantities.hh
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@
#include <cstring>
#include <utility>

#include <fmt/format.h>

namespace Opm {
/*!
* \ingroup BlackOilModel
Expand Down
16 changes: 8 additions & 8 deletions opm/models/discretization/common/fvbaseprimaryvariables.hh
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,14 @@ namespace Dune {
};


/** Specialization of FieldTraits for all PrimaryVariables derived from Opm::FvBasePrimaryVariables */
template<class TypeTag, template <class> class EwomsPrimaryVariable>
struct FieldTraits< EwomsPrimaryVariable< TypeTag > >
: public FieldTraitsImpl< TypeTag,
std::is_base_of< Opm::FvBasePrimaryVariables< TypeTag >,
EwomsPrimaryVariable< TypeTag > > :: value >
{
};
// /** Specialization of FieldTraits for all PrimaryVariables derived from Opm::FvBasePrimaryVariables */
// template<class TypeTag, template <class> class EwomsPrimaryVariable>
// struct FieldTraits< EwomsPrimaryVariable< TypeTag > >
// : public FieldTraitsImpl< TypeTag,
// std::is_base_of< Opm::FvBasePrimaryVariables< TypeTag >,
// EwomsPrimaryVariable< TypeTag > > :: value >
// {
// };
}

#endif
2 changes: 1 addition & 1 deletion opm/simulators/flow/ActionHandler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ class ActionHandler
void evalUDQAssignments(const unsigned episodeIdx,
UDQState& udq_state);

private:
/// Convey dynamic updates triggered by an action block back to the
/// running simulator.
///
Expand All @@ -125,6 +124,7 @@ class ActionHandler
const TransFunc& updateTrans,
bool& commit_wellstate);

private:
/// Static properties such as permeability and transmissibility.
EclipseState& ecl_state_;

Expand Down
1 change: 1 addition & 0 deletions opm/simulators/flow/CpGridVanguard.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ class CpGridVanguard : public FlowBaseVanguard<TypeTag>
}

this->doLoadBalance_(this->edgeWeightsMethod(), this->ownersFirst(),
this->addCorners(),this->numOverlap(),
this->partitionMethod(), this->serialPartitioning(),
this->enableDistributedWells(),
this->allow_splitting_inactive_wells_,
Expand Down
2 changes: 2 additions & 0 deletions opm/simulators/flow/FlowBaseVanguard.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ class FlowBaseVanguard : public BaseVanguard<TypeTag>,

ownersFirst_ = Parameters::Get<Parameters::OwnerCellsFirst>();
#if HAVE_MPI
numOverlap_ = Parameters::Get<Parameters::NumOverlap>();
addCorners_ = Parameters::Get<Parameters::AddCorners>();
partitionMethod_ = Dune::PartitionMethod(Parameters::Get<Parameters::PartitionMethod>());
serialPartitioning_ = Parameters::Get<Parameters::SerialPartitioning>();
imbalanceTol_ = Parameters::Get<Parameters::ImbalanceTol<Scalar>>();
Expand Down
4 changes: 4 additions & 0 deletions opm/simulators/flow/FlowGenericVanguard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,10 @@ void FlowGenericVanguard::registerParameters_()
Parameters::Register<Parameters::OwnerCellsFirst>
("Order cells owned by rank before ghost/overlap cells.");
#if HAVE_MPI
Parameters::Register<Parameters::AddCorners>
("Add corners to partion.");
Parameters::Register<Parameters::NumOverlap>
("Numbers of layers overlap in parallel partition");
Parameters::Register<Parameters::PartitionMethod>
("Choose partitioning strategy: 0=simple, 1=Zoltan, 2=METIS.");
Parameters::Register<Parameters::SerialPartitioning>
Expand Down
11 changes: 11 additions & 0 deletions opm/simulators/flow/FlowGenericVanguard.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ struct ActionParsingStrictness { static constexpr auto value = "normal"; };

// 0: simple, 1: Zoltan, 2: METIS, see GridEnums.hpp
struct PartitionMethod { static constexpr int value = 1; };
struct AddCorners { static constexpr bool value = false; };
struct NumOverlap { static constexpr int value = 1; };

struct SchedRestart{ static constexpr bool value = false; };
struct SerialPartitioning{ static constexpr bool value = false; };
Expand Down Expand Up @@ -253,7 +255,14 @@ class FlowGenericVanguard {
bool ownersFirst() const
{ return ownersFirst_; }


#if HAVE_MPI
bool addCorners() const
{ return addCorners_; }

int numOverlap() const
{ return numOverlap_; }

/*!
* \brief Parameter deciding which partition method to use
*/
Expand Down Expand Up @@ -349,6 +358,8 @@ class FlowGenericVanguard {

bool ownersFirst_;
#if HAVE_MPI
bool addCorners_;
int numOverlap_;
Dune::PartitionMethod partitionMethod_;
bool serialPartitioning_;
double imbalanceTol_;
Expand Down
8 changes: 5 additions & 3 deletions opm/simulators/flow/FlowProblem.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1676,9 +1676,8 @@ class FlowProblem : public GetPropType<TypeTag, Properties::BaseProblem>

return this->rockCompTransMultWc_[tableIdx].eval(effectivePressure, SwDeltaMax, /*extrapolation=*/true);
}

protected:
typename Vanguard::TransmissibilityType transmissibilities_;

std::shared_ptr<EclMaterialLawManager> materialLawManager_;
std::shared_ptr<EclThermalLawManager> thermalLawManager_;

Expand All @@ -1694,6 +1693,8 @@ class FlowProblem : public GetPropType<TypeTag, Properties::BaseProblem>
PffGridVector<GridView, Stencil, PffDofData_, DofMapper> pffDofData_;
TracerModel tracerModel_;


private:
template<class T>
struct BCData
{
Expand Down Expand Up @@ -1726,8 +1727,9 @@ class FlowProblem : public GetPropType<TypeTag, Properties::BaseProblem>
virtual void handleSolventBC(const BCProp::BCFace&, RateVector&) const = 0;

virtual void handlePolymerBC(const BCProp::BCFace&, RateVector&) const = 0;

protected:
BCData<int> bcindex_;
private:
bool nonTrivialBoundaryConditions_ = false;
bool explicitRockCompaction_ = false;
bool first_step_ = true;
Expand Down
8 changes: 6 additions & 2 deletions opm/simulators/flow/FlowProblemBlackoil.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,9 @@ 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;
Expand Down Expand Up @@ -436,7 +437,10 @@ class FlowProblemBlackoil : public FlowProblem<TypeTag>
void endTimeStep() override
{
FlowProblemType::endTimeStep();

this->endStepApplyAction();
}
void endStepApplyAction()
{
// after the solution is updated, the values in output module needs also updated
this->eclWriter()->mutableOutputModule().invalidateLocalData();

Expand Down
16 changes: 12 additions & 4 deletions opm/simulators/flow/GenericCpGridVanguard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ template<class ElementMapper, class GridView, class Scalar>
void GenericCpGridVanguard<ElementMapper, GridView, Scalar>::
doLoadBalance_(const Dune::EdgeWeightMethod edgeWeightsMethod,
const bool ownersFirst,
const bool addCorners,
const int numOverlap,
const Dune::PartitionMethod partitionMethod,
const bool serialPartitioning,
const bool enableDistributedWells,
Expand Down Expand Up @@ -205,7 +207,9 @@ doLoadBalance_(const Dune::EdgeWeightMethod edgeWeightsMethod,
const auto& possibleFutureConnections = schedule.getPossibleFutureConnections();
// Distribute the grid and switch to the distributed view.
if (mpiSize > 1) {
this->distributeGrid(edgeWeightsMethod, ownersFirst, partitionMethod,
this->distributeGrid(edgeWeightsMethod, ownersFirst,
addCorners, numOverlap,
partitionMethod,
serialPartitioning, enableDistributedWells,
imbalanceTol, loadBalancerSet != 0,
faceTrans, wells,
Expand Down Expand Up @@ -333,6 +337,8 @@ void
GenericCpGridVanguard<ElementMapper, GridView, Scalar>::
distributeGrid(const Dune::EdgeWeightMethod edgeWeightsMethod,
const bool ownersFirst,
const bool addCorners,
const int numOverlap,
const Dune::PartitionMethod partitionMethod,
const bool serialPartitioning,
const bool enableDistributedWells,
Expand All @@ -347,7 +353,7 @@ distributeGrid(const Dune::EdgeWeightMethod edgeWeights
if (auto* eclState = dynamic_cast<ParallelEclipseState*>(&eclState1);
eclState != nullptr)
{
this->distributeGrid(edgeWeightsMethod, ownersFirst, partitionMethod,
this->distributeGrid(edgeWeightsMethod, ownersFirst, addCorners, numOverlap, partitionMethod,
serialPartitioning, enableDistributedWells,
imbalanceTol, loadBalancerSet, faceTrans,
wells, possibleFutureConnections, eclState, parallelWells);
Expand All @@ -371,6 +377,8 @@ void
GenericCpGridVanguard<ElementMapper, GridView, Scalar>::
distributeGrid(const Dune::EdgeWeightMethod edgeWeightsMethod,
const bool ownersFirst,
const bool addCorners,
const int numOverlap,
const Dune::PartitionMethod partitionMethod,
const bool serialPartitioning,
const bool enableDistributedWells,
Expand All @@ -389,8 +397,8 @@ distributeGrid(const Dune::EdgeWeightMethod edgeWeights
*this->grid_, *eclState
};

const auto addCornerCells = false;
const auto overlapLayers = 1;
const auto addCornerCells = addCorners;
const auto overlapLayers = numOverlap;

if (loadBalancerSet) {
auto parts = isIORank
Expand Down
6 changes: 6 additions & 0 deletions opm/simulators/flow/GenericCpGridVanguard.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ class GenericCpGridVanguard {
#if HAVE_MPI
void doLoadBalance_(const Dune::EdgeWeightMethod edgeWeightsMethod,
const bool ownersFirst,
const bool addCorners,
const int numOverlap,
const Dune::PartitionMethod partitionMethod,
const bool serialPartitioning,
const bool enableDistributedWells,
Expand All @@ -176,6 +178,8 @@ class GenericCpGridVanguard {

void distributeGrid(const Dune::EdgeWeightMethod edgeWeightsMethod,
const bool ownersFirst,
const bool addCorners,
const int numOverlap,
const Dune::PartitionMethod partitionMethod,
const bool serialPartitioning,
const bool enableDistributedWells,
Expand All @@ -189,6 +193,8 @@ class GenericCpGridVanguard {

void distributeGrid(const Dune::EdgeWeightMethod edgeWeightsMethod,
const bool ownersFirst,
const bool addCorners,
const int numOverlap,
const Dune::PartitionMethod partitionMethod,
const bool serialPartitioning,
const bool enableDistributedWells,
Expand Down
Loading