plopm.utils.readers module#
Read and derive plotting quantities from OPM Flow output.
The module opens INIT, UNRST, EGRID, SMSPEC, deck, and CSV data; constructs plotting coordinates; evaluates variable expressions; and derives saturation, mass, caprock, distance, well, and fault quantities.
- read_case(deck, gif, vtk, variables, restart, filters, n=0)[source]#
Open the OPM output required for one simulation case.
- Parameters:
- deckstr
Simulation-case stem without an extension.
- gif, vtkbool
Output modes controlling restart and grid loading.
- variableslist
Requested variables or expressions.
- restartlist
Requested restart report steps.
- filterslist
Property-filter expressions.
- nint, default: 0
Case index used to select per-case settings.
- Returns:
- SimData
Loaded readers, grid properties, and report-step metadata.
- Parameters:
- Return type:
- get_yz_coords(cfg, data, n)[source]#
Build coordinate meshes for a yz slice.
- Parameters:
- cfgPlopmConfig
Initialized map configuration.
- dataSimData
Loaded grid data.
- nint
Slice index.
- Returns:
- tuple[np.ndarray, np.ndarray]
Y- and z-coordinate meshes.
- Parameters:
cfg (PlopmConfig)
data (SimData)
n (int)
- Return type:
tuple[NDArray, NDArray]
- get_xz_coords(cfg, data, n)[source]#
Build coordinate meshes for an xz slice.
- Parameters:
- cfgPlopmConfig
Initialized map configuration.
- dataSimData
Loaded grid data.
- nint
Slice index.
- Returns:
- tuple[np.ndarray, np.ndarray]
X- and z-coordinate meshes.
- Parameters:
cfg (PlopmConfig)
data (SimData)
n (int)
- Return type:
tuple[NDArray, NDArray]
- get_xy_coords(cfg, data, n)[source]#
Build coordinate meshes for an xy slice.
- Parameters:
- cfgPlopmConfig
Initialized map configuration.
- dataSimData
Loaded grid data.
- nint
Slice index.
- Returns:
- tuple[np.ndarray, np.ndarray]
X- and y-coordinate meshes.
- Parameters:
cfg (PlopmConfig)
data (SimData)
n (int)
- Return type:
tuple[NDArray, NDArray]
- read_series(cfg, case, values, tunit, qskl, n)[source]#
Read one one-dimensional series for plotting.
- Parameters:
- cfgPlopmConfig
Initialized series configuration.
- casestr
Simulation-case stem or CSV path.
- valuesstr
Variable name or expression.
- tunitstr
Requested time-unit code.
- qsklfloat
Scale factor applied to values.
- nint
Plot or case index.
- Returns:
- tuple[np.ndarray, np.ndarray, str, str]
Coordinates, values, coordinate unit, and value unit.
- Parameters:
- Return type:
- read_quantity(deck, data, name, step, scale, mass, mass_all, caprock, stress, filters, isgif, vmin, vmax, cvs)[source]#
Read and transform one spatial or VTK quantity.
- Parameters:
- deckstr
Simulation-case stem or CSV path.
- dataSimData
Loaded simulation data.
- namestr
Variable name or expression.
- stepint
Restart report step.
- scalefloat
Scale factor applied to derived values.
- mass, mass_all, caprocklist[str]
Supported derived-variable groups.
- stressfloat
Stress coefficient for caprock quantities.
- filtersstr
Property-filter expression.
- isgifbool
Whether the CSV path contains a restart placeholder.
- vmin, vmaxstr
Optional value thresholds.
- cvslist
CSV input and column settings.
- Returns:
- tuple[str, np.ndarray]
Unit label and quantity values.
- Parameters:
- Return type:
- get_wells(cfg, n)[source]#
Read wells intersecting the selected slice.
- Parameters:
- cfgPlopmConfig
Case and slice configuration.
- nint
Case index.
- Returns:
- tuple[list, list[str]]
Completion intervals grouped by well and the well names.
- Parameters:
cfg (PlopmConfig)
n (int)
- Return type: