FIELD_STATISTICS

Calculate mean, stdev and estimated facies probabilities from field parameters using ERTBOX grid.

The script reads ensembles of realizations from scratch disk from <RUN_PATH> directory:

share/results/grids/geogrid--<propertyname>.roff.

Optionally also temporary field parameters coming from APS or petrophysical field parameters can be used to calculate mean and standard deviations. The ensemble of realizations are usually located under <RUN_PATH> directory:

rms/output/aps

Since the realizations may have a grid geometry that is realization dependent and may have multiple zones, the values are first copied over to a static grid called ERTBOX grid. Depending on the grid conformity of the geogrid zones, the values are filled up from top or bottom of the ERTBOX grid. This is to ensure that zones with varying number of layers for each realization can be handled when calculating mean, standard deviation or estimated facies probabilities.

The grid cell indices in the ERTBOX grid is a label of the parameter value, and mean, standard deviation and facies fractions are calculated for each specified property for each individual grid cell (I,J,K) in the ERTBOX grid. Number of realizations of property values may vary from grid cell to grid cell due to varying number of layers per realization and due to stair case faults. Therefore also a parameter counting the number of realizations present for each individual grid cell is also calculated and used in the estimates of mean, standard deviation and facies probabilities.

The assumption behind this method (using ERTBOX grid as a fixed common grid for all realizations) is:

  • The lateral extension of the geogrid is close to a regular grid with same orientation and grid resolution as the ERTBOX grid.

  • The ERTBOX grid should be the same as used in ERT when field parameters are updated using the ERT keyword FIELD in the ERT configuration file.

  • Any lateral variability from realization to realization or curved shaped lateral grid is ignored. Only the cell indices are used to identify grid cell field parameters from each realization. This means that mean, standard deviation and estimated facies probabilities are estimated for each cell labeled with index (I,J,K) and not physical position (x,y,z).

The output statistical properties (mean, stdev, prob) is saved in a user specified folder for the ERTBOX grid, but default if not specified is ‘share/grid_statistics’ folder under the top level of the scratch directory for the ERT case. The default estimate of standard deviation is the sample standard deviation

\[\text{variance} = \frac{\sum (x_i - \bar{x})^2}{N-1}\]

and number of realizations must be at least 2. Optionally, the population standard deviation

\[\text{variance} = \frac{\sum (x_i - \bar{x})^2}{N}\]

can be specified.

For grid cells where number of realizations are less than 2, the standard deviation parameter calculated will be set to 0.

The script will read info about ERTBOX grid size from the FMU project specified (The <CONFIG_PATH>) from the location:

rms/output/aps/ERTBOX.roff

The script assumes that the keyword FACIES_ZONE keyword is defined in the global_variables.yml file specified in the FMU project (The <CONFIG_PATH>) from the location:

fmuconfig/output/global_variables.yml

Example of format for FACIES_ZONE keyword in global_variables.yml file from the Drogon case:

FACIES_ZONE:
  Valysar:
    0: Floodplain
    1: Channel
    2: Crevasse
    5: Coal
  Therys:
    6: Calcite
    10: Offshore
    11: Lowershoreface
    12: Uppershoreface
  Volon:
    0: Floodplain
    1: Channel
    6: Calcite

If this does not exist, it must be added.

There is an option to copy the resulting statistical estimates into the geogrid for a single realization of the grid. This makes it possible to visualize the results together with well paths. But be aware that the statistical estimates does not in general match 100% a single realization of the grid. So, comparing estimated facies probability with a facies log for a particular realization of the grid, will only give you an approximate impression of the well conditioning since the blocked wells grid cells may vary from realization to realization due to the variability of the grid which is due to structural uncertainty.

If this ERT workflow is run before the realizations are generated for all specified iterations, the script will not start calculating statistics, but return without doing anything.

usage: field_statistics [-h] -c CONFIGFILE [-p ERTCONFIGPATH] -e ENSEMBLEPATH
                        [-r RESULTPATH] [-z GENERATE_RMS_LOAD_SCRIPT] [-g]
                        [--version]

Named Arguments

-c, --configfile

Name of YAML config file

-p, --ertconfigpath

Path to the configuration of ERT (<CONFIG_PATH>).

Default: “./”

-e, --ensemblepath

File path to ensemble directory on scratch disk

-r, --resultpath

Relative file path to result files relative to ensemble directory on scratch disk

Default: “share/grid_statistics”

-z, --generate_rms_load_script

Output script to be used in RMS to load results into RMS for visualization.

Default: “tmp_import_ensemble_field_statistics.py”

-g, --copy_result_to_geogrid

Option to copy results into realization-0 for the geogrid under realization-0/iter-<iter>/share/results/grids/

Default: False

--version

show program’s version number and exit

# Configuration file for script wf_field_param_statistics.py
field_stat:
  # Number of realizations for specified ensemble
  # Required.
  nreal: 100

  # Iteration numbers from ES-MDA in ERT (iteration = 0 is initial ensemble,
  # usually iteration=3 is final updated ensemble)
  # Required.
  iterations: [0, 3]

  # Standard deviation estimator.
  # Optional. Default is False which means that
  # sample standard deviation ( normalize by (N-1)) is used
  # where N is number of realizations.
  # The alternative is True which means that
  # population standard deviation ( normalize by N) is used.
  use_population_stdev: False

  # Specify which geogrid fields to use
  # Geogrid fields are typically found in:
  # <RUN_PATH>/share/results/grids/geogrid--<property-name>.roff
  # Optional keyword
  geogrid_fields:
      # Selected set of zone names to use in calculations of statistics.
      # Must be one or more of the defined zones.
      # Require at least one zone to be selected.
      use_zones: ["Valysar", "Therys", "Volon"]

      # Zone numbers with zone name dictionary
      zone_code_names:
          1: "Valysar"
          2: "Therys"
          3: "Volon"

      # For each zone specify either Proportional, Top_conform or Base_conform
      # as grid conformity.
      # Conformity can be checked by opening the RMS job that has created
      # the geogrid and check the grid settings for grid layers.
      # Proportional means that number of layers is specified.
      # Top or base conform means that grid cell thickness is specified.
      # Required (but only for zones you want to use)
      zone_conformity:
          "Valysar": "Proportional"
          "Therys": "Top_conform"
          "Volon": "Proportional"

      # For each zone specify which discrete parameter to use to calculate
      # facies probability estimates.
      # Possible names are those found in the
      # share/results/grids/geogrid--<name>.roff
      # files that are of discrete type.
      # This key can be omitted or some of the lines specifying parameters
      # for a zone if you don't want to use it.
      discrete_property_param_per_zone:
          "Valysar": ["facies"]
          "Therys": ["facies"]
          "Volon": ["facies"]

      # For each zone specify which continuous parameter to use to
      # calculate estimate of mean and stdev over ensemble.
      # Possible names are those found in the
      #  share/results/grids/geogrid--<name>.roff
      # files that are of continuous type
      # This key can be omitted or some of the lines specifying
      # parameters for a zone if you don't want to use it.
      continuous_property_param_per_zone:
          "Valysar": ["phit", "klogh"]
          "Therys":  ["phit", "klogh"]
          "Volon":   ["phit", "klogh"]

      # Size of ertbox grid for (nx, ny, nz)
      # Optional, but required if the ERTBOX.EGRID is not found under
      # ERT model under <CONFIG_PATH>/../../rms/output/aps
      ertbox_size: [92, 146, 66]

  # Specify which temporary field parameters (in ertbox) to use
  # to calculate mean and stdev
  # Optional keyword
  temporary_ertbox_fields:
      # Relative path relative to ERT <RUN_PATH> for localisation of
      # initial ensemble of field parameters
      initial_relative_path: "rms/output/aps"

      # Field parameter names as specified in ERT FIELD keywords
      parameter_names: [
          Volon_Channel_KLOGH,
          Volon_Channel_PHIT,
          Therys_Uppershoreface_KLOGH,
          Therys_Lowershoreface_KLOGH,
          Therys_Offshore_KLOGH,
          Therys_Uppershoreface_PHIT,
          Therys_Lowershoreface_PHIT,
          Therys_Offshore_PHIT,
          Valysar_Crevasse_KLOGH,
          Valysar_Channel_KLOGH,
          Valysar_Floodplain_KLOGH,
          Valysar_Crevasse_PHIT,
          Valysar_Channel_PHIT,
          Valysar_Floodplain_PHIT,
          aps_Volon_GRF3,
          aps_Volon_GRF2,
          aps_Volon_GRF1,
          aps_Therys_GRF3,
          aps_Therys_GRF2,
          aps_Therys_GRF1,
          aps_Valysar_GRF3,
          aps_Valysar_GRF2,
          aps_Valysar_GRF1,
      ]