-
Notifications
You must be signed in to change notification settings - Fork 123
Update 3D field parameter with ensemble smoother with distance-based localization #12469
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
base: main
Are you sure you want to change the base?
Conversation
1554bb7 to
36554db
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #12469 +/- ##
==========================================
- Coverage 90.67% 90.67% -0.01%
==========================================
Files 429 429
Lines 29803 30073 +270
==========================================
+ Hits 27025 27268 +243
- Misses 2778 2805 +27
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
b52aa01 to
a9c9709
Compare
568900f to
3d044e4
Compare
e4b0c6f to
8f14437
Compare
8f14437 to
9f42875
Compare
872cdac to
fa9fee8
Compare
|
Let's have a meeting on the snapshots since this might be cumbersome to maintain. We should get to use hypothesis library instead and implement property based testing instead. |
799157d to
5471426
Compare
0587269 to
0bd1029
Compare
… 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 - define_active_matrix_for_initial_ensemble 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. The function define_active_matrix_for_initial_ensemble will create a (nparam, nreal) sized matrix with bool variables to defined which realization for which field parameters are used (active) and which one are not used in the prior ensemble since it does not exist in the geomodel from which the field parameter originate. update pyproject.toml to include gaussianfft to be used in tests
0bd1029 to
a464ab2
Compare
999445a to
01ed347
Compare
| # The output here is for visual inspection of the result | ||
| # and is not output in automatic test runs, but can be | ||
| # used in manual inspection of the results from the update. | ||
| write_mean_stdev_to_files( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's remove this output functions.
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.