36#ifndef OPENRS_SIMULATORTESTERFLEXIBLEBC_HEADER
37#define OPENRS_SIMULATORTESTERFLEXIBLEBC_HEADER
46 template <
class SimTraits>
54 virtual void initSources(
const Opm::parameter::ParameterGroup& param)
67 double total_inj = 0.0;
68 bool has_inj_block = param.getDefault(
"has_inj_block",
false);
71 low[0] = param.getDefault(
"inj_block_low_x", 0.0);
72 low[1] = param.getDefault(
"inj_block_low_y", 0.0);
73 low[2] = param.getDefault(
"inj_block_low_z", 0.0);
75 high[0] = param.getDefault(
"inj_block_high_x", 1.0);
76 high[1] = param.getDefault(
"inj_block_high_y", 1.0);
77 high[2] = param.getDefault(
"inj_block_high_z", 1.0);
78 double inj_block_density = param.get<
double>(
"inj_block_density");
79 total_inj = setSourceBlock(low, high, inj_block_density,
true);
81 double total_prod = 0.0;
82 bool has_prod_block = param.getDefault(
"has_prod_block",
false);
85 low[0] = param.getDefault(
"prod_block_low_x", 0.0);
86 low[1] = param.getDefault(
"prod_block_low_y", 0.0);
87 low[2] = param.getDefault(
"prod_block_low_z", 0.0);
89 high[0] = param.getDefault(
"prod_block_high_x", 1.0);
90 high[1] = param.getDefault(
"prod_block_high_y", 1.0);
91 high[2] = param.getDefault(
"prod_block_high_z", 1.0);
92 double prod_block_density = param.get<
double>(
"prod_block_density");
93 total_prod = setSourceBlock(low, high, prod_block_density,
false);
95 if (has_inj_block || has_prod_block) {
96 std::cout <<
"Initialized injectors with total rate: " << total_inj
97 <<
"\nInitialized producers with total rate: " << total_prod
110 return low[0] < pt[0]
118 double setSourceBlock(
const Vector& low,
const Vector& high,
double density,
bool is_injection)
123 double total_rate = 0.0;
125 if (isInside(low, high, c->centroid())) {
126 int index = c->index();
127 double rate = density*c->volume();
GIE::CellIterator< InterfaceType > CellIterator
Definition: GridInterfaceEuler.hpp:417
CellIterator cellbegin() const
Definition: GridInterfaceEuler.hpp:445
int numberOfCells() const
Definition: GridInterfaceEuler.hpp:453
Opm::SparseVector< double > injection_rates_
Definition: SimulatorBase.hpp:137
std::vector< double > injection_rates_psolver_
Definition: SimulatorBase.hpp:138
GridInterface ginterf_
Definition: SimulatorBase.hpp:134
BCs bcond_
Definition: SimulatorBase.hpp:136
Dune::FieldVector< double, Dimension > Vector
Definition: SimulatorBase.hpp:116
Definition: SimulatorTesterFlexibleBC.hpp:48
virtual void initBoundaryConditions(const Opm::parameter::ParameterGroup ¶m)
Definition: SimulatorTesterFlexibleBC.hpp:102
Super::GridInterface GI
Definition: SimulatorTesterFlexibleBC.hpp:51
SimulatorTester< SimTraits > Super
Definition: SimulatorTesterFlexibleBC.hpp:50
virtual void initSources(const Opm::parameter::ParameterGroup ¶m)
Definition: SimulatorTesterFlexibleBC.hpp:54
Super::Vector Vector
Definition: SimulatorTesterFlexibleBC.hpp:52
Definition: SimulatorTester.hpp:54
Definition: BlackoilFluid.hpp:32
void setupBoundaryConditions(const Opm::parameter::ParameterGroup ¶m, const GridInterface &g, BCs &bcs)
Setup boundary conditions for a simulation. It is assumed that the boundary ids are 1-6,...
Definition: setupBoundaryConditions.hpp:51