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

Changes in how the simulator handles NUPCOL #5724

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

Conversation

totto82
Copy link
Member

@totto82 totto82 commented Nov 11, 2024

  1. Dont allow wells to change to GRUP when iter >NUPCOL
  2. Update VREP even for iter > NUPCOL if it changes significantly. For now hardcoded to relative change > 0.01 (TODO make this a parameter. Update: DONE)

TODO

  • If this is a good idea for VREP it should be done for REIN etc.

@totto82
Copy link
Member Author

totto82 commented Nov 11, 2024

jenkins build this please

1 similar comment
@totto82
Copy link
Member Author

totto82 commented Nov 12, 2024

jenkins build this please

@totto82
Copy link
Member Author

totto82 commented Nov 12, 2024

jenkins build this failure_report please

@steink
Copy link
Contributor

steink commented Nov 18, 2024

I'm currently looking into this, but having some unrelated issues with recent updates, so not done testing

Comment on lines 2202 to 2203
// We also dont allow wells to change to group controls
// when iterationIdx > nupcol
Copy link
Contributor

Choose a reason for hiding this comment

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

Should the opposite also apply, e.g., that wells under group control should not be allowed to change to individual in the subsequent updateWellControl (individual mode)?

Copy link
Member Author

Choose a reason for hiding this comment

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

This change indeed reduce oscillations and improve convergence, but it has the potential to give very wrong results. I think we rather should remove the if statement completely i.e. always check the constrains. This will need some adjustment in the code to handle oscillatory controls for instance when a higher group has a constraint that is equal to the sum of the sub groups controls. I am testing out an option of detecting oscillatory controls like we do for the wells. This seems to work but need more testing. As a first move I plan to remove this part of this PR to be able to evaluate and test these things separately.

Copy link
Contributor

Choose a reason for hiding this comment

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

OK, sounds good.

@totto82
Copy link
Member Author

totto82 commented Nov 20, 2024

jenkins build this failure_report please

1 similar comment
@totto82
Copy link
Member Author

totto82 commented Nov 22, 2024

jenkins build this failure_report please

"at iteration {}. Update {} for Group {} even if iteration is larger than {} given by NUPCOL." ,
tol_nupcol, iterationIdx, control_str, gr_name, nupcol);
deferred_logger.info(msg);
}
Copy link
Member Author

Choose a reason for hiding this comment

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

This should be changes to .debug before merging.

@totto82
Copy link
Member Author

totto82 commented Nov 25, 2024

jenkins build this failure_report please

@totto82 totto82 marked this pull request as ready for review November 25, 2024 07:40
phaseIdx,
/*isInjector*/ false);
}
Scalar rel_change = std::abs( (gr_rate_nupcol - gr_rate) / (0.5*gr_rate_nupcol + 0.5*gr_rate));
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a possibility both group rates in denominator could be zero here? Or would that situation lead to failure at an earlier stage?

Copy link
Member Author

Choose a reason for hiding this comment

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

It is possible so I will add a check. Maybe we should have a "large epsilon" here since relative changes does not make much sense for very small numbers.

@steink
Copy link
Contributor

steink commented Nov 25, 2024

I'm running a tests on a larger model, and will report back. Otherwise PR is now simpler and tests seem fine except 02_WGRUPCON. This test is often causing problems, I'll have a closer look.

@steink
Copy link
Contributor

steink commented Nov 25, 2024

Larger testing looks fine on my side. Did some investigation on 02_WGRUPCON which gets quite a bit worse with the PR. Main reason is that with master we get Well C-1H will be shut because it fails to converge, while this does not trigger with the PR which rather does extra VREP-iterations until convergence failure. Reason for C-1H not converging in the first place is that there exists no converged state it will rest (production with its thp is not feasible (so it should stop), but when global system converges with well stopped, reservoir pressure supports re-opening). Since our operability checks only considers current reservoir pressure and we don't have any limits on how many times a well can try to re-open during a time-step, this well will always cause issues manifesting in one or the other way. The issue is not related to this PR however, and we should address it elsewhere.

@totto82
Copy link
Member Author

totto82 commented Nov 25, 2024

jenkins build this failure_report please

@totto82
Copy link
Member Author

totto82 commented Nov 26, 2024

re-open during a time-step

Does it make sense to not allow re-opening wells when iter > nupcol? This could reduce oscillations in the VREP control, but also to premature closing of wells. Often the closing/opening of individual wells stabilize after some iterations so maybe worth a try to test out?

@totto82
Copy link
Member Author

totto82 commented Nov 26, 2024

When I only allow for well opening when iter < nupcol I get back the reference solution. I will do some more tests with this and report back.

image

@steink
Copy link
Contributor

steink commented Nov 26, 2024

re-open during a time-step

Does it make sense to not allow re-opening wells when iter > nupcol? This could reduce oscillations in the VREP control, but also to premature closing of wells. Often the closing/opening of individual wells stabilize after some iterations so maybe worth a try to test out?

I agree that it should not be allowed to re-open at some stage, but not sure whether this should be related to nupcol (the problem is not neccessarlily related to groups).

@totto82
Copy link
Member Author

totto82 commented Nov 26, 2024

I agree that it should not be allowed to re-open at some stage, but not sure whether this should be related to nupcol (the problem is not neccessarlily related to groups).

I see your point. It seems to stabilize some corner cases thought. Does this mean that we accept the results of well C-1H in 02_WGRUPCON and can start the process of getting this PR in?

@steink
Copy link
Contributor

steink commented Nov 27, 2024

I agree that it should not be allowed to re-open at some stage, but not sure whether this should be related to nupcol (the problem is not neccessarlily related to groups).

I see your point. It seems to stabilize some corner cases thought. Does this mean that we accept the results of well C-1H in 02_WGRUPCON and can start the process of getting this PR in?

It's OK from my side.

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