mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Add PerfData member to SingleWellState
This commit is contained in:
parent
8b652c821b
commit
46f45e3999
@ -24,16 +24,15 @@ namespace Opm
|
||||
{
|
||||
|
||||
|
||||
PerfData::PerfData(std::size_t num_perf, bool injector_, const PhaseUsage& pu_arg)
|
||||
: pu(pu_arg)
|
||||
, injector(injector_)
|
||||
PerfData::PerfData(std::size_t num_perf, bool injector_, std::size_t num_phases)
|
||||
: injector(injector_)
|
||||
, pressure(num_perf)
|
||||
, rates(num_perf)
|
||||
, phase_rates(num_perf * pu.num_phases)
|
||||
, phase_rates(num_perf * num_phases)
|
||||
, solvent_rates(num_perf)
|
||||
, polymer_rates(num_perf)
|
||||
, brine_rates(num_perf)
|
||||
, prod_index(num_perf * pu.num_phases)
|
||||
, prod_index(num_perf * num_phases)
|
||||
, cell_index(num_perf)
|
||||
, connection_transmissibility_factor(num_perf)
|
||||
, satnum_id(num_perf)
|
||||
|
@ -23,19 +23,16 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include <opm/core/props/BlackoilPhases.hpp>
|
||||
|
||||
namespace Opm
|
||||
{
|
||||
|
||||
class PerfData
|
||||
{
|
||||
private:
|
||||
PhaseUsage pu;
|
||||
bool injector;
|
||||
|
||||
public:
|
||||
PerfData(std::size_t num_perf, bool injector_, const PhaseUsage& pu);
|
||||
PerfData(std::size_t num_perf, bool injector_, std::size_t num_phases);
|
||||
std::size_t size() const;
|
||||
bool try_assign(const PerfData& other);
|
||||
|
||||
|
@ -21,13 +21,14 @@
|
||||
|
||||
namespace Opm {
|
||||
|
||||
SingleWellState::SingleWellState(bool is_producer, std::size_t num_phases, double temp)
|
||||
SingleWellState::SingleWellState(bool is_producer, std::size_t num_perf, std::size_t num_phases, double temp)
|
||||
: producer(is_producer)
|
||||
, temperature(temp)
|
||||
, well_potentials(num_phases)
|
||||
, productivity_index(num_phases)
|
||||
, surface_rates(num_phases)
|
||||
, reservoir_rates(num_phases)
|
||||
, perf_data(num_perf, !is_producer, num_phases)
|
||||
{}
|
||||
|
||||
|
||||
|
@ -25,12 +25,13 @@
|
||||
#include <opm/simulators/wells/SegmentState.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Events.hpp>
|
||||
#include <opm/simulators/wells/PerfData.hpp>
|
||||
|
||||
namespace Opm {
|
||||
|
||||
class SingleWellState {
|
||||
public:
|
||||
SingleWellState(bool is_producer, std::size_t num_phases, double temp);
|
||||
SingleWellState(bool is_producer, std::size_t num_perf, std::size_t num_phases, double temp);
|
||||
|
||||
Well::Status status{Well::Status::OPEN};
|
||||
bool producer;
|
||||
@ -43,6 +44,7 @@ public:
|
||||
std::vector<double> productivity_index;
|
||||
std::vector<double> surface_rates;
|
||||
std::vector<double> reservoir_rates;
|
||||
PerfData perf_data;
|
||||
SegmentState segments;
|
||||
Events events;
|
||||
Well::InjectorCMode injection_cmode{Well::InjectorCMode::CMODE_UNDEFINED};
|
||||
|
@ -85,10 +85,10 @@ void WellState::initSingleWell(const std::vector<double>& cellPressures,
|
||||
const int np = pu.num_phases;
|
||||
double temp = well.isInjector() ? well.injectionControls(summary_state).temperature : 273.15 + 15.56;
|
||||
|
||||
auto& ws = this->wells_.add(well.name(), SingleWellState{well.isProducer(), static_cast<std::size_t>(np), temp});
|
||||
this->parallel_well_info_.add(well.name(), well_info);
|
||||
const int num_perf_this_well = well_info->communication().sum(well_perf_data.size());
|
||||
this->perfdata.add(well.name(), PerfData{static_cast<std::size_t>(num_perf_this_well), well.isInjector(), this->phase_usage_});
|
||||
this->perfdata.add(well.name(), PerfData{static_cast<std::size_t>(num_perf_this_well), well.isInjector(), this->phase_usage_.num_phases});
|
||||
auto& ws = this->wells_.add(well.name(), SingleWellState{well.isProducer(), num_perf_this_well, static_cast<std::size_t>(np), temp});
|
||||
|
||||
if ( num_perf_this_well == 0 )
|
||||
return;
|
||||
|
@ -548,12 +548,10 @@ OIL
|
||||
WATER
|
||||
GAS
|
||||
)";
|
||||
Opm::PhaseUsage pu = Opm::phaseUsageFromDeck(Opm::Parser{}.parseString(deck_string));
|
||||
|
||||
Opm::PerfData pd1(3, true, pu);
|
||||
Opm::PerfData pd2(3, true, pu);
|
||||
Opm::PerfData pd3(2, true, pu);
|
||||
Opm::PerfData pd4(3, false, pu);
|
||||
Opm::PerfData pd1(3, true, 3);
|
||||
Opm::PerfData pd2(3, true, 3);
|
||||
Opm::PerfData pd3(2, true, 3);
|
||||
Opm::PerfData pd4(3, false, 3);
|
||||
|
||||
|
||||
for (std::size_t i = 0; i < 3; i++) {
|
||||
@ -577,9 +575,9 @@ GAS
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(TestSingleWellState) {
|
||||
Opm::SingleWellState ws1(true, 3, 1);
|
||||
Opm::SingleWellState ws2(true, 3, 2);
|
||||
Opm::SingleWellState ws3(false, 3, 3);
|
||||
Opm::SingleWellState ws1(true, 10, 3, 1);
|
||||
Opm::SingleWellState ws2(true, 10, 3, 2);
|
||||
Opm::SingleWellState ws3(false, 10, 3, 3);
|
||||
|
||||
ws1.bhp = 100;
|
||||
ws1.thp = 200;
|
||||
|
Loading…
Reference in New Issue
Block a user