Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@totto82
Copy link
Member

@totto82 totto82 commented Mar 6, 2025

No description provided.

@totto82
Copy link
Member Author

totto82 commented Mar 6, 2025

jenkins build this opm-simulators=6050 please

@GitPaean GitPaean self-requested a review June 18, 2025 13:06
@totto82 totto82 added the manual:enhancement This is an enhancement/improvent that needs to be documented in the manual label Aug 26, 2025
@totto82
Copy link
Member Author

totto82 commented Aug 26, 2025

jenkins build this opm-simulators=6050 please

std::unordered_map<std::string, WTestWell> wells;
std::unordered_map<std::string, std::unordered_map<int, ClosedCompletion>> completions;

std::vector<std::string> follow_on_wells;
Copy link
Member

Choose a reason for hiding this comment

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

I am not sure that I understand everything correct, so excuse me if I see things wrong.

I think with item 9 of WECON, we establish a relationship/mapping between one well A and another well B (which should be SHUT).

In case the well A is shut due to economic limits or physical limit, we open the well B.

But if we put them in a std::vector for all the wells, how do we manage the relationship between the well A -> well B?

Copy link
Member

Choose a reason for hiding this comment

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

Now I see that it is only added when the specific wells are shut. You can discard the above comment.

@bska
Copy link
Member

bska commented Aug 27, 2025

I agree with @GitPaean. You need something stronger than a linear array to maintain the inter-well relationships implied by WECON(9).

Suppose we have

WECON
  'A' ... 'F1' /
  'B' ... 'F2' /
  'C' ... 'F3' /
/

If well C shuts in we're supposed to (try to) open well F3, not any one of the wells F1, F2, or F3.

Copy link
Member

@bska bska left a comment

Choose a reason for hiding this comment

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

It's not obvious to me that this does what it claims to do. Please add a lot of unit tests and documentation here to justify the choice of data structures.

std::unordered_map<std::string, WTestWell> wells;
std::unordered_map<std::string, std::unordered_map<int, ClosedCompletion>> completions;

std::vector<std::string> follow_on_wells;
Copy link
Member

Choose a reason for hiding this comment

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

The follow-on well concept is input from the WECON keyword in the SCHEDULE, it is static. WellTestState is dynamic.

With the current implementation, this list is the wells that will be opened the next time step as a follow-on well.

Maybe something like pending_follow_on_wells or to_open_follow_on_wells will be more accurate or informational.

@totto82
Copy link
Member Author

totto82 commented Aug 27, 2025

I agree with @GitPaean. You need something stronger than a linear array to maintain the inter-well relationships implied by WECON(9).

Note that the inter-well relationship is taken care of by the simulator. This list gives all wells that the simulator opens at any point due to WECON.

@totto82
Copy link
Member Author

totto82 commented Aug 28, 2025

jenkins build this opm-simulators=6050 please

@totto82 totto82 marked this pull request as draft August 28, 2025 13:35
@totto82
Copy link
Member Author

totto82 commented Aug 28, 2025

I changed the implementation significantly and I am not yet finished so I will make it draft. Just want some help from Jenkins to sort out the missing parts.

@totto82
Copy link
Member Author

totto82 commented Aug 29, 2025

jenkins build this opm-simulators=6050 failure_report please

@totto82
Copy link
Member Author

totto82 commented Aug 29, 2025

jenkins build this opm-simulators=6050 failure_report please

5 similar comments
@totto82
Copy link
Member Author

totto82 commented Aug 29, 2025

jenkins build this opm-simulators=6050 failure_report please

@totto82
Copy link
Member Author

totto82 commented Sep 2, 2025

jenkins build this opm-simulators=6050 failure_report please

@totto82
Copy link
Member Author

totto82 commented Sep 3, 2025

jenkins build this opm-simulators=6050 failure_report please

@totto82
Copy link
Member Author

totto82 commented Sep 4, 2025

jenkins build this opm-simulators=6050 failure_report please

@totto82
Copy link
Member Author

totto82 commented Sep 4, 2025

jenkins build this opm-simulators=6050 failure_report please

@totto82 totto82 marked this pull request as ready for review September 4, 2025 13:58
Copy link
Member

@GitPaean GitPaean left a comment

Choose a reason for hiding this comment

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

It looks generally fine. The following line probably can put inside a function to reduce duplication of the code and avoid inconsistency.

            if (handlerContext.getWellStatus(well_name) == WellStatus::OPEN) {
                handlerContext.state().wellgroup_events().addEvent( well_name, ScheduleEvents::REQUEST_OPEN_WELL);
                handlerContext.state().wellgroup_events().clearEvent( well_name, ScheduleEvents::REQUEST_SHUT_WELL);
            }
            if (handlerContext.getWellStatus(well_name) == WellStatus::SHUT) {
                handlerContext.state().wellgroup_events().addEvent( well_name, ScheduleEvents::REQUEST_SHUT_WELL);
                handlerContext.state().wellgroup_events().clearEvent( well_name, ScheduleEvents::REQUEST_OPEN_WELL);
            }

And furthermore, to qualify as a follow on well, the well needs to be a valid SHUT well when parsing, the master branch does not deal with that yet.

}
if (handlerContext.state().wells.get( well_name ).getStatus() == Well::Status::SHUT) {
handlerContext.state().wellgroup_events().addEvent(well_name, ScheduleEvents::REQUEST_SHUT_WELL);
}
Copy link
Member

Choose a reason for hiding this comment

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

Why is this one different from the other occasions without clearing?

@totto82
Copy link
Member Author

totto82 commented Sep 8, 2025

jenkins build this opm-simulators=6050 please

@totto82
Copy link
Member Author

totto82 commented Sep 8, 2025

And furthermore, to qualify as a follow on well, the well needs to be a valid SHUT well when parsing, the master branch does not deal with that yet.

I guess checking this on the parser level is less trivial than checking it on the simulator level when it is activated. Is this an abort simulation condition or just a warning?

@GitPaean
Copy link
Member

GitPaean commented Sep 8, 2025

Is this an abort simulation condition or just a warning?

I think we can treat it as a warning and disqualify the follow on well.

I guess checking this on the parser level is less trivial than checking it on the simulator level when it is activated.

It is fair to say that. If we want to do at the parsing stage, the well needs to be valid and is SHUT in the schedule when parsing WECON.

And checking at the simulator stage probably allowing more flexibility.

@totto82
Copy link
Member Author

totto82 commented Sep 8, 2025

And checking at the simulator stage probably allowing more flexibility.
Done.

Thanks for the review!

@totto82
Copy link
Member Author

totto82 commented Sep 8, 2025

jenkins build this opm-simulators=6050 failure_report please

@totto82
Copy link
Member Author

totto82 commented Sep 8, 2025

jenkins build this opm-simulators=6050 failure_report please

Copy link
Member

@GitPaean GitPaean 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 update. It looks good to me.

@totto82
Copy link
Member Author

totto82 commented Sep 10, 2025

jenkins build this opm-simulators=6050 please

@totto82
Copy link
Member Author

totto82 commented Sep 10, 2025

jenkins build this opm-simulators=6050 failure_report please

1 similar comment
@totto82
Copy link
Member Author

totto82 commented Sep 12, 2025

jenkins build this opm-simulators=6050 failure_report please

@GitPaean
Copy link
Member

jenkins build this opm-simulators=6050 update_data please

1 similar comment
@GitPaean
Copy link
Member

jenkins build this opm-simulators=6050 update_data please

jenkins4opm pushed a commit to jenkins4opm/opm-tests that referenced this pull request Sep 12, 2025
        PR OPM/opm-simulators#6050

Reason: PR OPM/opm-common#4507
        PR OPM/opm-simulators#6050

opm-common     = c62ecb474d75a3453f48521e0d5a4a5d6b699e50
opm-grid       = 3106eb85512718be5c5541ee8fd37b2372abe93a
opm-simulators = c62ecb474d75a3453f48521e0d5a4a5d6b699e50

### Changed Tests ###

  * 3dwecon9
@GitPaean
Copy link
Member

jenkins build this opm-simulators=6050 opm-tests=1393 please

@totto82
Copy link
Member Author

totto82 commented Sep 16, 2025

@GitPaean Any reasons for not merging this?

@totto82
Copy link
Member Author

totto82 commented Sep 16, 2025

jenkins build this opm-simulators=6050 opm-tests=1393 please

@GitPaean
Copy link
Member

jenkins build this opm-simulators=6050 update_data please

jenkins4opm pushed a commit to jenkins4opm/opm-tests that referenced this pull request Sep 16, 2025
        PR OPM/opm-simulators#6050

Reason: PR OPM/opm-common#4507
        PR OPM/opm-simulators#6050

opm-common     = 49104d7e0e492d4980243d6def64c35939626a59
opm-grid       = 3106eb85512718be5c5541ee8fd37b2372abe93a
opm-simulators = 49104d7e0e492d4980243d6def64c35939626a59

### Changed Tests ###

  * 3dwecon9
@GitPaean
Copy link
Member

jenkins build this opm-simulators=6050 opm-tests=1399 please

GitPaean added a commit to OPM/opm-tests that referenced this pull request Sep 16, 2025
…simulators_6050

Automatic Reference Data Update for PR OPM/opm-common#4507
@GitPaean GitPaean merged commit a4d6a93 into OPM:master Sep 16, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

manual:enhancement This is an enhancement/improvent that needs to be documented in the manual

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants