Merge pull request #1098 from jokva/phase-in-runspec
Read phase information from EclipseState.runspec
This commit is contained in:
commit
e348baa6c7
@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
||||||
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
|
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
|
||||||
#include <opm/parser/eclipse/EclipseState/Tables/TableManager.hpp>
|
#include <opm/parser/eclipse/EclipseState/Runspec.hpp>
|
||||||
|
|
||||||
|
|
||||||
namespace Opm
|
namespace Opm
|
||||||
@ -38,15 +38,15 @@ namespace Opm
|
|||||||
PhaseUsage pu;
|
PhaseUsage pu;
|
||||||
std::fill(pu.phase_used, pu.phase_used + BlackoilPhases::MaxNumPhases, 0);
|
std::fill(pu.phase_used, pu.phase_used + BlackoilPhases::MaxNumPhases, 0);
|
||||||
|
|
||||||
const auto& tm = eclipseState.getTableManager();
|
const auto& phase = eclipseState.runspec().phases();
|
||||||
// Discover phase usage.
|
// Discover phase usage.
|
||||||
if (tm.hasPhase(Phase::PhaseEnum::WATER)) {
|
if (phase.active(Phase::WATER)) {
|
||||||
pu.phase_used[BlackoilPhases::Aqua] = 1;
|
pu.phase_used[BlackoilPhases::Aqua] = 1;
|
||||||
}
|
}
|
||||||
if (tm.hasPhase(Phase::PhaseEnum::OIL)) {
|
if (phase.active(Phase::OIL)) {
|
||||||
pu.phase_used[BlackoilPhases::Liquid] = 1;
|
pu.phase_used[BlackoilPhases::Liquid] = 1;
|
||||||
}
|
}
|
||||||
if (tm.hasPhase(Phase::PhaseEnum::GAS)) {
|
if (phase.active(Phase::GAS)) {
|
||||||
pu.phase_used[BlackoilPhases::Vapour] = 1;
|
pu.phase_used[BlackoilPhases::Vapour] = 1;
|
||||||
}
|
}
|
||||||
pu.num_phases = 0;
|
pu.num_phases = 0;
|
||||||
@ -76,14 +76,17 @@ namespace Opm
|
|||||||
PhaseUsage pu;
|
PhaseUsage pu;
|
||||||
std::fill(pu.phase_used, pu.phase_used + BlackoilPhases::MaxNumPhases, 0);
|
std::fill(pu.phase_used, pu.phase_used + BlackoilPhases::MaxNumPhases, 0);
|
||||||
|
|
||||||
|
Runspec runspec( deck );
|
||||||
|
const auto& phase = runspec.phases();
|
||||||
|
|
||||||
// Discover phase usage.
|
// Discover phase usage.
|
||||||
if (deck.hasKeyword("WATER")) {
|
if (phase.active( Phase::WATER )) {
|
||||||
pu.phase_used[BlackoilPhases::Aqua] = 1;
|
pu.phase_used[BlackoilPhases::Aqua] = 1;
|
||||||
}
|
}
|
||||||
if (deck.hasKeyword("OIL")) {
|
if (phase.active( Phase::OIL )) {
|
||||||
pu.phase_used[BlackoilPhases::Liquid] = 1;
|
pu.phase_used[BlackoilPhases::Liquid] = 1;
|
||||||
}
|
}
|
||||||
if (deck.hasKeyword("GAS")) {
|
if (phase.active( Phase::GAS )) {
|
||||||
pu.phase_used[BlackoilPhases::Vapour] = 1;
|
pu.phase_used[BlackoilPhases::Vapour] = 1;
|
||||||
}
|
}
|
||||||
pu.num_phases = 0;
|
pu.num_phases = 0;
|
||||||
|
@ -1004,6 +1004,17 @@ namespace Opm
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
InjectionSpecification::InjectorType toInjectorType( Phase p )
|
||||||
|
{
|
||||||
|
switch( p ) {
|
||||||
|
case Phase::OIL: return InjectionSpecification::OIL;
|
||||||
|
case Phase::WATER: return InjectionSpecification::WATER;
|
||||||
|
case Phase::GAS: return InjectionSpecification::GAS;
|
||||||
|
}
|
||||||
|
OPM_THROW(std::logic_error, "Invalid state." );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#define HANDLE_ICM(x) \
|
#define HANDLE_ICM(x) \
|
||||||
if (type == #x) { \
|
if (type == #x) { \
|
||||||
return InjectionSpecification::x; \
|
return InjectionSpecification::x; \
|
||||||
@ -1069,7 +1080,7 @@ namespace Opm
|
|||||||
InjectionSpecification injection_specification;
|
InjectionSpecification injection_specification;
|
||||||
ProductionSpecification production_specification;
|
ProductionSpecification production_specification;
|
||||||
if (group.isInjectionGroup(timeStep)) {
|
if (group.isInjectionGroup(timeStep)) {
|
||||||
injection_specification.injector_type_ = toInjectorType(Phase::PhaseEnum2String(group.getInjectionPhase(timeStep)));
|
injection_specification.injector_type_ = toInjectorType(group.getInjectionPhase(timeStep));
|
||||||
injection_specification.control_mode_ = toInjectionControlMode(GroupInjection::ControlEnum2String(group.getInjectionControlMode(timeStep)));
|
injection_specification.control_mode_ = toInjectionControlMode(GroupInjection::ControlEnum2String(group.getInjectionControlMode(timeStep)));
|
||||||
injection_specification.surface_flow_max_rate_ = group.getSurfaceMaxRate(timeStep);
|
injection_specification.surface_flow_max_rate_ = group.getSurfaceMaxRate(timeStep);
|
||||||
injection_specification.reservoir_flow_max_rate_ = group.getReservoirMaxRate(timeStep);
|
injection_specification.reservoir_flow_max_rate_ = group.getReservoirMaxRate(timeStep);
|
||||||
|
Loading…
Reference in New Issue
Block a user