Skip to content

Conversation

@oddvarlia
Copy link
Collaborator

@oddvarlia oddvarlia commented Dec 6, 2025

Function to update 3D field parameters with the method implemented in DistanceESMDA for ensemble smoother with
distance-based localization

Linked to: #12406

Approach
A 3D field parameter can often not be update in one go due to large memory requirements due to the Kalman gain matrix K and the localization matrix RHO. To handle this the field parameter can be split into subsets or batches. Each batch should be a set of layers of field parameter values defined in the field parameter grid (ertbox grid). Each batch must consists of a complete set of layers, not subset of layers of field parameters. The main reason for processing the update by batches of layers of field parameters is that the calculation of scaling factors (elements in the RHO matrix) can be done layer by layer due to the assumption that only lateral distance is of importance in the definition of influence of an observation, hence the calculation of RHO is done for one layer and then copied to all the other layers of the ertbox grid.

@oddvarlia oddvarlia marked this pull request as draft December 6, 2025 10:16
@oddvarlia oddvarlia changed the title Added function to update 3D field parameter with ensemble smoother wi… Update 3D field parameter with ensemble smoother with distance-based localization Dec 6, 2025
@oddvarlia oddvarlia force-pushed the distance_based_batch_update branch 2 times, most recently from 1554bb7 to 36554db Compare December 6, 2025 19:50
@codecov-commenter
Copy link

codecov-commenter commented Dec 6, 2025

Codecov Report

❌ Patch coverage is 0% with 56 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.29%. Comparing base (72a6ffb) to head (ff04c62).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/ert/analysis/_es_distance_based_update.py 0.00% 56 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (72a6ffb) and HEAD (ff04c62). Click for more details.

HEAD has 8 uploads less than BASE
Flag BASE (72a6ffb) HEAD (ff04c62)
test 4 3
gui-tests 5 3
cli-tests 4 3
performance-and-unit-tests 4 0
Additional details and impacted files
@@             Coverage Diff             @@
##             main   #12469       +/-   ##
===========================================
- Coverage   90.61%   76.29%   -14.32%     
===========================================
  Files         433      434        +1     
  Lines       29470    29526       +56     
===========================================
- Hits        26704    22527     -4177     
- Misses       2766     6999     +4233     
Flag Coverage Δ
cli-tests 37.52% <0.00%> (-0.09%) ⬇️
gui-tests 68.89% <0.00%> (-0.18%) ⬇️
performance-and-unit-tests ?
test 38.40% <0.00%> (-0.08%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@xjules xjules added this to SCOUT Dec 8, 2025
@xjules xjules moved this to In Progress in SCOUT Dec 8, 2025
@oddvarlia oddvarlia force-pushed the distance_based_batch_update branch 9 times, most recently from b52aa01 to a9c9709 Compare December 12, 2025 10:10
@oddvarlia oddvarlia force-pushed the distance_based_batch_update branch 4 times, most recently from 568900f to 3d044e4 Compare December 20, 2025 09:49
@oddvarlia oddvarlia force-pushed the distance_based_batch_update branch 7 times, most recently from e4b0c6f to 8f14437 Compare January 6, 2026 18:46
@oddvarlia oddvarlia removed the status in SCOUT Jan 7, 2026
@oddvarlia oddvarlia moved this to In Progress in SCOUT Jan 7, 2026
@oddvarlia oddvarlia force-pushed the distance_based_batch_update branch from 8f14437 to 9f42875 Compare January 7, 2026 12:26
@oddvarlia oddvarlia force-pushed the distance_based_batch_update branch 2 times, most recently from 891b11f to eccf0c3 Compare January 8, 2026 11:28
… 3D fields

Added functions:
- update_3D_field_with_distance_esmda
- update_2D_field_with_distance_esmda
- _calc_max_number_of_layers_per_batch_for_distance_localization
- adjust_inactive_field_values_to_match_average_of_active_field_values

The function 'update_3D_field_with_distance_esmda' will update one 3D field parameter using the algorithm
implemented in class DistanceESMDA in repo iterative_ensemble_smoother. This function requires that
an object of DistanceESMDA is input. It will split the field parameter in batches when necessary due to memory
constraints. The function 'update_2D_field_with_distance_esmda' will update a 2D field (surface parameter),
but in this case no split into batches. Failure will be thrown if 2D field is too large to be updated.

The function '_calc_max_number_of_layers_per_batch_for_distance_localization' calculates the max
size of a batch of field parameter values within the limit of available memory.

The function ' adjust_inactive_field_values_to_match_average_of_active_field_values' is used to
ensure that ensemble average is not influenced by extrapolated values of inactive field parameters.
Is used to set field parameter values equal to ensemble average if they corresponds to realizations
where the geomodel grid cell is inactive.
@oddvarlia oddvarlia force-pushed the distance_based_batch_update branch from eccf0c3 to 167fc62 Compare January 8, 2026 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

2 participants