20#ifndef OPM_WELL_FRACTURE_FLOW_SPLIT_HPP_INCLUDED
21#define OPM_WELL_FRACTURE_FLOW_SPLIT_HPP_INCLUDED
23#include <opm/material/common/MathToolbox.hpp>
38template <
class FluidSystem,
class Scalar,
class Simulator,
39 class WellContainer,
class WellState>
45 for (
const auto& well : well_container) {
46 if (!well->isInjector()) {
50 const auto& fracture_indices = well->wellIndexFracture();
51 if (fracture_indices.empty()) {
55 const auto& wellstate_nupcol = nupcol_well_state.
well(well->indexOfWell());
56 auto& single_wellstate = well_state.
well(well->indexOfWell());
57 auto& perf_data = single_wellstate.perf_data;
58 auto& filtrate_data = perf_data.filtrate_data;
59 auto& fracture_data = perf_data.fracture_data;
61 const int nperf =
static_cast<int>(well->wellIndex().size());
62 assert(
static_cast<int>(fracture_indices.size()) == nperf);
64 Scalar total_flow_fracture = 0.0;
67 auto obtain = [](
const auto& value) {
return getValue(value); };
69 for (
int perf = 0; perf < nperf; ++perf) {
70 const auto cell_idx = well->perforationData()[perf].cell_index;
71 const auto& intQuants =
72 simulator.
model().intensiveQuantities(cell_idx, 0);
73 const auto trans_mult = simulator.
problem()
74 .template wellTransMultiplier<Scalar>(intQuants, cell_idx, obtain);
76 const Scalar matrix_wi = well->wellIndex()[perf] * trans_mult;
77 const Scalar perf_pressure = wellstate_nupcol.perf_data.pressure[perf];
78 const Scalar fracture_wi = fracture_indices[perf].wellIndex(perf_pressure);
79 const Scalar effective_wi = matrix_wi + fracture_wi;
81 auto& fracture_rate = fracture_data.water_rate[perf];
82 if (effective_wi > 0.0) {
83 const Scalar matrix_frac = matrix_wi / effective_wi;
84 filtrate_data.flow_factor[perf] = matrix_frac;
85 fracture_rate = (1.0 - matrix_frac)
86 * perf_data.phase_rates[perf*np + FluidSystem::waterPhaseIdx];
87 total_flow_fracture += fracture_rate;
90 filtrate_data.flow_factor[perf] = 0.0;
95 single_wellstate.frac_rate = total_flow_fracture;
Manages the initializing and running of time dependent problems.
Definition: simulator.hh:87
Problem & problem()
Return the object which specifies the pysical setup of the simulation.
Definition: simulator.hh:273
Model & model()
Return the physical model used in the simulation.
Definition: simulator.hh:260
Definition: WellContainer.hpp:46
Definition: WellState.hpp:68
constexpr int numPhases() const
The number of phases present.
Definition: WellState.hpp:274
const SingleWellState< Scalar, IndexTraits > & well(std::size_t well_index) const
Definition: WellState.hpp:315
Definition: blackoilbioeffectsmodules.hh:45
void updateWellFractureFlowSplit(const Simulator &simulator, const WellContainer &well_container, WellState &well_state, const WellState &nupcol_well_state)
Definition: WellFractureFlowSplit.hpp:40