From 53cc6bda2197224ebd2a2ba7c6e80d64079f39e2 Mon Sep 17 00:00:00 2001 From: Runar Ask Johannessen <89020325+equinor-ruaj@users.noreply.github.com> Date: Thu, 21 Nov 2024 11:25:34 +0100 Subject: [PATCH] Update 3dgrid docs (#113) * Add docs section about grid3d config * Fix typo * Make static param local variable instead * Update grid3d docs --- docs/sim2sumo.rst | 40 ++++++++++++++++++++++++++++----- src/fmu/sumo/sim2sumo/grid3d.py | 14 +++--------- 2 files changed, 38 insertions(+), 16 deletions(-) diff --git a/docs/sim2sumo.rst b/docs/sim2sumo.rst index 5d34dfa..eb0fbfe 100644 --- a/docs/sim2sumo.rst +++ b/docs/sim2sumo.rst @@ -148,7 +148,7 @@ The sim2sumo section in the config file gives you full flexibility for extractin You can also change where you extract results from, and even use all the extra custumization options that ``res2df`` has available. The three relevant sections are: -*datafile*: +datafile: -------------------- This section is for configuring where you extract results from, meaning where to look for simulation results. This section should be a list where each item is either a file path, file stub or a folder path. @@ -205,10 +205,40 @@ To include all datatypes use a list with a single item "all": For datatypes available see documentation for ``res2df`` -options: -------------- - | This section is for adding extra optional configuration for extracting the different datatypes. - | This section needs to be in a list format. +.. options: +.. ------------- +.. | This section is for adding extra optional configuration for extracting the different datatypes. +.. | This section needs to be in a list format. + + +Overriding default datatypes: +---------------- +``datatypes`` applies to all datafiles specified in the ``datafile`` section. +It is possible to override this configuration for individual files. +The example shows how to only extract summary data from the first file, and all default ``datatypes`` from the second file. + + .. code-block:: + + datafile: + - ../../eclipse/model/DROGON-0.DATA: + - summary + - ../../eclipse/model/DROGON-1.DATA + datatypes: + - summary + - wcon + - faults + +grid3d: +---------------- +When ``grid3d`` is set to ``true``, sim2sumo will try to upload 3D grid data and properties for all datafiles specified in the ``datafile`` section. +For the init file the following properties will be *ignored*: ENDNUM, DX, DY, DZ, TOPS. +For the restart the following properties will be *exported*: SWAT, SGAS, SOIL, PRESSURE, SFIPOIL, SFIPGAS. + + + .. code-block:: + + grid3d: true + Using sim2sumo in scripts diff --git a/src/fmu/sumo/sim2sumo/grid3d.py b/src/fmu/sumo/sim2sumo/grid3d.py index ba6c795..f3b56a3 100755 --- a/src/fmu/sumo/sim2sumo/grid3d.py +++ b/src/fmu/sumo/sim2sumo/grid3d.py @@ -138,28 +138,20 @@ def upload_init(init_path, xtgeoegrid, config, dispatcher): return count -def upload_restart( - restart_path, - xtgeoegrid, - time_steps, - config, - dispatcher, - prop_names=("SWAT", "SGAS", "SOIL", "PRESSURE", "SFIPOIL", "SFIPGAS"), -): +def upload_restart(restart_path, xtgeoegrid, time_steps, config, dispatcher): """Export properties from restart file Args: restart_path (str): path to restart file xtgeoegrid (xtge.Grid): the grid to unpack the properties to time_steps (list): the timesteps to use - prop_names (iterable, optional): the properties to export. - Defaults to ("SWAT", "SGAS", "SOIL", "PRESSURE"). Returns: int: number of objects to export """ logger = logging.getLogger(__name__ + ".upload_restart") count = 0 + prop_names = ("SWAT", "SGAS", "SOIL", "PRESSURE", "SFIPOIL", "SFIPGAS") for prop_name in prop_names: for time_step in time_steps: try: @@ -193,7 +185,7 @@ def upload_simulation_runs(datafiles, config, dispatcher): """Upload 3d grid and parameters for set of simulation runs Args: - datafiles (list): the datafiles defining the rums + datafiles (list): the datafiles defining the runs config (dict): the fmu config file with metadata dispatcher (sim2sumo.common.Dispatcher) """