pyopmnearwell.utils.writefile module

Utility functions for necessary files and variables to run OPM Flow

pyopmnearwell.utils.writefile.compact_format(v: ndarray[tuple[Any, ...], dtype[_ScalarT]]) list[str]

To ‘n*x’ notation

pyopmnearwell.utils.writefile.create_3dgrid(dic)

Handle the first part of the 3d grids

pyopmnearwell.utils.writefile.d3_grids(dic, dxarray)

Handle the second part of the 3d grids

pyopmnearwell.utils.writefile.generate_fluxnum(dic)

Write fluxnum.inc

pyopmnearwell.utils.writefile.generate_geology(dic)

Write geology.inc

pyopmnearwell.utils.writefile.generate_multpv(dic)

Write multpv.inc

pyopmnearwell.utils.writefile.generate_pcfact(dic)

Write pcfact.inc

pyopmnearwell.utils.writefile.generate_permfact(dic)

Write permfact.inc

pyopmnearwell.utils.writefile.generate_saturation_functions_format_1(dic)

Using SGOF

pyopmnearwell.utils.writefile.generate_saturation_functions_format_2(dic)

Using SGFN and SWFN

pyopmnearwell.utils.writefile.get_2dgrid(dic)

Create the 2D corner-point grid

pyopmnearwell.utils.writefile.get_spaces(dic)

Improve the format of the files by aligning the values

pyopmnearwell.utils.writefile.handle_core(dic)

Handle the core geometry

pyopmnearwell.utils.writefile.manage_grid(dic)

Handle the grid

pyopmnearwell.utils.writefile.manage_sections(dic)

Write the include files in the input deck

pyopmnearwell.utils.writefile.manage_tables(dic)

Write the saturation function tables

pyopmnearwell.utils.writefile.reservoir_files(dic, **kwargs)

Write OPM-related files by running Mako templates.

Parameters:
  • dic (dict) – Global dictionary with required parameters

  • **kwargs

    Possible kwargs are:

    • recalc_grid (bool): Whether to recalculate the GRID.INC file. Intended for ensemble runs, where the saturation functions/geography/etc. do not need to be recalculated for each ensemble member. Defaults to True.

    • recalc_tables (bool): Whether to recalculate the TABLES.INC file. Defaults to True.

    • recalc_sections (bool): Whether to recalculate the GEOLOGY.INC and FLUXNUM.INC files. Defaults to True.

    • inc_folder (pathlib.Path): If any of the mentioned files is not recalculated, they are taken from this folder. Defaults to pathlib.Path("").

Note

  • All of the recalc_* options only work for co2store no_disgas_no_diffusion on a cake grid so far.

  • For other models or grids there will be errors.

Returns:

Global dictionary with new added parameters

Return type:

dic (dict)

pyopmnearwell.utils.writefile.round_like_e(v: ndarray[tuple[Any, ...], dtype[_ScalarT]]) ndarray[tuple[Any, ...], dtype[_ScalarT]]

Keep only 8 significant digits to reduce size of created files