Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow group guide rates in case that a group is an auto choke group #5754

Open
wants to merge 27 commits into
base: master
Choose a base branch
from

Conversation

plgbrts
Copy link
Contributor

@plgbrts plgbrts commented Nov 21, 2024

This PR is to allow group guide rates in case that a group is an auto choke group:
In the example case we have:

GCONPROD--  1    2     3     4       5     6     7       8       9       10 
'M5S' ORAT  8000  1*      1*    1*  'RATE'  'YES'   40.0   'OIL'    1*   1*   1*   3* /
'B1'  FLD  1*     1*      1*    1*  'RATE'  'YES'   35.0   'OIL'    1*   1*   1*   3* /
'C1'  FLD  1*    1*       1*    1*  'RATE'  'YES’   5.0   'OIL'    1*   1*   1*   3* / 

and

NODEPROP
--  NodeName  Press  Choke
    PLAT-A    21.0   NO   /
    M5S       1*     NO   /     
    B1        1*     YES  / 
    C1        1*     NO   /

The M5S group is an ancestor of the production groups B1 and C1 and B1 is an autochoke group ( #4935). The target rates of B1 and C1 become 7000 (=8000*35/40) and 1000 (=8000*5/40)
A comparison with a reference simulator is shown in the figure
image
Note that OPM-Flow keeps wells open for a longer time.
The test case is: GROUPGUIDERATES_AC_8000_OPM_TEST.zip

@plgbrts plgbrts changed the title Ac group guide rates Allow group guide rates in case that a group is an auto choke group Nov 21, 2024
@plgbrts
Copy link
Contributor Author

plgbrts commented Nov 21, 2024

jenkins build this opm-common=4355 please

@plgbrts
Copy link
Contributor Author

plgbrts commented Nov 21, 2024

jenkins build this opm-common=4355 please

@plgbrts
Copy link
Contributor Author

plgbrts commented Nov 21, 2024

jenkins build this opm-common=4355 please

1 similar comment
@plgbrts
Copy link
Contributor Author

plgbrts commented Nov 22, 2024

jenkins build this opm-common=4355 please

@totto82 totto82 mentioned this pull request Nov 22, 2024
@plgbrts plgbrts marked this pull request as ready for review November 27, 2024 09:36
Copy link
Member

@totto82 totto82 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution. I have done the first review. I still struggle to understand the complete logic here, but for what I understand the code looks ok. My main concern is the code duplication in getAutoChokeGroupProductionTargetRate. This code is complicated so for maintenance it would be good to reduce the places the logic is copied. Also, I am not fully convinced that using guiderates from the production control is always ok. What if it is defaulted? Shouldn't it then accumulate it from its children group/wells?

}

const Scalar orig_target = target_tmp;
std::cout<< "Group: " << group.name() << " orig_target: " << orig_target*86400 << std::endl;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you introduce a target_tmp in addition to orig_target here?

@@ -147,7 +150,7 @@ guideRate(const std::string& name,
return WellGroupHelpers<Scalar>::getGuideRate(name, schedule_, well_state_, group_state_,
report_step_, guide_rate_, target_, pu_);
} else {
if (groupControlledWells(name, always_included_child) > 0) {
if ((groupControlledWells(name, always_included_child) > 0)) {
if (is_producer_ && guide_rate_->has(name)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why the extra parentheses

const auto& control_group = schedule.getGroup(control_group_name, report_step);
const auto& ctrl = control_group.productionControls(summary_state);
const auto& control_group_guide_rate = ctrl.guide_rate;
const auto& control_group_cmode = ctrl.cmode;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if the control group does not have a guiderate?

const auto& control_group_cmode = ctrl.cmode;

const auto& group_guide_rate = group.productionControls(summary_state).guide_rate;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here for the group

const Scalar current_rate = tcalc.calcModeRateFromRates(rates);

if (current_rate < 0.99 * target_rate)
included = false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need this 0.99 factor?

template<class Scalar>
std::pair<Scalar, Group::ProductionCMode> WellGroupControls<Scalar>::
getAutoChokeGroupProductionTargetRate(const std::string& name,
const Group& group,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the difference between this code and getGroupProductionTargetRate? Can this be refactored to avoid code duplication.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants