Skip to content

Commit

Permalink
Update 3dgrid docs (#113)
Browse files Browse the repository at this point in the history
* Add docs section about grid3d config

* Fix typo

* Make static param local variable instead

* Update grid3d docs
  • Loading branch information
equinor-ruaj authored Nov 21, 2024
1 parent 46e93cf commit 53cc6bd
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 16 deletions.
40 changes: 35 additions & 5 deletions docs/sim2sumo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
14 changes: 3 additions & 11 deletions src/fmu/sumo/sim2sumo/grid3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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)
"""
Expand Down

0 comments on commit 53cc6bd

Please sign in to comment.