opm-simulators icon indicating copy to clipboard operation
opm-simulators copied to clipboard

Compositional well

Open GitPaean opened this issue 10 months ago • 16 comments

This is the beginning of the implementation of the well facility for compositional simulation with flowexp_comp. To avoid interfering with the work with OPM-flow, I chose to reimplement things in a separate directory, so it does not affect the code in OPM-flow.

The current PR represents the implementation of a simple well model, with which each well can have one connection to the reservoir, the well can be under rate control and bhp control. It can output the bhp and surface rates for the summary output. With its current form, it can only handle oil gas two phase simulation. Water phase is not supported by the well model yet.

Schur complement happens to not work with the current implementation, it will crash the simulation for unknown reason, so the running now is without Schur complement of the well matrix. The symptom is the slow convergence with the rate controlled producers. Refactoring efforts will also be required to make the compositional simulator work with the new ISTLSolver. Currently, it is using the old default linear backend.

GitPaean avatar Feb 28 '25 14:02 GitPaean

jenkins build this please

GitPaean avatar Mar 07 '25 14:03 GitPaean

jenkins build this please

GitPaean avatar Mar 07 '25 15:03 GitPaean

jenkins build this please

GitPaean avatar Mar 07 '25 15:03 GitPaean

I am marking the PR as ready for review now. It is still preliminary in many aspects, while it is still experimental, along with the flowexp_comp.

GitPaean avatar Mar 07 '25 16:03 GitPaean

jenkins build this update_data please

GitPaean avatar Mar 07 '25 16:03 GitPaean

jenkins build this opm-tests=1303 please

GitPaean avatar Mar 07 '25 17:03 GitPaean

I know it still looks preliminary in many ways, while we reach the limit what we can do with the current budget and it is limited to the scope of the flowexp_comp without affecting any other simulators. It does also show a relatively complete workflow related to the well modeling for a compositional simulation. It provides a base for future development and extension in the direction.

I am requesting reviews and potentially to get it in.

GitPaean avatar Mar 10 '25 08:03 GitPaean

Thanks for the comments and I have update the PR accordingly. I will trigger another jenkins run to make sure nothing was changed by accident.

GitPaean avatar Mar 10 '25 13:03 GitPaean

jenkins build this opm-tests=1303 please

GitPaean avatar Mar 10 '25 13:03 GitPaean

Thanks for the substantial work. I have two initial comments. The first is on the code duplication wrt to the existing well model. I see the point of having the full freedom to play around but in the end we would like to reuse as much as possible. The second is the hard-coding of gas-oil without water. Since the simulator can handle dummy water it would be good if also the well could handle it. It shouldn't effect the flash so the required changes shouldn't be too many lines of code I hope.

Thanks for the review. I can check what I can do tomorrow. We are out of budget on this and I might be able to address something quick to address.

As mentioned above, it was a conscious decision not to use much from the blackoil well model, while let us see. Some efforts were made to make the CompositionalWellModel work with WellConnectionAuxiliaryModule without changing WellConnectionAuxiliaryModule at all. While we did not manage to use ISTLSolver which will need refactor ISTLSolver itself. We did not mange to do it because Schur complement does not work for unknown reasons.

Adding water phase was limited by the time and budget. It is true it does not affect the flash, while it needs to go through all the indices and primary variables and mass balance equations. It will not be too many lines of code while it needs to go through to make it work.

GitPaean avatar Mar 12 '25 08:03 GitPaean

jenkins build this opm-tests=1303 please

GitPaean avatar Mar 20 '25 21:03 GitPaean

jenkins build this please

GitPaean avatar Mar 25 '25 15:03 GitPaean

jenkins build this opm-tests=1303 please

GitPaean avatar Mar 26 '25 10:03 GitPaean

jenkins build this opm-tests=1303 please

GitPaean avatar Mar 26 '25 20:03 GitPaean

jenkins build this opm-tests=1303 please

GitPaean avatar Mar 26 '25 22:03 GitPaean

jenkins build this opm-tests=1303 please

GitPaean avatar Mar 27 '25 13:03 GitPaean

jenkins build this opm-tests=1303 please

GitPaean avatar Mar 28 '25 22:03 GitPaean

jenkins build this opm-tests=1303 please

GitPaean avatar Mar 31 '25 11:03 GitPaean

jenkins build this opm-tests=1303 please

GitPaean avatar Mar 31 '25 12:03 GitPaean

I do not understand the jenkins failure,

CUDA ERROR (code = 35, CUDA driver version is insufficient for CUDA runtime version) at /var/lib/jenkins/hypre/hypre/src/utilities/general.c:259
=== Executing comparison for EGRID, INIT, UNRST, UNSMRY and RFT files if these exists in reference folder ===
Comparing '/var/lib/jenkins/post-builder/workspace/opm-simulators-PR-builder/deps/opm-tests/actionx/opm-simulation-reference/flow/ACTIONX_WCONHIST' to '/var/lib/jenkins/post-builder/workspace/opm-simulators-PR-builder/mpi/build-opm-simulators/tests/results/flow+actionx_wconhist/ACTIONX_WCONHIST'.
No files found for reference case.
Comparing '/var/lib/jenkins/post-builder/workspace/opm-simulators-PR-builder/deps/opm-tests/actionx/opm-simulation-reference/flow/ACTIONX_WCONHIST' to '/var/lib/jenkins/post-builder/workspace/opm-simulators-PR-builder/mpi/build-opm-simulators/tests/results/flow+actionx_wconhist/ACTIONX_WCONHIST'.
No files found for reference case.

GitPaean avatar Mar 31 '25 12:03 GitPaean

you have to rebase the opm-tests branch.

akva2 avatar Mar 31 '25 12:03 akva2

jenkins build this opm-tests=1303 please

GitPaean avatar Mar 31 '25 14:03 GitPaean

jenkins build this opm-tests=1303 please

GitPaean avatar Mar 31 '25 14:03 GitPaean

jenkins build this opm-tests=1317 please

GitPaean avatar Mar 31 '25 20:03 GitPaean

Thanks for the reviewing comments.

Except the three phase to include the water phase, I have addressed or responded all the comments I believe, the PR is now in a much better shape (although it will keep being refined in the future development).

Adding the water phase is not hard, while requires going through the system carefully and will require some more work. I suggest we merge this PR for now and add dummy phase in a separate PR with a later opportunity. Since we now have a regression that can protect the compositional development, which has been broken multiple times without noticing earlier.

Please let me know what you think.

GitPaean avatar Mar 31 '25 21:03 GitPaean

jenkins build this opm-tests=1317 please

GitPaean avatar Apr 01 '25 08:04 GitPaean

jenkins build this opm-tests=1317 please

GitPaean avatar Apr 01 '25 11:04 GitPaean

jenkins build this opm-tests=1317 please

GitPaean avatar Apr 01 '25 12:04 GitPaean

Sorry, I have to revert this back. The build is broken now.

bska avatar Apr 01 '25 19:04 bska