OPM Common Python Documentation

class opm.io.sim.SummaryState

The SummaryState class - this is where the current summary results of the simulator are stored. The SummaryState class has methods to get hold of well, group and general variables.

opm.io.sim.SummaryState.update_well_var(well_name: str, variable_name: str, new_value: double) None

Updates the variable of a well.

Parameters:
  • well_name (str) – The name of the well.

  • variable_name (str) – The name of the variable to update.

  • new_value (double) – The new value of the variable.

opm.io.sim.SummaryState.update_group_var(group_name: str, variable_name: str, new_value: double) None

Updates the variable of a group.

Parameters:
  • group_name (str) – The name of the group.

  • variable_name (str) – The name of the variable to update.

  • new_value (double) – The new value of the variable.

opm.io.sim.SummaryState.well_var(well_name: str, variable_name: str) double

Gets the value of a variable for a well.

Parameters:
  • well_name (str) – The name of the well.

  • variable_name (str) – The name of the variable to retrieve.

Returns:

The value of the specified variable for the well.

opm.io.sim.SummaryState.group_var(group_name: str, variable_name: str) double

Gets the value of a variable for a group.

Parameters:
  • group_name (str) – The name of the group.

  • variable_name (str) – The name of the variable to retrieve.

Returns:

The value of the specified variable for the group.

opm.io.sim.SummaryState.elapsed() double

Returns the elapsed time in seconds of the current simulation.

Returns:

The elapsed time in seconds.

opm.io.sim.SummaryState.groups -> list

Returns a list of strings containing all group names.

Returns:

A list of strings representing all group names.

opm.io.sim.SummaryState.wells -> list

Returns a list of strings containing all well names.

Returns:

A list of strings representing all well names.

opm.io.sim.SummaryState.has_well_var(well_name: str, variable_name: str) bool

Checks if a well variable exists.

Parameters:
  • well_name (str) – The name of the well.

  • variable_name (str) – The name of the variable to check.

Returns:

True if the variable exists for the well, False otherwise.

opm.io.sim.SummaryState.has_group_var(group_name: str, variable_name: str) bool

Checks if a group variable exists.

Parameters:
  • group_name (str) – The name of the group.

  • variable_name (str) – The name of the variable to check.

Returns:

True if the variable exists for the group, False otherwise.

class opm.io.ecl_state.EclipseState

The EclipseState class - this is a representation of all static properties in the model,ranging from porosity to relperm tables. The content of the EclipseState is immutable and may not be changed at runtime.

opm.io.ecl_state.EclipseState.input_nnc() list

Returns a list of non-neighboring connections.

One non-neighboring connection is a tuple containing the following elements: - index1 (int): Index of the first cell. - index2 (int): Index of the second cell. - transmissibility (double): Transmissibility between the two cells.

Returns:

A list of non-neighboring connections.

opm.io.ecl_state.EclipseState.faultNames() list

Returns a list of fault names.

Returns:

A list containing the names of faults.

opm.io.ecl_state.EclipseState.faultFaces(fault_name: str) list

Returns a list of faces of a fault with the given name.

Parameters:

fault_name (str) – The name of the fault.

Returns:

A list containing the faces of the specified fault.

opm.io.ecl_state.EclipseState.jfunc() dict

Function returning a dictionary with the following entries: [‘FLAG’, ‘DIRECTION’, ‘ALPHA_FACTOR’, ‘BETA_FACTOR’, ‘OIL_WATER’, ‘GAS_OIL’]

Returns:

A dictionary containing the specified entries.

opm.io.ecl_state.EclipseState.simulation() SimulationConfiguration

Returns the simulation configuration.

Returns:

The simulation configuration.

class opm.io.schedule.Schedule

The Schedule class - this is a representation of all the content from the SCHEDULE section, notably all well and group information and the timestepping.

opm.io.schedule.Schedule.__getitem__(report_step: int) ScheduleState

Returns the ScheduleState at the given report step.

Parameters:

report_step (int) – The report step.

Returns:

The ScheduleState at the given report step.

opm.io.schedule.Schedule.shut_well(well_name: str, step: int) None

Shuts down a well at a given report step.

Parameters:
  • well_name (str) – The name of the well to shut down.

  • step (int) – The report step at which to shut down the well.

opm.io.schedule.Schedule.shut_well(well_name: str) None

Shuts down a well at the current report step.

Parameters:

well_name (str) – The name of the well to shut down.

opm.io.schedule.Schedule.open_well(well_name: str, step: int) None

Opens a well at a given report step.

Parameters:
  • well_name (str) – The name of the well to open.

  • step (int) – The report step at which to open the well.

Raises:

ValueError – If the report step is in the past or exceeds the duration of the simulation.

opm.io.schedule.Schedule.open_well(well_name: str) None

Opens a well at the current report step.

Parameters:

well_name (str) – The name of the well to open.

opm.io.schedule.Schedule.stop_well(well_name: str, step: int) None

Stops a well at a given report step.

Parameters:
  • well_name (str) – The name of the well to stop.

  • step (int) – The report step at which to stop the well.

Raises:

ValueError – If the report step is in the past or exceeds the duration of the simulation.

opm.io.schedule.Schedule.stop_well(well_name: str) None

Stops a well at the current report step.

Parameters:

well_name (str) – The name of the well to stop.

opm.io.schedule.Schedule.get_injection_properties(well_name: str, report_step: int) dict

Gets injection properties for a well at a specific report step.

Parameters:
  • well_name (str) – The name of the well.

  • report_step (int) – The report step to retrieve properties for.

Returns:

A dict containing the properties surf_inj_rate, resv_inj_rate, bhp_target, thp_target.

opm.io.schedule.Schedule.get_production_properties(well_name: str, report_step: int) dict

Gets production properties for a well at a specific report step.

Parameters:
  • well_name (str) – The name of the well.

  • report_step (int) – The report step to retrieve properties for.

Returns:

A dict containing the properties oil_rate, gas_rate, water_rate, liquid_rate, resv_rate, bhp_target, thp_target, alq_value.

opm.io.schedule.Schedule._groups(report_step: int) list

Gets a list of all groups at a specified report step.

Parameters:

report_step (int) – The report step to retrieve groups for.

Returns:

A list containing all groups at the specified report step.

opm.io.schedule.Schedule.get_well(well_name: str, report_step: int) Well

Retrieves a well at a given report step.

Parameters:
  • well_name (str) – The name of the well.

  • report_step (int) – The report step.

Returns:

Well object at the given report step.

opm.io.schedule.Schedule.get_wells(well_name_pattern: str) list

Gets the names of wells matching a specified pattern.

Parameters:

well_name_pattern (str) – The pattern for well names, where ‘*’ acts as a wildcard.

Returns:

A list containing the names of wells that match the specified pattern.

class Group

The Group class.

Group.name()

Returns the name of this group.

Returns:

The name of this group.

Group.num_wells()

Returns the number of wells in this group.

Returns:

The number of wells in this group.

Group.well_names()

Returns a list of all well names in this group.

Returns:

A list of all well names in this group.

class ScheduleState

The ScheduleState class.

ScheduleState.nupcol()

The NUPCOL value at this Schedule State. This is a positive integer that defines the maximum number of Newton iterations used to update well targets within a time step.

ScheduleState.get_group(group_name: str) Group

Gets the group with the specified name from the schedule state.

Parameters:

group_name (str) – The name of the group to retrieve from the schedule state.

Returns:

The group with the specified name from the schedule state.

class Well

The Well class.

Well.pos() tuple

Retrieves the position of the well.

Returns:

A tuple containing the (i, j) coordinates and the reference depth of the well.

Well.isdefined(report_step: int) bool

Checks if the well is defined at a specific report step.

Parameters:

report_step (int) – The report step to check for the well’s definition.

Returns:

True if the well is defined at the specified report step, False otherwise.

Well.available_gctrl() bool

Checks if the well is available for group control.

Returns:

True if the well is available for group control, False otherwise.

Well.connections() list

Gets a list of all connections associated with the well.

Returns:

A list containing all connections of the well.