mirror of
https://github.com/OPM/opm-simulators.git
synced 2026-08-13 08:45:05 -05:00
Enable UDA evaluation for groups
This commit is contained in:
@@ -30,17 +30,17 @@
|
||||
|
||||
namespace Opm
|
||||
{
|
||||
void WellCollection::addField(const Group2& fieldGroup, const PhaseUsage& phaseUsage) {
|
||||
void WellCollection::addField(const Group2& fieldGroup, const SummaryState& summaryState, const PhaseUsage& phaseUsage) {
|
||||
WellsGroupInterface* fieldNode = findNode(fieldGroup.name());
|
||||
if (fieldNode) {
|
||||
OPM_THROW(std::runtime_error, "Trying to add FIELD node, but this already exists. Can only have one FIELD node.");
|
||||
}
|
||||
|
||||
roots_.push_back(createGroupWellsGroup(fieldGroup, phaseUsage));
|
||||
roots_.push_back(createGroupWellsGroup(fieldGroup, summaryState, phaseUsage));
|
||||
}
|
||||
|
||||
void WellCollection::addGroup(const Group2& groupChild, std::string parent_name,
|
||||
const PhaseUsage& phaseUsage) {
|
||||
const SummaryState& summaryState, const PhaseUsage& phaseUsage) {
|
||||
WellsGroupInterface* parent = findNode(parent_name);
|
||||
if (!parent) {
|
||||
OPM_THROW(std::runtime_error, "Trying to add child group to group named " << parent_name << ", but this does not exist in the WellCollection.");
|
||||
@@ -55,8 +55,7 @@ namespace Opm
|
||||
group_control_active_ = true;
|
||||
}
|
||||
|
||||
std::shared_ptr<WellsGroupInterface> child = createGroupWellsGroup(groupChild, phaseUsage);
|
||||
|
||||
std::shared_ptr<WellsGroupInterface> child = createGroupWellsGroup(groupChild, summaryState, phaseUsage);
|
||||
if (child->injSpec().control_mode_ == InjectionSpecification::VREP) {
|
||||
having_vrep_groups_ = true;
|
||||
}
|
||||
|
||||
@@ -36,12 +36,12 @@ namespace Opm
|
||||
{
|
||||
public:
|
||||
|
||||
void addField(const Group2& fieldGroup, const PhaseUsage& phaseUsage);
|
||||
void addField(const Group2& fieldGroup, const SummaryState& summaryState, const PhaseUsage& phaseUsage);
|
||||
|
||||
void addWell(const Well2& wellChild, const SummaryState& summaryState, const PhaseUsage& phaseUsage);
|
||||
|
||||
void addGroup(const Group2& groupChild, std::string parent_name,
|
||||
const PhaseUsage& phaseUsage);
|
||||
const SummaryState& summaryState, const PhaseUsage& phaseUsage);
|
||||
|
||||
/// Adds the child to the collection
|
||||
/// and appends it to parent's children.
|
||||
|
||||
@@ -1556,12 +1556,12 @@ namespace Opm
|
||||
}
|
||||
} // anonymous namespace
|
||||
|
||||
std::shared_ptr<WellsGroupInterface> createGroupWellsGroup(const Group2& group, const PhaseUsage& phase_usage )
|
||||
std::shared_ptr<WellsGroupInterface> createGroupWellsGroup(const Group2& group, const SummaryState& st, const PhaseUsage& phase_usage )
|
||||
{
|
||||
InjectionSpecification injection_specification;
|
||||
ProductionSpecification production_specification;
|
||||
if (group.isInjectionGroup()) {
|
||||
const auto& injection = group.injectionProperties();
|
||||
const auto& injection = group.injectionControls(st);
|
||||
injection_specification.injector_type_ = toInjectorType(injection.phase);
|
||||
injection_specification.control_mode_ = toInjectionControlMode(GroupInjection::ControlEnum2String(injection.cmode));
|
||||
injection_specification.surface_flow_max_rate_ = injection.surface_max_rate;
|
||||
@@ -1571,7 +1571,7 @@ namespace Opm
|
||||
}
|
||||
|
||||
if (group.isProductionGroup()) {
|
||||
const auto& production = group.productionProperties();
|
||||
const auto& production = group.productionControls(st);
|
||||
production_specification.oil_max_rate_ = production.oil_target;
|
||||
production_specification.control_mode_ = toProductionControlMode(GroupProduction::ControlEnum2String(production.cmode));
|
||||
production_specification.water_max_rate_ = production.water_target;
|
||||
|
||||
@@ -550,6 +550,7 @@ namespace Opm
|
||||
/// \param[in] timeStep the time step in question
|
||||
/// \param[in] the phase usage
|
||||
std::shared_ptr<WellsGroupInterface> createGroupWellsGroup(const Group2& group,
|
||||
const SummaryState& summaryState,
|
||||
const PhaseUsage& phase_usage );
|
||||
}
|
||||
|
||||
|
||||
@@ -372,7 +372,7 @@ WellsManager::init(const Opm::EclipseState& eclipseState,
|
||||
|
||||
{
|
||||
const auto& fieldGroup = schedule.getGroup2( "FIELD", timeStep);
|
||||
well_collection_.addField(fieldGroup, pu);
|
||||
well_collection_.addField(fieldGroup, summaryState, pu);
|
||||
std::vector< std::string > group_stack = { "FIELD" };
|
||||
|
||||
do {
|
||||
@@ -380,7 +380,7 @@ WellsManager::init(const Opm::EclipseState& eclipseState,
|
||||
group_stack.pop_back();
|
||||
for (const auto& child: parent.groups()) {
|
||||
group_stack.push_back(child);
|
||||
well_collection_.addGroup( schedule.getGroup2( child, timeStep ), parent.name(), pu );
|
||||
well_collection_.addGroup( schedule.getGroup2( child, timeStep ), parent.name(), summaryState, pu );
|
||||
}
|
||||
|
||||
} while( !group_stack.empty() );
|
||||
|
||||
Reference in New Issue
Block a user