OPM / opm-models

The models module for the Open Porous Media Simulation (OPM) framework
Other
17 stars 69 forks source link

Avoid deleting derivatives with zero pressure difference #877

Closed hnil closed 1 week ago

hnil commented 6 months ago

This should be the correct, but it will may change many tests so it should be investigated carefully.

GitPaean commented 6 months ago

jenkins build this opm-simulators=5236 please

GitPaean commented 6 months ago

Somehow, it affects a lot of cases, maybe most of the regression tests. The results does not look problematic, while some checking need to be done.

https://ci.opm-project.org/job/opm-models-PR-builder/482/

GitPaean commented 2 months ago

It was reported that this PR and https://github.com/OPM/opm-simulators/pull/5236 helps thermal cases with certain setup. Will trigger a jenkins test to get an overview about how to get the PR and https://github.com/OPM/opm-simulators/pull/5236 in.

GitPaean commented 2 months ago

jenkins build this opm-simulators=5236 please

GitPaean commented 2 months ago

The following tests still needs to be fixed manually. Previously, we use smaller time steps to stabilize the time step sizes. But it is still vulnerable to other small changes. I do not have good ideas how to improve it other than relaxing the tolerance. And it is tricky to keep the reference updated automatically.

mpi.python_fluidstate_variables mpi.python_primary_variables

GitPaean commented 2 months ago

I will go through the test failures and provide evaluation. It looks like all minor and it should not risk the regression failures for other PRs.

The changes here are non-controversial.

GitPaean commented 2 months ago

benchmark opm-simulators=5236 please

GitPaean commented 2 months ago

Just post the observation of the regression failures, for later information. Not sure whether be able to finish it before the summer.

The following tests require more looking into.

mpi.compareECLFiles_flow+SPE1CASE2_BRINE_GASWATER c (double check) mpi.compareECLFiles_flow+UDT-1D-03 c double check mpi.compareECLFiles_flow+CO2STORE_GASWAT c double check mpi.compareECLFiles_flow+H2STORE_GASWAT c double check mpi.compareECLFiles_flow+MOD4_UDQ_ACTIONX c double check mpi.compareECLFiles_flow+MOD4_GRP_GEFAC c double check mpi.compareParallelSim_flow+AQUFLUX-01 c double check mpi.compareECLFiles_flow+SPE1CASE2_ROCK2DTR ci double check mpi.compareECLFiles_flow+UDQ_M1 c double check mpi.compareECLFiles_flow+KRNUM-03Y c (double check) mpi.compareECLFiles_flow+MAX_WGR_1 c carefully mpi.compareECLFiles_flow+9_3D_GINJ_GAS_MAX_EXPORT_STW c (double check)

The following do not have a SUMMARY output, so did not check in details,

mpi.compareECLFiles_flow+CO2STORE_DRSDTCON c (no plotted output) mpi.compareECLFiles_flow+H2STORE c (no plotted output) mpi.compareECLFiles_flow+CO2STORE_ENERGY o (no plotted output) mpi.compareECLFiles_flow+H2STORE_DIFFUSIVE c (no plotted output) mpi.compareECLFiles_flow+H2STORE_ENERGY c (no plotted output) mpi.compareECLFiles_flow+BC_LAB c no plotting output mpi.compareECLFiles_flow+BO_DIFFUSE_CASE1 c no plotting output

Other regression failures looks fine.

GitPaean commented 2 weeks ago

jenkins build this opm-simulators=5236 please

GitPaean commented 2 weeks ago

jenkins build this opm-simulators=5236 please

GitPaean commented 1 week ago

Will trigger a new jenkins to check for tomorrow.

GitPaean commented 1 week ago

jenkins build this opm-simulators=5236 please

GitPaean commented 1 week ago

jenkins build this opm-simulators=5236 please

GitPaean commented 1 week ago

UDT-1D-01B

image

MSW_MODEL_1 and BASE_MODEL_1 have the same problem, image

UDQ_M1 image

WVFPEXP-02 image

0_BASE_MODEL6 image

9_3D_GINJ_GAS_MAX_EXPORT_MSW image

H2STORE_GASWAT image

CO2STORE_DRSDTCON image

2D_OW_CTAQUIFER

image

The following case might not have summary output, has not checked. GASWATER_VAPWAT_PRECSALT CO2STORE CO2STORE_GW_DIRICHLET CO2STORE_DIFFUSIVE CO2STORE_ENERGY H2STORE H2STORE_DIFFUSIVE H2STORE_ENERGY BO_DIFFUSE_CASE1

GitPaean commented 1 week ago

For the case UDT-1D-01B

master branch has oscillation of the control mode for the production well and at the end, it chose ORAT control and had BHP lower than bhp limit (100bar, if I understand the UDQ code correct), which is not ideal.

With this PR, the solution result is much better, no control mode oscillation. It is under BHP control at the end. UDT-1D-01B.pdf

GitPaean commented 1 week ago

For UDQ_M1, using stricter tolerance for the wells either with '--tolerance-wells=1.e-8' or '--relaxed-well-flow-tol=1.e-7' will stablize the simulation some, while it is affected by the time stepping.

image

Editing the DATA file to use smaller time steps at the beginning, the results look better, image

So I will edit the DATA file and add '--tolerance-wells=1.e-8' to the regression test for UDQ_M1.

GitPaean commented 1 week ago

adding --tolerance-wells=1.e-8 to UDT-1D-01B also help to stablize the simulation.

image

Will also add that to UDQ-1D-01B regression test.

GitPaean commented 1 week ago

adding --tolerance-wells=1.e-8 to UDT-1D-01B also help to stablize the simulation.

image

Will also add that to UDQ-1D-01B regression test.

But it also causes the control mode oscillating for the well PROD and it ends up gets the wrong results with the wrong control mode.

Turning of the local switch control with --local-well-solve-control-switching=false can avoid to get BHP lower than the bhp limit. Maybe it is something interesting to investigate. @steink

Typically we struggle between THP or group control or rate control, this one looks like struggle between BHP and ORAT, which is rather rare. But it can be because the BHP limit is a function of the ORAT, which introduces some cross dependence there.

It might be interesting in improving the local well solve control switching.

GitPaean commented 1 week ago

For NORNE_ATW2013_B1H_RE-PERF

adding '--tolerance-wells=1.e-8' improves the comparison. Will updating this regression test.

image

GitPaean commented 1 week ago

9_3D_GINJ_GAS_MAX_EXPORT_MSW and WVFPEXP-02

looks like due to my PC has different results from the jenkins reference. We can ignore it.

GitPaean commented 1 week ago

CO2STORE_DRSDTCON

with master branch there are multiple time step cutting, which did not occurs with the Pull request, which I see is a positive thing.

steink commented 1 week ago

Turning of the local switch control with --local-well-solve-control-switching=false can avoid to get BHP lower than the bhp limit. Maybe it is something interesting to investigate. @steink

There are quite a few tests that violate limits. I've been doing some testing with increasing the default --maximum-number-of-well-switches from 3 to 10, and this seems to improve the overall quality of the solutions (also this test).

In some cases when switching between pressure and rate control, reservoir pressure updates overshoots, and the local well-solve will immediately switch back (causing oscillations). With the old approach (no local switching) one can be lucky and experience less oscillations. There is currently no good remedy for preventing these situations perhaps except trying harder (increasing --maximum-number-of-well-switches) .

GitPaean commented 1 week ago

I have finalized the investigation of the regression failures. Updated a few regression test. From my side, I am ready to update the reference and get the PR and the downstream PR merged.

GitPaean commented 1 week ago

jenkins build this opm-simulators=5236 update_data please

GitPaean commented 1 week ago

Sorry, I forgot the following cases,

GASWATER_VAPWAT_PRECSALT CO2STORE CO2STORE_GW_DIRICHLET CO2STORE_DIFFUSIVE CO2STORE_ENERGY H2STORE H2STORE_DIFFUSIVE H2STORE_ENERGY BO_DIFFUSE_CASE1

I am investigating and will create PR to stablize these tests. For the H2STORE ones, we need to use --tolerance-cnv-relaxed=0.01 to make the results sensible.

GitPaean commented 1 week ago

Not sure how to check GASWATER_VAPWAT_PRECSALT, but from the jenkins report, it looks fine. Potentially, we can tighten the tolerance in some way to improve it.

BO_DIFFUSE_CASE1 looks fine.

CO2STORE ones look fine.

I will update the H2STORE related (smaller time steps and tightening CNV tolerance ) so that the regression tests are more stable.

GitPaean commented 1 week ago

jenkins build this opm-simulators=5236 update_data please

GitPaean commented 1 week ago

jenkins build this opm-simulators=5236 opm-tests=1221 please

GitPaean commented 1 week ago

There are still regression failures related to H2STORE, the curves match while there is still some different time stepping at the beginning.

GitPaean commented 1 week ago

jenkins build this opm-simulators=5236 opm-tests=1221 please

GitPaean commented 1 week ago

jenkins build this opm-simulators=5236 opm-tests=1221 please

GitPaean commented 1 week ago

jenkins build this opm-simulators=5236 opm-tests=1221 please

GitPaean commented 1 week ago

jenkins build this opm-simulators=5236 opm-tests=1221 please

GitPaean commented 1 week ago

The updated reference has been installed. I am merging this now.