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

Modified version of safer well state

Open atgeirr opened this issue 9 months ago • 1 comments

Revised and rebased, based on #5990 originally. Removed some changes to simplify investigation.

For now, just for testing.

atgeirr avatar Mar 27 '25 13:03 atgeirr

jenkins build this failure_report please

atgeirr avatar Mar 27 '25 13:03 atgeirr

I think this should be ready now. I have addressed the assert() issue pointed out by @GitPaean above. The major changes are:

  • Ensure that WellInterface::initializeProducerWellState() [new name for updateWellStateRates()] is called when initializing a well from scratch, also rewrite that function to evaluate at bhp limit or 1 bar instead of 0 bar (from default-initialized primary variables).
  • Store well primary variables in SingleWellState, and restore from that class if they are set (and have the right size), when in the update() methods of the (Standard and Multisegment)PrimaryVariable classes.

atgeirr avatar Apr 02 '25 13:04 atgeirr

jenkins build this failure_report please

atgeirr avatar Apr 02 '25 13:04 atgeirr

jenkins build this failure_report please

atgeirr avatar Apr 02 '25 13:04 atgeirr

jenkins build this failure_report please

atgeirr avatar Apr 03 '25 15:04 atgeirr

jenkins build this failure_report please

GitPaean avatar Apr 07 '25 08:04 GitPaean

I checked the regression failures a little bit, not exhaustive. Most of the cases look fine. while the mpi.compareECLFiles_flow+WVFPEXP-02 , mpi.compareECLFiles_flow+MOD4_UDQ_ACTIONX,

maybe also mpi.compareECLFiles_flow+MSW-2D-VERT-02

can get some checking.

GitPaean avatar Apr 07 '25 13:04 GitPaean

Thanks to @GitPaean for testing, and pointing out some errors that are now hopefully fixed.

atgeirr avatar Apr 09 '25 14:04 atgeirr

jenkins build this failure_report please

atgeirr avatar Apr 09 '25 14:04 atgeirr

most of the regression failures look fine, the following ones have something to look at,

09_multiply_tranxyz_model2.pdf image

14_udt_udt-1d-03.pdf image

15_wvfpexp_02.pdf image

36_network_balance_01.pdf (same with other few network models.) image

GitPaean avatar Apr 10 '25 12:04 GitPaean

jenkins build this failure_report please

GitPaean avatar Apr 23 '25 08:04 GitPaean

The regression failure looks similar while there are more regressions. I will pick a couple to investigate some to see what is the problem.

The one I will look at 02_editnnc, 09_multiply, 15_wvfpexp_02, maybe also the network one.

GitPaean avatar Apr 23 '25 15:04 GitPaean

jenkins build this failure_report please

GitPaean avatar Apr 28 '25 16:04 GitPaean

jenkins build this failure_report please

GitPaean avatar Apr 29 '25 08:04 GitPaean

jenkins build this failure_report please

GitPaean avatar May 05 '25 10:05 GitPaean

jenkins build this failure_report please

atgeirr avatar May 05 '25 11:05 atgeirr

The number of the regression failures, 191, stays unchanged and let me check the detailed comparisons.

https://ci.opm-project.org/job/opm-simulators-PR-builder/8015/#showFailuresLink

GitPaean avatar May 05 '25 12:05 GitPaean

11_udt-1d-03 some bumps at the end image

multiple cases in this series the guide rates are different, e.g. 15_0a4_grctrl_lrat_lrat_ggr_base_model2_stw image

multiple wells in this case 16_model4_udq_group

image

some chopping in this case, 17_6_endscale_model2 image

some chopping in this case also, 26_1_multregt_model2 image

the network cases have different guide rates, 34_network-01_standard image

not saying there are problematic, while worth looking into a little bit.

GitPaean avatar May 05 '25 15:05 GitPaean

11_udt-1d-03 some bumps at the end image

This one is using UDT and UDQ to control the opening of the well, while somehow not sure why the wells is re-opened after 24 Jan 2023. There is not useful information in the DBG and PRT files.

The schedule looks like the following,

DATES
 2 JAN 2023 /
/
 
-- Reduce BHP limit as pressure drops

UDT
 'TU_FBHP' 1 /
 'LL'  100.0  500.0 / -- FOPR values
       100.0  180.0 / -- WBHP values
/
/

UDQ
ASSIGN WU_WBHP 0 /
DEFINE WU_WBHP0 WU_WBHP /
DEFINE WU_WBHP ((TU_FBHP[WOPR] UMIN WBHP) UMIN WU_WBHP0) UMAX 10.0 /  -- MIN BHP = 10
/

WCONPROD
  'PROD1'  'OPEN'  ORAT   500.0   4*   WU_WBHP /
  'PROD2'  'OPEN'  ORAT   500.0   4*   WU_WBHP /
/
 
DATES
 15 FEB 2023 /
/

GitPaean avatar May 06 '25 09:05 GitPaean

11_udt-1d-03 some bumps at the end image

This one is using UDT and UDQ to control the opening of the well, while somehow not sure why the wells is re-opened after 24 Jan 2023. There is not useful information in the DBG and PRT files.

Basically, it shows that the local solve can open a well being STOPPed, which should be a fallout in the logic. The logic related to wellIsStopped and others are rather complicated.

GitPaean avatar May 06 '25 11:05 GitPaean

Basically, it shows that the local solve can open a well being STOPPed, which should be a fallout in the logic. The logic related to wellIsStopped and others are rather complicated.

This would be an issue unrelated to this PR then, but something we should figure out and fix.

atgeirr avatar May 06 '25 12:05 atgeirr

For the following case, e.g. 15_0a4_grctrl_lrat_lrat_ggr_base_model2_stw= image

It looks like that at the start of the simulation, the simulator mistakenly thinks some wells are under zero rate target due to the uninitialized well state, it is also the change that removing !zero_target makes the major difference, while it might be a good thing because the master branch mistakenly think the wells under zero rate target (from the mistaken calculation of the group target based on the uninitialized well rate and potentials (did not go through all the logics))

Likely the other guide rate related regression are also due to this.

GitPaean avatar May 07 '25 09:05 GitPaean

some chopping in this case also, 26_1_multregt_model2 image

This one is due to different time stepping and no other abnormality is observed.

GitPaean avatar May 07 '25 12:05 GitPaean

multiple wells in this case 16_model4_udq_group

image

This looks like due to different time stepping at the end the wells are under different controls. I will not investigate more in details due to capacity.

GitPaean avatar May 07 '25 13:05 GitPaean

jenkins build this failure_report please

GitPaean avatar May 07 '25 13:05 GitPaean

  • Tested suggestion to set ws.primaryvar.resize(0); at the top of 'updateWellStateWithTarget' in order to force updating of primary variables together with doing updatePrimaryVariables(simulator, well_state, deferred_logger); at beginning of iterateWellEqWithControl/ iterateWellEqWithSwitching (both std/ms versions) to ensure consistency. This removed all singularities for the case I'm looking at.

steink avatar May 07 '25 15:05 steink

jenkins build this failure_report please

atgeirr avatar May 07 '25 16:05 atgeirr

the regressions look good. I think we can update_data now from my side.

GitPaean avatar May 08 '25 09:05 GitPaean

the regressions look good. I think we can update_data now from my side.

Good. Confirmed that I now get identical results with my previous testing

steink avatar May 08 '25 09:05 steink

jenkins build this update_data please

atgeirr avatar May 08 '25 09:05 atgeirr