pofff.utils.writefile module#
Write OPM Flow, ERT, Everest, and generated job files.
The module serializes grid and region keywords, renders the main OPM deck, and creates helper scripts for boundary properties, saturation functions, regional properties, Flow execution, copying, scaling, and monotonicity checks. It also renders the ERT and Everest workflow configurations.
- pofff.utils.writefile._compact_eclipse_values(values: list) list[source]#
Encode repeated numeric values with Eclipse run-length syntax.
- Parameters:
- valueslist
Values to encode in their existing global order.
- Returns:
- list
Eclipse-formatted strings using
n*valuecompaction.
- pofff.utils.writefile._render_boundary_properties_script(cfg: PofffConfig) None[source]#
Render the generated boundary-property job script.
- Parameters:
- cfgPofffConfig
Shared pofff configuration and derived runtime state.
- pofff.utils.writefile._render_copy_script(cfg: PofffConfig) None[source]#
Render the generated deck-copy job script.
- Parameters:
- cfgPofffConfig
Shared pofff configuration and derived runtime state.
- pofff.utils.writefile._render_ert_configuration(cfg: PofffConfig) None[source]#
Render the ERT configuration and forward-model sequence.
- Parameters:
- cfgPofffConfig
Shared pofff configuration and derived runtime state.
- pofff.utils.writefile._render_everest_configuration(cfg: PofffConfig) None[source]#
Render the Everest optimization configuration.
- Parameters:
- cfgPofffConfig
Shared pofff configuration and derived runtime state.
- pofff.utils.writefile._render_flow_script(cfg: PofffConfig) None[source]#
Render the generated OPM Flow execution script.
- Parameters:
- cfgPofffConfig
Shared pofff configuration and derived runtime state.
- pofff.utils.writefile._render_monotonic_script(cfg: PofffConfig) None[source]#
Render the generated monotonicity-check job script.
- Parameters:
- cfgPofffConfig
Shared pofff configuration and derived runtime state.
- pofff.utils.writefile._render_region_properties_script(cfg: PofffConfig) None[source]#
Render the generated regional rock-property script.
- Parameters:
- cfgPofffConfig
Shared pofff configuration and derived runtime state.
- pofff.utils.writefile._render_saturation_functions_script(cfg: PofffConfig) None[source]#
Render the generated saturation-function script.
- Parameters:
- cfgPofffConfig
Shared pofff configuration and derived runtime state.
- pofff.utils.writefile._render_scale_script(cfg: PofffConfig) None[source]#
Render the generated Everest parameter-scaling script.
- Parameters:
- cfgPofffConfig
Shared pofff configuration and derived runtime state.
- pofff.utils.writefile._write_keyword_files(cfg: PofffConfig) None[source]#
Write generated OPM property and geometry include files.
- Parameters:
- cfgPofffConfig
Shared pofff configuration and derived runtime state.
- pofff.utils.writefile.create_corner_point_grid(cfg: PofffConfig, xcoord: NDArray, zcoord: NDArray) None[source]#
Write OPM COORD and ZCORN data for the corner-point grid.
- Parameters:
- cfgPofffConfig
Shared pofff configuration and derived runtime state.
- xcoordNDArray
Corner-point x coordinates arranged by pillar and vertical interface.
- zcoordNDArray
Corner-point z coordinates arranged by pillar and vertical interface.
- pofff.utils.writefile.write_files(cfg: PofffConfig) None[source]#
Generate the OPM deck and optional ERT or Everest files.
Generated files are written below
cfg.deck,cfg.jobs, andcfg.folaccording to the selected workflow.- Parameters:
- cfgPofffConfig
Shared pofff configuration and derived runtime state.